Jump to content

how to obtain kit name from kit.ids


subtledoctor

Recommended Posts

Let's say I have identified a kit by some value in kitlist.2da. But the kit name in column 1 of that file differs from the kit name in kit.ids... and I need the latter to use with script triggers and actions.

 

The only thing shared between the two files is the unusability flag. (Unless the row numbers match? I don't think they do.) So I assume I would have to use that somehow...?

 

Does LOOKUP_IDS_SYMBOL_OF_INT work with kit.ids? Does READ_2DA_ENTRY?

 

EDIT - not even the unusability flag. But kitlist.2da in the EEs has an extra column with the IDS value. So presumably there is a method to use that to go between the files. (It's okay if this mod ends up being EE-only.)

Link to comment

Okay I'm at ym computer and can try some stuff out, but I'm hitting a wall. I've stored the KITIDS column value from kitlist.2da in %bar%; then I try to run this:

LOOKUP_IDS_SYMBOL_OF_INT foo ~kit~ %bar%

But I'm getting a parse error.

 

The Weidu documentation shows this for usage:

LOOKUP_IDS_SYMBOL_OF_INT variable idsFile value

Example:

LOOKUP_IDS_SYMBOL_OF_INT foo ~spell~ 1101

 

Not sure what I'm doing wrong... will it not take a variable in the "value" field? Is this a showstopper?

Link to comment

LOOKUP_IDS_SYMBOL_OF_INT should have no trouble with variable substitutions. It's a patch command though, so you have to use OUTER_PATCH or a similar construct if you want to use it on action level.

 

The PATCH_PRINT call of this code snippet

OUTER_PATCH foo BEGIN
  SET kit_value = 0x4024  // = 16420 (decimal)
  LOOKUP_IDS_SYMBOL_OF_INT kit_name ~kit~ kit_value
  PATCH_PRINT ~%kit_value% = %kit_name%~
END
should output "16420 = DARK_MOON" for BG2:EE.
Link to comment

LOOKUP_IDS_SYMBOL_OF_INT ... is a patch command though,

Oooooh... didn't realize that. How contained does it have to be? (I'm away from my computer again, can't test stuff.) Could I just use the OUTER_PATCH block solely to generate the variable, and then use it elsewhere? Like:

 

SET kit_value = 0x4024  // = 16420 (decimal)
OUTER_PATCH foo BEGIN
  LOOKUP_IDS_SYMBOL_OF_INT kit_name ~kit~ kit_value
END
[some command] ~%kit_name%~
Thing is, I'm generating the variable from kitlist.2da in an array (with various other values, like the name & description string refs, the class number, etc.) and then running iterated commands in an ACTION_PHP_EACH loop. The kit.ids name is used within that loop.
Link to comment

Archived

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

×
×
  • Create New...