triggering "units being built"

jig7c

Stop reading me...-statement
Reaction score
123
i have a map, obviously, and in my map, you start off with a worker unit...the worker unit trains/makes another units/buildings..

player 1,2,3,4,5 and player 11 are allies, with player 11 being computer
player 6,7,8,9,10 and player 12 are allies with player 12 being computer

when the player 1,2,3,4,5's worker finishes construction on the buildings, the buildings becomes player 11's.. and this is fine.. but the units part don't work well...

i need the same thing to happen to the units that were built for both teams
right now the players control the units, i don't want that, i want the player 11 and player 12 to control their respective units...

i currently have (free-hand):

Trigger:
  • robot
    • events
      • a unit finishes training a unit
    • conditions
      • unit-type of trained unit equal to robot
    • actions
      • change ownership of last created unit to player 11
      • set point = center of enemy base
      • order last created unit to move to point
      • point being removed...


see for structures, it is
events
a unit finishes construction
conditions...

i know the actions are working fine, because the way my map was setup before it worked, now i changed few things, to make things better, and now it doesn't work..

so my question to you is.. what goes in the event that applies to units being built
i tried finishes construction, finishes training... it doesn't work..
 

DragonBlade

Member
Reaction score
0
try this

Trigger:
  • Untitled Trigger 001
    • Events
      • Unit - A unit enters ally base <gen>
    • Conditions
      • (Unit-type of (Triggering unit)) Equal to robot
    • Actions
      • Unit Group - Pick every unit in (Units in ally base <gen> matching ((Unit-type of (Triggering unit)) Equal to Rifleman)) and do (Actions)
        • Loop - Actions
          • Unit - Order (Picked unit) to Attack-Move To (Center of Noob Zone <gen>)
          • Unit - Change ownership of (Picked unit) to Player 11 (Dark Green) and Retain color
 

Goliath520

New Member
Reaction score
0
I just tried it out and this seems to work:

Trigger:
  • Untitled Trigger 001
    • Events
      • Unit - A unit Finishes training a unit
    • Conditions
      • (Unit-type of (Trained unit)) Equal to Footman
    • Actions
      • Unit - Change ownership of (Trained unit) to Player 11 (Dark Green) and Change color


I think since you are using trained, triggering and created unit is throwing off your triggers. I think your trigger should be:

Trigger:
  • Events
    • Unit - A unit Finishes training a unit
    • Conditions
      • (Unit-type of (Trained unit)) Equal to robot
    • Actions
      • Unit - Change ownership of (Trained unit) to Player 11 (Dark Green) and Change color
      • set point = center of enemy base
      • order last Trained unit to move to point
      • point being removed...


see if that works
 

jig7c

Stop reading me...-statement
Reaction score
123
hmm, i'll try that..
i been using last created unit..

edit: no it doesn't work..
here is the trigger...

Trigger:
  • Robot4T1
    • Events
      • Unit - A unit owned by Player 1 (Red) Finishes training a unit
      • Unit - A unit owned by Player 2 (Blue) Finishes training a unit
      • Unit - A unit owned by Player 3 (Teal) Finishes training a unit
      • Unit - A unit owned by Player 4 (Purple) Finishes training a unit
      • Unit - A unit owned by Player 5 (Yellow) Finishes training a unit
    • Conditions
      • (Unit-type of (Trained unit)) Equal to Robot
    • Actions
      • Unit - Change ownership of (Trained unit) to Player 11 (Dark Green) and Retain color
      • Set Point = (Position of Palace 0002 <gen>)
      • Unit - Order (Trained unit) to Attack-Move To Point
      • Custom script: call RemoveLocation (udg_Point)


the way it is setup in the unit editor is, in the worker unit,
under Techtree - Structure Built - Robot
Robot is another unit, not a building or a tower or anything like that..
when in game, the unit is made like how a structure is made.. but when finished, the unit doesn't do the action part of the trigger and just stands there and the player gets to controls it...
 
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