Jump to content

Xml code


pasmon79

Recommended Posts

  • Replies 61
  • Created
  • Last Reply

Top Posters In This Topic

  • 2 months later...
<Check InputAmount="2" InputFlags="" InputId="Variable1" />

Above code checks a variable1 against a numerical value 2. Is it possible to check a variable1 to the numerical value of some other variable2 defined earlier without directly referring to its value i.e avoid "InputAmount"?

Edited by pasmon79
Link to comment
Share on other sites

Here are a number of examples... take a look for which format might work best for what you are trying to do. Many are the same, as I just searched for the compare lines.

 

<Compare CompareOp="GreaterThan" InputId1="Family.Influence" InputId2="Family.Renown" />
<Compare CompareOp="GreaterThan" InputId1="Stockpile.Ammo" InputId2="Max.Ammo" />
<Compare CompareOp="GreaterThan" InputId1="Stockpile.Food" InputId2="Max.Food" />
<Compare CompareOp="GreaterThan" InputId1="Stockpile.Fuel" InputId2="Max.Fuel" />
<Compare CompareOp="GreaterThan" InputId1="Stockpile.Materials" InputId2="Max.Materials" />
<Compare CompareOp="GreaterThan" InputId1="Stockpile.Medicine" InputId2="Max.Medicine" />
<Compare CompareOp="GreaterThanEqual" InputId1="Sandbox.TotalNPCsSpawned" InputId2="Sandbox.Survivors.Rare" />
<Compare CompareOp="LessThan" InputId1="100" InputId2="Stockpile.Food" />
<Compare CompareOp="LessThan" InputId1="200" InputId2="Stockpile.Food" />
<Compare CompareOp="LessThan" InputId1="Count.Population" InputId2="Capacity.Labor" />
<Compare CompareOp="LessThan" InputId1="Game.RTS.IncomeFood" InputId2="MaxFoodUse" />
<Compare CompareOp="LessThan" InputId1="Sandbox.TotalNPCsSpawned" InputId2="Sandbox.Survivors.Cap" />
<Compare CompareOp="LessThan" InputId1="Sandbox.TotalNPCsSpawned" InputId2="Sandbox.Survivors.Cap">
<Compare CompareOp="LessThan" InputId1="Sandbox.TotalNPCsSpawned" InputId2="Sandbox.Survivors.Rare" />
<Compare CompareOp="LessThanEqual" InputId1="Family.Influence" InputId2="Family.Renown" />
<Compare CompareOp="LessThanEqual" InputId1="Sandbox.Zombie.DensityMultiplier" InputId2="Sandbox.Zombie.DensityMultiplierMinimum" />
<Compare CompareOp="LessThanEqual" InputId1="Sandbox.Zombie.DensityMultiplierOriginal" InputId2="Sandbox.Zombie.DensityMultiplier" />
<Compare CompareOp="LessThanEqual" InputId1="Stockpile.Ammo" InputId2="Max.Ammo" />
<Compare CompareOp="LessThanEqual" InputId1="Stockpile.Food" InputId2="Max.Food" />
<Compare CompareOp="LessThanEqual" InputId1="Stockpile.Fuel" InputId2="Max.Fuel" />
<Compare CompareOp="LessThanEqual" InputId1="Stockpile.Materials" InputId2="Max.Materials" />
<Compare CompareOp="LessThanEqual" InputId1="Stockpile.Medicine" InputId2="Max.Medicine" />

 

GreaterThanEqual means greater OR equal, and the same for LessThanEqual, less than OR equal.

 

<Compare CompareOp="GreaterThan" InputId1="Stockpile.Ammo" InputId2="Max.Ammo" />

It specifically compares InputId1 to InputId2, so here it is looking to see if Stockpile.Ammo is greater then Max.Ammo.

Edited by qmjs
Link to comment
Share on other sites

Yes. I use one calculation that includes OutputAmount="Count.Population", so any variable that has a value defined already should work.

I have tried to use variable-name in "OutputAmount" and is not working. I have initialized the variables in the same "Event", well before the execution of line containing "OutputAmount" in addition to defining in rtsdata and it did not work. What do i need to do more?

Edited by pasmon79
Link to comment
Share on other sites

Make sure the variable is set up in globalconstants.xml, not just in the event. You can assign a value in the event, but the variable must exist in globalconstants first. Otherwise any call to the variable is always going to be 0/false.

Edited by qmjs
Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.

×
×
  • Create New...