How to reload a scenario 2 or 3 times in a campaign
Moderator: Forum Moderators
Forum rules
- Please use [code] BBCode tags in your posts for embedding WML snippets.
- To keep your code readable so that others can easily help you, make sure to indent it following our conventions.
How to reload a scenario 2 or 3 times in a campaign
Hello;
My hero wanders in and out of a scenario as part of a SP campaign. He alters events and once altered wants to return to the scenario later as it was left. So the events need to know they have been triggered and not reloaded from scratch. Is there a way to save and load a scenario, including the units active in the scenario and the triggered events as triggered in a previous visit. IE exactly as it was left when the scenario was finished? I see save as part of a save game, but how do I load just the scenario?
thanks for your time
yours
winkr7
My hero wanders in and out of a scenario as part of a SP campaign. He alters events and once altered wants to return to the scenario later as it was left. So the events need to know they have been triggered and not reloaded from scratch. Is there a way to save and load a scenario, including the units active in the scenario and the triggered events as triggered in a previous visit. IE exactly as it was left when the scenario was finished? I see save as part of a save game, but how do I load just the scenario?
thanks for your time
yours
winkr7
Re: How to reload a scenario 2 or 3 times in a campaign
There is no simple way. For events you can set their id as variable and check for that variable with [filter_condition].
Re: How to reload a scenario 2 or 3 times in a campaign
Ravana;
Thankyou.
yours
winkr7
Thankyou.
yours
winkr7
- beetlenaut
- Developer
- Posts: 2867
- Joined: December 8th, 2007, 3:21 am
- Location: Washington State
- Contact:
Re: How to reload a scenario 2 or 3 times in a campaign
Depending on what the events did, you can probably store the effects themselves when the hero leaves the scenario. You can store the whole map with [store_locations] if an event could have changed the map, and you can [store_items] if something could have gotten added. You also have [store_unit] and [store_villages]. Maybe that will help, though you will still need Ravana's solution or something similar for disabling previously-triggered events.
Campaigns: Dead Water,
The Founding of Borstep,
Secrets of the Ancients,
and WML Guide
The Founding of Borstep,
Secrets of the Ancients,
and WML Guide
Re: How to reload a scenario 2 or 3 times in a campaign
Thanks beetlenaut;
I will consider the [store_unit] and [store_items]. To load them in I have to erase all the units and items loaded by the scenario at start correct?
Also, how do I access scenario.id? I have tried getting it from prestart events, start events and the scenario tag level and the side tag level and I always come up blank.
thanks for your time.
yours
winkr7
I will consider the [store_unit] and [store_items]. To load them in I have to erase all the units and items loaded by the scenario at start correct?
Also, how do I access scenario.id? I have tried getting it from prestart events, start events and the scenario tag level and the side tag level and I always come up blank.
thanks for your time.
yours
winkr7
- beetlenaut
- Developer
- Posts: 2867
- Joined: December 8th, 2007, 3:21 am
- Location: Washington State
- Contact:
Re: How to reload a scenario 2 or 3 times in a campaign
Yes, you would. It's only a few lines though.
You can't just invent a variable like that. You can use :inspect to see all the variables that currently exist. A container called "scenario" will not be there. If you need it, you can set it as a variable or macro in the prestart event. You entered it at the top (probably) of the scenario, so you know what it is. It's probably also visible to the Lua API somewhere, but you still can't make up a name.
Campaigns: Dead Water,
The Founding of Borstep,
Secrets of the Ancients,
and WML Guide
The Founding of Borstep,
Secrets of the Ancients,
and WML Guide
Re: How to reload a scenario 2 or 3 times in a campaign
beetlenaut;
Thanks for the help as always. I assumed id was part of scenario--a property of scenario. I assumed that id was what next_scenario referenced.
I will try to set a variable in prestart. A good suggestion, thanks.
yours
winkr7
Thanks for the help as always. I assumed id was part of scenario--a property of scenario. I assumed that id was what next_scenario referenced.
I will try to set a variable in prestart. A good suggestion, thanks.
yours
winkr7
- beetlenaut
- Developer
- Posts: 2867
- Joined: December 8th, 2007, 3:21 am
- Location: Washington State
- Contact:
Re: How to reload a scenario 2 or 3 times in a campaign
And that's probably true in the engine's C++ code, but WML doesn't have access to those variables. There are only a handful of variables in WML that are stored automatically. You need to use the [store_*] tags to gain access to more of them, but there is no tag for storing the whole scenario. If you haven't been, you definitely should be using :inspect to see what the scenario structure looks like before and after you store variables. (I always set it as a menu item when I am testing.)
Code: Select all
[set_menu_item]
id=inspection
description="Inspect"
[command]
[inspect][/inspect]
[/command]
[/set_menu_item]
Campaigns: Dead Water,
The Founding of Borstep,
Secrets of the Ancients,
and WML Guide
The Founding of Borstep,
Secrets of the Ancients,
and WML Guide
Re: How to reload a scenario 2 or 3 times in a campaign
beetlenaut;
Yeah, I got the menu for inspect from one of your earlier wml examples back in may--thanks. I didn't realize it showed every available variable, I thought it was a debug subset.
thanks for your time
yours
winkr7
Yeah, I got the menu for inspect from one of your earlier wml examples back in may--thanks. I didn't realize it showed every available variable, I thought it was a debug subset.
thanks for your time
yours
winkr7