Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add lua libs for lua map generator, also add bindings for mt rng
Tested to work with this test scenario, and the mainline defaults: [label] x = {X} y = {Y} text = {STRING} [/label] [multiplayer] id=lua_map_gen name= _ "Lua Map Gen Test Scenario" description= _ "test test test of lua map gen" map_generation="lua" [generator] id="test" config_name="Test Lua Map Generator" create_map = << local rng = Rng:create() print(rng:draw()) print(rng:draw()) print(rng:draw()) local w = 50 local h = 40 map="" for y=1,h do local r = rng:draw() % 2 for x=1,w do if x == 10 and y == 10 then map = map .. " 1 " end if x == (w-10) and y == (h-10) then map = map .. " 2 " end if ((x + y) % 2) == r then map = map .. "Gg" else map = map .. "Md" end if x ~= w then map = map .. "," end end map = map .. "\n" end return map >> [/generator] id = foo random_start_time=yes {DEFAULT_SCHEDULE} [event] name=prestart {LABEL 25 20 ("Lua map generator")} [/event] [side] [ai] villages_per_scout=8 [/ai] id=RBY_Side1 side=1 save_id=RBY_Side1 persistent=yes color=red team_name=Red user_team_name= _ "teamname^Red" controller=human canrecruit=yes shroud=no fog=no gold=1000000 [/side] [side] [ai] villages_per_scout=8 [/ai] id=RBY_Side2 side=2 save_id=RBY_Side2 persistent=yes color=blue team_name=Blue user_team_name= _ "teamname^Blue" controller=human canrecruit=yes shroud=no fog=no gold=1000000 [/side] [/multiplayer]
- Loading branch information