I added (in svn) a new lua function that allows you to load another scenario from inside an existing scenario:
loadScenario('capture_the_flag2')
Currently there are a number of things incomplete so i need feedback. I have a restriction that the new scenario must have hte same techtree and factions, but map, tileset can change. How should we make this progress, what kinds of things would we want to see? Carry over untis or start iwth new units and new factions? Bring over builds and upgrades or not etc?
Update: Added a way to call the next scenario with exisitng factions or with only newly defined factions in the new scenario:
-- keep existing factions
loadScenario('capture_the_flag2',1)
-- drop existing factions
loadScenario('capture_the_flag2',0)
Playing around with this shows a lot of promise for doing things like missions! Using the current svn code I made two scenarios. The first scenario i setup a cell trigger (to find out cell co-ordinates, svn's debug view shows mouse xy cell coords):
cell_event_newscenario = registerCellTriggerEventForFactionToLocation(0,{12,20})
print( 'cell_event_newscenario = ' .. cell_event_newscenario )
When any unit from faction 0 touches the cell at 12,20, my cell trigger event is called:
<cellTriggerEvent>
if triggeredCellEventId() == cell_event_newscenario then
clearDisplayText()
DisplayFormattedText('warping to new scenario!')
createUnit('blacksmith', 0, startLocation(0))
createUnit('technodrome', 0, startLocation(0))
technodrome= lastCreatedUnit()
giveResource('gold', 0, 400);
giveResource('wood', 0, 400);
giveUpgradeCommand(technodrome, 'robotics')
loadScenario('capture_the_flag2',1)
end
</cellTriggerEvent>
In this case i add a few new units, start an upgrade and then load all of my factions into scenario: capture_the_flag2
This should make for some great new scenarios