Help with Creep revival

worldeditors

Cool Member
Reaction score
1
Hello, I'm doing a creep revival system, whereby when a creep dies, it revives after the hero leaves the region, but apparently some creeps DON'T revive. I cant find the problem. please help!

Code:
Creep revive initialization
    Events
        Map initialization
    Conditions
    Actions
        Unit Group - Pick every unit in (Units in (Playable map area) owned by Neutral Hostile) and do (Actions)
            Loop - Actions
                Set Integer = (Integer + 1)
                Unit - Set the custom value of (Picked unit) to Integer
                Custom script:   set udg_Creep_X[udg_Integer] = GetUnitX(GetEnumUnit())
                Custom script:   set udg_Creep_Y[udg_Integer] = GetUnitY(GetEnumUnit())

Code:
Revive creep
    Events
        Unit - A unit Dies
    Conditions
        (((Dying unit) is Summoned) Equal to False) and ((Owner of (Dying unit)) Equal to Neutral Hostile)
    Actions
        Wait until ((Number of units in (Units within 400.00 of (Position of (Dying unit)) matching (((Triggering unit) is A Hero) Equal to True))) Equal to 0), checking every 1.00 seconds
        Unit - Create 1 (Unit-type of (Dying unit)) for Neutral Hostile at ((Center of (Entire map)) offset by (Creep_X[(Custom value of (Dying unit))], Creep_Y[(Custom value of (Dying unit))])) facing Default building facing degrees
 

canons200

New Member
Reaction score
50
the first trigger, use pick every unit in entire map, not playable map
second trigger, matching there, use matching unit, not triggering unit
 

bLu3_eYeS

New Member
Reaction score
31
Make a point variable to be set to Entire map and at unit group set it to pick every unit in units in (The variable you created)
and use wc3 tags next time.By the way it had some leaks...
Here is how it needs to look like:

Trigger:
  • Creep revive initialization
    • Events
      • Map initialization
    • Conditions
    • Actions
    • Set CreepReviveGroup = (Units in (Entire map))
    • Set CreepReviveLoc = (Center of (Entire map))
    • Unit Group - Pick every unit in CreepReviveGroup owned by Neutral Hostile) and do (Actions)
      • Loop - Actions
        • Set Integer = (Integer + 1)
        • Unit - Set the custom value of (Picked unit) to Integer
        • Custom script: set udg_Creep_X[udg_Integer] = GetUnitX(GetEnumUnit())
        • Custom script: set udg_Creep_Y[udg_Integer] = GetUnitY(GetEnumUnit())


Trigger:
  • Revive creep
    • Events
      • Unit - A unit Dies
    • Conditions
      • (((Dying unit) is Summoned) Equal to False) and ((Owner of (Dying unit)) Equal to Neutral Hostile)
    • Actions
      • Wait until ((Number of units in (Units within 400.00 of (Position of (Dying unit)) matching (((Triggering unit) is A Hero) Equal to True))) Equal to 0), checking every 1.00 seconds
      • Unit - Create 1 (Unit-type of (Dying unit)) for Neutral Hostile at CreepReviveLoc offset by (Creep_X[(Custom value of (Dying unit))], Creep_Y[(Custom value of (Dying unit))])) facing Default building facing degrees


The Variables in chase you don't know wich is wich.

CreepReviveGroup is a Unit Group variable
CreepReviveLoc is a Point variable

I think it works now.
 

HydraRancher

Truth begins in lies
Reaction score
197
If leaks are ok then yes (check the first trigger).

For the second action of the second trigger, replace all the (Dying) with (Triggering)

(Dying) would expire if there was too much waiting.
 

worldeditors

Cool Member
Reaction score
1
Alright, now it's like this, but this time, the creeps don't even revive at all. What's happening?
Code:
Creep revive initialization
    Events
        Map initialization
    Conditions
    Actions
        Set CreepReviveGroup = (Units in (Entire map))
        Set CreepReviveLoc = (Center of (Entire map))
        Unit Group - Pick every unit in (Units in (Entire map) owned by Neutral Hostile) and do (Actions)
            Loop - Actions
                Set Integer = (Integer + 1)
                Unit - Set the custom value of (Picked unit) to Integer
                Custom script:   set udg_Creep_X[udg_Integer] = GetUnitX(GetEnumUnit())
                Custom script:   set udg_Creep_Y[udg_Integer] = GetUnitY(GetEnumUnit())
Code:
Revive creep
    Events
        Unit - A unit Dies
    Conditions
        (((Triggering unit) is Summoned) Equal to False) and ((Owner of (Triggering unit)) Equal to Neutral Hostile)
    Actions
        Wait until ((Number of units in (Units within 400.00 of (Position of (Triggering unit)) matching (((Matching unit) is A Hero) Equal to True))) Equal to 0), checking every 20.00 seconds
        Unit - Create 1 (Unit-type of (Triggering unit)) for Neutral Hostile at (CreepReviveLoc offset by (Creep_X[(Custom value of (Triggering unit))], Creep_Y[(Custom value of (Triggering unit))])) facing Default building facing degrees
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top