Topic: Game Initialization
Atanase Topic Opener |
Posted at: 2021-04-18, 00:24
Hello, I found out how to initialize 'stocks' with set_wares{} and set_workers{} but it is possible to initialize "Economy options"? The economic profiles are not stored at the level of the map but above they cannot be forced manually. La connaissance ne vaut que si elle est partagée par le plus grand nombre. |
kaputtnik |
Posted at: 2021-04-18, 10:06
Economy options can be set through out the game, not only during initialization. According to the documentation enomy options can be accessed through a buildings flag properties Something like this should work:
Top Quote |
Atanase Topic Opener |
Posted at: 2021-04-18, 10:42
Ok, thank you. I was hoping for a somewhat simpler system like the one that allows you to fill stocks. But never mind, I'll add all of this to my init.lua file. La connaissance ne vaut que si elle est partagée par le plus grand nombre. |
hessenfarmer |
Posted at: 2021-04-18, 14:35
well, as far as I know you could use the set_target_quantity function like the set_wares function (meaning you can set multiple ware, quantity pairs at once) only thing is to identify the correct economy for the settings (widelands has economies for workers and economies for wares, later in the game you might have multiple economies as each separated warehouse which is not connected to another warehouse has its own economy) Top Quote |
Nordfriese |
Posted at: 2021-04-18, 14:39
No, Top Quote |
Atanase Topic Opener |
Posted at: 2021-04-18, 15:42
Hello, Small explanation about this kind of questions that I sometimes ask. Experience has taught me that some computer languages initialize the variables at creation, others are content to reserve space without cleaning up. This sometimes leads to 'surprising' values for these variables. So I got into the habit of always initializing the variables, even at 0, from their first use so as not to have any unpleasant surprises, whatever the method to use. I "speak" nearly fluently : Enhanced basic, Fortran, Pascal, C, Prolog, 3 Asm languages and 1 I created for pleasure (not Cobol, I'm not so old) but no modern object oriented language, I'm not familiar with their syntax but I learn. I will not ask such a question soon. PS: Where can I find the list of the authorized variable I can use in this context ? Edited: 2021-04-18, 15:49
La connaissance ne vaut que si elle est partagée par le plus grand nombre. |
kaputtnik |
Posted at: 2021-04-18, 17:01
I do not exactly understand your question, what 'authorized variable' refers to. I guess you mean the internal names of wares and so on? For tribe specific things you can find those internal names in our Encyclopedia. In the subpages there is a checkbox to show internal names. For other things, like global map objects (Rocks, Trees, and so on) you have to dig into the corresponding If this does not answer the question, please ask again Top Quote |
Atanase Topic Opener |
Posted at: 2021-04-18, 17:50
Thank you but.... There are holes in the "economy tables". This probably means that we cannot define values for the missing 'objects'. I can try to force values for all the internal names I found in the Encyclopedia and wait to see the errors generated by the program to remove, one by one, what it doesn't want to initialize, but it might take a long time and tedious, or find the list and initialize only those that are allowed. La connaissance ne vaut que si elle est partagée par le plus grand nombre. |
Nordfriese |
Posted at: 2021-04-18, 18:06
You can set a target quantity for any (existing) ware or worker and it will not crash. But some items are hidden from the Configure Economy window because their target quantities are completely ignored. So you can set those as well, and it just has no visible effect. (Except that there might be some lines in the standard output Top Quote |
Atanase Topic Opener |
Posted at: 2021-04-18, 18:31
Do you want the real purpose of it all? In fact I am preparing a skeleton which will be used again for other 'maps' and other 'campaigns'. Perhaps it can even be used by others wishing to develop in Lua and who have been a little cooled by the research necessary to find the information. I won't tell you how many scripting directories I have already explored, you would be surprised, pleasantly I hope. Also I prefer not to have 'parasitic' declarations in this template to avoid idle questions like: Why are my initializations not taken into account? from potential future users. I am retired, so I have time to spend 8 to 12 hours a day on these programs. La connaissance ne vaut que si elle est partagée par le plus grand nombre. |