Jump to content

Xml code


pasmon79

Recommended Posts

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 by qmjs
Link to comment
Share on other sites

  • Replies 61
  • Created
  • Last Reply

Top Posters In This Topic

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 by pasmon79
Link to comment
Share on other sites

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 by qmjs
Link to comment
Share on other sites

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

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 by pasmon79
Link to comment
Share on other sites

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

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

  • Recently Browsing   0 members

    • No registered users viewing this page.

×
×
  • Create New...