• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

[Trigger] Conflicting triggers (maybe variable)

Status
Not open for further replies.
Level 11
Joined
Oct 9, 2015
Messages
721
Hey everyone, it's me (again), I'm having a problem with what seems to be a conflicting trigger or variable (real array)

I have these two triggers:

  • Interacting
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Interact
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (((Region centered at (Position of Unit[(Player number of (Owner of (Triggering unit)))]) with size (100.00, 100.00)) offset by (0.00, 0.00)) contains (Position of UnitHorse[(Player number of (Owner of (Triggering unit)))])) Equal to True
          • Mounted[(Player number of (Owner of (Triggering unit)))] Equal to False
        • Then - Actions
          • Unit - Move UnitHorse[(Player number of (Owner of (Picked unit)))] instantly to (Position of Unit[(Player number of (Owner of (Picked unit)))]), facing (Facing of Unit[(Player number of (Owner of (Picked unit)))]) degrees
          • Set Mounted[(Player number of (Owner of (Triggering unit)))] = True
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Region 020 <gen> contains (Triggering unit)) Equal to True
          • Mounted[(Player number of (Owner of (Triggering unit)))] Equal to False
        • Then - Actions
          • Unit - Create 1 Riderless Horse for (Owner of (Triggering unit)) at (Position of (Triggering unit)) facing (Facing of (Triggering unit)) degrees
          • Set UnitHorse[(Player number of (Owner of (Triggering unit)))] = (Last created unit)
          • Set Mounted[(Player number of (Owner of (Triggering unit)))] = True
        • Else - Actions
AND

  • Interacting2
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Region 020 <gen> contains (Triggering unit)) Equal to False
      • (Ability being cast) Equal to Interact
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Mounted[(Player number of (Owner of (Triggering unit)))] Equal to True
        • Then - Actions
          • Set Mounted[(Player number of (Owner of (Triggering unit)))] = False
          • Animation - Reset UnitHorse[(Player number of (Owner of (Triggering unit)))]'s animation
        • Else - Actions

I also have this trigger, that checks if "Real:Mounted" for player is True then do actions:


  • movendo montaria
    • Events
      • Time - Every 0.01 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in (Units in (Playable map area)) and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Mounted[(Player number of (Owner of (Picked unit)))] Equal to True
            • Then - Actions
              • Unit - Move UnitHorse[(Player number of (Owner of (Picked unit)))] instantly to (Position of Unit[(Player number of (Owner of (Picked unit)))]), facing (Facing of Unit[(Player number of (Owner of (Picked unit)))]) degrees
            • Else - Actions
And it seems like the variable (Real: Mounted equal to True) are conflicting with each other's trigger.

Can anyone point a solution for this mess?

Thanks again Hive!
 
Last edited:
Level 8
Joined
Jan 28, 2016
Messages
486
Hi Streetpunk!

I had a look over your triggers and there doesn't seem to be a problem with your "Mounted" variable, though there are numerous leaks but I'm assuming this is a work-in-progress. Can you tell us what's meant to happen and what's actually happening with respect to the "Mounted" variable?

Pseudo-code
As for the spell, from what I can tell from your triggers is that you have a certain region (let's call it a 'Stable') where you can get a unit (let's call it a 'horse') to ride.
  • If you don't have an existing horse and you're in the Stable, get a new horse and "mount" it.
  • If you're not on your horse but it's nearby, then "mount" it.
  • If you are on your horse and in the Stable, then "dismount" it.
And the periodic trigger is to move the horse with you. If you could clarify this, then I might have a solution for you.
 
Level 11
Joined
Oct 9, 2015
Messages
721
you're right, except It's meant to mount/dismount even if it's not in the stable, however it's only mounting in stable and dismouting, but not mounting back, I figured out that maybe it's not mounting back because Mounted is set to false in the Interacting2 trigger. Plus can you point out the leaks, please?
 
1st trigger:

Why you create a region/rect in runtime to check if horse is close?
If you only want to check distance, then a real comparison the way to go.

Inside the first actions you use "Picked Unit", which should be "Triggering Unit".

And you wanna create each time a new horse? The old one might be moved instead. :)

Periodic trigger:

Only loop though your Hero units, not trhough every unit on map.

----

Please use a integer variable to store Player number of (Owner of (Triggering unit))) to increase readability.

Mind to work on mentioned things and then post the reworked trigger again if you still need help? :)
 
Level 11
Joined
Oct 9, 2015
Messages
721
Sure, I'm working on it atm,

1st trigger corrected:
  • interactions
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Interact
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Distance between (Position of (Triggering unit)) and (Position of UnitHorse[(Player number of (Owner of (Triggering unit)))])) Less than or equal to 100.00
          • Mounted[(Player number of (Owner of (Triggering unit)))] Equal to False
        • Then - Actions
          • Unit - Move UnitHorse[(Player number of (Owner of (Triggering unit)))] instantly to (Position of Unit[(Player number of (Owner of (Triggering unit)))]), facing (Facing of Unit[(Player number of (Owner of (Triggering unit)))]) degrees
          • Set Mounted[(Player number of (Owner of (Triggering unit)))] = True
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Region 020 <gen> contains (Triggering unit)) Equal to True
          • Mounted[(Player number of (Owner of (Triggering unit)))] Equal to False
        • Then - Actions
          • Unit - Create 1 Riderless Horse for (Owner of (Triggering unit)) at (Position of (Triggering unit)) facing (Facing of (Triggering unit)) degrees
          • Set UnitHorse[(Player number of (Owner of (Triggering unit)))] = (Last created unit)
          • Set Mounted[(Player number of (Owner of (Triggering unit)))] = True
        • Else - Actions
about creating a new horse: how can I check if the player already have an horse so I can move it instead of creating a new one ?

Periodic Trigger:
i didn't post on the periodic trigger but I have a condition to pick only units from type of hero of player.

about using integer variables to store player number I don't know if I know how to do it correctly.

What I want to do is: When a unit uses the interact ability in the stable, it gets a horse that is moved to it's position every 0.01 seconds and it's Mounted real is set to true, then if it uses the interact ability again it would go out of the horse, and if used AGAIN near the horse it gets back to the horse. Everything is working fine, except getting back to the horse.

Thanks for the advices and the fast answers! Can you point any more flaws or any solutions for me, please?
 
Level 8
Joined
Jan 28, 2016
Messages
486
you're right, except It's meant to mount/dismount even if it's not in the stable, however it's only mounting in stable and dismouting, but not mounting back, I figured out that maybe it's not mounting back because Mounted is set to false in the Interacting2 trigger. Plus can you point out the leaks, please?

Okay so I eventually managed to make the Interacting trigger work combined but I didn't test it with the periodic trigger. I also went along and fixed the leaks though I'm still unsure if <Owner of (TriggeringUnit)> leaks a player handle. You can check these guides out to familiarise yourself with common leaks: Complete list of things that leak and Things That Leak.

  • Interacting Edit
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Interact
    • Actions
      • Set SP_UnitRider = (Triggering unit)
      • Set PlayerID = (Player number of (Owner of SP_UnitRider))
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • SP_Mounted[PlayerID] Equal to False
        • Then - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • SP_UnitHorse[PlayerID] Not equal to No unit
            • Then - Actions
              • Set SP_Loc1 = (Position of SP_UnitRider)
              • Set SP_Loc2 = (Position of SP_UnitHorse[PlayerID])
              • Set SP_Distance = (Distance between SP_Loc1 and SP_Loc2)
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • SP_Distance Less than or equal to 400.00
                • Then - Actions
                  • Set SP_Mounted[PlayerID] = True
                  • Unit - Move SP_UnitHorse[PlayerID] instantly to SP_Loc1, facing (Facing of SP_UnitRider) degrees
                • Else - Actions
              • Custom script: call RemoveLocation(udg_SP_Loc1)
              • Custom script: call RemoveLocation(udg_SP_Loc2)
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Stable <gen> contains SP_UnitRider) Equal to True
                • Then - Actions
                  • Set SP_Mounted[PlayerID] = True
                  • Set SP_Loc1 = (Position of SP_UnitRider)
                  • Unit - Create 1 Riderless Horse for (Owner of SP_UnitRider) at SP_Loc1 facing (Facing of SP_UnitRider) degrees
                  • Set SP_UnitHorse[PlayerID] = (Last created unit)
                  • Custom script: call RemoveLocation(udg_SP_Loc1)
                • Else - Actions
                  • Custom script: call BJDebugMsg("no existing horse; not in stable")
        • Else - Actions
          • Set SP_Mounted[PlayerID] = False
      • Set SP_UnitRider = No unit
If you want, I can upload the test map.
 
Level 11
Joined
Oct 9, 2015
Messages
721
I could't make your trigger work, Dehua :( could you test it with the periodic trigger for me aswell? that would be really nice and I would be very thankfull, you see I do what I can with all I know, what I don't know I come on the hive to ask :)

KILLCIDE:
I'm trying to make a mount/dismount system but not like the hippogryph, I'm making the mount and the rider two separated units that interact with each other
 
Level 11
Joined
Oct 9, 2015
Messages
721
I'm trying to make a video but filesize is getting too big :(

When the hero approaches an horse and uses the Interact ability, then the (real)Mounted for the player is set to true, and if mounted is set to true then every 0.01 seconds the horse will be moved to the hero's position, then if he uses interact again while mounted, he dismounts and (real)Mounted is set to false for player, and if it is false then the horse will stop moving to the hero's location at every 0.01 seconds.

here's the video:

https://youtu.be/3zXGQoirkdc
 
Last edited:
Level 37
Joined
Jul 22, 2015
Messages
3,485
That's an extremely easy trigger to make. I recommend using the custom value of a unit (unit indexer) vs the player number of the owner since the latter limits this spell to only work once per player instead of per unit with the unit indexer.

It's really late where I am right now, so I can't provide the triggers for you. When I get home tomorrow and I see that the problem isn't solved yet, I'll give you an example.
 
Level 8
Joined
Jan 28, 2016
Messages
486
I could't make your trigger work, Dehua :( could you test it with the periodic trigger for me aswell? that would be really nice and I would be very thankfull, you see I do what I can with all I know, what I don't know I come on the hive to ask :)

So I was adding the periodic trigger and realised that you have a unit variable array called "Unit" at this point; "...instantly to (Position of Unit[(Player number..." so I made a work-around for the moment. I also realised that when mounted, the two units would glitch even though I turned off the horse's collision (it's complicated).

In the meantime, I've made a quick fix to make it work. For the triggers, you should probably use indexing later on to make this all work properly. For the collision problem, I changed it so its flying instead but it still comes out a bit weird; I could fix it but it's gonna take a while.

Also I'm about to have dinner :p

P.S.: The video didn't work for me, I'll try again later.
 

Attachments

  • [Demo] Impacting.w3x
    11.7 KB · Views: 58
Level 11
Joined
Oct 9, 2015
Messages
721
Your triggers are working just fine, thank you very much, it was really appreciated!

Can I do one last request if it's not going to upset you can you addapt this trigger to the other ones?

  • Mount Animation
    • Events
      • Time - Every 0.50 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in (Units in (Playable map area)) and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Or - Any (Conditions) are true
                • Conditions
                  • (Unit-type of (Picked unit)) Equal to Human(unit)
              • Mounted[(Player number of (Owner of (Picked unit)))] Equal to True
            • Then - Actions
              • For each (Integer A) from 1 to 10, do (Actions)
                • Loop - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • IsRunning[(Player number of (Owner of (Picked unit)))] Equal to True
                    • Then - Actions
                      • Custom script: call SetUnitAnimationByIndex(udg_UnitHorse[GetConvertedPlayerId(GetOwningPlayer(GetEnumUnit()))], 9)
                    • Else - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • IsRunning[(Player number of (Owner of (Picked unit)))] Equal to False
                    • Then - Actions
                      • Animation - Queue UnitHorse[(Player number of (Owner of (Picked unit)))]'s stand animation
                    • Else - Actions
            • Else - Actions
IsRunning is the function I use to check if the hero is moving or not.
This trigger is used to change the horse's animation to Walk if IsRunning for player is true and to quee Stand animation if IsRunning for player is false. By the way I don't know if Queeing animation is the best way to make it play the stand animation and if For each 1 to 10 is the best way to execute it.

Thanks in advice, your help is much appreciated!
 
Level 8
Joined
Jan 28, 2016
Messages
486
Alright I tried adding your Mount Animation trigger but when it came to setting the animations, I couldn't get it to work properly (WC3 visuals aren't my forté) so I left it out. If you have JNPG, then Bribe's IsUnitMoving system might help create the animations you're after. In that same trigger, you had some unit variable called "Human(unit)" in the ITE conditions which I also left out because I assumed that was meant to be the horse variable.

Actually just on your Mount Animation trigger, you didn't need the loop because it never used Integer A to loop through anything. And the two ITE statements within it could've been merged together as booleans are either true or false. So when you check if <bool> is true, then do <this>, else do <that>. Okay that probably isn't as clear as I thought it was so just have a look at the hidden trigger, hopefully that makes more sense. Not trying to sound like a rich snob; just wanted to give you some coding advice. :D

  • Booleans and stuff
    • Events
    • Conditions
    • Actions
      • Set PlayerID = (Player number of (Owner of (Triggering unit)))
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • IsRunning[PlayerID] Equal to True
        • Then - Actions
          • Custom script: call SetUnitAnimationByIndex(udg_UnitHorse[udg_PlayerID], 9)
        • Else - Actions
          • Animation - Queue UnitHorse[PlayerID]'s stand animation
Thought I had a solution to this whole thing which could make it somewhat simpler but if it's MPI then it won't make a difference. I fixed the horse's weird movement when mounted thanks to this recent thread. I also jazzed up the scenery 'coz I got bored with triggering and replaced the attack-your-own-horse-to-instantly-kill-it thing with Finger of Death!
 

Attachments

  • [Demo] Impacting v2.0.w3x
    17.4 KB · Views: 55
Last edited:
Level 11
Joined
Oct 9, 2015
Messages
721
Somehow the animations still don't work, the horse keeps with the "stand" animation even when it is moving. I use an keyboard arrow movment system that sets [IsMoving] variable when the player is moving, so I don't know if it would work with Bribe's system, however if I had better knowledge in JASS I would certainly try it. The Human(unit) variable is meant for the rider of the mount. I saw you described the "two abilities" thing in the triggers comment, I had tought about the "using two different abilities" solutions before and maybe it was what was the solution for the whole thing from the start. I managed to make an improved version of the original triggers by myself and it seemed to work, however your solutions seemed to be a lot better, plus there's the leaks thing that seem to infest many of my triggers haha I just wanted to thank you guys for all the help you're offering me and for the effort trying to point me in the right direction. I'll post the triggers I made later and a video of how it is working so you guys could have a better point of view of this situation.

PS: this is the OLD (non working) version video, the one Dehua said it wasn't opening, try it now:
https://www.youtube.com/watch?v=3zXGQoirkdc

PS2: I'll post the video and triggers of the "work-arround" I've made but Dehua's solutions seemed a lot better than them!
 
Level 8
Joined
Jan 28, 2016
Messages
486
You don't need JNGP if you use my GUI version of IsUnitMoving.

I had seen it before and was convinced that it was meant to be in GUI but all I could find was the Jass version that I posted.
Should the two threads be merged and offer both versions? After all, they are both called IsUnitMoving and provide the same thing but in different ways.

Somehow the animations still don't work, the horse keeps with the "stand" animation even when it is moving. I use an keyboard arrow movment system that sets [IsMoving] variable when the player is moving, so I don't know if it would work with Bribe's system, however if I had better knowledge in JASS I would certainly try it. The Human(unit) variable is meant for the rider of the mount. I saw you described the "two abilities" thing in the triggers comment, I had tought about the "using two different abilities" solutions before and maybe it was what was the solution for the whole thing from the start. I managed to make an improved version of the original triggers by myself and it seemed to work, however your solutions seemed to be a lot better, plus there's the leaks thing that seem to infest many of my triggers haha I just wanted to thank you guys for all the help you're offering me and for the effort trying to point me in the right direction. I'll post the triggers I made later and a video of how it is working so you guys could have a better point of view of this situation.

PS: this is the OLD (non working) version video, the one Dehua said it wasn't opening, try it now:
https://www.youtube.com/watch?v=3zXGQoirkdc

PS2: I'll post the video and triggers of the "work-arround" I've made but Dehua's solutions seemed a lot better than them!

Yeah I kept getting the same results with the animations as you described. I managed to have the horse running at one stage but couldn't make it stop which was a headache to say the least. Then I remembered Bribe's IsUnitMoving system and thought it would help except I posted the Jass version of the system! The video still doesn't work; it keeps trying to load but never does. It's okay though I've got a good idea of what your experiencing with animations. :p


I can help out a bit further but before I do I need to ask:
Is this thread considered off-topic at this point?
If so, I'll post my answer to the original problem and continue this in private with StreetPunk.
 
Level 8
Joined
Jan 28, 2016
Messages
486
Okay let's wrap this up!

Hey everyone, it's me (again), I'm having a problem with what seems to be a conflicting trigger or variable (real array)

I have these two triggers:

  • Interacting
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Interact
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (((Region centered at (Position of Unit[(Player number of (Owner of (Triggering unit)))]) with size (100.00, 100.00)) offset by (0.00, 0.00)) contains (Position of UnitHorse[(Player number of (Owner of (Triggering unit)))])) Equal to True
          • Mounted[(Player number of (Owner of (Triggering unit)))] Equal to False
        • Then - Actions
          • Unit - Move UnitHorse[(Player number of (Owner of (Picked unit)))] instantly to (Position of Unit[(Player number of (Owner of (Picked unit)))]), facing (Facing of Unit[(Player number of (Owner of (Picked unit)))]) degrees
          • Set Mounted[(Player number of (Owner of (Triggering unit)))] = True
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Region 020 <gen> contains (Triggering unit)) Equal to True
          • Mounted[(Player number of (Owner of (Triggering unit)))] Equal to False
        • Then - Actions
          • Unit - Create 1 Riderless Horse for (Owner of (Triggering unit)) at (Position of (Triggering unit)) facing (Facing of (Triggering unit)) degrees
          • Set UnitHorse[(Player number of (Owner of (Triggering unit)))] = (Last created unit)
          • Set Mounted[(Player number of (Owner of (Triggering unit)))] = True
        • Else - Actions
AND

  • Interacting2
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Region 020 <gen> contains (Triggering unit)) Equal to False
      • (Ability being cast) Equal to Interact
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Mounted[(Player number of (Owner of (Triggering unit)))] Equal to True
        • Then - Actions
          • Set Mounted[(Player number of (Owner of (Triggering unit)))] = False
          • Animation - Reset UnitHorse[(Player number of (Owner of (Triggering unit)))]'s animation
        • Else - Actions

I also have this trigger, that checks if "Real:Mounted" for player is True then do actions:


  • movendo montaria
    • Events
      • Time - Every 0.01 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in (Units in (Playable map area)) and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Mounted[(Player number of (Owner of (Picked unit)))] Equal to True
            • Then - Actions
              • Unit - Move UnitHorse[(Player number of (Owner of (Picked unit)))] instantly to (Position of Unit[(Player number of (Owner of (Picked unit)))]), facing (Facing of Unit[(Player number of (Owner of (Picked unit)))]) degrees
            • Else - Actions
And it seems like the variable (Real: Mounted equal to True) are conflicting with each other's trigger.

Can anyone point a solution for this mess?

Thanks again Hive!
Basically there was no conflicting triggers or variables initially; the logic was simply in the wrong order. I merged the two 'Interacting' triggers together as Nichilus suggested and cleared all the leaks (hopefully). I also went over the periodic trigger and added another for when the 'horse' dies. The triggers can be improved further, but ya know...

  • Interacting
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Interact
    • Actions
      • Set PlayerOwner = (Owner of (Triggering unit))
      • Set PlayerID = (Player number of PlayerOwner)
      • Set UnitRider[PlayerID] = (Triggering unit)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • IsMounted[PlayerID] Equal to False
        • Then - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • UnitHorse[PlayerID] Not equal to No unit
            • Then - Actions
              • Set Loc1 = (Position of UnitRider[PlayerID])
              • Set Loc2 = (Position of UnitHorse[PlayerID])
              • Set Dist = (Distance between Loc1 and Loc2)
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • Dist Less than or equal to 400.00
                • Then - Actions
                  • Set IsMounted[PlayerID] = True
                  • Unit Group - Add UnitHorse[PlayerID] to MountedGroup
                  • Unit - Move UnitHorse[PlayerID] instantly to Loc1, facing (Facing of UnitRider[PlayerID]) degrees
                • Else - Actions
              • Custom script: call RemoveLocation(udg_Loc1)
              • Custom script: call RemoveLocation(udg_Loc2)
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Stable <gen> contains UnitRider[PlayerID]) Equal to True
                • Then - Actions
                  • Set IsMounted[PlayerID] = True
                  • Set Loc1 = (Position of UnitRider[PlayerID])
                  • Unit - Create 1 Riderless Horse for PlayerOwner at Loc1 facing (Facing of UnitRider[PlayerID]) degrees
                  • Set UnitHorse[PlayerID] = (Last created unit))
                  • Unit Group - Add UnitHorse[PlayerID] to MountedGroup
                  • Custom script: call RemoveLocation(udg_Loc1)
                • Else - Actions
        • Else - Actions
          • Set IsMounted[PlayerID] = False
          • Unit Group - Remove UnitHorse[PlayerID] from MountedGroup
          • Animation - Reset UnitHorse[PlayerID]'s animation
      • Custom script: set udg_PlayerOwner = null
  • Interacting Periodic
    • Events
      • Time - Every 0.03 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in SP_UnitGroup and do (Actions)
        • Loop - Actions
          • Set PlayerOwnerLoop = (Owner of (Picked unit))
          • Set PlayerIDLoop = (Player number of PlayerOwnerLoop)
          • Set Loc3 = (Position of UnitRider[PlayerIDLoop])
          • Unit - Move (Picked unit) instantly to Loc3, facing (Facing of SP_UnitRider[PlayerIDLoop]) degrees
          • Custom script: call RemoveLocation(udg_Loc3)
          • Custom script: set udg_PlayerOwnerLoop = null
  • Interacting Death
    • Events
      • Unit - A unit Dies
    • Conditions
      • (Unit-type of (Triggering unit)) Equal to Riderless Horse
    • Actions
      • Set PlayerOwner = (Owner of (Triggering unit))
      • Set PlayerID = (Player number of PlayerOwner)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • IsMounted[PlayerID] Equal to True
        • Then - Actions
          • Set IsMounted[PlayerID] = False
        • Else - Actions
      • Set SP_UnitHorse[PlayerID] = No unit
      • Unit Group - Remove (Triggering unit) from UnitGroup
      • Custom script: set udg_PlayerOwner = null
 
Status
Not open for further replies.
Top