• 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] Issue with Loading

Status
Not open for further replies.
Level 12
Joined
Apr 16, 2007
Messages
262
Hey Guys :wink:

I'm making an advanced load and cargo hold system for all the siege weapons in my map. First off, I made it impossible for a siege unit to do anything without having three of the right units in it.

Second, I made a trigger that ejects all the units from the Siege weapon if you load the wrong type of unit in it (has to be an engineer)....

And lastly i made a trigger that prevents the siege weapon from attacking unless it has more than 1 mana (loses 1 mana per attack...)

Now the problem is, I gave my engineer units a special ability called "man siege weapon" so they can theoretically "steal" an empty siege weapon owned by another player. It can also be used to load the unit into one of your siege weapons.

When I cast this ability (based off channel with no effects) on one of my siege weapons, the caster goes to it and nothing happens. When I order one of my siege weapons to LOAD one of my Engineers, it tells me "cannot load target"...

I can only imagine that it cannot load the target because I made a trigger order the unit to "stop" every 0.01 secs of the game so it cannot move or carry out any orders....

I really need help with this, I'll rep anyone who can help me :D
There are several triggers for this, so It may take up some page space XD

:fp: Engineer "Steal" or "use" siege engine

  • Steal or man
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Man Siege Engine
      • (Unit-type of (Triggering unit)) Equal to Engineer
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Owner of (Target unit of ability being cast)) Equal to (Owner of (Triggering unit))
        • Then - Actions
          • Unit - Order (Triggering unit) to Force Board (Target unit of ability being cast)
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Owner of (Target unit of ability being cast)) Not equal to (Owner of (Triggering unit))
              • (Custom value of (Target unit of ability being cast)) Equal to 0
            • Then - Actions
              • Unit - Change ownership of (Target unit of ability being cast) to (Owner of (Triggering unit)) and Change color
              • Unit - Order (Triggering unit) to Force Board (Target unit of ability being cast)
            • Else - Actions
:fp: Siege Weapon - Prevent orders 1

  • prevent attack if not enough engineers CATAPULT
    • Events
      • Unit - A unit Is issued an order targeting an object
    • Conditions
      • (Unit-type of (Ordered unit)) Equal to Catapult
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Custom value of (Ordered unit)) Less than 3
          • (Issued order) Not equal to (Order(load))
        • Then - Actions
          • Unit Group - Add (Ordered unit) to unusable_siege_engines
          • Player Group - Add (Owner of (Ordered unit)) to ranged_message[1]
          • Player Group - Pick every player in ranged_message[1] and do (Game - Display to ranged_message[1] for 10.00 seconds the text: This Siege Engine n...)
          • Player Group - Remove all players from ranged_message[1]
        • Else - Actions
          • Unit Group - Remove (Ordered unit) from unusable_siege_engines
:fp: Siege Weapon - Prevent Orders 2

  • prevent move if not enough engineers CATAPULT Copy
    • Events
      • Unit - A unit Is issued an order targeting a point
    • Conditions
      • (Unit-type of (Ordered unit)) Equal to Catapult
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Custom value of (Ordered unit)) Less than 3
          • (Issued order) Not equal to (Order(unload))
        • Then - Actions
          • Unit Group - Add (Ordered unit) to unusable_siege_engines
          • Player Group - Add (Owner of (Ordered unit)) to ranged_message[1]
          • Player Group - Pick every player in ranged_message[1] and do (Game - Display to ranged_message[1] for 10.00 seconds the text: This Siege Engine n...)
          • Player Group - Remove all players from ranged_message[1]
        • Else - Actions
          • Unit Group - Remove (Ordered unit) from unusable_siege_engines

:fp: Siege Weapon - Prevent Orders 3

  • prevent group move
    • Events
      • Time - Every 0.01 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in unusable_siege_engines and do (Unit - Order (Picked unit) to Stop)
:fp: Siege Weapon - Custom Value (number of engineers in cargo)

  • add to custom value
    • Events
      • Unit - A unit Is loaded into a transport
    • Conditions
      • (Unit-type of (Transporting unit)) Equal to Catapult
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Unit-type of (Loading unit)) Equal to Engineer
        • Then - Actions
          • Unit - Set the custom value of (Transporting unit) to ((Custom value of (Transporting unit)) + 1)
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Unit-type of (Loading unit)) Not equal to Engineer
            • Then - Actions
              • Unit - Order (Transporting unit) to Unload All At (Position of (Transporting unit))
            • Else - Actions

Thank You very much and Sorry about the length of this post, its just soo many triggers....

:pal: Hellblazer-14 :pal:
 
Level 35
Joined
Oct 9, 2006
Messages
6,394
Well I might have overlooked it, but in order for a unit in wc3 to load a unit they need to be owned by the same player or the laoding unit and the units being loaded need to share units. So if you havent done so you will need to change the owner of the siege weapon just before loading it or unloading it.

btw: If that aint working I propably jsut misread you trigger and then do correct me, and I try giving an other solution.
 
Level 2
Joined
Jun 10, 2006
Messages
4
If you give the catapults a form of the Cargo Hold (Orc Burrow) and Battle Stations abilities that will prevent them from attacking. Then make trigger like this:
  • Trigger
  • Events
    • Unit - A unit is loaded into a transport
  • Conditions
    • (Unit-type of (Transporting unit)) Equal to Siege Thingy
  • Actions
    • Unit - Set the custom value of (Transporing unit) to ((Custom value of (Transporting unit)) + 1)
Then make the man siege engine ability into a control siege engine ability, then check if the units value is 0 and change control like you do now.
 
Level 12
Joined
Apr 16, 2007
Messages
262
Ok, thanks... but the thing is, I've got it all working...
My catapult has the Orc Burrow ability, and the trigger to prevent it from attacking or moving works fine.

Its just that the catapult won't load any units at all... And I have no idea why.
And thanks red baron, Yeah, the owner would be the same at all times, unless the engineer is stealing the siege weapon, where a trigger actually changes the owner of the targeted unit. So that is ok...
 
Status
Not open for further replies.
Top