Getting the current state shouldn't be a problem. They all have an ID, so you can identify them. But NPCs get regularly destroyed, either when they reach their target exit or you leave the stage. So they don't really move to a different stage and don't preserve their state when you switch stages. Though it would be interesting to have NPCs carry your stuff to a different stage and you have to search for it.Crisp2002 Since you're immersed in NPC stuff right now, it's probably a good time to ask:
How hard would it be to expose information about existing NPCs to v2 missions? Not spawn or manipulate them, but maybe just get a list of the positions and states of the NPCs already on the map?
For context, I'd like to make the "NPCs pick up and mess with your dropped items" mod, and I think the whole thing could just be a v2 mission if only there was a way to know where NPCs are. For example, if I could call aGetNPCs()function that returned a list of NPC objects with x/y/z and state data of each NPC, I could iterate through that, compare to_state.DroppedItems, see if any NPCs are very close to any of the dropped items, and then move the item away and trigger any other logic based on that. That would be enough for the basic mod, and then it could be spruced up later if you get NPC manipulation working (stopping them, triggering animations on them, etc).
There's also a police uniform version of an NPC (though only female, I think). But someone had the idea to, instead of going game over when you are seen, increase the police presence in that area and have them patrol. And if you are caught by the police (that might even case you) you get the game over.
To do that in my mod, I would need more functions to change the base functionality. But even as a standalone mod I fear that it would cause problems with other mods that change NPC behavior.
If we don't agree on some conventions at least. Like, I could probably change the ID of a custom NPC to something like 100000+x. And so an ID over 100000 could be an indicator to leave the NPC alone. Or maybe make it a million, the possible IDs should go up to over 2 billion. You probably wouldn't reach such a high ID in a normal game session.