IDs to DataRefs, and Plot Work

Most of today was spent on phase two of the mod merging update: converting all internal data IDs from plain numbers to mod-specific numbers. This looks like:

Old -> New
5 -> DataRef("0:5")
12.7 -> DataRef("0:12.7")
etc.

Basically, every time I refer to something in the game, I need to update it from just the old ID to the new mod ID plus data ID. To do this, I've created a special class called DataRef. DataRef takes a string like "0:12.7" and figures out that:

"0" is for mod ID 0 (default game data)
"12.7" is for item nGroupID 12 and nSubgroupID 7

Similarly, it handles variations like "0:9" for mod 0, condition 9, and will make several assumptions if parts of the input string are missing. (E.g. assume base game data if no mod specified)

As one could probably guess, this is a big job. NEO Scavenger is all about data. It's everywhere in the game code. So refactoring the old IDs to new DataRefs is going to take a bit of work.

So far, I've converted a few of the classes, and rewritten several of the data parsers. I suspect there will be at least another day of this, though. Fortunately, the DataRef string-parsing seems to be saving me quite a bit of work. I'm hoping that it'll also mean I can continue using old base game data without having to insert "0:" in front of all data IDs in the XML.

This may seem like a lot of work for supporting mods, but I think it's pretty important. It literally saves modders from having to rewrite their mods each new game version, due to conflicting IDs in the update.

Aside from the DataRef changes, I also did another plot review this afternoon. Harald is already starting on his new encounter spec, but in the meantime, he also made some changes to his previous one based on our discussion. I think we're good to go on that one now, and I can begin converting it into game data once I'm done with mod merging.

Have a good night, all!

Comments

EmperorZA's picture
EmperorZA

Epic! <3 you making many modders happy! +10000 points

IMAGE(http://steamsignature.com/status/english/76561198001057148.png)IMAGE(http://steamsignature.com/AddFriend.png)

Byzanthei's picture
Byzanthei

"Find/ Replace" FTW!