Some questions about campaign scripting

For AI and campaign script related discussions and questions
Post Reply
User avatar
aubergine
Professional
Professional
Posts: 3459
Joined: 10 Oct 2010, 00:58
Contact:

Some questions about campaign scripting

Post by aubergine »

Not like me to have questions, but here goes... :P

Does each mission start with a fresh scripting environment?

I was wondering if it would be worth updating gameOverMessage() to have an additional 'allowSave' param, which if 'true' would show the save game option.

This would mean that for a single map, all missions on that map could be done with a single set of scripts.

This could then be used in challenge games, allowing a challenge to act like a mini-campaign with several missions on the one map and the option to save between each mission.

How come setScrollParams() isn't being used?

I imagine the accessible area of the map is still being controlled by some weirdness in a .slo or .vlo file somewhere (or some other strange file that I'm yet to discover). Surely it would be better to use labels that define the area of the map available for each mission, and then have the camXy.js script use setScrollParams() to limit the visible area of the map to the area object associated with the label?

We could also update setScrollParams() to accept different parameter formats - eg. allow a label name or area object to be passed in.

What gets persisted between missions?

I imagine there will come a point where we want to persist variables between missions, so stuff that happened in a previous mission can affect a future mission.

Is there some info on what currently gets retained from one mission to the next?
"Dedicated to discovering Warzone artefacts, and sharing them freely for the benefit of the community."
-- https://warzone.atlassian.net/wiki/display/GO
Per
Warzone 2100 Team Member
Warzone 2100 Team Member
Posts: 3780
Joined: 03 Aug 2006, 19:39

Re: Some questions about campaign scripting

Post by Per »

Each mission starts with a fresh scripting context.

Scroll parameters can be controlled from .gam files, which is how cam1a (Alpha 1) is restricted.

I do not have a full list of things that persist between missions. Nothing persists between scripts. Adding a way to allow such persistence is on my list of things to do.
Post Reply