Kill counter
May 8 2008, 9:18 pm
By: Asuka22dk  

May 8 2008, 9:18 pm Asuka22dk Post #1



Hey I need some help with a set of triggers
I am trying to make it so player X get 1 gas per kill, but then I this one it count per hit and not kill :S
Defence is force1 human players
Code
Trigger("Defence"){
Conditions:
    Score("Current Player", Kills, At least, 1);

Actions:
    Set Score("Current Player", Subtract, 1, Kills);
    Set Resources("Current Player", Add, 1, gas);
    Preserve Trigger();
}

//-----------------------------------------------------------------//

Trigger("Defence"){
Conditions:
    Accumulate("Current Player", At least, 10, gas);

Actions:
    Set Resources("Current Player", Add, 1, ore);
    Set Resources("Current Player", Subtract, 10, gas);
    Preserve Trigger();
}




None.

May 8 2008, 9:31 pm Conspiracy Post #2



Try SET kills to zero. Subtract doesn't seem to work, its just there.

I know [that makes no sense!], its the only easy way to do it right now though.



None.

May 8 2008, 9:41 pm NudeRaider Post #3

We can't explain the universe, just describe it; and we don't know whether our theories are true, we just know they're not wrong. >Harald Lesch

Subtract works. LOL
The problem is that when he kills a Zergling for example he gets 50 Kills Score
Then the trigger subtracts 1 score and gives 1 gas => score = 49, then subtracts another 1 score, adds 1 gas, etc. Until it is 0.

But your solution was correct. He has to SET it to 0 because a single kill gives a high amount of score which varies from unit to unit. Check the Wiki/tutorials if you want to know which unit gives how much score.

I don't know if you already realized, Asuka22dk, but your system has a big problem:
It can only handle one kill per trigger loop especially when not using hyper triggers or when using splash damage several of your kills will not be rewarded, because you SET it to 0, no matter what score.

Check the Wiki/tutorials if you need better kills to cash systems.




May 8 2008, 9:49 pm Asuka22dk Post #4



thanks I just hope some other then set as I think it count to slow even then I use hyper trigger
I also need some help with a round trigger
something like
counter down = 0 and switch "roundnumber" then spawn bla bla bla
if switch "all monster have been spawn" and player 7 has no unit at anyway set counterdown timer to 2min
But it wont work probly so right now only round 1 work and they dont spawn after that



None.

May 8 2008, 10:26 pm Conspiracy Post #5



Quote from Asuka22dk
... Kills...);

Actions:
...Kills...
[quote=name:NudeRaider]...50 Kills Score...

Kills and Kill Score is different.



None.

May 8 2008, 10:36 pm Vrael Post #6



Can easily be accomplished with the timer and a death counter.

Round 1:
Conditions:
Countdown timer is exactly 0 seconds
Computer player has suffered exactly 0 deaths of Independant command center
Actions:
Spawn men
Set to 1 for Independant Command Center for Computer Player

Round 2:
Enemies brings 0 men to location
COuntdown timer is exactly 0 seconds
Deaths 2 for Ind. COmmand center
Actions
Spawn
Set Timer

ect ect, get the point?



None.

May 8 2008, 10:39 pm Vrael Post #7



Quote from name:Epoch
Quote from Asuka22dk
... Kills...); Actions: ...Kills... [quote=name:NudeRaider]...50 Kills Score...
Kills and Kill Score is different.

Now look at the trigger

Score("Current Player", Kills, At least, 1);

Hehe. It is kill score.

Edit: sorry for double post



None.

May 9 2008, 8:25 am NudeRaider Post #8

We can't explain the universe, just describe it; and we don't know whether our theories are true, we just know they're not wrong. >Harald Lesch

Quote from name:Epoch
Quote from Asuka22dk
... Kills...);

Actions:
...Kills...
[quote=name:NudeRaider]...50 Kills Score...

Kills and Kill Score is different.
Yes, but he always uses score, so what?




May 9 2008, 8:41 am NudeRaider Post #9

We can't explain the universe, just describe it; and we don't know whether our theories are true, we just know they're not wrong. >Harald Lesch

I'll clarify and correct a bit:
Quote from Vrael
Can easily be accomplished with the timer and a death counter.

Round 1: (spawn)
Conditions:
Countdown timer is exactly 0 seconds
Computer player has suffered exactly 0 deaths of Independent command center (he uses a death counter instead of a switch to determine the round, which is more efficient)
Actions:
Spawn men
Set to 1 for Independent Command Center for Computer Player

prepare for next Round: (set timer)
Player 7 brings 0 men to location
Countdown timer is exactly 0 seconds
Actions
Set Timer

Round 2: (spawn)
Conditions:
Countdown timer is exactly 0 seconds
Computer player has suffered exactly 1 (not 2!) deaths of Independent command center
Actions:
Spawn men
Set to 2 for Independent Command Center for Computer Player

ect ect, get the point?
You might have noticed that order matters in this example. So you should have them owned by only one player because If the set timer trigger runs after the spawn triggers it wouldn't work. Also the timer trigger can be used for every round.




May 10 2008, 12:43 pm Asuka22dk Post #10



I must say death count is powerfull now I have learn how to use it both as a time and much more thnks nuderaider

Post has been edited 1 time(s), last time on May 11 2008, 11:51 pm by Asuka22dk.



None.

May 10 2008, 4:10 pm Falkoner Post #11



Yes, deaths are some of the most useful functions in SC, since they're basically the only way to declare a variable. If you want to see just about all the functions possible with them, check out this tutorial: http://Falkoner.CoW.GooglePages.com/Death_Counts.html



None.

May 10 2008, 10:10 pm NudeRaider Post #12

We can't explain the universe, just describe it; and we don't know whether our theories are true, we just know they're not wrong. >Harald Lesch

Quote from Asuka22dk
and much more thnks Nukeraider
O.o I will drop a Nude upon you if you call me that again! >:(
lol, joking, you're welcome. :lol:




Options
  Back to forum
Please log in to reply to this topic or to report it.
Members in this topic: None.
[2024-5-31. : 2:36 pm]
Wing Zero -- Bop em
[2024-5-31. : 2:36 pm]
Wing Zero -- Mods
[2024-5-29. : 9:40 pm]
Ultraviolet -- :wob:
[2024-5-28. : 8:43 am]
TheHappy115 -- Yea, thats the issue. Thanks. It would also explain why my deleted map couldn't get updated. Updated version reduced collision on units (only thing added) since was dodging game (players collide with each other)
[2024-5-28. : 5:26 am]
Ultraviolet -- If so, I'd just focus on getting them on scmscx.com and then you can link to that in the showcase thread for your maps
[2024-5-28. : 5:25 am]
Ultraviolet -- I can't upload my EUD maps, I think the DLDB has some issue with handling them. Are you trying to upload EUD maps?
[2024-5-28. : 2:06 am]
TheHappy115 -- Its been awhile but ever since I requested one of the Maps I posted to be deleted since I couldn't delete it myself (or update it), I haven't been able to upload any more maps. Any reason for that?
[2024-5-26. : 7:14 pm]
Kyradax -- Hi
[2024-5-26. : 5:05 pm]
O)FaRTy1billion[MM] -- :wob:
[2024-5-25. : 9:22 am]
Zycorax -- :wob:
Please log in to shout.


Members Online: O)FaRTy1billion[MM], jun3hong, Roy