Appending to IDS files (or replacing them?)
chimeric
Member Posts: 1,163
I'm at the point where I can release a spell for testing, but I have made some new entries in my MISSILE.IDS, PROJECTL.IDS and SPECIFIC.IDS. What do I do with these files, when I assemble my Weidu installation? Do I just include them in the mod whole-cloth so they go in the players' Override folder, or do I append to players' files? Then how do I do that? All entries have position numbers. For example, the default SPECIFIC.IDS has Normal, Magic, Non-Magic, Spirit, and those are not 1,2,3,4. Spirit is 50, I think. The state I added there also has its own number, and it is by this number that the Specific trigger calls on the IDS. The positions are important for the other IDS files, too.
Have you appended to IDS files? How does it work?
Have you appended to IDS files? How does it work?
0
Comments
I'm not sure there are weidu functions for the others.
Projectiles require another step: Take (value - 1) and add an entry to Missile.IDS using that new value, that is the value you will use for the Projectile. Missile.IDS is not used by the game, has missing entries, and so cannot be used to find available values, however, it is used by Near Infinity and DLTCEP to give meaningful names to projectiles other than their filename, so it is generally worth updating.
Here is something for Specifics. It would go as early in your installation as possible.
DEFINE_ACTION_FUNCTION ADD_SPECIFIC STR_VAR label = ~~ RET index BEGIN OUTER_SET index = ~-1~ ACTION_IF FILE_CONTAINS_EVALUATED (~SPECIFIC.IDS~ ~^.+[ %TAB%]%label%\b~) BEGIN COPY_EXISTING ~SPECIFIC.IDS~ override COUNT_2DA_ROWS 2 rows FOR (i = 0; i < rows; ++i) BEGIN READ_2DA_ENTRY i 1 2 state_label PATCH_IF ~%state_label%~ STRING_EQUAL_CASE ~%label%~ BEGIN READ_2DA_ENTRY i 0 2 state_id SET index = state_id END END BUT_ONLY END ELSE BEGIN ACTION_IF (~%label%~ STRING_EQUAL ~~) BEGIN FAIL ~Missing Specific's label~ END ELSE BEGIN ACTION_IF ((~%label%~ STRING_CONTAINS_REGEXP ~ ~) = 0) BEGIN FAIL ~Specific's lable cannot have spaces~ END ELSE BEGIN COPY_EXISTING ~SPECIFIC.IDS~ override COUNT_2DA_ROWS 2 rows FOR (i = 1; i < rows; ++i) BEGIN READ_2DA_ENTRY i 0 2 state_id SET $occupied_slot(~%state_id%~) = 1 END FOR (i = 0; i < 256; ++i) BEGIN PATCH_IF (!VARIABLE_IS_SET $occupied_slot(~%i%~)) BEGIN SET index = i SET i = 256 PATCH_IF index <= rows BEGIN INSERT_2DA_ROW index 2 ~%index% %label%~ END ELSE BEGIN INSERT_2DA_ROW rows 2 ~%index% %label%~ END END END PATCH_IF (index = ~-1~) BEGIN PATCH_FAIL ~No available slots in SPECIFIC.IDS~ END BUT_ONLY END END END END LAF ADD_SPECIFIC STR_VAR string = ~custom_label~ RET specific_1 = index ENDThe first part is a function that will do what I described: read every entry and find a vacant slot.The last line can be reused with different labels and a different "specific_#" for additional entries.
custom_label is the arbitrary string you want to identify your specifics as, it needs the ~'s on both sides of it, cannot have spaces, probably not special characters(at least not other ~'s).
The variable "specific_1" will store the value you need to use in effects like Opcode 177.
And here is the code to alter your spells/items at installation:
file_path will need to be written out starting from(but not including) the folder containing Chitin.key for that game, the same one the Setup-MYMOD.exe file will be located.
edit:typo, edit2: sorry, another typo in the code