Tricky question

Started by Grauniad, December 18, 2012, 08:56:33 PM

Previous topic - Next topic

Grauniad

If I set some "Once" commands for a CRPLTower, do I then have to save the map before I run it to ensure that the Once is executed for the player and not for me alone?


IOW. How do I set/preserve initial state on a map?

Also. I don't want my CRPL script to run before a CN hasn't touched down.
A goodnight to all and to all a good night - Goodnight Moon

knucracker

Hmmmmm.....  Good question.  Good one...
I need a separate save, or a button to "reset to initial state" before you save.

Normally, a save game needs to serialize the internal once map since you don't want once clauses executing again upon each game load (don't ask.... that would be an extra evil way to penalize players who load a lot....).

But you are correct, when you save the map for consumption you want things reset to first positions, so to speak.  You want the time zeroed as well (which you can do with a key press currently).  You want the internal update count zeroed, etc.  I'll write this one down on my pad for a 'first thing in the morning' job.

As for checking the number of CN's on the map.... sounds like maybe I need a new API for that "GetCommandNodeCount", or such.

lurkily

I presume you could just recompile each script before saving, as a stopgap measure?

knucracker

Yeah, that will reset all script related data, including the once map.