Jump to content

Photo

how to specify no kit in scripts


5 replies to this topic

#1 subtledoctor

subtledoctor
  • Modders
  • 2856 posts
  • Gender:Male

Posted 15 November 2018 - 07:13 PM

I have a few scripted things that trigger different dialogues depending on the speaker's kit. For the default, I use
Class(LastSummonerOf(Myself),THIEF)
Kit(LastSummonerOf(Myself),TRUECLASS)
But it looks like some "trueclass" .CRE files actually have their kit set to 0, rather than 0x4000. In that case the above check returns false, even though the character is a trueclass thief. (I think that is why Imoen2.cre doesn't work with my feats mod.) Can I specify that in a script? Something like
Class(LastSummonerOf(Myself),THIEF)
Kit(LastSummonerOf(Myself),NONE)
?

Edited by subtledoctor, 15 November 2018 - 07:15 PM.

Faiths & Powers: Spell spheres and kit pack for priests and paladins
Might & Guile: Tweaks and kits for warriors and rogues
Scales of Balance: Game tweaks and rule overhauls
NPC_EE: More options for NPCs in BGEE, SoD, & BG2EE


#2 DavidW

DavidW
  • Gibberlings
  • 4710 posts
  • Gender:Male

Posted 15 November 2018 - 07:29 PM

Actually this relates to the stats.ids conversation on the other thread. As far as the BCS format is concerned, TRUECLASS is just a lookup in kit.ids. It gets replaced by 0x4000 when the script is compiled, because that's the entry next to TRUECLASS in the ids file.

To check for either kit=0x4000 or kit=0, you need

OR(2)
  Kit(LastSummonerOf(Myself),TRUECLASS)
  Kit(LastSummonerOf(Myself),0)
You can add
0 TRUECLASS2
to kit.ids if you like, and if you do it'll let you do
OR(2)
  Kit(LastSummonerOf(Myself),TRUECLASS)
  Kit(LastSummonerOf(Myself),TRUECLASS2)
but as far as the engine is concerned you can use the bare number just as well.

#3 Ardanis

Ardanis

    A very GAR character

  • Modders
  • 2631 posts
  • Gender:Male
  • Location:Saint-Petersburg, Russia

Posted 15 November 2018 - 08:16 PM

Make sure to test that 0 in script triggers doesn't also return true for "any" kit, like iirc crushing damage type does.


Retired from modding.


#4 subtledoctor

subtledoctor
  • Modders
  • 2856 posts
  • Gender:Male

Posted 16 November 2018 - 07:45 AM

Sounds safest to append 0 to the table then. Easy enough.

Honestly not even sure if this is the problem with Imoen - don't have access to check the .CRE file at the moment - but a lot of creatures do have their kit set to 0 so it's good to know anyway.

Faiths & Powers: Spell spheres and kit pack for priests and paladins
Might & Guile: Tweaks and kits for warriors and rogues
Scales of Balance: Game tweaks and rule overhauls
NPC_EE: More options for NPCs in BGEE, SoD, & BG2EE


#5 DavidW

DavidW
  • Gibberlings
  • 4710 posts
  • Gender:Male

Posted 16 November 2018 - 07:57 AM

Whether or not 0 is appended won't make any difference to whether it works. Like I say, these ids files are just for human readability.

Ardanis is right, you need to check whether Kit(…,0) just returns true whatever. That happens for some triggers. If it does, you'll need to find a workaround (patching kit-0 creatures to kit-0x4000 is the most straightforward, but depending on your goal, there may be a subtler way).

#6 subtledoctor

subtledoctor
  • Modders
  • 2856 posts
  • Gender:Male

Posted 19 November 2018 - 04:08 PM

Ardanis is right, you need to check whether Kit(,0) just returns true whatever. That happens for some triggers. If it does, you'll need to find a workaround (patching kit-0 creatures to kit-0x4000 is the most straightforward,


Yeah on reflection, this is the best course.

Faiths & Powers: Spell spheres and kit pack for priests and paladins
Might & Guile: Tweaks and kits for warriors and rogues
Scales of Balance: Game tweaks and rule overhauls
NPC_EE: More options for NPCs in BGEE, SoD, & BG2EE




Reply to this topic



  


0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users