You must be logged in to post messages.
Please login or register

Caesar IV: Game Help
Moderated by kach, Gweilo

Hop to:    
Welcome! You are not logged in. Please Login or Register.4 replies
Caesar IV Heaven » Forums » Caesar IV: Game Help » Scripting help needed for loading save games
Bottom
Topic Subject:Scripting help needed for loading save games
Gordon Farrell
VIP
posted 03-29-08 17:38 ET (US)         
Hey, can anyone help me with this? You out there, Pecunia?

When I load saved games in my new scenario (it's based on heavily modified Brundisium cs script), the game.ScriptDone flag doesn't get set to true. At least, I think that's the problem... in any event, the game no longer recognizes when the victory conditions have been met. This is ONLY true after loading saved games. Otherwise, it works fine, so long as you play the scenario in one sitting.

I'm sure there's a bit of script that will recognize the save game load and re-set the necessary flag?

Thanks in advance!

President and Creative Director, Alternate Worlds (2011 - present) http://alternate-worlds.com/
Lead Writer, Reverie World Studios, (2008 - present)
Director of Voice Acting, Reverie World Studios, (2014 - present)
AuthorReplies:
goonsquad
Pleb
posted 03-29-08 21:52 ET (US)     1 / 4       
I have the line

game.ScriptDone=true;

at the bottom of the OnScenarioLoad section of the script. This seems to work.

[This message has been edited by goonsquad (edited 03-29-2008 @ 09:58 PM).]

Angrod
Pleb
posted 03-30-08 06:34 ET (US)     2 / 4       
Yes, goonsquad has (I believe) the right answer (having had a quick look at the Brundisium script). OnScenarioLoad will be executed each time you load from a save, so needs to be told to set the flag to TRUE. If you look at the scripts for other (non-tutorial) scenarios, you will see that the flag is usually set TRUE in both OnBeginScenario and OnScenarioLoad. The exception to this will be scenarios like "Arabian Bizarre" where victory (or defeat) can only occur after a set period of time.

[This message has been edited by Angrod (edited 03-30-2008 @ 06:34 AM).]

Gordon Farrell
VIP
posted 03-31-08 14:08 ET (US)     3 / 4       
Hey guys, thanks for looking into this for me! Here's the problem... I'm using the Brundisium cs as a template because I'm creating scenarios that involve a lot more narrative developments and plot twists than a typical c4 scenario has. The Brundisium cs is all set up with several tutorial-style messages that can easily be triggered where ever I want them to appear in the course of playing the map. However, along the way, I am also disabling the tutorial functions like locked Tools, flashing tool buttons, etc. So this is where I am...

The OnScenarioLoad script contains this information:

void OnScenarioLoad(IGameQueryInterface game)
{
Tools = new Toolset();
loadState = scriptState;
scriptState = EventList.kLoadState;
}

When I load a saved game, however, it fails to recognize when the ratings victory conditions have been mket. So I changed the OnScenarioLoad script to read:

void OnScenarioLoad(IGameQueryInterface game)
{
game.ScriptDone=true;
}

(Obviously, I don't need the Tools = new Toolset function anymore.) Now, however, when the scenario FIRST STARTS it seems to initiate game.ScriptDone=true immediately. The varrious tutorial-style messages I've created no longer fire.

Any thoughts?

President and Creative Director, Alternate Worlds (2011 - present) http://alternate-worlds.com/
Lead Writer, Reverie World Studios, (2008 - present)
Director of Voice Acting, Reverie World Studios, (2014 - present)
Gordon Farrell
VIP
posted 03-31-08 14:56 ET (US)     4 / 4       
Heh, okay, I think I solved it.

Turns out in the Tutorial scripts the command Tools = new Toolset() is what activates the messaging system and I actually DO need it!

Anyway, it seems to be working... will report back after a few playtests... thanks!

President and Creative Director, Alternate Worlds (2011 - present) http://alternate-worlds.com/
Lead Writer, Reverie World Studios, (2008 - present)
Director of Voice Acting, Reverie World Studios, (2014 - present)
You must be logged in to post messages.
Please login or register

Hop to:    

Caesar IV Heaven | HeavenGames