qwerty12345 Posted February 13, 2014 Share Posted February 13, 2014 I want to add an entry to shout.ids. How do I make sure that there will be no clashes with other possibly added by mods? Link to comment
Jarno Mikkola Posted February 13, 2014 Share Posted February 13, 2014 Similar to this: // Adds CD_STATE_NOTVALID state APPEND ~STATE.IDS~ ~0x80101FEF CD_STATE_NOTVALID~ UNLESS ~CD_STATE_NOTVALID~ Link to comment
qwerty12345 Posted February 13, 2014 Author Share Posted February 13, 2014 that will just skip if there's such entry already. So my scripts will use this shared shout. I need a new, unique shout. Link to comment
Jarno Mikkola Posted February 13, 2014 Share Posted February 13, 2014 that will just skip if there's such entry already. So my scripts will use this shared shout. I need a new, unique shout. Erhm, it will skip if the UNLESS statement is true within the line... this allows you to build up a nearly endless of possibility ... say you wish a simple QHELP as the shout in your scripts, you can: APPEND ~shoutids.ids~ ~131 QHELP~ UNLESS ~131~ Now then if the case is that the 131 is already occupied, you just... APPEND ~shoutids.ids~ ~171 QHELP~ UNLESS ~QHELP~ Cover it... ETC. Link to comment
qwerty12345 Posted February 13, 2014 Author Share Posted February 13, 2014 that's the question, how do I choose the number that is not occupied. Link to comment
Mike1072 Posted February 13, 2014 Share Posted February 13, 2014 You can use LOOKUP_IDS_SYMBOL_OF_INT to determine if any identifier is associated with a specific value. This will only guarantee you get a unique shout if you assume every mod that uses shouts actually adds an identifier to shoutids.ids. SET val = 0 LOOKUP_IDS_SYMBOL_OF_INT identifier ~shoutids~ val PATCH_IF (~%identifier%~ STRING_EQUAL ~%val%~) BEGIN // no identifier assigned to val END Combine it with a loop to keep searching until you find one that's unused. Edit: Keep in mind that you'll need to recommend installing your mod after mods that are less careful about this sort of thing. Link to comment
qwerty12345 Posted February 13, 2014 Author Share Posted February 13, 2014 Yep, thanks. Link to comment
Recommended Posts
Archived
This topic is now archived and is closed to further replies.