• 🏆 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] SetUnitFacing Wont Work

Status
Not open for further replies.
Level 5
Joined
Feb 22, 2013
Messages
161
So here are the triggers leading up to the problem.

  • Intro Begin
    • Events
    • Conditions
    • Actions
      • Set inCinematic = True
      • Cinematic - Fade out over 0.00 seconds using texture White Mask and color (0.00%, 0.00%, 0.00%) with 0.00% transparency
      • Cinematic - Turn cinematic mode On for (All players)
      • Camera - Apply Camera 001 <gen> for Player 10 (Light Blue) over 0.00 seconds
      • Camera - Apply Camera 002 <gen> for Player 10 (Light Blue) over 4.00 seconds
      • Custom script: call IssuePointOrder(udg_talthoric, "move", GetRectCenterX(gg_rct_talthoricHalt), GetRectCenterY(gg_rct_talthoricHalt))
      • Custom script: call IssuePointOrder(udg_swordsman02, "move", GetRectCenterX(gg_rct_talthoricHalt) - 128.00, GetRectCenterY(gg_rct_talthoricHalt) - 128.00)
      • Custom script: call IssuePointOrder(udg_chaplain02, "move", GetRectCenterX(gg_rct_talthoricHalt) - 256.00, GetRectCenterY(gg_rct_talthoricHalt) - 64.00)
      • Custom script: call IssuePointOrder(udg_chaplain01, "move", GetRectCenterX(gg_rct_talthoricHalt) - 256.00, GetRectCenterY(gg_rct_talthoricHalt) + 64.00)
      • Custom script: call IssuePointOrder(udg_swordsman01, "move", GetRectCenterX(gg_rct_talthoricHalt) - 128.00, GetRectCenterY(gg_rct_talthoricHalt) + 128.00)
      • Cinematic - Fade in over 2.00 seconds using texture White Mask and color (0.00%, 0.00%, 0.00%) with 0.00% transparency
  • Intro Cont
    • Events
      • Unit - A unit enters talthoricHalt <gen>
    • Conditions
    • Actions
      • Custom script: call IssuePointOrder(udg_footman01, "move", GetRectCenterX(gg_rct_footman01Move), GetRectCenterY(gg_rct_footman01Move))
      • Custom script: call IssuePointOrder(udg_footman02, "move", GetRectCenterX(gg_rct_footman02Move), GetRectCenterY(gg_rct_footman02Move))
  • Footman 01 Enter
    • Events
      • Unit - A unit enters footman01Move <gen>
    • Conditions
    • Actions
      • Custom script: call SetUnitFacing(GetTriggerUnit(), 180.00)
Everything works until the trigger above, Footman 01 Enter, for some reason when the unit moves to the region nothing happens. Any idea what could be the cause? I have not tested whether it registers the unit entering the regions or if it's the custom script, nothing.
 
The unit is issued to move to the center of footman01Move, but the event fires when the unit is on the outskirts of footman01Move. The unit is still moving at that point, and facing cannot be changed while a unit is moving. As such, the trigger won't do anything.

To fix it, you would have to order the unit to stop before setting its facing, or you would have to run a small wait until the unit reaches the center, and then set the facing (this would require some testing. I assume this is for a cinematic?).
 
Level 5
Joined
Feb 22, 2013
Messages
161
The unit is issued to move to the center of footman01Move, but the event fires when the unit is on the outskirts of footman01Move. The unit is still moving at that point, and facing cannot be changed while a unit is moving. As such, the trigger won't do anything.

To fix it, you would have to order the unit to stop before setting its facing, or you would have to run a small wait until the unit reaches the center, and then set the facing (this would require some testing. I assume this is for a cinematic?).

Yes, this is for cinematic purpose. That was my first thought of what went wrong was because the unit was still moving but wasn't sure on how to resolve that.
 
Level 12
Joined
Feb 22, 2010
Messages
1,115
You can try this instead of facing maybe,

  • Animation - Lock (Entering unit)'s Chest/Head to face (need target unit here), offset by (0.00, 0.00, 90.00)
 
Status
Not open for further replies.
Top