Can't get this function to return anything other than error.. any ideas?
I'm trying to use it like this:

Your code is wrong in in 2 ways:
1) wesnoth.theme_items.income is a function, to get the wml table you need to call it with () at the end, like in wesnoth.theme_items.income()
2) helper.get_child(cfgm nam) is a returns a, returns subtag of a waml table to, get an attibute like text=3, just use cfg.text. Not however that text is no atribute of wesnoth.theme_items.income() it is a attribute of a [element] child of wesnoth.theme_items.income()

Scenario with Robots SP scenario (1.11/1.12), allows you to build your units with components, PYR No preperation turn 1.12 mp-mod that allows you to select your units immideately after the game begins.

Scenario with Robots SP scenario (1.11/1.12), allows you to build your units with components, PYR No preperation turn 1.12 mp-mod that allows you to select your units immideately after the game begins.

it finally gave me what i needed, thanks so much gfgtdf!!!!!!!!!!!!
by the way, any ideas how to read particular text[number] of element? There may be many.. T.elements
maybe local element_subtag = helper.get_child(whole_wml, "element[1]")? if you know what I mean..

PS. and you were right, with income it would be easier..
actually I tried with income, but because it is negative in my case and I could not replicate the "-" sign for some reason, I had to do it with upkeep
AND IT WORKS! it shows different reources depending on who's turn it is!
I made sure that each side upkeep is equal to $side_number and then used this code:

At the moment my problem is that when I end turn, side loses this new resource bar, so it only shows for whoever turn it is, but it is great! it means tomorrow I will fix it and it will work perfectly and soon I will update my mod with a new nice resource display bar!!!!!!!!! me happy, players happy!! Thanks again and again gfgtdf!!!

enclave wrote:Hi, is there a way to find out that players chosen random race or picked one?
Thank you..
PS. and if possible to know who picked random and who didn't..?

Not sure, why do you want that?

Scenario with Robots SP scenario (1.11/1.12), allows you to build your units with components, PYR No preperation turn 1.12 mp-mod that allows you to select your units immideately after the game begins.

I wanted to make an option.. that would randomize the race if mirror. But I thought it would be good if it only worked for people who chosen random..

For example if my add-on had 3 different races, humans, orcs and elves.
player 1 chosen humans,
player 2 chosen random
player 3 chosen random.

host chosen in options to make all races different so they don't repeat.

So I thought would be good idea if player 1 would remain with humans, no matter what.. and only player2 and player 3 would get something different (Orcs and Elves), so every player has different race.
If i make such script it will change every single race.. even if player picked humans. But I thought would be great if the ones who picked would not suffer.

enclave wrote:I wanted to make an option.. that would randomize the race if mirror. But I thought it would be good if it only worked for people who chosen random..

I don't know how exactly but there are other random-no-mirro addons so i think it's possible.

Also note that wesnoth 1.13 has random-no-mirror function in it so such an addon will be unnecessary in wesnoth 1.13

Scenario with Robots SP scenario (1.11/1.12), allows you to build your units with components, PYR No preperation turn 1.12 mp-mod that allows you to select your units immideately after the game begins.

gfgtdf wrote:
I don't know how exactly but there are other random-no-mirro addons so i think it's possible.
Also note that wesnoth 1.13 has random-no-mirror function in it so such an addon will be unnecessary in wesnoth 1.13

I "think" none of these add-ons would ignore randomization if player has chosen his race, I may be wrong but I'm quite sure that even if player chosen he wants to be Orcs he could end up being Human or Drake or other with any of the currently existing no mirror add-ons.

If you have 1.13 installed, could you check what will happen for me?
Start a local game for 6 players in default era,
player 1 pick Random
player 2 pick Random
player 3 pick Random
player 4 pick Northerners
player 5 pick Random
player 6 pick Random
Enable no-mirror option (you said it has been implemented into 1.13)
And tell me if player 4 remained Northerners? If possible host same thing 3 times, to make sure that it happens the same all the time.

My idea of my add-on was to make sure that player 4 will remain Northerners, but every other race will be no mirror, hence the question.. if there is a way to find out who picked race and who picked random..
Thanks very much in advance if you could find a few minutes to test it for me.. I have no 1.13 installed unfortunately..

enclave wrote:
Thanks very much in advance if you could find a few minutes to test it for me.. I have no 1.13 installed unfortunately..

Sry, but (assuming that your OS is directly supported by wesnoth and you don't need to compile it yourself) i think installing 1.13.6 is actulally less work than doing these tests. So i'm not really motivated to so these things for you.

Ravana wrote:

enclave wrote:Hi, is there a way to find out that players chosen random race or picked one?
Thank you..
PS. and if possible to know who picked random and who didn't..?

the wiki might be wrong here so it possibel that its supported on 1.12 aswell.

Scenario with Robots SP scenario (1.11/1.12), allows you to build your units with components, PYR No preperation turn 1.12 mp-mod that allows you to select your units immideately after the game begins.

A strange question.. Looks like my mod's save file size has reached the limit..
When somebody (including me) tried to reload a save of New Settlers in multiplayer, it didn't let us and was said that it has reached the 40mb wml size or something similar. What would be the most efficient way to reduce the size?
I looked into the wml code of the save.. and wow.. it saves a lot of things.. first thing that came to my mind, was that.. if I do all the calculations in LUA instead of WML would it help?
for example if i understand things right then if I sort an array in WML then it will all be stored into saved file, but what if I do all calculations in lua and only save results in wml variables? Will it cause OOS or will it reduce the size of save file?
I know that clearing as many variables as possible would help.. but what else can help? and what helps most?
Thanks..

enclave wrote:
A strange question.. Looks like my mod's save file size has reached the limit..
When somebody (including me) tried to reload a save of New Settlers in multiplayer, it didn't let us and was said that it has reached the 40mb wml size or something similar.

Yes i have seens that before, once there was an addon "betwren darkness and light" it was coded very ineffectiveley and had the same problem

enclave wrote:
What would be the most efficient way to reduce the size?
I looked into the wml code of the save.. and wow.. it saves a lot of things.. first thing that came to my mind, was that.. if I do all the calculations in LUA instead of WML would it help?

Well yes it can help, but its possible the problem is somwhere else, for example its quite possible that there just too many units on the map.
But of coursew it is also possible that your wml code abuses macors to repeat code so that it becomes really big, in this case replacing your code with lua can help.

enclave wrote:
for example if i understand things right then if I sort an array in WML then it will all be stored into saved file, but what if I do all calculations in lua and only save results in wml variables?

In wml you can and should also clenaup you temporary variables with {CLEAR_VARIABLES}

enclave wrote:
Will it cause OOS?

You have 2 options: 1) Insert the lua code in the scenario or 2) read it from disk every time the scenrio is loaded. Option (1) is the safer one, but option (2) allows you to reduce the amount of the 'programming code' (e.g. [event]) in the savefile to 0 but it requires all players to have your addon installed. If you are targeting 1.13 then i reccomend using option (2) since it has a 'download addon on demand' feaute so that reuiring download of an addon is less of an issue.

enclave wrote:
I know that clearing as many variables as possible would help.. but what else can help? and what helps most?
Thanks..

Scenario with Robots SP scenario (1.11/1.12), allows you to build your units with components, PYR No preperation turn 1.12 mp-mod that allows you to select your units immideately after the game begins.