Moonboy187 Posted August 16, 2022 Share Posted August 16, 2022 Hi, I have been trying to modify some of the properties of some .PRO files, for example Storm of Vengance, Comet, some fire effects. However, my usual trial of "Add copy of" using NI does not seem to work with these files. Even though the copy is made, when I go to the spell to select the new .PRO it does not show up on the list. I have added the new .PRO inside the ID's as well, but still nothing. Quote Link to comment
subtledoctor Posted August 16, 2022 Share Posted August 16, 2022 Weidu has an ADD_PROJECTILE function to add them. Quote Link to comment
CamDawg Posted August 16, 2022 Share Posted August 16, 2022 The slightly longer answer: items/spells which use projectiles lookup the value from projectl.ids which is where the engine finds the actual pro file to use. ADD_PROJECTILE automatically adds an entry for your new pro file so that you can use it in your mod/NI. Quote Link to comment
subtledoctor Posted August 16, 2022 Share Posted August 16, 2022 (edited) Sorry I was in a rush earlier. Yes the new projectile has to be logged with the engine, i.e. have a valid .IDS index number, for it to be used. 14 hours ago, Moonboy187 said: I have added the new .PRO inside the ID's as well, but still nothing. It's been a long time since I looked at doing this without using Weidu, but yeah, even if you add the new projectile to PROJECTL.IDS by adding a new entry in NI, it is still not available. This might be as simple as you have to close NI after saving the .IDS file, and then re-open NI so that it can recognize the new entry. But even that might not work. Honestly I forget. I generally keep a little mini-mod in a BG2 game folder called "test.tp2" so that I can just plop in some Weidu and run it really quickly - that is useful for stuff like this. The procedure would be something like: copy an existing projectile in NI, something close to how you want it to be; close NI put the copy in the /override folder with a new name (say, "newproj.pro"), and open NI and make some changes to it; close NI in the mini-mod: ADD_PROJECTILE ~override/newproj.pro~ // (Weidu conveniently stores the new projectile index in a variable with the same name as the file) COPY_EXISTING ~spwi925.spl~ // Comet LPF ALTER_SPELL_HEADER INT_VAR projectile = %newproj% END IF_EXISTS BUT_ONLY Of course the projectile index is added dynamically by Weidu, so this isn't a "drop files in /override" way of applying changes to the game. This is one of those instances where it's really better and easier to use Weidu, which means making/having your own personal little Weidu mod. Edited August 16, 2022 by subtledoctor Quote Link to comment
Moonboy187 Posted August 19, 2022 Author Share Posted August 19, 2022 On 8/16/2022 at 6:27 PM, subtledoctor said: Sorry I was in a rush earlier. Yes the new projectile has to be logged with the engine, i.e. have a valid .IDS index number, for it to be used. It's been a long time since I looked at doing this without using Weidu, but yeah, even if you add the new projectile to PROJECTL.IDS by adding a new entry in NI, it is still not available. This might be as simple as you have to close NI after saving the .IDS file, and then re-open NI so that it can recognize the new entry. But even that might not work. Honestly I forget. I generally keep a little mini-mod in a BG2 game folder called "test.tp2" so that I can just plop in some Weidu and run it really quickly - that is useful for stuff like this. The procedure would be something like: copy an existing projectile in NI, something close to how you want it to be; close NI put the copy in the /override folder with a new name (say, "newproj.pro"), and open NI and make some changes to it; close NI in the mini-mod: ADD_PROJECTILE ~override/newproj.pro~ // (Weidu conveniently stores the new projectile index in a variable with the same name as the file) COPY_EXISTING ~spwi925.spl~ // Comet LPF ALTER_SPELL_HEADER INT_VAR projectile = %newproj% END IF_EXISTS BUT_ONLY Of course the projectile index is added dynamically by Weidu, so this isn't a "drop files in /override" way of applying changes to the game. This is one of those instances where it's really better and easier to use Weidu, which means making/having your own personal little Weidu mod. Its okay, thank you for helping out. I have never used Weidu before, I did a search on G3 and found a tutorial DavidW has made, I just need to find the time to read through it and give it a try. All the changes I have made to creatures, spells, areas etc, I have just manually done via NI. I was a bit confused when the Add Copy did work as it was the first time since using it that it didn't. I will download Weidu soon and give it a bash and see how it goes. Quote Link to comment
subtledoctor Posted August 19, 2022 Share Posted August 19, 2022 1 hour ago, Moonboy187 said: All the changes I have made to creatures, spells, areas etc, I have just manually done via NI. Yeah, I used to do that too. You will find that if you invest a bit of time with Weidu, you can basically package up your changes in a portable mod that can go from install to install, game to game, without doing the same things over and over in NI. Here's a start: Grab a very simple mod to use as a basis: like this one. Rename the folder to "moonboy_mod" and the .exe to "setup-moonboy_mod.exe" and the .tp2 file inside the folder to "moonboy_mod.tp2." Open the .tp2 file in a text editor. Delete everything below the "VERSION" line. Change the "BACKUP" line to ~moonboy_mod/backup~ Now, at the bottom, write BEGIN ~make some changes~ Now above, when you exported a copy of a projectile in NI as "newproj.pro" - make a subfolder in the "moonboy_mod" folder called "data." Put the newproj.pro file intot hat subfolder. Then copy this into the .tp2 file (adapted from the above post): ADD_PROJECTILE ~moonboy_mod/data/newproj.pro~ // (Weidu stores the new projectile index in a variable with this name) COPY_EXISTING ~spwi925.spl~ // Comet LPF ALTER_SPELL_HEADER INT_VAR projectile = %newproj% END // there's that variable IF_EXISTS BUT_ONLY You can make changes to an item in NI; let's say you think Kondar should have a general +3 enchantment value. You can change it manually, put the changed file into that "moonboy_mod/data/" folder, and then add this to the .tp2 file: COPY ~moonboy_mod/data/sw1h03.itm~ ~override~ Maybe you think the name should change to reflect the new enchantment value: you would write COPY ~moonboy_mod/data/sw1h03.itm~ ~override~ SAY NAME2 ~Kondar +3~ You can also use Weidu to make that change rather than doing it manually. When you did it manually in NI, if you had the "show hex offsets" option on, you would see that the enchantment field is at "60 h" on the right. The next value is at "64 h" so you can see the enchantment field is size 4. Remember this: 1 = "BYTE" 2 = "SHORT" 4 = "LONG" ... and now we can tell Weidu how to change that field: COPY_EXISTING ~sw1h03.itm~ ~override~ WRITE_LONG 0x60 3 SAY NAME2 ~Kondar +3~ 0x60 is the location of the field you want to change ("60 h") and 3 is the new value you want there. Mixing your manual changes with a bit of Weidu will save you time and effort, and will enable you to change things that would not otherwise be feasible, like easily adding projectiles. Quote Link to comment
pete_smith1229 Posted September 18, 2022 Share Posted September 18, 2022 Hi @subtledoctor, I followed your example and attempting to apply it to IW:EE but facing issues. I used a similar naming convention and inserted the main folder "moonboy_mod" with a subfolder "data" into my IW:EE directory. I placed my .PRO file into the "data" folder, edited the .tp file and ran the .exe file but received the following error: [C:\Program Files (x86)\Steam\steamapps\common\Icewind Dale Enhanced Edition\setup-moonboy_mod.exe] WeiDU version 24900 In state 32, I expected one of these tokens: [2] ~~ Parse error (state 32) at LAUNCH_PATCH_FUNCTION [MOONBOY_MOD/MOONBOY_MOD.TP2] PARSE ERROR at line 11 column 1-5 Near Text: LPF GLR parse error [MOONBOY_MOD/MOONBOY_MOD.TP2] ERROR at line 11 column 1-5 Near Text: LPF Parsing.Parse_error ERROR: parsing [MOONBOY_MOD/MOONBOY_MOD.TP2]: Parsing.Parse_error ERROR: problem parsing TP file [MOONBOY_MOD/MOONBOY_MOD.TP2]: Parsing.Parse_error FATAL ERROR: Parsing.Parse_error Press ENTER to exit. This is the contents of my .tp file: BACKUP ~moonboy_mod/backup~ AUTHOR ~SubtleD~ VERSION ~1~ BEGIN ~make some changes~ ADD_PROJECTILE ~moonboy_mod/data/RB_BLT01.PRO~ // (Weidu stores the new projectile index in a variable with this name) COPY_EXISTING ~spwi925.spl~ // Comet LPF ALTER_SPELL_HEADER INT_VAR projectile = %RB_BLT01% END // there's that variable IF_EXISTS BUT_ONLY Any ideas what the error is or advice please? Quote Link to comment
CamDawg Posted September 18, 2022 Share Posted September 18, 2022 COPY_EXISTING needs a destination: COPY_EXISTING ~spwi925.spl~ should be COPY_EXISTING ~spwi925.spl~ ~override~ Quote Link to comment
pete_smith1229 Posted September 19, 2022 Share Posted September 19, 2022 (edited) 15 hours ago, CamDawg said: COPY_EXISTING needs a destination: COPY_EXISTING ~spwi925.spl~ should be COPY_EXISTING ~spwi925.spl~ ~override~ Thanks but I still get the same error, even if I completely remove everything after the line "VERSION" in the .tp2 file, it still complains of a parsing error at Line 11 (when there is nothing at Line 11). This is what is in the .debug file: WeiDU v 24900 Log C:\Program Files (x86)\Steam\steamapps\common\Icewind Dale Enhanced Edition\setup-moonboy_mod.exe [.\chitin.key] loaded, 532278 bytes [.\chitin.key] 167 BIFFs, 37681 resources [.\engine.lua] loaded, 160 bytes [.\weidu.conf] loaded, 17 bytes [.\lang\en_us\dialog.tlk] loaded, 4470491 bytes [.\lang\en_us\dialog.tlk] 41352 string entries WARNING: parsing log [WeiDU.log]: Sys_error("WeiDU.log: No such file or directory") [MOONBOY_MOD/MOONBOY_MOD.TP2] PARSE ERROR at line 11 column 1-5 Near Text: LPF GLR parse error [MOONBOY_MOD/MOONBOY_MOD.TP2] ERROR at line 11 column 1-5 Near Text: LPF Parsing.Parse_error ERROR: parsing [MOONBOY_MOD/MOONBOY_MOD.TP2]: Parsing.Parse_error ERROR: problem parsing TP file [MOONBOY_MOD/MOONBOY_MOD.TP2]: Parsing.Parse_error FATAL ERROR: Parsing.Parse_error WeiDU Timings load TLK 0.000 Parsing TP2 files 0.016 loading files 0.016 stuff not covered elsewhere 0.016 unmarshal TLK 0.016 unmarshal KEY 0.031 TOTAL 0.094 Perhaps this is not compatible with IW:EE? Edited September 19, 2022 by pete_smith1229 Quote Link to comment
CamDawg Posted September 19, 2022 Share Posted September 19, 2022 Because you're passing it a variable, you need to tell WeiDU by wrapping the variable name in tildes and giving it explicit instructions to evaluate it: ADD_PROJECTILE ~moonboy_mod/data/RB_BLT01.PRO~ // (Weidu stores the new projectile index in a variable with this name) COPY_EXISTING ~spwi925.spl~ // Comet LPF ALTER_SPELL_HEADER INT_VAR projectile = EVAL ~%RB_BLT01%~ END // there's that variable IF_EXISTS BUT_ONLY Quote Link to comment
subtledoctor Posted September 19, 2022 Share Posted September 19, 2022 In my experience that is only necessary for string variables. Integer variables don’t need the extra quotes or EVAL. Example I can’t figure it out. Removing everything after the VERSION line won’t troubleshoot anything, because you need the BEGIN and some actions for the mod install to actually run. Btw, 1 hour ago, pete_smith1229 said: Perhaps this is not compatible with IW:EE? It is “compatible” with IWDEE in the technical sense, but it is meaningless on that game because you’re modifying an HLA and that game has no HLAs. Maybe that’s the problem: the IF_EXISTS stops the patch from happening, and then the installer is left with a mod component with no actions to process. So it throws an error. Try this: use your original code, with Camdawg’s fix (add ~override~ to the COPY_EXISTING line), and then at the very end, add: PRINT ~Hello world~ I bet it works then. (Albeit, as noted, it will have no effect in IWDEE.) Quote Link to comment
pete_smith1229 Posted September 19, 2022 Share Posted September 19, 2022 1 hour ago, CamDawg said: Because you're passing it a variable, you need to tell WeiDU by wrapping the variable name in tildes and giving it explicit instructions to evaluate it: ADD_PROJECTILE ~moonboy_mod/data/RB_BLT01.PRO~ // (Weidu stores the new projectile index in a variable with this name) COPY_EXISTING ~spwi925.spl~ // Comet LPF ALTER_SPELL_HEADER INT_VAR projectile = EVAL ~%RB_BLT01%~ END // there's that variable IF_EXISTS BUT_ONLY That makes sense, thanks. 10 minutes ago, subtledoctor said: In my experience that is only necessary for string variables. Integer variables don’t need the extra quotes or EVAL. Example I can’t figure it out. Removing everything after the VERSION line won’t troubleshoot anything, because you need the BEGIN and some actions for the mod install to actually run. Btw, It is “compatible” with IWDEE in the technical sense, but it is meaningless on that game because you’re modifying an HLA and that game has no HLAs. Maybe that’s the problem: the IF_EXISTS stops the patch from happening, and then the installer is left with a mod component with no actions to process. So it throws an error. Try this: use your original code, with Camdawg’s fix (add ~override~ to the COPY_EXISTING line), and then at the very end, add: PRINT ~Hello world~ I bet it works then. (Albeit, as noted, it will have no effect in IWDEE.) Yes, "Hello world" does work. I think you nailed it, I removed everything after ADD_PROJECTILE and now the .PRO file has been added correctly and I can reference it in the NI tool. I tested the new projectile and it works perfectly! Thank you both @subtledoctor@CamDawg Quote Link to comment
Recommended Posts
Join the conversation
You are posting as a guest. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.