• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

aos

Status
Not open for further replies.
Level 10
Joined
Jul 2, 2004
Messages
690
ok so anyway im not really THAT good at triggers... can anyone teach me how to like do when player 1 kills player 2 it will do a text message to all players which says something like "Player 1 has Killed Player 2 and collected the bounty"? and about reviving timers. like a level 8 hero died and there will be a timer shown which like "Player 2 00:16" or something like that sorry but im really bad at triggers... so ya... thank you to whoever can help me
 
Level 2
Joined
Sep 2, 2004
Messages
25
question 1:

something like this?

Untitled Trigger 001
Events
Unit - fire 0001 <gen> Dies
Conditions
Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Owner of (Killing unit)) Equal to Player 1 (Red)
Then - Actions
Game - Display to (All players) for 20.00 seconds the text: player 1 killed pla...
Player - Add 100 to Player 1 (Red) Current gold
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Owner of (Killing unit)) Equal to Player 2 (Blue)
Then - Actions
Game - Display to (All players) for 20.00 seconds the text: player 2 killed pla...
Player - Add 100 to Player 2 (Blue) Current gold
Else - Actions


question 2:


Untitled Trigger 001
Events
Unit - A unit owned by Player 1 (Red) Dies
Conditions
((Dying unit) is A Hero) Equal to True
Actions
Countdown Timer - Start player1timer as a One-shot timer that will expire in 30.00 seconds
Countdown Timer - Create a timer window for player1timer with title player 1 revival:
Wait 30.00 seconds
Hero - Instantly revive (Dying unit) at (Center of (Playable map area)), Show revival graphics

its probably not exactly what u want but i may give you ideas
 
Level 6
Joined
Aug 29, 2004
Messages
159
Better Solutions:

This is my DeathMatchKill trigger straight from my hero defence... (edited slightly so u dont copy me :wink: )

DeathMatchKills
Events
Unit - A unit Dies
Conditions
((Owner of (Dying unit)) is an ally of (Owner of (Killing unit))) Equal to False
((Dying unit) is A Hero) Equal to True
(Arena <gen> contains (Dying unit)) Equal to True
Actions
Set DeathMatcKills[(Player number of (Owner of (Killing unit)))] = DeathMatcKills[(DeathMatcKills[(Player number of (Owner of (Killing unit)))] + 1)]
Leaderboard - Change the value for (Owner of (Killing unit)) in ArenaLeaderBoard to Kills[(Player number of (Owner of (Killing unit)))]
Leaderboard - Sort ArenaLeaderBoard by Value in Descending order
Player - Add ((Level of (Dying unit)) x 100) to (Owner of (Killing unit)) Current gold
Game - Display to (All players) for 4.00 seconds the text: ((Name of (Owner of (Killing unit))) + ( slaughtered + (Name of (Owner of (Dying unit)))))


Umm somewhere in there is a Variable:DeathMatchKills(IntegerArray), a Region:Arena, a Leaderboard:ArenaLeaderBoard.. and maybe some other stuff :?

Basically when a hero dies, it checks to see if the dying unit is an ally of the killing unit (so you dont go killing your own friends for gold), if the dying unit is a hero, and if the dying unit is in the arena (bcoz i have another death trigger). Then it increases the number of kills you have by one, updates the leaderboard and sorts the leaderboard to show the appropriate values. Then it gives you gold (100x the level of the dying hero) and displays a text message to all players for 4 seconds announcing your victory.



DeathRevive
Events
Unit - A unit Dies
Conditions
((Dying unit) is A Hero) Equal to True
(Arena <gen> contains (Dying unit)) Equal to False
Actions
Countdown Timer - Start TIMER_revive as a One-shot timer that will expire in ((Real((Hero level of (Dying unit)))) + 35.00) seconds
Countdown Timer - Create a timer window for TIMER_revive with title ((Name of (Owner of (Dying unit))) + revives in:)
Set TIMER_revive = (Last started timer)
Wait ((Real((Hero level of (Dying unit)))) + 35.00) seconds
If (((Owner of (Dying unit)) is in Team1) Equal to True) then do (Hero - Instantly revive (Dying unit) at (Center of Herospawn 1 <gen>), Show revival graphics) else do (Hero - Instantly revive (Dying unit) at (Center of Herospawn 2 <gen>), Show revival graphics)
Countdown Timer - Hide (Last created timer window) for (Owner of (Dying unit))
Countdown Timer - Destroy (Last created timer window)

Thats a dumbed down version of my deathrevive trigger. Its for heroes who dont die in the arena (so watch out with the conditions). You need a Variable:Timer, Variable:Team1(PlayerGroup), Varible:Team2(PlayerGroup), Region:Herospawn1, Region:Herospawn2.

This trigger does so that if a hero dies, it will wait 35 seconds plus his level and then revive him at the appropriate spawn point (you need to have set the teams up as player group variables somewhere else...)

hope thats helpful
Bort
 
Level 10
Joined
Jul 2, 2004
Messages
690
jus one small problem guys, lets say player 1 kills player 2 and their player names are like "GrEgOrY" and "09873" respectively, how do i make it instead of showing " player 1 has killed player 2" it will show like "GrEgOrY has killed 09873"?
 
Level 8
Joined
Jul 9, 2004
Messages
405
on the messege part choose 'concatenate strings' then on the first one change it to 'name of (owner of killing unit) + (another concatenate string)_has killed_ + 'name of (owner of dying unit)'

when i used the _'s on has killed that means put a space there, if not it will be directly after there name EG. Rad-has killedqwerty

lol if u need clerifaction just ask though if u look close enough its pretty clear
 
Status
Not open for further replies.
Top