paladin84 Posted November 2, 2023 Share Posted November 2, 2023 I have a huge mod, all the resource files in it already have prefixes, but global variables are not. What is the best way to add a prefix to all the global variables automatically? I wrote a python script to find all the instance strings in *.baf and *.d files that looks like: "SOME_STRING","GLOBAL" using the regexp (\s is all ASCII whitespaces, like space, tab, end of the string): "[^"]*"\s*,\s*"GLOBAL" and I am replacing it to be (my prefix is NW): "NWSOME_STRING","GLOBAL" I am making sure that the resultant string length is no more than 32 and ignoring all the variables started with "SPRITE_IS_DEAD". Is there anything else I should consider, or this is enough? Quote Link to comment
lynx Posted November 2, 2023 Share Posted November 2, 2023 (edited) Effects — there could be some modifying variables via 0x109 https://gibberlings3.github.io/iesdp/opcodes/bgee.htm#op265 Oh, you can make the process faster by not converting all dlg and bcs files. I had to do the same for 10pp and first check for a rough match in the non-decompiled file: https://github.com/lynxlynxlynx/gemrb-mods/blob/bf997587928686f8cc3b5f5b57e77ebebf152060/10pp/setup-10pp.tp2#L68 Edited November 2, 2023 by lynx Quote Link to comment
paladin84 Posted November 2, 2023 Author Share Posted November 2, 2023 Thank you, I also found all "\x09\x01" in all the items and spells (it happend to be not that many of them) and checked them manually using NI. 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.