Latest Posts

Topic: Trees and Terrains

kaputtnik
Avatar
Topic Opener
Joined: 2013-02-18, 19:48
Posts: 2441
OS: Archlinux
Version: current master
Ranking
One Elder of Players
Location: Germany
Posted at: 2015-07-10, 17:30

king_of_nowhere wrote:

I changed nothing except the values, and going to new lines for every new terrain for ease of reading.

I have a vage feeling that there is something wrong either with the file you have edited or with your editor. The file should look like world/terrains/init.lua (link points to temperature value) If your file looks different there is something wrong.


Fight simulator for Widelands:
https://wide-fighter.netlify.app/

Top Quote
king_of_nowhere
Avatar
Joined: 2014-09-15, 17:35
Posts: 1668
Ranking
One Elder of Players
Posted at: 2015-07-10, 19:34

huh, it looks fairly different. probably because i opened it with block notes. i don't have a specialized editor. is that so bad? in case it is, can i just mail the datasheet with the values and let someone else try them?


Top Quote
Tibor

Joined: 2009-03-23, 22:24
Posts: 1377
Ranking
One Elder of Players
Location: Slovakia
Posted at: 2015-07-10, 20:19

can you post your file somewhere?


Top Quote
kaputtnik
Avatar
Topic Opener
Joined: 2013-02-18, 19:48
Posts: 2441
OS: Archlinux
Version: current master
Ranking
One Elder of Players
Location: Germany
Posted at: 2015-07-11, 07:12

I wrote king_of_nowhere a PM and he has send me the files per E-mail. Here are the ods.files containing the changed values from king_of_nowhere:


Fight simulator for Widelands:
https://wide-fighter.netlify.app/

Top Quote
Tibor

Joined: 2009-03-23, 22:24
Posts: 1377
Ranking
One Elder of Players
Location: Slovakia
Posted at: 2015-07-11, 21:42

I prepared very primitive python script to convert csv files to lua format - I pushlished the text here http://textuploader.com/86bh (2x output and the python script itself, separated by lines "-------------") - very crude but as a starting point...

re csv - your ods must be saved as csv (directly in Libreoffice) File -> Save as -> pick cvs -> check Edit filter settings -> Save -> Delimiter ; (semicolon), Field delimiter None (leave empty)

EDIT: oh, I just noticed that my locales setting made libreoffice use comma instead of point as decimal separator - but this is not critical problem, if you manage to run the python code you can generate own files...

Edited: 2015-07-12, 21:38

Top Quote
kaputtnik
Avatar
Topic Opener
Joined: 2013-02-18, 19:48
Posts: 2441
OS: Archlinux
Version: current master
Ranking
One Elder of Players
Location: Germany
Posted at: 2015-07-12, 12:23

king_of_nowhere wrote:

i treid the new init file but it's not working. it reports an error message

"tribe barbarians: [c:/data/bzr/widelands/working/src/scripting/lua_errors.cc:22] [string "world/init.lua"]:2: attempt to index global 'world' (a nil value)

king_of_nowhere has send me also his init.lua (he has renamed it to init_terrain.lua). If i opened this file with a text editor (i use kate ) and it looks well. Renaming it to "init.lua" and storing this file at the right place it works, except that some values are not in an appropriate range. The values for "humidity" and "fertility" has to be between 0 and 1 and some values are defined as as 1. Those values do through an error.

Edit: The values for the first terrain (wiese1) are not changed.

Here is the file from king_of_nowhere: init_terrain.lua


Tanks Tibor for providing your script. May i test it this evening.

Edited: 2015-07-12, 12:28

Fight simulator for Widelands:
https://wide-fighter.netlify.app/

Top Quote
king_of_nowhere
Avatar
Joined: 2014-09-15, 17:35
Posts: 1668
Ranking
One Elder of Players
Posted at: 2015-07-12, 20:48

i assumed that if the values are to be between 0 and 1, it mean including the extremes. you can change the 0 to 0.001 and 1 to 0.999 in that case.

wiese 1 escaped my attention ( i see the file without formatting, as a wall of text). give it values similar to the oother wiese.

EDIT: actually, if the onlly problem is that it cannot have values of 1 or 0, i can just modify it and try it myself, as was the original plan

Edited: 2015-07-12, 23:29

Top Quote
king_of_nowhere
Avatar
Joined: 2014-09-15, 17:35
Posts: 1668
Ranking
One Elder of Players
Posted at: 2015-07-19, 19:14

almost a week has passed. did someoone try my values? did they work?


Top Quote
Tibor

Joined: 2009-03-23, 22:24
Posts: 1377
Ranking
One Elder of Players
Location: Slovakia
Posted at: 2015-07-19, 20:48

I was also wondering what are the results of testing...


Top Quote
kaputtnik
Avatar
Topic Opener
Joined: 2013-02-18, 19:48
Posts: 2441
OS: Archlinux
Version: current master
Ranking
One Elder of Players
Location: Germany
Posted at: 2015-07-19, 21:24

Sorry, i am very busy this time (if your comments are related to me).


Fight simulator for Widelands:
https://wide-fighter.netlify.app/

Top Quote