moridar
  • moridar
  • 64.25% (Friendly)
  • Private Topic Starter
13 years ago
With a couple of maps I have been making, I am trying to award cash per a certain number of kills.

Now so far, I have tried a couple of different ways, each with their own problems, as follows.


[ns A D] Set Counter
*** IF ***
True.
*** THEN ***
Set 'KILLS' to 0

[ns A nd] Store Kills
*** IF ***
True.
*** THEN ***
Store the amount of kills by Player 'Player_1' of the Kind is 'CAN_ATTACK' to 'KILLS'

[ns A nd] Award
*** IF ***
Counter 'KILLS' IS Greater Than or Equal To 20
*** THEN ***
Player 'Player_1' gets $ 2000
Enable Script 'Set Counter'.



When the counter 'KILLS' is reset to 0, the game remains keeping track of Player 1's kills, and immediately reverts the counter to the previous value.



[ns A D] Set Counter 2
*** IF ***
True.
*** THEN ***
Set 'KILLS' to 0

[ns A nd] Store Kills 2
*** IF ***
Player 'Player_1' has killed 1 or more objects of Kind is 'CAN_ATTACK'.
*** THEN ***
Add 1 to 'KILLS'

[ns A nd] Award 2
*** IF ***
Counter 'KILLS' IS Greater Than or Equal To 20
*** THEN ***
Player 'Player_1' gets $ 2000
Enable Script 'Set Counter 2'.



As soon as Player 1 kills one unit, the counter shoots up rapidly, because the game holds on to the knowledge that Player 1 has killed a unit of type 'CAN_ATTACK', regardless of the reset.


I have looked at the scripts from Tiberium Blood maps in TW and they had to create a unique script for every 20 kills... I'd rather not do this.

Can anyone offer me any advice?   Scripts.zip (3kb) downloaded 5 time(s).
Even Heroes know when to be scared.
Sponsor