ScriptData question.

General Tso

Panzer General
Joined
Oct 12, 2007
Messages
1,548
Location
U. S. of A.
Can you only save one set of ScriptData at a time?

For example if I do this:
CyGameInstance.setScriptData(pickle.dumps(myGameData))

Then do this:
CyUnit.setScriptData(pickle.dumps(myUnitData)) (Where CyUnit is one of the units in the game.)

Does the data from the second line replace the first line or would there now be two sets of data available for recall using CyGameInstance and CyUnit?

Edit: Another question: Why can't I get rid of the space in "myGameData" above. It doesn't show up when I edit the post.
 
No, CyUnit.setScriptData, CyPlot.setScriptData, CyPlayer.setScriptData, CyGameInstance.setScriptData, etc do not effect each other, they all have their own script data variable.
 
Thanks Jeckel, that sounds like it will come in real handy for what I want to do.
 
I don't know what you are going to be storing in striptdata, but just fyi, scriptdata needs to be a str string and won't take a unicode string. So if you run into probs trying to set it, first thing to try would be to set it again with str() around your string. This can pop up because alot of Civ4 methods, like CyUnit.getName() and all the info.getDescription()s, all return unicode strings and not str strings.

Just somthing that popped to mind. :king:
 
Back
Top Bottom