Show whole topic Aug 10, 2014 3:03 pm
ness Offline
Developer
Registered since: Nov 12, 2010
Location: -


Subject: Singlepayer scenario
Hi all,

I've been playing around with alzi "menu_refactoring" code branch, and hacked a singleplayer scenario editor.
That means you have a new menu entry in "singleplayer" games called scenarios, next screen will list available scenarios found in maxr/scenarios, next screen you are in the game with ennemy players ! Ok for now all is static, so you are going to attack a static player not moving, but all sentry are activated so watch out for turrets !

How it works, each scenario is a text file that describe the game, it features:
- Choose the map
- Choose game settings
- Add 1 to 7 opponents
- Add Buildings, units and landing units

It misses (for now...):
- Clans selection does not work on human and on ennemy landing units
- Handle unit upgrades
- End of game conditions
- Load/save

Here is an example of scenario file, it is scripted with Lua language :
DownloadSource code (Text):
  1. scenarioName = "Assault : destroy ennemy base"
  2. description = "Watchout for anti aircrafts"
  3.  
  4. settings = LuaSettings()
  5. settings:setBridgeHeadDefinite(true)  -- default to mobile (no landing mining station)
  6. game:setSettings(settings)
  7.  
  8. human = game:getHumanPlayer()
  9. human:setLandingPosition(35, 60)
  10. human:setClan(0)
  11. for i=1,6 do human:addLandingUnit("bomber") end
  12. human:addLandingUnit("awac")
  13.  
  14. mapName = "Iron Cross.wrl"
  15. game:loadMap(mapName)
  16.  
  17. billy = game:addPlayer("Billy")
  18. billy:setClan(6)
  19. billy:setLandingPosition(50, 37)
  20. for i=1,8 do billy:addLandingUnit("missel") end
  21. for i=1,10 do billy:addBuilding("block", 43 + i, 33) end
  22. for i=1,10 do billy:addBuilding("block", 43 + i, 43) end
  23. for i=1,10 do billy:addBuilding("block", 44, 33 + i) end
  24. for i=1,10 do billy:addBuilding("block", 54, 33 + i) end
  25. billy:addBuilding("radar", 49, 39)
  26. billy:addBuilding("gun_aa", 45, 34)
  27. billy:addBuilding("gun_aa", 53, 34)
  28. billy:addBuilding("gun_aa", 45, 42)
  29. billy:addBuilding("gun_aa", 53, 42)
  30.  
  31. -- Start the game
  32. game:start()

I attached a few demonstration scenarios.

To make this run, you will have to compile the "scenario" branch from git (once I'll have find out how to push the code!).,
add the scenario directory into your maxr directory and that's it.
Note: this is still work under progress and is based on menu refactoring branch of alzi (we encoutered some SDL crashes at least on windows);
Testing is welcome as it will test both branch all toghether Smiling

After all this is set, I'll try to make the scenario more reactive by scripting unit movements and attacks !

Have fun !

Attachments:
scenarios.zip
Downloads: 346
Filesize: 2.82 KB