Topic: How to add trunks over time?
PkK Topic Opener |
Posted at: 2014-03-18, 17:20
I want to create a starting condition, that gives additional trunks over time. I naively tried modifying the existing stating condition file by canging the end like this
But I just get an error message Now, I have no idea about lua, but I saw that there is a hq = ... just above, so hq should be a variable I can use. I just want to give the AI periodically some resources, to make the game more challenging. Philipp ![]() ![]() |
fk![]() |
Posted at: 2014-03-18, 18:43
@PkK
The function 'prefilled_buildings' returns no value. hq = wl.Game().map:get_field(sf.x, sf.y).immovable Edited: 2014-03-18, 18:56
![]() ![]() |
PkK Topic Opener |
Posted at: 2014-03-18, 18:52
So what purpose does the variable hq serve in the init script that comes with widelands?
and get ![]() ![]() |
fk![]() |
Posted at: 2014-03-18, 18:58
See above, I just edited my previous answer. The "hq = " serves no purpose, as far as I can see. ![]() ![]() |
PkK Topic Opener |
Posted at: 2014-03-18, 19:01
Thanks. That one works. I also considered
just in case the hq is not at the startng loation, but even though documentation says that get_buildings() accepts a string, widelands complains that the argument is not a table. ![]() ![]() |
fk![]() |
Posted at: 2014-03-18, 19:13
In case of a startup script I expect that it is save to assume that the hq is at the starting location. By the way, in the newest widelands version you will have to change "trunk" to "log". ![]() ![]() |
PkK Topic Opener |
Posted at: 2014-03-18, 19:17
What happens if there is no hq (e.g. when the enemy has already destroyed it)? Philipp ![]() ![]() |
PkK Topic Opener |
Posted at: 2014-03-18, 19:19
I now use this, which I hope means the AI will never run out of basic building materials:
P.S.: I'm using build18, and the init scripts use "trunk" everywhere. ![]() ![]() |
SirVer |
Posted at: 2014-03-18, 19:22
This is wrong
either
or the short form:
![]() ![]() |
fk![]() |
Posted at: 2014-03-18, 19:29
"What happens if there is no hq (e.g. when the enemy has already destroyed it)?"
![]() ![]() |