Docker image which provides a full Eressea installation to host a local game.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

30 lines
803 B

3 weeks ago
  1. require("config")
  2. require("eressea")
  3. require("tools/build-e3")
  4. -- script build-e3 calls functions in module eressea; but without module name
  5. -- don't how to solve this; but is fully operational
  6. free_game = eressea.free_game
  7. -- first we have to create an empty game data file
  8. -- reason: only when a game is loaded, the random seed is initialized correctly
  9. eressea.free_game()
  10. eressea.write_game(get_turn() .. ".dat")
  11. -- load game data in order to seed initialized
  12. eressea.free_game()
  13. eressea.read_game(get_turn() .. ".dat")
  14. local w = os.getenv("ERESSEA_MAP_WIDTH")
  15. if not w then
  16. w = 80
  17. end
  18. local h = os.getenv("ERESSEA_MAP_HEIGHT")
  19. if not h then
  20. h = 40
  21. end
  22. local pl = plane.create(0, -w/2, -h/2, w+1, h+1)
  23. build(pl)
  24. fill(pl, w, h)
  25. -- save new world
  26. eressea.write_game(get_turn() .. ".dat")