Need Help with a Trigger Concerning Unloading Units

death_knight

Dark is the heart of a corrupted man.
Reaction score
24
Hey guys,

I have the following trigger:

Code:
Fuel Runs Out
    Events
        Time - Every 1.00 seconds of game time
    Conditions
    Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (Owner of PlayerCar[1]) Equal to Player 1 (Red)
                (Integer((Mana of PlayerCar[1]))) Equal to 0
                CarOwned[1] Equal to True
            Then - Actions
                Unit - Order PlayerCar[1] to Unload PlayerUnit[1]
                Unit - Order PlayerCar[1] to Stop
                Unit - Change ownership of PlayerCar[1] to Neutral Passive and Retain color
                Set FuelConsumption[1] = False
                Set Unloaded[1] = True
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        (South Western Car Park <gen> contains PlayerCar[1]) Equal to True
                    Then - Actions
                        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            If - Conditions
                                Or - Any (Conditions) are true
                                    Conditions
                                        SWCPCarParkNumber[1] Less than or equal to 6
                            Then - Actions
                                Unit - Move PlayerCar[1] instantly to (Center of PlayerCarParkSWCP[1]), facing 90.00 degrees
                            Else - Actions
                        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            If - Conditions
                                Or - Any (Conditions) are true
                                    Conditions
                                        SWCPCarParkNumber[1] Greater than or equal to 7
                            Then - Actions
                                Unit - Move PlayerCar[1] instantly to (Center of PlayerCarParkSWCP[1]), facing 270.00 degrees
                            Else - Actions
                    Else - Actions
                Game - Display to Player Group - Player 1 (Red) the text: You're car has run ...
                Set FuelRunOut[1] = True
            Else - Actions

Whats basically happening is that the trigger is checking three things:
  1. Whether or not the player is the owner of the vehicle
  2. If the player actually bought the car (CarOwned = True)
  3. And If the Fuel (mana) is equal to zero

My problem is that the car doesn't unload the player's unit before the ownership of the car is changed back to Neutral Passive, even though I have the action "Unit - Order PlayerCar[1] to Unload PlayerUnit[1]".

Any ideas?
 

Necrach

You can change this now in User CP.
Reaction score
62
You order it to stop 0 time after issuing the unload order... Maybe add a short, short Wait action between the unload order and the Stop, or simply remove the "Unit - Order PlayerCar[1] to Stop"? :)
 

death_knight

Dark is the heart of a corrupted man.
Reaction score
24
I didn't put 2 and 2 together and realise that. Thanks very much. I just added a short wait after the unload action.
 

GFreak45

I didnt slap you, i high 5'd your face.
Reaction score
130
just a thought here, take it or leave it, what if u added a trigger to make the mana drain faster per unit in the vehicle, like set it to drain 1/sec with 1 unit, 2 with 2 units, etc
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top