qmjs Posted July 16, 2020 Share Posted July 16, 2020 I can't think of anything else that would help with this. Link to comment Share on other sites More sharing options...
pasmon79 Posted July 16, 2020 Author Share Posted July 16, 2020 No problem, I will work out another way for accomplishing task. Thanks a lot dear. Link to comment Share on other sites More sharing options...
pasmon79 Posted September 25, 2020 Author Share Posted September 25, 2020 (edited) <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 September 25, 2020 by pasmon79 Link to comment Share on other sites More sharing options...
qmjs Posted September 25, 2020 Share Posted September 25, 2020 (edited) 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 September 25, 2020 by qmjs Link to comment Share on other sites More sharing options...
pasmon79 Posted September 25, 2020 Author Share Posted September 25, 2020 Gee, Thanks. Link to comment Share on other sites More sharing options...
pasmon79 Posted September 27, 2020 Author Share Posted September 27, 2020 (edited) 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 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) 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 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 Well let us say I need to define a variable Count.Population in OutputAmount. I need to define it in rtsdata first and then in Global constants as "<Constant> <Name>Count.Population</Name> <Value>0</Value> </Constant>" It did not work. Link to comment Share on other sites More sharing options...
qmjs Posted September 27, 2020 Share Posted September 27, 2020 I am a bit confused. What are you trying to do? I need more context to determine what might work. Link to comment Share on other sites More sharing options...
pasmon79 Posted September 27, 2020 Author Share Posted September 27, 2020 <Event Id=""> <EventTrigger Event="fsEvent." /> (Initializes values of Count.Population(say)) <RTSStat_MultiplyAdd MultiplyBy="Var1" OutputAmount="Count.Population" OutputId="Var3" PauseWhenOffline="" /> Link to comment Share on other sites More sharing options...
Recommended Posts