View Full Version : continual trigger
Guyton
11-16-2007, 5:21 PM
I've been told there's not, but is there any such thing as a single trigger (or trigger system) that can repeat an action an infinte amount of times every time the conditions are met?
More specifically, is it possible to have a trigger that for every one unit that is killed (blank) goodie is given to player.
Before you respond, try it yourself in campaign editor, it sounds infinitely easy but it just doesn't work the way you'd think.
Ever heard of "Preserve Trigger"? Once you put that action in a trigger, the trigger will repeat itself infinitely, every time the condition is met. This is probably the most basic knowledge of someone who makes triggers, if you don't even know this you should consider reading the help files inside staredit, they're very useful.
SilverCrusader
11-16-2007, 6:05 PM
Whoever told you that needs to come here. *pulls out mace with a malevolent grin*
Other than that Aqo said everything I would.
Guyton
11-16-2007, 7:20 PM
Ever heard of "Preserve Trigger"? Once you put that action in a trigger, the trigger will repeat itself infinitely, every time the condition is met. This is probably the most basic knowledge of someone who makes triggers, if you don't even know this you should consider reading the help files inside staredit, they're very useful.
I misunderstood, I said, repeats a action every time the conditions are met
All preserve does is repeats the action, if you kill one unit you will get 50 minerals every second till the game ends in the example I gave, what I want is every time you kill a seperate unit you get 50 minerals.
Fiendwurm
11-16-2007, 7:54 PM
lol ok what you do is have preserve trigger and (!) you reset the kills (or what ever the hell it is i forgot) to zero, BAM ,tada, if you don't belive me just look at zombie hotel, it isn't protected(well the version if have isn't)
Guyton
11-16-2007, 9:03 PM
Upload your version please, none of mine have that.
KillerKow
11-16-2007, 9:04 PM
I misunderstood, I said, repeats a action every time the conditions are met
This is how preserve trigger works.
All preserve does is repeats the action, if you kill one unit you will get 50 minerals every second till the game ends in the example I gave, what I want is every time you kill a seperate unit you get 50 minerals.
This is because the condition will always be met.
Guyton
11-16-2007, 9:56 PM
This is how preserve trigger works.
This is because the condition will always be met.
...I think your misunderstanding what I want or your just screwing with me now. Try this out in campaign editor.
Players: All
Conditions: current player kills at least one any unit
Actions: add 50 ore for current player.
preserve trigger
I don't want to receive 50 ore every second, I want it every time I kill something seperate. It won't work, I've tried it before.
You people missed what I said in my first post about testing your advice before you post it here assuming your not just fooling with me.
SilverCrusader
11-16-2007, 10:41 PM
No you see, it is working properly. The conditions are still met. Because if you kill something, why would it go back to 0?
Just like in math. If you add +1 to 0. Why would it stay at one than go back to zero?
So if you say at least 1, well you always have at least one kill unless you somehow reset to zero. So the condition remains true. So you would fix this by setting the killscore back to zero.
P.S. Heinermann says you're a retard.
Guyton
11-16-2007, 11:02 PM
No you see, it is working properly. The conditions are still met. Because if you kill something, why would it go back to 0?
Just like in math. If you add +1 to 0. Why would it stay at one than go back to zero?
So if you say at least 1, well you always have at least one kill unless you somehow reset to zero. So the condition remains true. So you would fix this by setting the killscore back to zero.
P.S. Heinermann says you're a retard.
I honestly don't care about why it doesn't work, what I really need is something that does.
And you can tell Heinermann to blow it out his ear.
Valcien
11-16-2007, 11:19 PM
Preserve Trigger does not repeat the action, it checks the conditions over and over again and then repeats the action if they have been met. This is becuse what you see:
Players: All
Conditions: current player kills at least one any unit
Actions: add 50 ore for current player.
preserve trigger
Is actually this in english:
Players: All
Conditions: current player has killed at least one of any unit
Actions: add 50 ore for current player.
preserve trigger
What it does not mean in english:
Players: All
Conditions: every time current player kills something
Actions: add 50 ore for current player.
preserve trigger
Got it?
SilverCrusader gave you the answer.
The trigger preforms the actions over and over again because the condition is still met: the player has, indeed, killed (past tense) at least one thing each time the trigger checks its conditions. The way to remedy this is to make the game forget that he killed a thing. The way we do this is with the Set Score action.
SilverCrusader
11-16-2007, 11:39 PM
Here's a method of doing this I devised, it is universal for anyone that the trigger runs for.
-Link Moved- (http://www.warboards.org/showthread.php?p=594438#post594438)
Twitch6000
11-17-2007, 1:05 AM
I've been told there's not, but is there any such thing as a single trigger (or trigger system) that can repeat an action an infinte amount of times every time the conditions are met?
More specifically, is it possible to have a trigger that for every one unit that is killed (blank) goodie is given to player.
Before you respond, try it yourself in campaign editor, it sounds infinitely easy but it just doesn't work the way you'd think.
I belive you might wanna look at my tutorial of gas to cash that might point to what you want.
Guyton
11-17-2007, 9:03 AM
Here's a method of doing this I devised, it is universal for anyone that the trigger runs for.
Attached Files
File Type: scm Example - Kill to Resource.scm (51.1 KB, 2 views)
Now this works, thanks. I find it interesting that hte majority of big maps who need a trigger like this never used it, for example: Zergling Blood, Helms Deep, Predator, Zombie hotel, Golems. certain defence maps.
The point is, it's not a purely idiotic question.
SilverCrusader
11-17-2007, 9:13 AM
Well we have. You can either download my map above, or look at Twitch's tutorial here (http://www.warboards.org/showthread.php?p=541010#post541010).
Guyton, let me make it clear.
The first thing you need to understand is how Starcraft remembers things. At the beginning, when you start a game, all units have their "died" counter at "0", and all players have their "kill" counter at "0".
Once you kill a unit, the appropriate counters go up.
Take a look at the following scenario:
Player 1 kills a unit.
Player 1's kill counter went up to "1".
Your trigger, which has "current player kills at least "1" any unit" as condition, will find that the player does have 1 kill, so it will fire.
If that trigger has a preserve trigger action, it will once again check the conditions later. When it does that, it will once again see that the player has "1" for kills, and once again run.
If you want it to only run once per kill, then you need to reset the "1" back into "0" after the triggers runs, otherwise the condition will still be met.
It's impossible to reset the kill counter.
However, it is possible to reset the kill score.
Thus, in order for something to happen every time that a player kills a unit, you need the following condition:
Current Player has at least 1 kill score
Actions:
comment -blah blah-
Modify kill score for current player: set to 0
[do stuff]
Preserve Trigger
---
Preserve Trigger is exactly what you need. Your problem was that your condition was wrong, and you were lacking an action.
Dem0nS1ayer
11-17-2007, 4:59 PM
Players
Player 1
Conditions
Player 1 kills exactly 1 unit
Actions
Add 1 ore
Clear Previous Combat Data
Preserve Trigger
oh there's a second page lmao. Okay, never mind, forget my post. But wouldn't clearing the combat data work also?
Twitch6000
11-17-2007, 9:34 PM
If by clearing killscore is what you mean then yes :p.Again what he needs to do has been said by silver.
So I think this can be closed :o.
vBulletin® v3.7.2, Copyright ©2000-2008, Jelsoft Enterprises Ltd.