• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

Need Spell help (Every X kills do (blank)

Status
Not open for further replies.
Level 3
Joined
Jul 14, 2006
Messages
39
Hey, either I'm an idiot and missed this like 5 times or else I I'm not but anyway
I've been trying to find out how to make a trigger that for the event is something like: Every 50 kills. Or: (Variable) equal to multiple of 50 would also work. I'd love your help, thanks!
 
Level 8
Joined
Sep 15, 2006
Messages
426
First do this:

  • Kills
    • Events
      • Unit - A unit Dies
    • Conditions
    • Actions
      • Set Kills = (Kills + 1.00)
Change the conditions if you need to.

Then do this:

  • Every 50 Kills
    • Events
      • Game - Kills becomes Equal to 50.00
    • Conditions
    • Actions
      • Set Kills = 0.00
You can add in more actions after the variable is reset.
 
Level 3
Joined
Jul 14, 2006
Messages
39
Sorry again Rui, but I read in the description ask for spell, trigger, and other help and thanks a lot Dark, that'll work well!

Alright dark so I set it up the way you said and it didn't work out, this is what I have (I don't know how to copy the trigger into the forum):

Trigger 1:
  • Events
    • Unit - A unit Dies
  • Conditions
    • (Owner of (Killing unit)) Equal to Player 1 (Red)
    • ((Owner of (Dying unit)) is an enemy of Player 1 (Red)) Equal to True
  • Actions
    • Set Player1kills = (Player1kills + 1.00)
Trigger 2:
  • Events
    • Game - Player1kills becomes Equal to 50.00
  • Conditions
  • Actions
    • Set Player1kills = 0.00
    • Unit - Create 1 Footman Player 1 (Red) at (Center of (Playable map area)) facing Default building facing degrees

I think the problem might be that in order to do "Game - Player1kills becomes Equal to 50.00" I had to change the variable "Player1kills" to real instead of interval since there is no "Game - Value of Integer Variable" or any way to do that to my knowledge, so I'm in need of someones help again!
 
Last edited by a moderator:
Level 11
Joined
Jul 12, 2005
Messages
764
Simply, in one trigger, making it MUI/player:
  • Events
    • Unit - A unit Dies
  • Conditions
    • (Owner of (Killing unit)) is an enemy of ((Owner of (Dying unit)) Equal to true
  • Actions
    • Set PlayerNum = Player number of (Owner of (Killing unit))
    • Set Kills[PlayerNum] = (Kills[PlayerNum] + 1.00)
    • If -
      • Kills[PlayerNum] is equal to 50.0
    • Then -
      • Kills[PlayerNum] = 0.00
      • Unit - Create 1 Footman (Owner of (Killing unit)) at (Center of (Playable map area)) facing Default building facing degrees
 
Level 40
Joined
Dec 14, 2005
Messages
10,532
The leaks, they burn! (and so does Dying Unit)

Where TempPoint is a global Point variable:
  • Events
    • Unit - A unit Dies
  • Conditions
    • (Owner of (Killing unit)) is an enemy of ((Owner of (Triggering unit)) Equal to true
  • Actions
    • Set PlayerNum = Player number of (Owner of (Killing unit))
    • Set Kills[PlayerNum] = (Kills[PlayerNum] + 1.00)
    • If -
      • Kills[PlayerNum] is equal to 50.0
    • Then -
      • Kills[PlayerNum] = 0.00
      • Set TempPoint = <your point>
      • Unit - Create 1 Footman (Owner of (Killing unit)) at TempPoint facing Default building facing degrees
      • Custom script: call RemoveLocation( udg_TempPoint )
 
Level 3
Joined
Jul 14, 2006
Messages
39
So Paskovich I followed your trigger exactly and it didn't work, what happened was whoever got the first kill was the only one who got a footman every 50 kills
 
Level 3
Joined
Jul 14, 2006
Messages
39
Okay yeah, I had made a really dumb mistake, now it works more, everyone can get a footman, but I think if I kill units too fast it'll skip a few because I have a leaderboard and I had 102 kills but only 1 footman and it'll look bad if it turns out that way, but that doesn't make sense to me, if the leaderboard can keep up, why cant the footman spawn? I have the same event and condition...
 
Status
Not open for further replies.
Top