Jump to content

NPC Attributes


Guest Guest_Ergopad_*

Recommended Posts

Well, I have to say that tb#tweaks do make an elegant solution. Several NPC's usefulness in combat has been improved (ie Ajantis, Jaheira) and the remove stat restrictions component takes care of Quayle's and Tiax's weapons. My hat's off to you, the bigg! In such case, the only thing left would be to fix Khalid's INT, but seeing as it doesn't really matter (unless you make him a Mage or F/M) I might leave it as is.

Link to comment
Wasn't there talk of allowing L1NPC to change NPC stats as well as altering their class and adjusting their proficiencies? That seems like the best place for a tweak of this kind.
There was talk, but I think it was just that, and after dealing the code in rather excruciating detail, I can see how mindless that would be. Bad enough to code it, but another to actually sit through it while installing/modding the NPCs. You're already getting asked a tonne of questions about them, but here you'd get queried about every individual stat - including, I suppose, exceptional strength (which, incidentally, if the bigg's mod does away with, could wreak some small havoc with equipment reassignment, but that's a minor thing).

 

So for example: Jaheira: Modify Strength [Y/N]?

 

Then you sit through that for however many points you want to mess with (or not). Then:

 

Jaheira: Modify Intelligence [Y/N]?

 

Now granted, this could be optimised, something like:

 

Modify stats (currently S:15 I:12 W:16 D:14 C:18 cH:10)?

Hit 0 for no change, the lowercase attribute letter to increase by one point, or the uppercase attribute letter to decrease by one point.

 

But you see how contrived that can be (then there's language translations, and it's unlikely Polish is going to have the same stat initials). And then you have to sit through it or skip it for *every* NPC.

 

Now if there was a GUI where you could select not only checkboxes for attribute and proficiency changes, but arrows for increasing/decreasing as well, that'd be the bomb. But dabus laughed at that concept for the existing BWS so unless Nythrun or someone else comes up with brighter ideas, I thought I'd just include Ergopad's components as optional (skippable) tweaks. That way, you can install them or not as you please, and even if L1NPCs subsequently includes stat-modding stuff, you'll still have a baseline you can further tweak if you so desire.

 

As for 3rd edition stats, I haven't looked at the component in detail, apart from alpha testing whether it installed. But I think some folks might want to stick with 2nd edition rules, and even item stat restrictions, however silly they may seem.

Link to comment
Wasn't there talk of allowing L1NPC to change NPC stats as well as altering their class and adjusting their proficiencies? That seems like the best place for a tweak of this kind.
There was talk, but I think it was just that, and after dealing the code in rather excruciating detail, I can see how mindless that would be. Bad enough to code it, but another to actually sit through it while installing/modding the NPCs. You're already getting asked a tonne of questions about them, but here you'd get queried about every individual stat - including, I suppose, exceptional strength (which, incidentally, if the bigg's mod does away with, could wreak some small havoc with equipment reassignment, but that's a minor thing).

 

So for example: Jaheira: Modify Strength [Y/N]?

 

Then you sit through that for however many points you want to mess with (or not). Then:

 

Jaheira: Modify Intelligence [Y/N]?

 

Now granted, this could be optimised, something like:

 

Modify stats (currently S:15 I:12 W:16 D:14 C:18 cH:10)?

Hit 0 for no change, the lowercase attribute letter to increase by one point, or the uppercase attribute letter to decrease by one point.

 

But you see how contrived that can be (then there's language translations, and it's unlikely Polish is going to have the same stat initials). And then you have to sit through it or skip it for *every* NPC.

 

Now if there was a GUI where you could select not only checkboxes for attribute and proficiency changes, but arrows for increasing/decreasing as well, that'd be the bomb. But dabus laughed at that concept for the existing BWS so unless Nythrun or someone else comes up with brighter ideas, I thought I'd just include Ergopad's components as optional (skippable) tweaks. That way, you can install them or not as you please, and even if L1NPCs subsequently includes stat-modding stuff, you'll still have a baseline you can further tweak if you so desire.

 

As for 3rd edition stats, I haven't looked at the component in detail, apart from alpha testing whether it installed. But I think some folks might want to stick with 2nd edition rules, and even item stat restrictions, however silly they may seem.

 

Agreed, that might be the best solution.

Link to comment

I have been thinking about these changes and whereas I find the idea intriguing, it just does not seem correct to me. Is a score of 9 not representative for a peasant? Then would a score of 13 intelligence really be on the low side for a bard (Garrick) from the realm point of view?

 

For installation, wouldn't it be easier to just ask for a stat distribution and figure it out in the working code how often you have to increase/decrease stats as in?

 

Modify stats (currently Str:15 Dex:14 Con:18 Int:12 Wis:16 Cha:10)?

Enter the six stat values to change into or hit N for no change.

 

So if you enter 18 16 10 13 17 9, you will get 18 Strength, 16 dex, 10 con, 13 int, 17 wis, 9 cha?

Link to comment
I have been thinking about these changes and whereas I find the idea intriguing, it just does not seem correct to me. Is a score of 9 not representative for a peasant? Then would a score of 13 intelligence really be on the low side for a bard (Garrick) from the realm point of view?

 

AFAIK, it depends. In 2e AD&D, the supposition was that adventurers where common people with unusual jobs. That's why most of stats between 5-15 give zero modifiers. OTOH, in D&D 3e/3.5, the assumption is that adventurers are exceptional or "elite", with the suggested stat distribution for elite chars being 8, 10, 12, 13, 14, 15, while the distribution for non-elite chars is 8, 9, 10, 11, 12, 13. That is also the reason I was looking for a way to evaluate the character's stats, to see wether a stat boost was justified.

Link to comment
For installation, wouldn't it be easier to just ask for a stat distribution and figure it out in the working code how often you have to increase/decrease stats as in?

 

Modify stats (currently Str:15 Dex:14 Con:18 Int:12 Wis:16 Cha:10)?

Enter the six stat values to change into or hit N for no change.

 

So if you enter 18 16 10 13 17 9, you will get 18 Strength, 16 dex, 10 con, 13 int, 17 wis, 9 cha?

No, that can't be done.

 

Sigh, I hate it when I'm talked into (more) hackery :cringe:. Someone point out a fatal flaw in this so I don't have to implement it. Though it *appears* to work in preliminary testing, I can't guarantee I didn't muck up something somewhere else in the mod.

  DEFINE_ACTION_MACRO ~select_stats~ BEGIN
OUTER_SET nstr = 0
OUTER_SET nxst = 0
OUTER_SPRINT nxstr ~~
PRINT ~%t-attr%~ //Current attributes
PRINT @110001 //Type new attributes as whole numbers separated by a space, etc.
ACTION_READLN selected_stats
SILENT
ACTION_IF ((~%selected_stats%~ STRING_EQUAL ~0~ = 0) AND (~%selected_stats%~ STRING_MATCHES_REGEXP ~^[1-2]?[1-9] [1-2]?[1-9] [1-2]?[1-9] [1-2]?[1-9] [1-2]?[1-9] [1-2]?[1-9]$~ = 1)) BEGIN
  PRINT @110500 //You fail at life. Try again.
  LAUNCH_ACTION_MACRO ~select_stats~
END ELSE BEGIN
  ACTION_IF (~%selected_stats%~ STRING_EQUAL ~0~ = 0) BEGIN
	OUTER_PATCH ~%selected_stats%~ BEGIN
	  REPLACE_EVALUATE ~^\([1-2]?[1-9]\) \([1-2]?[1-9]\) \([1-2]?[1-9]\) \([1-2]?[1-9]\) \([1-2]?[1-9]\) \([1-2]?[1-9]\)$~ BEGIN
		SET nstr = MATCH1
		SET ndex = MATCH2
		SET ncon = MATCH3
		SET nint = MATCH4
		SET nwis = MATCH5
		SET ncha = MATCH6
	  END ~%nstr% %ndex% %ncon% %nint% %nwis% %ncha%~
	END
	ACTION_IF ((nstr > 25) OR (ndex > 25) OR (ncon > 25) OR (nint > 25) OR (nwis > 25) OR (ncha > 25)) BEGIN
	  PRINT @110500
	  LAUNCH_ACTION_MACRO ~select_stats~
	END ELSE BEGIN
	  ACTION_IF ((nstr = 18) AND ((class = 2) OR (class = 6) OR (class = 7) OR (class = 8) OR (class = 9) OR (class = 10) OR (class = 12) OR (class = 16) OR (class = 17) OR (class = 18))) BEGIN
		PRINT @110002 //Type exceptional strength percentage
		ACTION_READLN ~nxst~
		OUTER_WHILE ((NOT (IS_AN_INT ~%nxst%~)) OR (nxst > 100) OR (nxst < 1)) BEGIN
		  PRINT @110500
		  ACTION_READLN ~nxst~
		END
		OUTER_SPRINT nxstr ~/%nxst%~
	  END
	  OUTER_SPRINT t-fmratt @110003 //Former attributes
	  OUTER_SPRINT t-newatt @110004 //New attributes
	  PRINT ~%t-fmratt% %t-attr%~
	  PRINT ~%t-newatt% %nstr%%nxstr%, %ndex%, %ncon%, %nint%, %nwis%, %ncha%~
	END
  END ELSE BEGIN
	PRINT @200014 //You've opted to make no changes
  END
  SILENT
  LAUNCH_ACTION_MACRO ~select_kit~
END
 END

Link to comment
It will not accept a value of 10 or 20 for a stat. Fatal enough?
Eh, not really since that's easily fixed, but thanks. What is more annoying is stuff I can't fix easily, like if you enter an illegal value, get warned, then enter a correct value, it will proceed along, letting you assign a kit, proficiencies, etc., but after all that instead of patching the CREs and going to the next NPC, it will send you back to the initial class selection, making you go through everything again, at which point the 2nd time it will be successful. Wasn't doing that before I added this macro, which is analogous to the existing ones that mod class, kit etc. Not even sure how to debug... would rather just get a FAIL so I knew where it was choking. Some stupid nesting issue probably.
Link to comment

When you call your macro in the middle of that macro, you queue up the remaining actions in the macro for later.

 

Macro code:

ASK_QUESTIONS
IF (error)
 LAUNCH_THIS_MACRO
END
DO_STUFF

 

Expanding that LAUNCH, you get:

ASK_QUESTIONS
IF (error)
 ASK_QUESTIONS
 IF (error)
LAUNCH_THIS_MACRO
 END
 DO_STUFF
END
DO_STUFF

So, stuff is done twice.

 

Classic recursive Robozzle.

Link to comment
No, that can't be done.

 

Sigh, I hate it when I'm talked into (more) hackery :cringe:.

Hehe. At least you can modify the character in one go. I also think that not many people will actually fail to type 6 numbers (plus 1 for exceptional strength which I did not even mention but which you did not forget nonetheless).
Link to comment
When you call your macro in the middle of that macro, you queue up the remaining actions in the macro for later.
That... doesn't really help, unless you can suggest something a bit more specific. I'd already suspected something like that ("Some stupid nesting issue") but all the existing selection macros are coded this way: they start over on an invalid assignment and launch the subsequent macro at the end. So actually it is the select_kit macro that gets called twice. I could put in some sort of variable check I guess but that sounds like (yet even more) hackery; I don't see that in the other macros.
Link to comment

     1	  DEFINE_ACTION_MACRO ~select_stats~ BEGIN
    2	    OUTER_SET nstr = 0
    3	    OUTER_SET nxst = 0
    4	    OUTER_SPRINT nxstr ~~
    5	    PRINT ~%t-attr%~ //Current attributes
    6	    PRINT @110001 //Type new attributes as whole numbers separated by a space, etc.
    7	    ACTION_READLN selected_stats
    8	    SILENT
    9	    ACTION_IF ((~%selected_stats%~ STRING_EQUAL ~0~ = 0) AND (~%selected_stats%~ STRING_MATCHES_REGEXP ~^[1-2]?[1-9] [1-2]?[1-9] [1-2]?[1-9] [1-2]?[1-9] [1-2]?[1-9] [1-2]?[1-9]$~ = 1)) BEGIN
   10	      PRINT @110500 //You fail at life. Try again.
   11	      LAUNCH_ACTION_MACRO ~select_stats~
   12	    END ELSE BEGIN
   13	      ACTION_IF (~%selected_stats%~ STRING_EQUAL ~0~ = 0) BEGIN
   14	        OUTER_PATCH ~%selected_stats%~ BEGIN
   15	          REPLACE_EVALUATE ~^\([1-2]?[1-9]\) \([1-2]?[1-9]\) \([1-2]?[1-9]\) \([1-2]?[1-9]\) \([1-2]?[1-9]\) \([1-2]?[1-9]\)$~ BEGIN
   16	            SET nstr = MATCH1
   17	            SET ndex = MATCH2
   18	            SET ncon = MATCH3
   19	            SET nint = MATCH4
   20	            SET nwis = MATCH5
   21	            SET ncha = MATCH6
   22	          END ~%nstr% %ndex% %ncon% %nint% %nwis% %ncha%~
   23	        END
   24	        ACTION_IF ((nstr > 25) OR (ndex > 25) OR (ncon > 25) OR (nint > 25) OR (nwis > 25) OR (ncha > 25)) BEGIN
   25	          PRINT @110500
   26	          LAUNCH_ACTION_MACRO ~select_stats~
   27	        END ELSE BEGIN
   28	          ACTION_IF ((nstr = 18) AND ((class = 2) OR (class = 6) OR (class = 7) OR (class = 8) OR (class = 9) OR (class = 10) OR (class = 12) OR (class = 16) OR (class = 17) OR (class = 18))) BEGIN
   29	            PRINT @110002 //Type exceptional strength percentage
   30	            ACTION_READLN ~nxst~
   31	            OUTER_WHILE ((NOT (IS_AN_INT ~%nxst%~)) OR (nxst > 100) OR (nxst < 1)) BEGIN
   32	              PRINT @110500
   33	              ACTION_READLN ~nxst~
   34	            END
   35	            OUTER_SPRINT nxstr ~/%nxst%~
   36	          END
   37	          OUTER_SPRINT t-fmratt @110003 //Former attributes
   38	          OUTER_SPRINT t-newatt @110004 //New attributes
   39	          PRINT ~%t-fmratt% %t-attr%~
   40	          PRINT ~%t-newatt% %nstr%%nxstr%, %ndex%, %ncon%, %nint%, %nwis%, %ncha%~
   41	        END
   42	      END ELSE BEGIN
   43	        PRINT @200014 //You've opted to make no changes
   44	      END
   45	      SILENT
   46	      LAUNCH_ACTION_MACRO ~select_kit~
   47	    END
   48	  END

If the ACTION_IF at 24 is true, the error-handling code at 25~26 is executed (re-executing the full macro and then calling select_kit at 46); once that is done, execution begins again at 45~46 (re-executing select_kit).

Link to comment

Yeah... well, I guess I do need to put in a check for valid values or that a kit hasn't been assigned already before launching that. What baffles me is why none of the other analogously-coded macros do that, but now that I think of it, they could and possibly I have seen that early on in testing. I never really occurred to me to do a test run of Nythrun's code with invalid values (though I did so for my own code).

Link to comment

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...