Topic: Scrtipting trouble infrastructure.lua
Lokimaros Topic Opener |
Posted at: 2017-01-04, 14:30
To do a specific test I've made a simple map with a script to set up the intended starting conditions: a headquarters, with a lumberjack-range size forest to the east and a single lumberjack in the centre, with a connecting road. That's the goal. Curerntly it crashes with: The full inti.lua is listed below: [code] include "scripting/infrastructure.lua" local game=wl.Game() -- reveal the whole map for every player local sf = map.player_slots[1].starting_field prefilled_buildings(plr, { "barbarians_headquarters", sf.x, sf.y, prefilled_buildings(plr, "barbarians_lumberjacks_hut", 24, 24) sf = map.player_slots[1].starting_field Top Quote |
Lokimaros Topic Opener |
Posted at: 2017-01-04, 15:27
Upon reflection, it's not the connect_road that fails, of course, but the prefilled_building of the lumberjack, but I still don't see what the error in my using it is. I've already moved the conquer to precede it, in case land ownership was the problem, but the result is exactly the same. Top Quote |
kaputtnik |
Posted at: 2017-01-04, 15:54
Compare the first prefilled_buildings function and the one which causes the error:
and the second:
Try to add curly braces to it:
And be aware that a flag of a building is not at the same spot as the building is. Fight simulator for Widelands: |
Lokimaros Topic Opener |
Posted at: 2017-01-04, 16:52
Doing! Well, grate my skin and bake me for 197 minutes, I should have seen that! As for the starting point, I had that right originally, but a previous error made me think I might have the wrong spot. Corrected back, now, and with a further correction of connect_road to connected_road, and eliminating one 'e', (e,e|e,e into e,e,e), it works as intended, yay! My slumberjack is happily hacking away at his wood, and results will be posted in about 4 hours. Top Quote |