Currently Online

Latest Posts

Topic: auto_speed problem

Nordfriese
Avatar
Joined: 2017-01-17, 18:07
Posts: 2057
OS: Debian Testing
Version: Latest master
Ranking
One Elder of Players
Location: 0x55555d3a34c0
Posted at: 2021-12-06, 17:12

You need to place the template file in your Widelands home directory or one of its subdirectories so Widelands can find the file, and specify a path relative to the WL home dir.

How can I pass custom lua script?

EDIT: I presume that I can use --script parameter

Yes, --script should work with templates

Edited: 2021-12-06, 17:12

Top Quote
Tibor

Topic Opener
Joined: 2009-03-23, 23:24
Posts: 1377
Ranking
One Elder of Players
Location: Slovakia
Posted at: 2021-12-06, 17:58

thanks, now it works


Top Quote
Tibor

Topic Opener
Joined: 2009-03-23, 23:24
Posts: 1377
Ranking
One Elder of Players
Location: Slovakia
Posted at: 2021-12-08, 15:44

Hm, the script is not working somehow now, but I believe it was working. My command is:

/var/widelands2/git/trunk/build/src/widelands --autosave=50000 --new_game_from_template=/home/tibor/.widelands/templates/l_along_the_e.txt --script=/home/tibor/.widelands/scripting/125min.lua --datadir=/var/widelands2/git/trunk/data --nosound --auto_speed --ai_training --verbose

and I noticed even if I use non_existent file as script - no complains from the game...

template is followed


Top Quote
Tibor

Topic Opener
Joined: 2009-03-23, 23:24
Posts: 1377
Ranking
One Elder of Players
Location: Slovakia
Posted at: 2021-12-08, 20:37

I would say it worked when I was loading the game, but not with templates. I am looking into wlapplication.cc I do not fully understand the code but I would say that in the case of template the script is not even parsed from cli


Top Quote