qmjs Posted September 27, 2020 Share Posted September 27, 2020 (edited) That is probably an issue with Var1. These work:<RTSStat_MultiplyAdd MultiplyBy="-1" OutputAmount="Count.Population" OutputId="Game.ExtraFoodEaten" PauseWhenOffline="" /><RTSStat_Add DurationCancellable="" OutputAmount="Game.ExtraFoodEaten" OutputDuration="" OutputId="Stockpile.Food" PauseWhenOffline="" /> If Var1 doesn't have a value and is being read as 0, the <RTSStat_MultiplyAdd MultiplyBy="Var1" OutputAmount="Count.Population" OutputId="Var3" PauseWhenOffline="" /> won't work. Keep in mind when defining a variable, name1.name2.name3 is defined as (group name).(subgroup name).(value name). Subgroup can be skipped if you set it up without any subgroups under the group name (see manual.dangerlevel, or put it under a group name but outside a subgroup) Just looking at that again, I think maybe you have them in the wrong position. You don't want to change Count.Population... that is a variable already used and updated by the system. The variables you would need to intitialise are Var1 and Var3. it would work as Var3(new value)=Var3(previous value) + CountPopulation*Var1. Edited September 27, 2020 by qmjs Link to comment Share on other sites More sharing options...
pasmon79 Posted September 27, 2020 Author Share Posted September 27, 2020 (edited) Count.Population is a fictional variable. Do I need to define Variable name in both rts.data and global constants or only on global constants.xml? Can the variable defined in globalconstabts.xml be manipulated like <RTSStat_Set DurationCancellable="" OutputAmount="3" OutputDuration="" OutputId="Count.Population" PauseWhenOffline="" /> Edited September 27, 2020 by pasmon79 Link to comment Share on other sites More sharing options...
qmjs Posted September 27, 2020 Share Posted September 27, 2020 (edited) I just updated the previous post to clarify a couple of things that weren't clear. (Bold text) Both rtsdata and globalconstants usually. Although, global constants you can sometimes get by without, but if it is looking for it, it will cause a failure. Most are text replacements, but a few are actual values. For example, the original example I was going to give uses ExtraFoodEaten instead of Game.ExtraFoodEaten Game.ExtraFoodEaten is defined in rtsdata ExtraFoodEaten is defined in globalconstants based on Game.ExtraFoodEaten. I use these mainly because the files have a maximum amount of code they can contain, and minimizing space where possible slows down the point where you hit that limit. Edited September 27, 2020 by qmjs Link to comment Share on other sites More sharing options...
pasmon79 Posted September 27, 2020 Author Share Posted September 27, 2020 (edited) <Name>Count.Population</Name> <Value>0</Value> </Constant>I used dot while naming in Globalconstants.xml because of its position formatting in rtsdata.xml. Is it okay? Edited September 27, 2020 by pasmon79 Link to comment Share on other sites More sharing options...
qmjs Posted September 27, 2020 Share Posted September 27, 2020 I don't think that will work. If you are trying to change count.population, that is a variable used by the system, and gets reset approximately every 30 seconds. When you say "Count.Population is a fictional variable.", does that mean that the actual values you are using is not Count.Population but something else, like Game.Variablename? Link to comment Share on other sites More sharing options...
pasmon79 Posted September 27, 2020 Author Share Posted September 27, 2020 (edited) Yes i am just using Count.Population as an example for another Variablename.Name.There is definitely something wrong with the declaration of variable as whenever i replace the variable defined in "OutputAmount" with the actual numerical values, results are ok. Could it be that defining new variable in GlobalConstants.xml requires restart of a new level similar to sandbox.xml? Edited September 27, 2020 by pasmon79 Link to comment Share on other sites More sharing options...
qmjs Posted September 27, 2020 Share Posted September 27, 2020 That is possible, but I don't actually know. There is a long and complicated method you might be able to use, depending on how many possible values your variable has. Take a look in rtsevents, and then search for AdjustStaminaBonus Very long, but it might work if it is critical to what you are doing. Link to comment Share on other sites More sharing options...
pasmon79 Posted September 28, 2020 Author Share Posted September 28, 2020 Well thanks a lot I will be keep sharing any new finding related to globalconstasts with you later. Link to comment Share on other sites More sharing options...
pasmon79 Posted September 28, 2020 Author Share Posted September 28, 2020 I was wondering how much decimal value is allowed in OutputAmount during increment of a variable. Link to comment Share on other sites More sharing options...
qmjs Posted September 28, 2020 Share Posted September 28, 2020 I don't know if there is an actual limit. Most calculations use a single decimal point (1.2, 1.5) Also, regarding variables as defined in globalconstants, some examples used in calculations can be found in characters.xml as such: <RTSStat_Add DurationCancellable="" OutputAmount="[hp_HealthPenalty_Med]" OutputDuration="" OutputId="Character.HealthBonus" PauseWhenOffline="" /><RTSStat_Add DurationCancellable="" OutputAmount="[hp_StaminaPenalty_Med]" OutputDuration="" OutputId="Character.StaminaBonus" PauseWhenOffline="" /> Link to comment Share on other sites More sharing options...
Recommended Posts