I am here to tell you how to put a command -revive into your maps, b/c i have taken enough out of wc3edit.net, its time to put something of my knowledge back in!
First, start off with creating a variable:
Variable Name(i picked ReviveGroup)
Make it Unit Group With Array 1
The images should look like this in triggers
Just continue the Trigger till you get to the amount of units in your map
Then, make something like this for the -revive command
And that should be it! I use it myself and haven't had any troubles with it, just post your problems here and i will try and fix it, Thanks ^ ^
EDIT!: one second, the images arent coming up
EDIT2: Here is a a Map of the tested trigger you can see for yourself
-Revive Command Triggers
Moderator: Cheaters
-
- Forum Staff
- Posts: 506
- Joined: August 5th, 2007, 1:38 pm
- Title: Gui Expert
- Location: *Unknown*
-Revive Command Triggers
You do not have the required permissions to view the files attached to this post.
Last edited by Arabidnun on January 16th, 2008, 9:36 pm, edited 1 time in total.
-
- Forum Staff
- Posts: 829
- Joined: January 28th, 2007, 8:10 pm
- Title: JASS Programmer
- Location: Canada
Re: -Revive Command Triggers
Just a few comments.
You can simplify your entire trigger to this:
[(Player number of (Owner of (Triggering unit))) will detect for us which player the hero belonged to.
Also, we don't need the condition "(Player <#> (<Color>) slot status) Equal to Is playing" because a player who isn't playing won't be able to type "-revive" anyway.
The following trigger also has two flaws:
First, (Center of (Playable map area)), is a location leak. Secondly, if you type -revive and your hero isn't dead, you still lose 200 gold.
To fix that, you should change the code to the following:
I appreciate your desire to help out.
You can simplify your entire trigger to this:
Code: Select all
ReviveHeroVariables
Events
Unit - A unit Dies
Conditions
((Dying unit) is A Hero) Equal to True
Actions
Unit Group - Add (Dying unit) to ReviveGroup[(Player number of (Owner of (Triggering unit)))]
Also, we don't need the condition "(Player <#> (<Color>) slot status) Equal to Is playing" because a player who isn't playing won't be able to type "-revive" anyway.
The following trigger also has two flaws:
Code: Select all
CommandRevive
Events
Player - Player 1 (Red) types a chat message containing -revive as An exact match
Conditions
((Triggering player) Current gold) Greater than or equal to 200
Actions
Hero - Instantly revive (Random unit from ReviveGroup[1]) at (Center of (Playable map area)), Show revival graphics
Player - Add -200 to (Triggering player) Current gold
Wait 2.00 seconds
Unit Group - Remove (Reviving Hero) from ReviveGroup[1]
To fix that, you should change the code to the following:
Code: Select all
CommandRevive
Events
Player - Player 1 (Red) types a chat message containing -revive as An exact match
Player - Player 2 (Blue) types a chat message containing -revive as An exact match
Player - Player 3 (Teal) types a chat message containing -revive as An exact match
Player - Player 4 (Purple) types a chat message containing -revive as An exact match
Player - Player 5 (Yellow) types a chat message containing -revive as An exact match
Player - Player 6 (Orange) types a chat message containing -revive as An exact match
Player - Player 7 (Green) types a chat message containing -revive as An exact match
Player - Player 8 (Pink) types a chat message containing -revive as An exact match
Player - Player 9 (Gray) types a chat message containing -revive as An exact match
Player - Player 10 (Light Blue) types a chat message containing -revive as An exact match
Player - Player 11 (Dark Green) types a chat message containing -revive as An exact match
Player - Player 12 (Brown) types a chat message containing -revive as An exact match
Conditions
((Triggering player) Current gold) Greater than 199
(Number of units in ReviveGroup[(Player number of (Triggering player))]) Greater than 0
Actions
Set TempUnit = (Random unit from ReviveGroup[(Player number of (Triggering player))])
Set AntiLeak_TempPoint = (Center of (Playable map area))
Hero - Instantly revive TempUnit at AntiLeak_TempPoint, Show revival graphics
Custom script: call RemoveLocation(udg_AntiLeak_TempPoint)
Player - Add -200 to (Triggering player) Current gold
Unit Group - Remove TempUnit from ReviveGroup[(Player number of (Triggering player))]
-
- Forum Staff
- Posts: 506
- Joined: August 5th, 2007, 1:38 pm
- Title: Gui Expert
- Location: *Unknown*
Re: -Revive Command Triggers
Just trying to help, I will edit my Attachment with your Anti-leak help and it will be ready for everyone to use ^ ^
EDIT: The anti-leak, er? What does that exactly do, I actually myself am using not center of map, i am using a region, What about leaks there?
EDIT: The anti-leak, er? What does that exactly do, I actually myself am using not center of map, i am using a region, What about leaks there?
-
- Forum Staff
- Posts: 829
- Joined: January 28th, 2007, 8:10 pm
- Title: JASS Programmer
- Location: Canada
Re: -Revive Command Triggers
Then set the variable to the center of the region.
There's many tutorials on memory leaks.
If you want to learn about them, I suggest clicking here.
There's many tutorials on memory leaks.
If you want to learn about them, I suggest clicking here.
-
- Forum Staff
- Posts: 506
- Joined: August 5th, 2007, 1:38 pm
- Title: Gui Expert
- Location: *Unknown*
Re: -Revive Command Triggers
Thank you very much, and i hope we can exchange map editing in the future