Jump to content


Photo

An issue concerning Counters...


  • Please log in to reply
4 replies to this topic

#1 Sleetil

Sleetil
  • Members
  • 140 posts

Posted 31 August 2010 - 02:26 AM

So basically, I have one counter which is incremented by things in my map. (Simply functions as a Kill # counter)

Is it possible to take the values of this first counter, tweak them, by say a multiplicitive, and then add that new value to another counter (I'm not changing the value of the first counter)

Edited by Sleetil, 03 September 2010 - 12:08 AM.


#2 Puzzler33

Puzzler33
  • Members
  • 226 posts

Posted 29 September 2010 - 03:57 PM

You can only add and subtract counters so to multiply you would need a third counter which governs how many times you add the first counter to the second.

In Scripting > Counters you can find the relevant scripts and basically for the how many times you add C1 to C2 you use C3:

Lets say in C1 I have a number which may be different each time the game is played (though it will be a positive whole number). For the example I will pick 20. In C2 I have 0 because I haven't calculated anything yet, and in C3 I have the number I want to times C1 by. C3 does not need to be the same for each game, though. Let's say I want to times C1 by 5.
C1 = 20
C2 = 0
C3 = 5

You will need a script to activate the following one when the maths is do be done, and with any luck you will have made it so that C1 doesn't change during the time the maths is being done.

[ns na nd]
IF
Counter 3 is greater than or equal to 1
THEN
Counter 2: Add counter 1
Counter 3: Take away 1
ELSE
Deactivate <this script>
(Whatever else you do once the math is complete)
That's basically it.
Posted Image

#3 Sleetil

Sleetil
  • Members
  • 140 posts

Posted 05 October 2010 - 03:31 AM

All right. Thanks for the help! There's also a script in WB for "Counter to do Math operation with another counter" that you can add/sub/mult./div. one counter by the value of another, but there is the need for a third counter, like you said.

#4 Puzzler33

Puzzler33
  • Members
  • 226 posts

Posted 07 October 2010 - 09:26 PM

Are you sure there are multiply and divide options? I never saw any.
Posted Image

#5 Sleetil

Sleetil
  • Members
  • 140 posts

Posted 08 October 2010 - 12:14 AM

It's at: Scripting --> Counters --> Counter do math operation with another Counter./Counter do math operation with value.

Counter 'X', Add/Subtract/Multiply/Divide with value 0.. Etc..




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users