Spawning - Loading - Sending?

emilemil1

New Member
Reaction score
20
I am trying to make a loop with 5 players, each with their own set of units.

This trigger is supposed to create a boat, loop the creation action and the load ability on the created unit, and when all units has been loaded it should leave the shore and the next player would have his boat created and so on...

I have modified the event, it should be every 120 seconds, so the problem is not that the waits makes it doubleexecute.

Every time i make a little change i get one of 3 outcomes:

1. The boat waiting a few seconds, then moving on. With waits.
2. The boat loading the first time, then moving on(that far flawlessly), but when running the second time it does not load the unit, it also refuses to load unit groups with more than one unit. I don't know what i did this time.
3. The boat is created, tries to load the unit, but is interrupted by the move action coming after. This is with no waits in.

I tried with game messages to detect what went wrong, and it turned out that the last set of triggers (the ones moving the ship and cleaning) would not run if a wait is placed there.

Any solutions?

EDIT: I detected a tiny mistake, fixed it, but still running wrong.

Code:
Heaven Naval
    Events
        Time - Every 10.00 seconds of game time
    Conditions
    Actions
        For each (Integer A) from 1 to 5, do (Actions)
            Loop - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        (Number of units in NavalForces[(Integer A)]) Equal to 0
                    Then - Actions
                    Else - Actions
                        Set NavalRunning[(Integer A)] = True
                        Unit - Create 1 Human Light Transport Ship for (Player((Integer A))) at HeavenNavalPoint facing 180.00 degrees
                        Set Temp_Unit = (Last created unit)
                        Unit - Set level of Cargo Hold (Ship) for (Last created unit) to ((Current research level of Improved Cargo for (Owner of (Last created unit))) + 1)
                        Unit - Change ownership of (Last created unit) to Player 6 (Orange) and Retain color
                        Set Temp_Group = NavalForces[(Integer A)]
                        For each (Integer B) from 1 to (Number of units in Temp_Group), do (Actions)
                            Loop - Actions
                                Wait 0.50 seconds
                                Set Temp_Unit2 = (Random unit from Temp_Group)
                                Unit - Create 1 (Unit-type of Temp_Unit2) for (Player((Integer A))) at HeavenNavalPoint facing Default building facing degrees
                                Unit Group - Remove Temp_Unit2 from Temp_Group
                                Unit - Order Temp_Unit to Load (Last created unit)
                                Set X = (X + 1)
                        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            If - Conditions
                                X Equal to (Number of units in NavalForces[(Integer A)])
                            Then - Actions
                                Set X = 0
                                Custom script:   call DestroyGroup (udg_Temp_Group)
                                Wait 1.00 seconds
                                Unit - Order Temp_Unit to Move To HellNavalTarget
                                Set NavalRunning[(Integer A)] = False
                            Else - Actions
                Wait 1.00 seconds
 

emilemil1

New Member
Reaction score
20
Oh, forgot to close this, i figured out that i had to separate the spawning and loading procedure into 2 loops to make it work. But it's fixed now.

But I do have another issue now xD

The boat turns around and faces all 15 units (my unit cap) but it only loads 10 of them into the cargo. The last 5 are just beeing looked at for 0.75 sec.

Since it works up to 10 I'm guessing it is something about max cargo. I have it set to 15. But is there a gameplay constant or something blocking my setup? (like with movementspeed)

The delivery is flawless though :/

I'm also wondering, if a boat is destroyed in shallow water with units in its cargo. Does the units die or become released?

I have to take the answers/solutions tomorrow :)

GN and THX in advance.
 

Samael88

Evil always finds a way
Reaction score
181
I don't think that it is even possible to load more than a maximum of 10 units in any cargo-thing:( It's the game that has limitations there.

You could solve it by having a dummy transporter at the point of the ship, but it would take a lot more triggering.

The shallow water thing, test it, how much time could it take to test it yourself, 10mins max?
Whatever happened to "trial and error"? That is how we did it when I was young:p
 

emilemil1

New Member
Reaction score
20
Damn :/ i guess i can reduce the cap and the spawn time to even it out. But that could cause collisions :/ damn again. I have to copy the trigger with new variables :/

+rep | thx for the info

About the trial and error

I had shut down WE and was going to bed. Otherwise i would ofc not ask it here :) Just a little side Q
 
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