• 🏆 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] Strange trigger problem... Only loading one unit... See inside

Status
Not open for further replies.
Level 6
Joined
Jul 8, 2008
Messages
150
The trigger is supposed to create one zeppelin and order it to load all units that were created with it, but it is only loading a single unit...

  • Zeppelins
    • Events
      • Time - Every 10.00 seconds of game time
    • Conditions
    • Actions
      • For each (Integer A) from 0 to (Random integer number between 1 and 3), do (Actions)
        • Loop - Actions
          • Player Group - Pick every player in (All players) and do (Actions)
            • Loop - Actions
              • Set Spawn_Point = (Random point in Spawn_Region[(Random integer number between 1 and 4)])
              • Set Enemy_Force = (All enemies of (Owner of (Last created unit)))
              • Set Enemy_Point = ((Random player from Enemy_Force) start location)
              • Unit - Create 1 Ghost Zeppelin for (Picked player) at Spawn_Point facing (Random angle) degrees
              • Set Zeppelin = (Last created unit)
              • For each (Integer B) from 0 to (Random integer number between 2 and 3), do (Actions)
                • Loop - Actions
                  • Unit - Create 1 Random_Unit[(Random integer number between 8 and 11)] for (Picked player) at Spawn_Point facing (Random angle) degrees
                  • Unit - Order Zeppelin to Load (Last created unit)
              • Unit - Order Zeppelin to Unload All At Enemy_Point
              • Custom script: call RemoveLocation(udg_Spawn_Point)
              • Custom script: call DestroyForce(udg_Enemy_Force)
              • Custom script: call RemoveLocation(udg_Enemy_Point)
              • Custom script: call RemoveRect(udg_Spawn_Region[5])
 
Level 11
Joined
Jul 2, 2008
Messages
601
Don't feel like I know how to solve the problem 100%, but my mind says that the units for each integer created at the same time, so Zeppelin really loads only the Last Created. Maybe you should try to add waits?
 
Level 9
Joined
Nov 28, 2008
Messages
704
I think that it takes time for the zeppelin to load those units.. it is unable to handle so many instantly. Try using waits, see if it solves the problem.

If it does, then I dont know of any other way to fix your problem, except MAYBE if you spawn the units at like 1 in game distance unit farther in the direction of the facing of the zeppelin.

I doubt that would help pthough.. maybe there is an option on the zeppelin to increase the range at which units can load at? I know when you load something, the unit that is going to take the unit into itself has to turn and face the unit.. so maybe if your zeppelin has to do that, it can only do it so fast, and your trigger would spawn them NEAR INSTNATLY, giving it no time to pick them up individually.

Again, waits are your only solution far as I can see.
 
Level 12
Joined
Apr 27, 2008
Messages
1,228
Nothing strange here. As said twice, carrying out orders usually takes some time.

A solution(but in jass) is this.
 
Level 7
Joined
Sep 5, 2006
Messages
334
the zeppelin takes time to load a unit, and when you first order it to load, it would start loading, but with the 2nd order, it tried to load another unit, making it impossible to load. Trying waiting, it's the best way. Or spiwn's link to "OrderQueue".
 
Level 6
Joined
Jul 8, 2008
Messages
150
Thanks for the replies everyone.

I can't use waits because it's inside a loop. I could store the units in variables, then use waits, but then it wouldn't be MUI... (and I don't know JASS)

I also can't order the units to right-click the zeppelin because:
1) Zeppelin could be faster
2) units may be stuck in trees

Is there a way to directly create the units INSIDE the zeppelin?
 
Level 6
Joined
Jul 8, 2008
Messages
150
what about instantly moving the units to the position of the zepellin after there creation? they should be close enough then

else do the right click thing as well, ordering the zepellin to load is bad

and why do you use this strange integer thing with random number etc? plz tell me that cuz it makes no sence to me

Thanks I'll try that +rep.

The random integers are for creating random units for the zeppelin to load.

EDIT: Doesn't work.
 
Level 1
Joined
Feb 12, 2005
Messages
6
  • Set Enemy_Force = (All enemies of (Owner of (Last created unit)))
Is this seriously working?
Because i don't see a created unit above this variable trigger
 
Last edited:
Level 9
Joined
May 30, 2008
Messages
430
as far as i remember when u click to a unit to load into a ship/zeppelin when the unit stop (becouse there is no way to go into the zeppelin/ship) then the zeppelin/ship is coming to take it, so try to force units to load into the zeppelin and he must pick them one by one after this
 
Level 6
Joined
Jul 8, 2008
Messages
150
as far as i remember when u click to a unit to load into a ship/zeppelin when the unit stop (becouse there is no way to go into the zeppelin/ship) then the zeppelin/ship is coming to take it, so try to force units to load into the zeppelin and he must pick them one by one after this

it works but then the zeppelin doesn't unload them.

This is my current trigger:

  • Zeppelins
    • Events
      • Time - Every 10.00 seconds of game time
    • Conditions
    • Actions
      • For each (Integer A) from 0 to (Random integer number between 1 and 3), do (Actions)
        • Loop - Actions
          • Player Group - Pick every player in (All players) and do (Actions)
            • Loop - Actions
              • Set Spawn_Point = (Random point in Spawn_Region[(Random integer number between 1 and 4)])
              • Unit - Create 1 Ghost Zeppelin for (Picked player) at Spawn_Point facing (Random angle) degrees
              • Set Enemy_Force = (All enemies of (Owner of (Last created unit)))
              • Set Enemy_Point = ((Random player from Enemy_Force) start location)
              • Set Zeppelin = (Last created unit)
              • For each (Integer B) from 0 to (Random integer number between 2 and 3), do (Actions)
                • Loop - Actions
                  • Unit - Create 1 Random_Unit[(Random integer number between 8 and 11)] for (Picked player) at Spawn_Point facing (Random angle) degrees
                  • Unit - Order (Last created unit) to Right-Click Zeppelin
              • Unit - Order Zeppelin to Unload All At Enemy_Point
              • Custom script: call RemoveLocation(udg_Spawn_Point)
              • Custom script: call DestroyForce(udg_Enemy_Force)
              • Custom script: call RemoveLocation(udg_Enemy_Point)
              • Custom script: call RemoveRect(udg_Spawn_Region[5])
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,202
Did you try messing with the objectt editor, variaos values for the abilities and unit that does the transporting. If you can get rid of the delay there, then it may work instantly.

Otherwise, you will have to create them 1 at a time and load them with delays before the next unit is created.
 
Status
Not open for further replies.
Top