Topic: How to add a custom starting condition?
PkK Topic Opener |
Posted at: 2016-02-03, 20:11
I used to play with custom starting conditions for some players. To do that I added .lua files in tribes/barbarians/scripting/, etc. It seems the default starting conditions are now in data/tribes/scripting/starting_conditions/empire/, etc. But if I put a .lua file in there, it doesn't show up in game as a starting condition to select. Philipp Top Quote |
GunChleoc |
Posted at: 2016-02-03, 20:53
You have to register the new scripts in Busy indexing nil values Top Quote |
PkK Topic Opener |
Posted at: 2016-02-04, 09:18
Thanks, now I can add my starting condition. I had to rename a few wares, etc to make it not crash with current widelands, but there is one remaining issue: The periodic goods addition is not happening.
Top Quote |
GunChleoc |
Posted at: 2016-02-04, 09:25
The problem here is that the headquarters have different names now, depending on the tribe. So, you need to get the https://wl.widelands.org/docs/wl/autogen_wl_map/#module-interfaces Something like this should work:
Busy indexing nil values Top Quote |
PkK Topic Opener |
Posted at: 2016-02-04, 09:39
But the code doesn't even use the name of the headquarter. The line that has the name is commented out. Philipp Top Quote |
GunChleoc |
Posted at: 2016-02-04, 11:26
I just noticed that you have an old ware name in there. Try You might find this table useful - it's the translatable names rather than the internal names, but it might still help you as a guideline to which names have been changed. All the workers, buildings ships etc. now have a prefix in their name to denote the tribe, but the wares generally don't except for bread. Edited: 2016-02-04, 11:32
Busy indexing nil values Top Quote |
PkK Topic Opener |
Posted at: 2016-02-04, 12:02
Thanks. Unfortunately, execution doesn't even make it to that point in the code. Philipp Top Quote |
PkK Topic Opener |
Posted at: 2016-02-04, 12:45
Would this work with the if test even when the player has been defeated? Would it crash or return 0, NULL or whatever it is in Lua for hq? Philipp Top Quote |
PkK Topic Opener |
Posted at: 2016-02-04, 13:07
Your suggestion gives:
Top Quote |
PkK Topic Opener |
Posted at: 2016-02-04, 13:11
Hmm, I get the same when I put the tribe-specific name manually. Philipp Top Quote |