Topic: How to add a custom starting condition?
PkK Topic Opener |
Posted at:
2016-02-03, 21:11 UTC+1.0
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 ![]() ![]() |
GunChleoc![]() |
Posted at:
2016-02-03, 21:53 UTC+1.0
You have to register the new scripts in Busy indexing nil values ![]() ![]() |
PkK Topic Opener |
Posted at:
2016-02-04, 10:18 UTC+1.0
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.
![]() ![]() |
GunChleoc![]() |
Posted at:
2016-02-04, 10:25 UTC+1.0
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 ![]() ![]() |
PkK Topic Opener |
Posted at:
2016-02-04, 10:39 UTC+1.0
But the code doesn't even use the name of the headquarter. The line that has the name is commented out. Philipp ![]() ![]() |
GunChleoc![]() |
Posted at:
2016-02-04, 12:26 UTC+1.0
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, 12:32 UTC+1.0
Busy indexing nil values ![]() ![]() |
PkK Topic Opener |
Posted at:
2016-02-04, 13:02 UTC+1.0
Thanks. Unfortunately, execution doesn't even make it to that point in the code. Philipp ![]() ![]() |
PkK Topic Opener |
Posted at:
2016-02-04, 13:45 UTC+1.0
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 ![]() ![]() |
PkK Topic Opener |
Posted at:
2016-02-04, 14:07 UTC+1.0
Your suggestion gives:
![]() ![]() |
PkK Topic Opener |
Posted at:
2016-02-04, 14:11 UTC+1.0
Hmm, I get the same when I put the tribe-specific name manually. Philipp ![]() ![]() |