• 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.

Revive Hero Win

Status
Not open for further replies.
Level 2
Joined
Oct 10, 2013
Messages
173
Ok i am working on a animie project and want a triger regarding reviving my hero to a region or base after he dies instantly :thumbs_up: and a win conditon that will be killing 150 heros a team will win the match forgive my english and forgive the thing if this was the wrong section guide me if i did something wrong or if it violates your policy happy map editing everyone:grin::goblin_yeah:
 
Last edited by a moderator:

Rheiko

Spell Reviewer
Level 26
Joined
Aug 27, 2013
Messages
4,214
  • Events
    • Unit - A unit dies
  • Conditions
    • ((Triggering unit) is a hero) equal to True
  • Actions
    • Hero - Revive (Triggering unit) at YourRegion
  • Events
    • Unit - A unit dies
  • Conditions
    • ((Killing unit) is a hero) equal to True
  • Actions
    • Set IntegerVariable = (IntegerVariable + 1)
    • If (Conditions) then (Actions) else (Actions):
      • Conditions:
        • IntegerVariable greater than or equal to 150
      • Then:
        • Victory YourPlayer (Shows dialogs, Show scores)
      • Else:
something like that, i'm too lazy to write it all for you
at the first trigger use if then else to revive him at specific region
for the second trigger, make the integervariable into an array
 
Level 12
Joined
Oct 16, 2010
Messages
680
a unit dies whenever i do a unit dies i cant set it as event the ok button wont activate only help me please

Use generic unit event instead of specific unit event

BTW if non hero units will exist in the game add

((dying unit)is a hero) equals true

To rheikos trigger as well

If there won't be any non hero unit then u don't need any condition

And if it's a PvP map u might want to count kills / teams separately
 
Level 2
Joined
Oct 10, 2013
Messages
173
ah you guys are so good i love you all thanks for help :)
how to count kills/team separatly can u give me trigger for that too you see i am completly new to this forums
and yea thanks that genric unit worked and the region i want to set 2 team team 1 base region team 2 base region and if team 1 hero dies he reives in team 1 base and team 2 unit dies he revives at team 2 base
 
Level 12
Joined
Oct 16, 2010
Messages
680
ah you guys are so good i love you all thanks for help :)
how to count kills/team separatly can u give me trigger for that too you see i am completly new to this forums

Well use if then else block the clarify which teams unit scored
Use array for the kill count integers

Like: if owner of killing unit is a friend of (any player from team1) then increment killcountinteger[1] and so on..
 

Rheiko

Spell Reviewer
Level 26
Joined
Aug 27, 2013
Messages
4,214
lender, i know that.. just change it lol

  • Events
    • Unit - A unit Dies
  • Conditions
    • ((Triggering unit) is A Hero) Equal to True
  • Actions
    • For each (Integer A) from 1 to 5, do (Actions)
      • Loop - Actions
        • For each (Integer B) from 6 to 10, do (Actions)
          • Loop - Actions
            • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
              • If - Conditions
                • (Owner of (Triggering unit)) Equal to (Player((Integer A)))
              • Then - Actions
                • Hero - Instantly revive (Last created unit) at YourAPoint, Show revival graphics
              • Else - Actions
                • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                  • If - Conditions
                    • (Owner of (Triggering unit)) Equal to (Player((Integer B)))
                  • Then - Actions
                    • Hero - Instantly revive (Last created unit) at YourBPoint, Show revival graphics
                  • Else - Actions
  • Events
    • Unit - A unit Dies
  • Conditions
    • ((Killing unit) is A Hero) Equal to True
    • ((Triggering unit) is A Hero) Equal to True
  • Actions
    • Set IntegerVariable[(Player number of (Owner of (Killing unit)))] = (IntegerVariable[(Player number of (Owner of (Killing unit)))] + 1)
    • For each (Integer A) from 1 to 5, do (Actions)
      • Loop - Actions
        • For each (Integer B) from 6 to 10, do (Actions)
          • Loop - Actions
            • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
              • If - Conditions
                • IntegerVariable[(Integer A)] Greater than or equal to 150
              • Then - Actions
                • Game - Victory Player 1 (Red) (Show dialogs, Show scores)
              • Else - Actions
                • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                  • If - Conditions
                    • IntegerVariable[(Integer B)] Greater than or equal to 150
                  • Then - Actions
                    • Game - Victory Player 6 (Orange) (Show dialogs, Show scores)
                  • Else - Actions
pick the player first then victory condition, i'm too lazy to do that lol
 
Level 2
Joined
Oct 10, 2013
Messages
173
lender, i know that.. just change it lol

  • Events
    • Unit - A unit Dies
  • Conditions
    • ((Triggering unit) is A Hero) Equal to True
  • Actions
    • For each (Integer A) from 1 to 5, do (Actions)
      • Loop - Actions
        • For each (Integer B) from 6 to 10, do (Actions)
          • Loop - Actions
            • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
              • If - Conditions
                • (Owner of (Triggering unit)) Equal to (Player((Integer A)))
              • Then - Actions
                • Hero - Instantly revive (Last created unit) at YourAPoint, Show revival graphics
              • Else - Actions
                • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                  • If - Conditions
                    • (Owner of (Triggering unit)) Equal to (Player((Integer B)))
                  • Then - Actions
                    • Hero - Instantly revive (Last created unit) at YourBPoint, Show revival graphics
                  • Else - Actions
  • Events
    • Unit - A unit Dies
  • Conditions
    • ((Killing unit) is A Hero) Equal to True
    • ((Triggering unit) is A Hero) Equal to True
  • Actions
    • Set IntegerVariable[(Player number of (Owner of (Killing unit)))] = (IntegerVariable[(Player number of (Owner of (Killing unit)))] + 1)
    • For each (Integer A) from 1 to 5, do (Actions)
      • Loop - Actions
        • For each (Integer B) from 6 to 10, do (Actions)
          • Loop - Actions
            • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
              • If - Conditions
                • IntegerVariable[(Integer A)] Greater than or equal to 150
              • Then - Actions
                • Game - Victory Player 1 (Red) (Show dialogs, Show scores)
              • Else - Actions
                • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                  • If - Conditions
                    • IntegerVariable[(Integer B)] Greater than or equal to 150
                  • Then - Actions
                    • Game - Victory Player 6 (Orange) (Show dialogs, Show scores)
                  • Else - Actions
pick the player first then victory condition, i'm too lazy to do that lol

hey can u tell me were are if conditon (the conditon in if command u entered with pictures please and if action and else actions please) like which type of commands are they thank ya
(Owner of (Triggering unit)) Equal to (Player((Integer A)))
integer a i cannot find were is integer a in that
 

Rheiko

Spell Reviewer
Level 26
Joined
Aug 27, 2013
Messages
4,214
ah i don't know what are you talking about, lol
which if then else? the first or second trigger?
(Owner of (Triggering unit)) Equal to (Player((Integer A))) you can find this
convert player index to player -> player(1)
replace 1 with "for loop integer A"

You remind me to my past self, when i was looking for an answer at thehelper.net :D
but i didn't asking, just keep looking for it until i found it
 
Level 2
Joined
Oct 10, 2013
Messages
173
ah i don't know what are you talking about, lol
which if then else? the first or second trigger?
(Owner of (Triggering unit)) Equal to (Player((Integer A))) you can find this
convert player index to player -> player(1)
replace 1 with "for loop integer A"

You remind me to my past self, when i was looking for an answer at thehelper.net :D
but i didn't asking, just keep looking for it until i found it

rep up for ya thanks u are too much user friendly keep good job up bud

Sad the trigger 1 u showed when i test that my war3 crashes lol
 
JASS:
function SmartCameraPanBJ takes player whichPlayer, location loc, real duration returns nothing
    local real dist
    if (GetLocalPlayer() == whichPlayer) then
        // Use only local code (no net traffic) within this block to avoid desyncs.

        set dist = DistanceBetweenPoints(loc, GetCameraTargetPositionLoc())
        if (dist >= bj_SMARTPAN_TRESHOLD_SNAP) then
            // If the user is too far away, snap the camera.
            call PanCameraToTimed(GetLocationX(loc), GetLocationY(loc), 0)
        elseif (dist >= bj_SMARTPAN_TRESHOLD_PAN) then
            // If the user is moderately close, pan the camera.
            call PanCameraToTimed(GetLocationX(loc), GetLocationY(loc), duration)
        else
            // User is close enough, so don't touch the camera.
        endif
    endif
endfunction
Blizzard failed here [AFAIR] : if (GetLocalPlayer() == whichPlayer)
EDIT :
Blizzard actually failed here [by PurgeandFire - credits to him] : set dist = DistanceBetweenPoints(loc, GetCameraTargetPositionLoc())
 
Last edited:
Level 20
Joined
Aug 13, 2013
Messages
1,696
I don't know why just don't use this ?
Demo Code Only some things are not needed in this.
Team 1:
  • T1
    • Events
      • Unit - A unit owned by Player 1 (Red) Dies
      • Unit - A unit owned by Player 3 (Teal) Dies
      • Unit - A unit owned by Player 5 (Yellow) Dies
      • Unit - A unit owned by Player 7 (Green) Dies
      • Unit - A unit owned by Player 10 (Light Blue) Dies
    • Conditions
      • ((Dying unit) is A Hero) Equal to True
      • ((Dying unit) has an item of type Ankh of Reincarnation) Equal to False
    • Actions
      • If ((Owner of (Killing unit)) Not equal to Neutral Hostile) then do (Game - Display to (All players) for 4.00 seconds the text: ((Name of (Owner of (Killing unit))) + ( |cffff0000Defeats|r + (Name of (Owner of (Triggering unit)))))) else do (Game - Display to (All players) the text: ((Name of (Owner of (Triggering unit))) + Dies To Creeps))
      • Wait 25.00 seconds
      • Hero - Instantly revive (Dying unit) at (Center of Ally <gen>), Show revival graphics
      • Animation - Change (Dying unit) flying height to (Default flying height of (Dying unit)) at 0.00
      • Unit - Reset ability cooldowns for (Dying unit)
Team2:
  • T2
    • Events
      • Unit - A unit owned by Player 2 (Blue) Dies
      • Unit - A unit owned by Player 4 (Purple) Dies
      • Unit - A unit owned by Player 6 (Orange) Dies
      • Unit - A unit owned by Player 8 (Pink) Dies
      • Unit - A unit owned by Player 11 (Dark Green) Dies
    • Conditions
      • ((Dying unit) is A Hero) Equal to True
      • ((Dying unit) has an item of type Ankh of Reincarnation) Equal to False
    • Actions
      • If ((Owner of (Killing unit)) Not equal to Neutral Hostile) then do (Game - Display to (All players) for 4.00 seconds the text: ((Name of (Owner of (Killing unit))) + ( |cffff0000Defeats|r + (Name of (Owner of (Triggering unit)))))) else do (Game - Display to (All players) the text: ((Name of (Owner of (Triggering unit))) + Dies To Creeps))
      • Wait 25.00 seconds
      • Hero - Instantly revive (Dying unit) at (Center of Enemy <gen>), Show revival graphics
      • Animation - Change (Dying unit) flying height to (Default flying height of (Dying unit)) at 0.00
      • Unit - Reset ability cooldowns for (Dying unit)
I tried this reviving my heroes and seems working properly.
 
Dying unit will get overwritten on next run.
This will bug up the revival.

Can be avoided with local variables afaik;

  • Revive
    • Events
      • Unit - A unit owned by Player 1 (Red) Dies
    • Conditions
      • ((Dying unit) is A Hero) Equal to True
      • ((Decaying unit) has an item of type Ankh of Reincarnation) Equal to True
    • Actions
      • Custom script: local unit u = GetDyingUnit()
      • Wait 25.00 seconds
      • Custom script: set udg_Hero = u
      • Hero - Instantly revive Hero at (Center of (Playable map area)), Hide revival graphics
      • Custom script: set u = null
 

Rheiko

Spell Reviewer
Level 26
Joined
Aug 27, 2013
Messages
4,214
jakeZinc, could you please post your test map. i wonder whether your test map is the problem or our deduction is wrong?
  • Events
    • Unit - A unit Dies
  • Conditions
  • Actions
    • Wait - Wait 10 seconds
    • Unit - Create 1 ((Unit-type) of (Dying unit)) at (Center of (Playable map area) facing default building facing
try to kill two units, then see..
if only one unit get revived, then it is not MUI/MPI
you can use debug though
i don't try this yet, it is better if you show us it is working or not
 
Status
Not open for further replies.
Top