Jump to content

Photo

Xml code


61 replies to this topic

#1
pasmon79

pasmon79

    Enthusiast

  • Members
  • PipPip
  • 224 posts

If we define two variables in rtsdata(Status.Var1,Status.Var2, Status.Var3), assign Var 1 & Var 2  and then add their assigned values to Var3 in rtsevnts?

 

How can it be accomplished?



#2
qmjs

qmjs

    Faithful poster

  • Members
  • PipPipPipPip
  • 1,764 posts

Make sure you define all three variables, even if they are 0 initially.

 

This can be done, but it is not very straightforward. It is a three step process.

 

The process goes:
Var3=0
Var3=Var3+Var1*1
Var3=Var3+Var2*1

 

<RTSStat_Set DurationCancellable="" OutputAmount="0" OutputDuration="" OutputId="Status.Var3" PauseWhenOffline="" />
<RTSStat_MultiplyAdd MultiplyBy="Status.Var1" OutputAmount="1" OutputId="Status.Var3" PauseWhenOffline="" />

<RTSStat_MultiplyAdd MultiplyBy="Status.Var2" OutputAmount="1" OutputId="Status.Var3" PauseWhenOffline="" />

 

That format means, OutputId = OutputID + MultiplyBy*OutputAmount

 

Net value, Var3 = Var1+Var2

The output amount is the multiplier, so use -1 to subtract.

You set it to 0 to remove whatever value was set the last time it was called.

 

 

A couple of other notes:

You can use the same method to divide, by changing the OutputID, so to divide by 2 you would use 0.5

 

RTSStat_Set occasionally gives invalid values if you use a variable, so to set Var3=Var2, it works better to use a format like this:

<RTSStat_Set DurationCancellable="" OutputAmount="0" OutputDuration="" OutputId="Status.Var3" PauseWhenOffline="" />
<RTSStat_MultiplyAdd MultiplyBy="Status.Var2" OutputAmount="1" OutputId="Status.Var3" PauseWhenOffline="" />


Edited by qmjs, 17 April 2020 - 12:03 AM.


#3
pasmon79

pasmon79

    Enthusiast

  • Members
  • PipPip
  • 224 posts

Thanks



#4
pasmon79

pasmon79

    Enthusiast

  • Members
  • PipPip
  • 224 posts

Is it possible to print out the Variable 3 in the "EventLog", i.e in Daily  Journal?



#5
qmjs

qmjs

    Faithful poster

  • Members
  • PipPipPipPip
  • 1,764 posts

I think so. The fatecards Daily_Offline uses a lot of variables. But, you'll have to look around to determine exactly what to use.

 

In those, %+d is referring to the last OutputAmount value used.

 

If you can't figure out the appropriate variable, just add a dummy statement with the number you want as outputamount.



#6
pasmon79

pasmon79

    Enthusiast

  • Members
  • PipPip
  • 224 posts

Ok, thanks figured it out.



#7
pasmon79

pasmon79

    Enthusiast

  • Members
  • PipPip
  • 224 posts

Can "OutputAmount" use variable name in order that "%+d" displays the "updated" value of variable ?



#8
qmjs

qmjs

    Faithful poster

  • Members
  • PipPipPipPip
  • 1,764 posts

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


Edited by qmjs, 15 July 2020 - 02:23 AM.


#9
pasmon79

pasmon79

    Enthusiast

  • Members
  • PipPip
  • 224 posts
%d is used to output previously stored numerical value only as in c++. It gives exact value of variable while in conjugation with &variable.

How to use this combination of %d and &variable in Text=

Edited by pasmon79, 15 July 2020 - 02:49 PM.


#10
qmjs

qmjs

    Faithful poster

  • Members
  • PipPipPipPip
  • 1,764 posts

I can't quite tell what you are asking, I think the charset is making it confusing.

 

But, as for other variable types, %1$s refers to the first Actor's first name, and %2$s is the second actor's first name. (In most cases the first one listed is referred to as Actor 0, but not with these variables.) The highest these go is %3$s, but it should actually apply to any number of actors in a specific action. If only one is listed, %s works.

 

There is also some instances where %d is used instead of %+d, usually referring to the Count= value in a previous Com_Give  statement.

 

I suspect these are simply related to the return values from the exe. Those are really the only formats used. 


Edited by qmjs, 15 July 2020 - 07:06 AM.




Reply to this topic



  


IPB skins by Skinbox
Page loaded in: 1.168 seconds