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

[Solved] [trigger] Creeps Revival No leak system

Status
Not open for further replies.
Level 6
Joined
Jun 28, 2016
Messages
70
Hello here's my problem, nowadays Creeps Revival system here, got some leaks, i used many like this one :
  • Init Revive Hostile Creeps
    • joinminus.gif
      events.gif
      Events
      • line.gif
        joinbottom.gif
        folder.gif
        Map initialization
    • join.gif
      cond.gif
      Conditions
    • joinbottomminus.gif
      actions.gif
      Actions
      • empty.gif
        join.gif
        set.gif
        Set Respawn_Time = 8.00
      • empty.gif
        joinbottomminus.gif
        unitgroup.gif
        Unit Group - Pick every unit in (Units in (Playable map area) owned by Neutral Hostile) and do (Actions)
        • empty.gif
          empty.gif
          joinbottomminus.gif
          actions.gif
          Loop - Actions
          • empty.gif
            empty.gif
            empty.gif
            join.gif
            set.gif
            Set Temp_Integer = (Temp_Integer + 1)
          • empty.gif
            empty.gif
            empty.gif
            join.gif
            unit.gif
            Unit - Set the custom value of (Picked unit) to Temp_Integer
          • empty.gif
            empty.gif
            empty.gif
            joinbottom.gif
            set.gif
            Set Creep_Points[TempInteger] = (Position of (Picked unit))
  • base.gif
    Current Respawn Hostile Creeps
    • joinminus.gif
      events.gif
      Events
      • line.gif
        joinbottom.gif
        unit.gif
        Unit - A unit Dies
    • joinminus.gif
      cond.gif
      Conditions
      • line.gif
        join.gif
        if.gif
        (Owner of (Triggering unit)) Equal to Neutral Hostile
      • line.gif
        joinbottom.gif
        if.gif
        (Custom value of (Triggering unit)) Greater than 0
    • joinbottomminus.gif
      actions.gif
      Actions
      • empty.gif
        join.gif
        zzz.gif
        Wait Respawn_Time game-time seconds
      • empty.gif
        join.gif
        unit.gif
        Unit - Create 1 (Unit-type of (Triggering unit)) for Neutral Hostile at Creep_Points[(Custom value of (Triggering unit))] facing 180.00 degrees
      • empty.gif
        joinbottom.gif
        unit.gif
        Unit - Set the custom value of (Last created unit) to (Custom value of (Triggering unit))
  • But recently i'v been facing many bugs, if someone wanna take the time, either way to teach me a better one, and by that i mean Effective, then i'm open for any Suggestion .
 
Level 5
Joined
Mar 30, 2006
Messages
60
You need to remove the point variables with custom trigger.

call removelocation (udg_creep_points[TempInteger] )

Else you'll create quite a lot of leaks with the map start already. Same with the Creep_Points location in the 2nd trigger. There's a sticky topic on leaks on this forum, you should read that one.
 
call removelocation (udg_creep_points[TempInteger] )
Just because he uses a point does not mean it leaks. Unless there is another trigger that replaces Creep_Points[TempInteger], it does not leak. He should not remove it because he needs to store the location and use it forever. The only leak I see is the unit group in Init Revive Hostile Creeps. You can get rid of it by storing it into a unit group variable and using call DestroyGroup(udg_YourUnitGroup) or by just putting set bj_wantDestroyGroup = true

But recently i'v been facing many bugs
Probably because of the wait timer. You are going to want to use a periodic loop to revive the creeps.


Also, I wouldn't change the custom value of the unit unless you really know what you are doing. There are a lot of systems / spells on the Hive that rely on unit indexers to function. If you happen to import one into your map, it will bug out.
 
Level 24
Joined
Aug 1, 2013
Messages
4,658
Or you want to use JASS and use timers... they are much more efficient, but they do require a JASS script.

The bugs may indeed come from the waits, but they can also come from a unit indexer if you added one recently.
If so, instead of using the custom value of the unit, you can use the value of an integer variable array using the custom value of the unit as index.
(Be aware that creating a new unit gives it a different custom value, so you have to set the value of that integer array when you create a unit.

Also, that init trigger is a bit weird.
It has no configuration, so I suppose you added it yourself.
You might want to set TempInteger to 0 at the start of that trigger to ensure it starts counting from 0.
 
Level 6
Joined
Jun 28, 2016
Messages
70
i fixed the problem, actually the system didn't worked, because of the Decay Timer in GameAdvance settings, because the decay was less than the actual respawn time. & Without a corpse the creeps cannot revive, it's fixed now thx for your answer.

Cya around :D
 
Level 24
Joined
Aug 1, 2013
Messages
4,658
You dont revive the units (even though it is more efficient), but you create new units.
The source of the problem was still the same, you make a unit with the same unit type as the triggering unit, but you ask for the unit type at the moment that you want the creep to respawn, and if the unit would be gone from the game, then you ask the unit type of "null" (aka nothing), which is going to end up with a unit type of "0", which doesnt really work well.
 
Status
Not open for further replies.
Top