Skip to content

how to customize states?

sarevok57sarevok57 Member Posts: 5,975
edited January 2017 in General Modding
so I've been looking at making character scripts, and there is one thing I can't figure out fully

lets say for example I want to make a script where my character casts draw upon holy might when the enemy is sighted, but I only want to have the caster cast it once ( if I have more than 1 memorized) but when it comes to checking the state to see if my character already has it cast, this is where things get a little wonky

im pretty sure in the past I just used checkstate drawuponholymight but that didn't seem to work

but then I also realized for things like armor of faith, for when it checks state it says 3,ARMORCLASS, and not armor_of_faith

and then even deathward has check state: scriptingstate2

where are all these armor class/ scripting states located? im using near infinity and I cant find them anywhere, im pretty sure, if I can just make customized scripting states ( like the deathward one for example), I can make my draw upon holy might work perfectly if I just make it a scripting state

Comments

  • ArdanisArdanis Member Posts: 1,736
    Stats.ids and splstate.ids

    For a full stat-to-spell link table, see https://github.com/Gibberlings3/SpellRevisions/blob/master/spell_rev/lib/ds.tph
    Par2 is the stat's entry in corresponding IDS file (stats.ids for opcodes 233/282, splstate.ids for 328), par1 is its value. For opcode 282 add 156 to par2 get the real entry number. Sorry for the lack of better documentation :(

    Scriptingstate2 is a proper stat for Death Ward, even though the name is hardly intuitive.
    DUHM doesn't have a dedicated one, but you can use scriptingstate6<4. Otherwise, add new entry to splstate.ids and patch it into the spell.
    You can also use the linked tph library to add it automatically - e.g. copy and paste the lines 377-378 and specify a custom HEY_I_JUST_ADDED_A_NEW_STATE ( :) ) state name which it will assign to the first unoccupied slot. Then !CheckSpellState(Myself,HEY_I_JUST_ADDED_A_NEW_STATE) in your script will work fine.
  • sarevok57sarevok57 Member Posts: 5,975
    alrighty, I will try and give this a go later tonight, thanks for the info :)
  • sarevok57sarevok57 Member Posts: 5,975
    @Ardanis so I tried using that link you gave me ( although I didn't know what I was looking at) and then I tried messing around with the ids files ( by trying to add lines and things like that) still no dice

    and then, I just happened to stumble upon the advanced AI script in the BCS and then all my dreams starting coming true, copy pasted some lines, deleted some global variables and voila, everything worked like a charm

    even though your post really didn't help too terribly much, I still appreciate the help and input :)
Sign In or Register to comment.