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

Triggering Revives

Status
Not open for further replies.
Level 2
Joined
Mar 26, 2010
Messages
5
Im kinda new to the whole Warcraft 3 editor thing and trigger making.

K so im making a map for me and my friends to enjoy and im making it up to like 10 players. im attempting to make an rpg inspired by twilights eve! :)
So i ran into one problem during the project i dont no how to make units(Heros) revive at certain points when they past by it. You no in Twilight eve how when you past an inn it said revival point save and the next time you die you respawn there, i really like that idea and wanna use it so can anyone help me out here ?

If i dont make sense sorry :thumbs_up:
 
Level 37
Joined
Mar 6, 2006
Messages
9,243
This system does that. Press ESC to kill the hero. It will then revive at the last check point it visited. The check points are represented by fire columns in the test map.

All you need to do is to create the regions and set them to the region array. Then change the loop max value to the index of the last region. And then set the Player number condition to match the biggest player number you use for players.

Run the first trigger when all players have picked their heroes.


  • Revive Init
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Custom script: local region revregs
      • -------- ------------------------------- --------
      • Set ReviveRegions[0] = Region 000 <gen>
      • Set ReviveRegions[1] = Region 001 <gen>
      • Set ReviveRegions[2] = Region 002 <gen>
      • Set ReviveRegions[3] = Region 003 <gen>
      • -------- ------------------------------- --------
      • Set RevivePoints[0] = (Center of ReviveRegions[0])
      • -------- ------------------------------- --------
      • Hashtable - Create a hashtable
      • Set ReviveHash = (Last created hashtable)
      • -------- ------------------------------- --------
      • For each (Integer A) from 1 to 3, do (Actions)
        • Loop - Actions
          • Custom script: set revregs = CreateRegion()
          • Custom script: call RegionAddRect(revregs, udg_ReviveRegions[bj_forLoopAIndex])
          • Custom script: call TriggerRegisterEnterRegion(gg_trg_Revive_Set_Point, revregs, null )
          • Set RevivePoints[(Integer A)] = (Center of ReviveRegions[(Integer A)])
          • Custom script: call SaveInteger(udg_ReviveHash, GetHandleId(revregs), 0, bj_forLoopAIndex)
      • -------- ------------------------------- --------
      • Custom script: set bj_wantDestroyGroup = true
      • Unit Group - Pick every unit in (Units in (Playable map area) matching ((((Matching unit) is A Hero) Equal to True) and ((Player number of (Owner of (Picked unit))) Less than 13))) and do (Actions)
        • Loop - Actions
          • Custom script: call SaveLocationHandle(udg_ReviveHash, GetHandleId(GetEnumUnit()), 0, udg_RevivePoints[0])
      • -------- ------------------------------- --------
      • Custom script: set revregs = null
  • Events
  • Conditions
    • ((Triggering unit) is A Hero) Equal to True
    • (Player number of (Triggering player)) Less than 13
  • Actions
    • Custom script: call SaveInteger(udg_ReviveHash, GetHandleId(GetTriggerUnit()), 0, LoadInteger(udg_ReviveHash, GetHandleId(GetTriggeringRegion()), 0))
  • Test Die
    • Events
      • Unit - A unit Dies
    • Conditions
      • ((Triggering unit) is A Hero) Equal to True
      • (Player number of (Triggering player)) Less than 13
    • Actions
      • Wait 2.00 seconds
      • Custom script: set udg_TempLoc = udg_RevivePoints[LoadInteger(udg_ReviveHash, GetHandleId(GetTriggerUnit()), 0)]
      • Hero - Instantly revive (Triggering unit) at TempLoc, Show revival graphics
      • Camera - Pan camera for (Triggering player) to TempLoc over 2.00 seconds
      • Selection - Add (Triggering unit) to selection for (Triggering player)


http://www.hiveworkshop.com/forums/pastebin.php?id=jcgjnd
 
Level 2
Joined
Mar 26, 2010
Messages
5
Thanks Alot to everyone I used a bit from everyone :) thanks alot for the help

This system does that. Press ESC to kill the hero. It will then revive at the last check point it visited. The check points are represented by fire columns in the test map.

All you need to do is to create the regions and set them to the region array. Then change the loop max value to the index of the last region. And then set the Player number condition to match the biggest player number you use for players.

Run the first trigger when all players have picked their heroes.


  • Revive Init
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Custom script: local region revregs
      • -------- ------------------------------- --------
      • Set ReviveRegions[0] = Region 000 <gen>
      • Set ReviveRegions[1] = Region 001 <gen>
      • Set ReviveRegions[2] = Region 002 <gen>
      • Set ReviveRegions[3] = Region 003 <gen>
      • -------- ------------------------------- --------
      • Set RevivePoints[0] = (Center of ReviveRegions[0])
      • -------- ------------------------------- --------
      • Hashtable - Create a hashtable
      • Set ReviveHash = (Last created hashtable)
      • -------- ------------------------------- --------
      • For each (Integer A) from 1 to 3, do (Actions)
        • Loop - Actions
          • Custom script: set revregs = CreateRegion()
          • Custom script: call RegionAddRect(revregs, udg_ReviveRegions[bj_forLoopAIndex])
          • Custom script: call TriggerRegisterEnterRegion(gg_trg_Revive_Set_Point, revregs, null )
          • Set RevivePoints[(Integer A)] = (Center of ReviveRegions[(Integer A)])
          • Custom script: call SaveInteger(udg_ReviveHash, GetHandleId(revregs), 0, bj_forLoopAIndex)
      • -------- ------------------------------- --------
      • Custom script: set bj_wantDestroyGroup = true
      • Unit Group - Pick every unit in (Units in (Playable map area) matching ((((Matching unit) is A Hero) Equal to True) and ((Player number of (Owner of (Picked unit))) Less than 13))) and do (Actions)
        • Loop - Actions
          • Custom script: call SaveLocationHandle(udg_ReviveHash, GetHandleId(GetEnumUnit()), 0, udg_RevivePoints[0])
      • -------- ------------------------------- --------
      • Custom script: set revregs = null
  • Events
  • Conditions
    • ((Triggering unit) is A Hero) Equal to True
    • (Player number of (Triggering player)) Less than 13
  • Actions
    • Custom script: call SaveInteger(udg_ReviveHash, GetHandleId(GetTriggerUnit()), 0, LoadInteger(udg_ReviveHash, GetHandleId(GetTriggeringRegion()), 0))
  • Test Die
    • Events
      • Unit - A unit Dies
    • Conditions
      • ((Triggering unit) is A Hero) Equal to True
      • (Player number of (Triggering player)) Less than 13
    • Actions
      • Wait 2.00 seconds
      • Custom script: set udg_TempLoc = udg_RevivePoints[LoadInteger(udg_ReviveHash, GetHandleId(GetTriggerUnit()), 0)]
      • Hero - Instantly revive (Triggering unit) at TempLoc, Show revival graphics
      • Camera - Pan camera for (Triggering player) to TempLoc over 2.00 seconds
      • Selection - Add (Triggering unit) to selection for (Triggering player)


http://www.hiveworkshop.com/forums/pastebin.php?id=jcgjnd


Umm maker but im also wondering how to make the time of death for multiple players up to 10.
i would also like to make a window for it to show a countdown.
can you show me a place on the sight where they possibly teach me all that or you can do it :p

Thanks
 
Last edited by a moderator:
Status
Not open for further replies.
Top