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

[Trigger] Locust Units Bah

Status
Not open for further replies.
Level 22
Joined
Jul 25, 2009
Messages
3,091
Locust units don't seem to accept move orders, even after they've been changed with Chaos... So when a unit spawns in my group system, the leader wanders to the rally-point completely alone and the other squad members don't follow, any ideas on a fix.

Train trigger.

  • Group Train units
    • Events
      • Unit - A unit Finishes training a unit
    • Conditions
    • Actions
      • Set GNumber = (GNumber + 1)
      • Set GLeader[GNumber] = (Trained unit)
      • Unit - Add GLeader to GLeader[GNumber]
      • Unit - Set the custom value of GLeader[GNumber] to GNumber
      • Set GroupRequirements[GNumber] = 5
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Point-value of (Unit-type of (Trained unit))) Not equal to 0
          • (Unit-type of (Trained unit)) Not equal to Chaos Sorcerer Coven
        • Then - Actions
        • Else - Actions
      • For each (Integer GInt) from 1 to ((Point-value of (Trained unit)) - 1), do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Triggering player) Food used) Equal to ((Triggering player) Food max)
            • Then - Actions
              • Set GPlayerGroup = (Player group((Triggering player)))
              • Game - Display to GPlayerGroup the text: You have reached yo...
              • Custom script: call DestroyForce(udg_GPlayerGroup)
              • Skip remaining actions
            • Else - Actions
              • Set GPoint[1] = (Position of (Trained unit))
              • Set GPoint[2] = (Rally-Point of (Triggering unit) as a point)
              • Set tempLoc2 = (GPoint[1] offset by 160.00 towards (72.00 x (Real(GInt))) degrees)
              • Unit - Create 1 Doombolt Dummy for (Owner of (Triggering unit)) at tempLoc2 facing (Facing of (Trained unit)) degrees
              • Unit - Add Locust Switcher to (Last created unit)
              • Custom script: call UnitAddAbility(GetLastCreatedUnit(),'Aloc')
              • Custom script: call UnitRemoveAbility(GetLastCreatedUnit(),'Aloc')
              • Unit - Set level of Locust Switcher for (Last created unit) to (Level of (Trained unit))
              • AI - Ignore (Last created unit)'s guard position
              • Unit - Set the custom value of (Last created unit) to GNumber
              • Unit - Order (Last created unit) to Stop
              • Unit - Order (Last created unit) to Move To GPoint[2]
              • Custom script: call DestroyGroup(udg_TempGroup)
              • Custom script: call RemoveLocation(udg_GPoint[1])
              • Custom script: call RemoveLocation(udg_GPoint[2])
Order trigger.

  • Group Order units order
    • Events
      • Unit - A unit Is issued an order with no target
      • Unit - A unit Is issued an order targeting an object
      • Unit - A unit Is issued an order targeting a point
    • Conditions
      • ((Ordered unit) is A structure) Equal to False
      • GLeader[(Custom value of (Ordered unit))] Equal to (Ordered unit)
      • (Custom value of (Ordered unit)) Not equal to 0
    • Actions
      • Trigger - Turn off (This trigger)
      • Set GGroup[1] = (Units in (Playable map area) matching (((Custom value of (Matching unit)) Equal to (Custom value of (Ordered unit))) and (((Matching unit) is A structure) Equal to False)))
      • Custom script: call GroupImmediateOrder( udg_GGroup[1], OrderId2String(GetIssuedOrderId()) )
      • Custom script: call GroupTargetOrder( udg_GGroup[1], OrderId2String(GetIssuedOrderId()), GetOrderTargetUnit() )
      • Custom script: call GroupTargetOrder( udg_GGroup[1], OrderId2String(GetIssuedOrderId()), GetOrderTargetDestructable() )
      • Custom script: call GroupTargetOrder( udg_GGroup[1], OrderId2String(GetIssuedOrderId()), GetOrderTargetItem() )
      • Set GPoint[1] = (Target point of issued order)
      • Custom script: call GroupPointOrderLoc( udg_GGroup[1], OrderId2String(GetIssuedOrderId()), udg_GPoint[1] )
      • Custom script: call RemoveLocation(udg_GPoint[1])
      • Custom script: call DestroyGroup(udg_GGroup[1])
      • Trigger - Turn on (This trigger)
 
Just so you know, in your second trigger, the group will only be ordered to do the last thing you ordered them to do.
Orders are not instant because there are often animations that need to be played.

This mean that removing all the order lines in that trigger and keeping this one:
Custom script: call GroupPointOrderLoc( udg_GGroup[1], OrderId2String(GetIssuedOrderId()), udg_GPoint[1] )
would leave you with the same results.

edit
  • Custom script: call UnitAddAbility(GetLastCreatedUnit(),'Aloc')
  • Custom script: call UnitRemoveAbility(GetLastCreatedUnit(),'Aloc')
Why are you removing the ability here directly after adding it? :eek:
I've never really seen this before, so I'm curious.
 
Level 22
Joined
Jul 25, 2009
Messages
3,091
Just so you know, in your second trigger, the group will only be ordered to do the last thing you ordered them to do.
Orders are not instant because there are often animations that need to be played.

This mean that removing all the order lines in that trigger and keeping this one:
Custom script: call GroupPointOrderLoc( udg_GGroup[1], OrderId2String(GetIssuedOrderId()), udg_GPoint[1] )
would leave you with the same results.

edit
  • Custom script: call UnitAddAbility(GetLastCreatedUnit(),'Aloc')
  • Custom script: call UnitRemoveAbility(GetLastCreatedUnit(),'Aloc')
Why are you removing the ability here directly after adding it? :eek:
I've never really seen this before, so I'm curious.


Ah good to know.

And I add and remove so create an effect where the units can move/operate like normal units, but cannot be selected.

The process is as follows, create a dummy, add locust, remove locust, add a Chaos to get your desired unit, done.

Problem is they won't go the rally-point whenever I order them to, I tried a bunch of different stuff nothing works. I figured it could just be that locust units can't be order by triggers, but the order command triggers work perfectly.
 
Level 22
Joined
Jul 25, 2009
Messages
3,091
Have you checked it with IssueUnitPointOrderById() of a random group unit?
If that works, maybe the group is the problem.

The problem is in the train trigger...

The problem is when a locust unit is produce/created/trained, it will not proceed to the rally-point of the trained unit. The trained unit is the leader, the locust units are squad members. The locust units accept the orders properly via the order trigger, but will not accept any orders in the train trigger.

I have 2 ideas, either the base unit the dummy, which I'm converting with Chaos, has no movement settings, and this is the problem, or a Wait has to be added.

Other than that idk, any ideas on how I can fix this?
 
Status
Not open for further replies.
Top