• 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] risk unit change

Status
Not open for further replies.
Level 11
Joined
Nov 12, 2006
Messages
765
I created a star wars risk map. however there is a consistent bug that occurs im stumped on how to fix. in the map, their is a city, a tower, a circle of power and usually a unit inside the circle of power. once u kill the unit the city and tower go to you. however sometimes the Unit A (attacking the guy in the circle) dies right as he is killing Unit B (the guy defending inside the circle). it seems that when this happens, the city and tower go to neutral. now when a unit goes into the circle of power its supposed to change ownership to you, but this doesn't happen when the tower and city are neutral.

example of ownership trigger designed for an empty COP:
  • Events
    • Unit - A unit enters Hoth Echo Base <gen>
  • Conditions
    • ((Units in Hoth Echo Base <gen> owned by (Owner of Hoth - Echo Base 0001 <gen>)) is empty) Equal to True
  • Actions
    • Unit - Change ownership of Hoth - Echo Base 0001 <gen> to (Owner of (Triggering unit)) and Change color
    • Unit - Change ownership of Laser Turret 0042 <gen> to (Owner of (Triggering unit)) and Change color
their is also these change ownership triggers designed for when a unit kills another
  • Events
    • Unit - A unit owned by Player 1 (Red) Dies
    • Unit - A unit owned by Player 2 (Blue) Dies
    • Unit - A unit owned by Player 3 (Teal) Dies
    • Unit - A unit owned by Player 4 (Purple) Dies
    • Unit - A unit owned by Player 5 (Yellow) Dies
    • Unit - A unit owned by Player 6 (Orange) Dies
    • Unit - A unit owned by Player 7 (Green) Dies
    • Unit - A unit owned by Player 8 (Pink) Dies
    • Unit - A unit owned by Player 9 (Gray) Dies
    • Unit - A unit owned by Player 10 (Light Blue) Dies
    • Unit - A unit owned by Player 11 (Dark Green) Dies
    • Unit - A unit owned by Player 12 (Brown) Dies
  • Actions
    • Unit - Change ownership of (Triggering unit) to Neutral Victim and Retain color
    • If (((Hoth Echo Base <gen> contains (Triggering unit)) Equal to True) and ((((Units in Hoth Echo Base <gen> owned by (Owner of Hoth - Echo Base 0001 <gen>)) is empty) Equal to True) and ((Unit-type of (Killing unit)) Not equal to Laser Turret))) then do (Unit - Move (Killing unit) instantly to (Center of Hoth Echo Base <gen>), facing Default building facing degrees) else do (Do nothing)
    • If (((Hoth Ion Cannon <gen> contains (Triggering unit)) Equal to True) and ((((Units in Hoth Ion Cannon <gen> owned by (Owner of Hoth - Ion Cannon 0003 <gen>)) is empty) Equal to True) and ((Unit-type of (Killing unit)) Not equal to Laser Turret))) then do (Unit - Move (Killing unit) instantly to (Center of Hoth Ion Cannon <gen>), facing Default building facing degrees) else do (Do nothing)
    • If (((Hoth Wampa Lair <gen> contains (Triggering unit)) Equal to True) and ((((Units in Hoth Wampa Lair <gen> owned by (Owner of Hoth - Wampa Lair 0005 <gen>)) is empty) Equal to True) and ((Unit-type of (Killing unit)) Not equal to Laser Turret))) then do (Unit - Move (Killing unit) instantly to (Center of Hoth Wampa Lair <gen>), facing Default building facing degrees) else do (Do nothing)
    • If (((Hoth North Ridge <gen> contains (Triggering unit)) Equal to True) and ((((Units in Hoth North Ridge <gen> owned by (Owner of Hoth - North Ridge 0006 <gen>)) is empty) Equal to True) and ((Unit-type of (Killing unit)) Not equal to Laser Turret))) then do (Unit - Move (Killing unit) instantly to (Center of Hoth North Ridge <gen>), facing Default building facing degrees) else do (Do nothing)
etc etc



to try and correct this issue - i manufactured this situation with some triggers in place, so that every 7 seconds any neutral hostile/passive/victim/extra would instantly change ownership to brown (which is an empty slot), hoping that maybe if its not one of the neutrals the ownership change trigger would work. well it didn't.

so if anyone has any ideas on how to create a (short?) system so that when a unit leaves the circle of power, it will definitely control it if their are no other players in the region. thanks!
 
Level 5
Joined
Jul 25, 2008
Messages
126
Do you have any other triggers, because those both seem fine except for the 2nd

one where it says change triggering unit to neutral victim, The unit can't

change ownership if its dead.


Maybe you have a trigger so when like a long ranged attacked such as a

riflemen killed the unit in circle it goes to circle instantly which would for a

temporary time change control of the tower and base to neutral and your guy

would be stuck in it, if you did indeed have one of those triggers.
 
Level 11
Joined
Nov 12, 2006
Messages
765
the other trigger that i have is this, which is made to always keep a guard unit inside.

  • Events
    • Unit - A unit leaves Hoth Echo Base <gen>
  • Conditions
    • (Number of units in (Units in Hoth Echo Base <gen> matching ((((Matching unit) is A structure) Equal to False) and (((Matching unit) is alive) Equal to True)))) Less than or equal to 0
  • Actions
    • Unit - Move (Triggering unit) instantly to (Center of Hoth Echo Base <gen>)
edit: this trigger does work properly. except that even if the only unit inside is the unit, and it leaves it is forced to re-enter the region. when this happens control of the city/tower should be given to the unit, but its not.

and im not sure why the ownership change to neutral victim is in there. these arrant my triggers, i borrowed them from non protected maps. ill take that out and see what happens.
 
Level 5
Joined
Jul 25, 2008
Messages
126
Not sure if this had anything to do with the problem

but that trigger condition doesn't look like it works should you change it to

number of unit in region owned by player owner of unit Hoth echo base? Cause

how can there be no units in the region if your event is a unit enters a region?
 
Level 11
Joined
Nov 12, 2006
Messages
765
haha nope. although in the second trigger i posted here where the "unit changed ownership to neutral victim" i wonder what would happen if i changed it so something like "owner of killing unit". *shrug* we will see.

edit: because i dont really understand that trigger. i tried taking it out but when i did that whole line of triggering diddnt work and you couldnt capture bases.
 
Status
Not open for further replies.
Top