• 🏆 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!

[Trigger] My respawn trigger is not working :(

Status
Not open for further replies.
Level 5
Joined
May 20, 2008
Messages
138
First, there is an initialization trigger, that stores each unit in a certain area in an unit group and also each units position in the map in a Point array (yeah, thats the theory)

  • Akilzon gauntlet init
    • Events
      • Time - Elapsed game time is 1.00 seconds
    • Conditions
    • Actions
      • Unit Group - Pick every unit in (Units in Akilzon gauntlet pick units <gen> owned by Player 12 (Brown)) and do (Actions)
        • Loop - Actions
          • Unit Group - Add (Picked unit) to Akilzon_gauntlet_units
      • Unit Group - Pick every unit in Akilzon_gauntlet_units and do (Actions)
        • Loop - Actions
          • Set Akilzon_gauntlet_unit_integer = (Akilzon_gauntlet_unit_integer + 1)
          • Set Akilzon_gauntlet_unit_position[Akilzon_gauntlet_unit_integer] = (Position of (Picked unit))
          • Unit - Set the custom value of (Picked unit) to Akilzon_gauntlet_unit_integer
Then there is a trigger that starts a respawn timer (this one I know is working lol :p)

  • Akilzon gauntlet win
    • Events
      • Unit - Amani'shi Tempest 0037 <gen> Dies
    • Conditions
    • Actions
      • Set Akilzon_gauntlet_inProgress = False
      • Countdown Timer - Start Akilzon_gauntlet_respawntimer as a One-shot timer that will expire in 10.00 seconds
      • Countdown Timer - Create a timer window for (Last started timer) with title Time until respawn
Then there is the respawn trigger. This trigger is run when the respawn timer launched in the previous trigger runs out. Basicly it checks what units in the unit group that was created in the first trigger ("Akilzon_ganutlet_units") are dead, removes them from the unit group, creates a new unit of the same unit-type and moves them to their start position. However this trigger doesnt seem to work at all. No new units are created and the old units (that werent killed) arent moved to their start position either. THIS IS A PROBLEM :O

  • Akilzon gauntlet respawn
    • Events
      • Time - Akilzon_gauntlet_respawntimer expires
    • Conditions
    • Actions
      • Trigger - Turn on Akilzon gauntlet start <gen>
      • Unit - Move Akilzon_gauntlet_Lookout instantly to (Center of Akilzon gauntlet lookout point <gen>)
      • Unit Group - Pick every unit in Akilzon_gauntlet_units and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Picked unit) is dead) Equal to True
            • Then - Actions
              • Unit - Create 1 (Unit-type of (Picked unit)) for Player 12 (Brown) at (Center of akilzon cree <gen>) facing Default building facing degrees
              • Unit - Set the custom value of (Last created unit) to (Custom value of (Picked unit))
              • Unit Group - Add (Last created unit) to Akilzon_gauntlet_units
              • Unit Group - Remove (Picked unit) from Akilzon_gauntlet_units
            • Else - Actions
      • Unit Group - Pick every unit in Akilzon_gauntlet_units and do (Actions)
        • Loop - Actions
          • Unit - Move (Picked unit) instantly to Akilzon_gauntlet_unit_position[(Custom value of (Picked unit))], facing Default building facing degrees
What is wrong with my code? :(
 
Last edited by a moderator:
Level 5
Joined
May 20, 2008
Messages
138
I thought I did? It says
  • before post name on my screen anyway... maybe I should examine my eyes? :)
  • (and btw maybe you could help with my trigger also? =)
 
Level 5
Joined
May 20, 2008
Messages
138
Didn't know that was possible lol :p

But if you are gonna post here, can you Please help with my trigger?? It's frustrating to get posts that dont even bother looking at the problem... nice community lol
 
Level 5
Joined
May 20, 2008
Messages
138
If you had actually read my post you wouldve seen it is that exact tutorial I have based my respawn off, however I needed to change it a bit since my system has som different mechanics.

Could you have a look at my trigger and try to understand what I am trying to do, since it is already based of that tutorial with some modifications. It is the last of the triggers that I think there are problems with, but it might be the first one. I don't know. Thats what I am ASKING....
 
Level 40
Joined
Dec 14, 2005
Messages
10,532
You have a ton of uneeded unit group loops.

--

Are you sure the trigger is even running? Try putting in some messages to see if the timer ever successfully expires (I should think it does, but you really never know).

--

Are your units still existent as decaying corpses in 10 seconds?

--

About your earlier comments, I have a good deal to do and can't post an in-depth answer to ever question, so i generally just pop in and contribute something here and there.
 
Level 5
Joined
May 20, 2008
Messages
138
Thanks for your reply PurplePoot!

Hmm uneeded unit loops? Could you explain a bit more indepth why they are uneeded? I don't even know what of the loops you are referring to :p

I know the timer is running since I create a timer window in the second trigger. (And I know that it finishes succesfully since Akilzon_gauntlet_lookout unit gets succesfully moved at the beginning of the third trigger (the one I am having problems with))

However, my units does not exist as decaying corpses after 10 seconds. That could be the problem with picking the units!

This does not explain why the units that are still alive still doesn't get Instantly Moved to their specified location though (see trigger 1 where the location is set and the end of trigger 3 where the units are moved).
 
Level 40
Joined
Dec 14, 2005
Messages
10,532
Hmm uneeded unit loops? Could you explain a bit more indepth why they are uneeded? I don't even know what of the loops you are referring to :p
You loop through a unit group to add all units to another, and then re-loop through the (now-added) group to do stuff to the units.

That sort of thing.

However, my units does not exist as decaying corpses after 10 seconds. That could be the problem with picking the units!
That would be it. The units aren't stored in memory any more, so they don't have a type, custom value, and so on.

This does not explain why the units that are still alive still doesn't get Instantly Moved to their specified location though (see trigger 1 where the location is set and the end of trigger 3 where the units are moved).
It actually does. When the game tries to do this stuff with a unit which doesn't exist, I imagine it crashes the thread, thus halting the rest of the trigger (Imagine an involuntary Skip Remaining Actions).

I'm not 100% sure this is the case with nonexistent units, but it's likely.
 
Status
Not open for further replies.
Top