• 🏆 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!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

[General] Creep Revive at start point and has facing

Status
Not open for further replies.
Level 4
Joined
May 21, 2015
Messages
70
does anyone here know any creep revival systems(one that can spawn the dying unit to its starting location and also with its facing direction in the starting location) +rep
 
Level 16
Joined
Mar 27, 2011
Messages
1,349
Well I made a simple system that revives units after 30 seconds of dieing. One problem I haven't fixed yet though is that units revive where they died. Ideally you would want them to revive where their "creep camp" is. Hmm...

  • Unit Revival
    • Events
      • Unit - A unit Dies
    • Conditions
    • Actions
      • Set Revival_Index = (Revival_Index + 1)
      • Set Revival_Unit[Revival_Index] = (Triggering unit)
      • Set Revival_Point[Revival_Index] = (Position of Revival_Unit[Revival_Index])
      • Set Revival_Owner[Revival_Index] = (Owner of Revival_Unit[Revival_Index])
      • Set Revival_Counter[Revival_Index] = 0.00
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Revival_Index Equal to 1
        • Then - Actions
          • Trigger - Turn on Unit Revival Loop <gen>
        • Else - Actions
  • Unit Revival Loop
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
    • Actions
      • For each (Integer Revival_LoopInteger) from 1 to Revival_Index, do (Actions)
        • Loop - Actions
          • Set Revival_Counter[Revival_LoopInteger] = (Revival_Counter[Revival_LoopInteger] + 1.00)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Revival_Counter[Revival_LoopInteger] Greater than or equal to 30.00
            • Then - Actions
              • Unit - Create 1 (Unit-type of Revival_Unit[Revival_LoopInteger]) for Revival_Owner[Revival_LoopInteger] at Revival_Point[Revival_LoopInteger] facing Default building facing degrees
              • Custom script: call RemoveLocation( udg_Revival_Point[udg_Revival_LoopInteger])
              • Set Revival_Point[Revival_LoopInteger] = Revival_Point[Revival_Index]
              • Custom script: set udg_Revival_Point[udg_Revival_Index] = null
              • Set Revival_Unit[Revival_LoopInteger] = Revival_Unit[Revival_Index]
              • Set Revival_Unit[Revival_Index] = No unit
              • Set Revival_Owner[Revival_LoopInteger] = Revival_Owner[Revival_Index]
              • Set Revival_Counter[Revival_LoopInteger] = Revival_Counter[Revival_Index]
              • Set Revival_Index = (Revival_Index - 1)
              • Set Revival_LoopInteger = (Revival_LoopInteger - 1)
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • Revival_Index Equal to 0
                • Then - Actions
                  • Trigger - Turn off (This trigger)
                • Else - Actions
            • Else - Actions
Edit: Fixed a small problem with reindexing unit owner.
 

Attachments

  • Unit Revival.w3x
    20 KB · Views: 26
Level 4
Joined
May 21, 2015
Messages
70
woah thank you for that but i need a trigger (in GUI) that can spawn a dying unit where it started when the game starts.
 
Level 16
Joined
Mar 27, 2011
Messages
1,349
Ok I figured it out. I indexed unit's positions and facing angles upon map initialization. When units respawn, they'll respawn at their starting position (not where they died). New system uses Bribe's unit indexing system.

For demonstration, I changed the respawn timer to 5 seconds.
 

Attachments

  • Unit Revival 2.w3x
    24.8 KB · Views: 44
Level 4
Joined
May 21, 2015
Messages
70
last question is this for multi-killing spawn or individual? +rep

EDIT1: thats what im talking about well +rep, how do i edit the spawn time im a bit confused.
 
Last edited:
Level 16
Joined
Mar 27, 2011
Messages
1,349
Not sure what you mean. This should work for all units. You can kill as many as you want at a time and they'll all independently respawn after 5 seconds (or whatever you set it to).

Edit: Download the map I attached and see how the system works.
 
Status
Not open for further replies.
Top