k is an integer variable you declare to do 3 things: store the hero's kills before the event, increment the number and finally reset the hero's kill count to this number after the event. Cycling k is equivalent to k = k + 1.
This will work for kills, I have no idea about experience.
Load
Event: Any unit loads cargo
Condition: Owner of triggring unit=player0
Condition: Or bracket with "type of triggering unit=" for each mount you have
Action: Change ownership of triggering unit to (owner of triggering freight unit)
Unload:
Event: Any unit unloads cargo
Condition: Number of alive units in (cargo units in triggering unit) =0
Condition: Or bracket with "type of triggering unit=" for each mount you have
Action: Change ownership of triggering unit to player 0
This check:
Condition: Or bracket with "type of triggering unit=" for each mount you have
Would be better if it were "Unit has ability" and you specify the driver seat ability unique to all your vehicles. Then you won't have to modify this trigger if you implement a new vehicle.
Figured it out, and I can shave an entire trigger off your setup: If you change the Target Filter to "Neutral" instead of Ally, you can leave the vehicle player neutral and this will work as well, which doesn't require an "alliances" trigger to initialize.
@ShadowDancer93, you should find trigger conditions for "unit is killed" - use this condition and actions for "modify unit property" like this:
Event - Any unit is killed
Variable - k = Unit Kills (Cargo Unit in (Killing Unit) in slot 1)
Condition - Comparison (Unit has ability - Killing Unit has <YOUR DRIVER SEAT ABILITY HERE>)
Actions - Cycle k from 1 to 1000000000
Set Unit Property: Killing Unit, kills, 0
Set Unit Property: Cargo Unit in Killing Unit in slot 1, kills, k
I've been working on this vehicle trigger thing for a bit, I haven't tried yours but I have a question.. How does a unit load cargo it doesn't control? How do you ask a vehicle owned by a neutral party to load your unit, beginning this trigger?
In mine, I have the trigger occur when a unit enters within 1.0 distance of the vehicle, and have the vehicle react by changing factions and loading the hero. however I run into trouble trying to set this up for many vehicles at once (without having to define a trigger for each)
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
k is an integer variable you declare to do 3 things: store the hero's kills before the event, increment the number and finally reset the hero's kill count to this number after the event. Cycling k is equivalent to k = k + 1.
This will work for kills, I have no idea about experience.
You can make any player neutral by changing their "control" under Player Properties
This check: Condition: Or bracket with "type of triggering unit=" for each mount you have
Would be better if it were "Unit has ability" and you specify the driver seat ability unique to all your vehicles. Then you won't have to modify this trigger if you implement a new vehicle.
Figured it out, and I can shave an entire trigger off your setup: If you change the Target Filter to "Neutral" instead of Ally, you can leave the vehicle player neutral and this will work as well, which doesn't require an "alliances" trigger to initialize.
@ShadowDancer93, you should find trigger conditions for "unit is killed" - use this condition and actions for "modify unit property" like this:
Event - Any unit is killed
Variable - k = Unit Kills (Cargo Unit in (Killing Unit) in slot 1)
Condition - Comparison (Unit has ability - Killing Unit has <YOUR DRIVER SEAT ABILITY HERE>)
Actions - Cycle k from 1 to 1000000000 Set Unit Property: Killing Unit, kills, 0 Set Unit Property: Cargo Unit in Killing Unit in slot 1, kills, k
I've been working on this vehicle trigger thing for a bit, I haven't tried yours but I have a question.. How does a unit load cargo it doesn't control? How do you ask a vehicle owned by a neutral party to load your unit, beginning this trigger?
In mine, I have the trigger occur when a unit enters within 1.0 distance of the vehicle, and have the vehicle react by changing factions and loading the hero. however I run into trouble trying to set this up for many vehicles at once (without having to define a trigger for each)