WorldBuilder functions not working

Geekob

Chieftain
Joined
Apr 30, 2017
Messages
20
I found some useful functions in worldbuilder lua files but it seems im not able to use them. Its kind of weird since I can run those commands in runtime through firetuner. Lua doesnt throw any error, it just doesnt execute them. Im using ImprovementBuilder also, and it works even outside debug environment. I want to add plot to city, so it can be workable so I used
Code:
WorldBuilder.CityManager():SetPlotOwner(plot, city);
but lua just ignores it. Is there any way to make it working? Or does anyone know any alternative function for setting plot to be owned by some city?
 
I call it with those arguments
Code:
WorldBuilder.CityManager():SetPlotOwner( x, y, playerID, cityID )
 
WorldBuilder functions can take various form of parameters. E.g. the one you want:
SetPlotOwner (iX, iY, false)
SetPlotOwner (pPlot, false)
SetPlotOwner (pPlot, pCity)
SetPlotOwner (pPlot, ePlayer, iCity)
SetPlotOwner (iX, iY, ePlayer, iCity)
 
Ok nevermind, i found them :D Im just blind. But I still have problem with many functions that I dont know what arguments they take. And lua will tell me just that there is problem with calling that function, nothing like "function requires arguments string, int instead of int int".
 
I use the spreadsheet, too. I also scan Lua objects for functions (since they are tables) and use TableBrowser from FireTuner to check what functions are available in a context. But the parameters is trial & error case. Just use logic, and some testing in FT.
 
Oh, okay then. I still dont understand why Firaxis didnt release any API reference. I wonder if they ever will.
 
Back
Top Bottom