Creeps respawn trigger doesn't work

Jarko89

New Member
Reaction score
1
Ok guys, i have this 2 trigger in my map (i took them froma tutorial on this forum)

here is the first, it checks all unit playable map area owned bu neutral hostile and assignes to them a custom value and position

Code:
Creep Revival System Initialization
    Events
        Time - Map initialisazion // i also tried to change it to elapsed game time
    Conditions
    Actions
        Unit Group_ - Pick every unit in (Units in (Playable map area) owned by Neutrale-ostile) 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())

the second revive every dying unit where it was at map initialisation

Code:
Revive Creeps 1 by 1
    Events
        Unit_ - A unit is dead
    Conditions
        (Owner of (Triggering unit)) Equal to Neutrale-ostile
        ((Triggering unit) is A Hero) Equal to FALSE
        ((Triggering unit) is Summoned) Equal to FALSE
    Actions
        Set TempPointCreeps[1] = (Center of (Entire map))
        Set TempPointCreeps[2] = (TempPointCreeps[1] offset by (Creep_X[(Custom value of (Triggering unit))], Creep_Y[(Custom value of (Triggering unit))]))
        Wait 90.00 seconds
        Unit_ - Create 1 (Unit-type of (Triggering unit)) for Neutrale-ostile at TempPointCreeps[2] facing Orientamento predefinito degli edifici degrees
        Unit_ - Set the custom value of (Last created unit) to (Custom value of (Triggering unit))
        Custom script:   call RemoveLocation(udg_TempPointCreeps[1])
        Custom script:   call RemoveLocation(udg_TempPointCreeps[2])

this should work perfectly and be leak free... but it does not!! rarely i find a unit respawned in a different location (maybe a couple of units respwaned where another unit died :eek:)

might it be due the time needed for bones of creeps corpes to disappear? i saw some people talkink abount that, but i dunno how could it be related to my triggers..

thanx!!!
 

darkbeer

Beer is Good!
Reaction score
84
your global gets overwritten if the trigger is executed 2 or more times within 90 seconds because of the wait, heres my suggestion:

use a local to save the location so it stays the same after the wait, you could alternatively use a global array with the custom value but i prefer it this way^^

Code:
Revive Creeps 1 by 1
    Events
        Unit_ - A unit is dead
    Conditions
        (Owner of (Triggering unit)) Equal to Neutrale-ostile
        ((Triggering unit) is A Hero) Equal to FALSE
        ((Triggering unit) is Summoned) Equal to FALSE
    Actions
        CustomScript: local location loc = Location(udg_Creep_X[GetUnitUserData(GetTriggerUnit())], udg_Creep_Y[GetUnitUserData(GetTriggerUnit())]))
        Wait 90.00 seconds
        CustomScript: set udg_TempPointCreeps[1] = loc
        Unit_ - Create 1 (Unit-type of (Triggering unit)) for Neutrale-ostile at TempPointCreeps[1] facing Orientamento predefinito degli edifici degrees
        Unit_ - Set the custom value of (Last created unit) to (Custom value of (Triggering unit)) // dont know if this works,after the 90 secs wait else store in local
        Custom script:   call RemoveLocation(udg_TempPointCreeps[1])
        Custom script:   call RemoveLocation(loc)
 

Renendaru

(Evol)ution is nothing without love.
Reaction score
309
It may be that the trigger is being overwritten...
 

Renendaru

(Evol)ution is nothing without love.
Reaction score
309
@DarkBeer: Your trigger doesn't seem to be MUI either...

Edit: Ah man.... I double posted w/o realizing. Sorry people.
 

darkbeer

Beer is Good!
Reaction score
84
why isnt it MUI? it uses a local to store the location, so it shouldnt get overwritten.... or am i wrong?
 

Renendaru

(Evol)ution is nothing without love.
Reaction score
309
The 2nd part still seems to be easily overwritten.
 

AceHart

Your Friendly Neighborhood Admin
Reaction score
1,495
> et TempPointCreeps[2] = (TempPointCreeps[1] offset by (Creep_X[(Custom value of (Triggering unit))], Creep_Y[(Custom value of (Triggering unit))]))

1.
Don't set the points before the wait...

2.
That second point is just wrong.
Your storing the positions of the units, and restore them offset to their own point???


Instead, use a "point" array, simply store all the positions there,
and restore them as needed with just that point.
 

darkbeer

Beer is Good!
Reaction score
84
@ renendaru: since theres no wait between the global and its use it wont get overwritten, you can test it if you want..... and next time be more precise where it isnt MUI so i dont have to do like 3 posts .....

EDIT: i also think too complicated just use vypur85s trigger^^
 

vypur85

Hibernate
Reaction score
803
Code:
Revive Creeps 1 by 1
    Events
        Unit_ - A unit is dead
    Conditions
        (Owner of (Triggering unit)) Equal to Neutrale-ostile
        ((Triggering unit) is A Hero) Equal to FALSE
        ((Triggering unit) is Summoned) Equal to FALSE
    Actions
        [B]Wait 90.00 seconds[/B]
        Set TempPointCreeps[1] = (Center of (Entire map))
        Set TempPointCreeps[2] = (TempPointCreeps[1] offset by (Creep_X[(Custom value of (Triggering unit))], Creep_Y[(Custom value of (Triggering unit))]))
        Unit_ - Create 1 (Unit-type of (Triggering unit)) for Neutrale-ostile at TempPointCreeps[2] facing Orientamento predefinito degli edifici degrees
        Unit_ - Set the custom value of (Last created unit) to (Custom value of (Triggering unit))
        Custom script:   call RemoveLocation(udg_TempPointCreeps[1])
        Custom script:   call RemoveLocation(udg_TempPointCreeps[2])

Actually, you just need to shift the wait to the top :).

Edit:
> That second point is just wrong.

Ah... Never checked on this... :p
 

Jarko89

New Member
Reaction score
1
Actually, you just need to shift the wait to the top :).

damn! now it works perfectly!! thank you!!! it revives 95% of dead creeps, it only "loses" a unit sometimes, but it think it might be due to the fact i kill creeps very quickly...
 

vypur85

Hibernate
Reaction score
803
> only "loses" a unit sometimes

Impossible. Any unit that dies should fire the event. Unless your creep is not able to leave corpse, or you have other triggers that remove the corpse from the game.
 

Jarko89

New Member
Reaction score
1
> only "loses" a unit sometimes

Impossible. Any unit that dies should fire the event. Unless your creep is not able to leave corpse, or you have other triggers that remove the corpse from the game.

mhh it might be that those specific units cant leave corpse... how to fix it? i cant find a "leave bones" option in the object editor...
 

Dameon

"All the power in the world resides in the eyes"
Reaction score
127
mhh it might be that those specific units cant leave corpse... how to fix it? i cant find a "leave bones" option in the object editor...

in the object editor scroll down to the creeps armor and attack type enabled, there will be an option there like none revivable does not decay, thats what you want to change.
 

Jarko89

New Member
Reaction score
1
in the object editor scroll down to the creeps armor and attack type enabled, there will be an option there like none revivable does not decay, thats what you want to change.

mhh mine is written in italian, btw those 2 units that didnt respawn had "CAN, CAN" like all other units... :confused:
 
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