Jump to content

Setting ability scores


Recommended Posts

I didn't see a script action for this, so I made up a bunch of spells with opcodes 44/15/10/19/49/6. The spells use timing mode 1, parameter1 = [chosen value], and parameter2 = 1 [set score to value of parameter1].

But when a spell would set an ability score to something lower than it is, no change is registered. Is the only way to lower ability scores doing it incrementally?

Link to post
20 minutes ago, Luke said:

What about ChangeStat()?

Oh yeah, huh. Must have made a typo when searching the IESDP page.

...I was about to say "I'll experiment with that for the next update," but I suppose since I haven't yet released the current update, the responsible thing to do is to go experiment with that now. Sigh.

The IESDP should probably still mention those opcodes' inability to set scores lower, though.

Link to post
Posted (edited)

Testing seemed pretty clean. The dialogue for setting stat scores looks like:

IF ~~ THEN BEGIN d5stttlk_20 
 SAY @2052
 IF ~~ THEN REPLY @2058 DO ~ApplySpellRES("D5ST_05",myself)~ GOTO d5stttlk
 IF ~~ THEN REPLY @2059 DO ~ApplySpellRES("D5ST_06",myself)~ GOTO d5stttlk
 IF ~~ THEN REPLY @2060 DO ~ApplySpellRES("D5ST_07",myself)~ GOTO d5stttlk
 IF ~~ THEN REPLY @2061 DO ~ApplySpellRES("D5ST_08",myself)~ GOTO d5stttlk
 IF ~~ THEN REPLY @2062 DO ~ApplySpellRES("D5ST_09",myself)~ GOTO d5stttlk
 IF ~~ THEN REPLY @2063 DO ~ApplySpellRES("D5ST_10",myself)~ GOTO d5stttlk
 IF ~~ THEN REPLY @2064 DO ~ApplySpellRES("D5ST_11",myself)~ GOTO d5stttlk
 IF ~~ THEN REPLY @2065 DO ~ApplySpellRES("D5ST_12",myself)~ GOTO d5stttlk
 IF ~~ THEN REPLY @2066 DO ~ApplySpellRES("D5ST_13",myself)~ GOTO d5stttlk
 IF ~~ THEN REPLY @2067 DO ~ApplySpellRES("D5ST_14",myself)~ GOTO d5stttlk
 IF ~~ THEN REPLY @2068 DO ~ApplySpellRES("D5ST_15",myself)~ GOTO d5stttlk
 IF ~~ THEN REPLY @2069 DO ~ApplySpellRES("D5ST_16",myself)~ GOTO d5stttlk
 IF ~~ THEN REPLY @2070 DO ~ApplySpellRES("D5ST_17",myself)~ GOTO d5stttlk
 IF ~~ THEN REPLY @2071 DO ~ApplySpellRES("D5ST_18",myself)~ GOTO d5stttlk
 IF ~~ THEN REPLY @2072 DO ~ApplySpellRES("D5ST_19",myself)~ GOTO d5stttlk
 IF ~~ THEN REPLY @2073 DO ~ApplySpellRES("D5ST_20",myself)~ GOTO d5stttlk
 IF ~~ THEN REPLY @2074 DO ~ApplySpellRES("D5ST_21",myself)~ GOTO d5stttlk
 IF ~~ THEN REPLY @2075 DO ~ApplySpellRES("D5ST_22",myself)~ GOTO d5stttlk
 IF ~~ THEN REPLY @2076 DO ~ApplySpellRES("D5ST_23",myself)~ GOTO d5stttlk
 IF ~~ THEN REPLY @2077 DO ~ApplySpellRES("D5ST_24",myself)~ GOTO d5stttlk
 IF ~~ THEN REPLY @2078 DO ~ApplySpellRES("D5ST_25",myself)~ GOTO d5stttlk
 IF ~~ THEN REPLY @2079 GOTO d5stttlk 
END 

D5ST_## is a spell setting the STR stat to the value of ##. This is repeated for each ability score:

ACTION_FOR_EACH value IN ~5~ ~6~ ~7~ ~8~ ~9~ ~10~ ~11~ ~12~ ~13~ ~14~ ~15~ ~16~ ~17~ ~18~ ~19~ ~20~ ~21~ ~22~ ~23~ ~24~ ~25~ BEGIN
  COPY ~npc_ee/lib/d5_base.spl~ ~override/d5st_%value%.spl~
    LPF ADD_SPELL_EFFECT INT_VAR opcode = 44 target = 1 parameter1 = %value% parameter2 = 1 timing = 1 END
  COPY ~npc_ee/lib/d5_base.spl~ ~override/d5dx_%value%.spl~
    LPF ADD_SPELL_EFFECT INT_VAR opcode = 15 target = 1 parameter1 = %value% parameter2 = 1 timing = 1 END
  COPY ~npc_ee/lib/d5_base.spl~ ~override/d5cn_%value%.spl~
    LPF ADD_SPELL_EFFECT INT_VAR opcode = 10 target = 1 parameter1 = %value% parameter2 = 1 timing = 1 END
  COPY ~npc_ee/lib/d5_base.spl~ ~override/d5in_%value%.spl~
    LPF ADD_SPELL_EFFECT INT_VAR opcode = 19 target = 1 parameter1 = %value% parameter2 = 1 timing = 1 END
  COPY ~npc_ee/lib/d5_base.spl~ ~override/d5ws_%value%.spl~
    LPF ADD_SPELL_EFFECT INT_VAR opcode = 49 target = 1 parameter1 = %value% parameter2 = 1 timing = 1 END
  COPY ~npc_ee/lib/d5_base.spl~ ~override/d5ch_%value%.spl~
    LPF ADD_SPELL_EFFECT INT_VAR opcode = 6 target = 1 parameter1 = %value% parameter2 = 1 timing = 1 END
END

When I tested it on Imoen and Jaheira in Chateau Irenicus I tried to set their stats to 5-20-5-20-5-20, or 25-6-25-6-25-6, etc.. In every instance, when the applied value was higher than their current value the score would change to the higher number. But no stats were ever changed to 5 or 6 etc.

I haven't released it yet but you can test the latest master of the mod here. Install on BG2EE and have Imoen use the innate ability that looks like a person.

Edited by subtledoctor
Link to post
Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...