JASS - forcing animation n23

Level 4
Joined
Apr 21, 2016
Messages
31
Hi,

I've been playing with JASS scripts and triggers to achieve that model Onyxia spawn (create unit), uses animation 23 (walk alternate) to a region and then play animation 8 (cinematic land) after which she is deleted.

I got lost. From errors with declaration, to animation not fully executing and I lost my path.

Can anyone assist me with this script? I am not a veteran and this is my first time going into JASS after watching available rudimentary guides on youtube.
 
This forum is more for miscellaneous programming. For your case, you'd be best off asking the question in the Triggers & Scripts forum!

It'd be good to share your code so far, even if it has errors! But when I was first learning, it was usually easiest to start with GUI and then adapt it to JASS later on (if you choose to do so, GUI is perfectly capable on its own).

At a high level, you would want to issue an order for Onyxia to move to the center of your region. By default, wc3 will play the unit's "Walk" animation during movement. To make her use her "flying" animation (Walk Alternate) instead of the default walk animation, you can add the animation tag "alternate" to the unit (this is the same concept used for characters that morph and should use a new set of animations, e.g. Illidan turning into his Metamorphosis form, or Druids turning into their beast forms).

You can then create a separate trigger to detect when she enters your region, and then you can trigger the "Cinematic Land" animation and remove the "alternate" animation tag.

I've attached a sample map that does what you describe (apart from deleting her). The triggers are listed below:
  • Move Onyxia
    • Events
      • Player - Player 1 (Red) skips a cinematic sequence
    • Conditions
    • Actions
      • Camera - Lock camera target for Player 1 (Red) to Onyxia 0001 <gen>, offset by (0.00, 0.00) using Default rotation
      • Animation - Add the alternate animation tag to Onyxia 0001 <gen>
      • Set VariableSet TempLoc = (Center of OnyxiaLandRegion <gen>)
      • Unit - Order Onyxia 0001 <gen> to Move To TempLoc
      • Custom script: call RemoveLocation(udg_TempLoc)
  • Onyxia Land
    • Events
      • Unit - A unit enters OnyxiaLandRegion <gen>
    • Conditions
      • (Unit-type of (Triggering unit)) Equal to Onyxia
    • Actions
      • Camera - Reset camera for Player 1 (Red) to standard game-view over 0.00 seconds
      • Unit - Order (Triggering unit) to Stop.
      • Animation - Remove the alternate animation tag to (Triggering unit)
      • Animation - Play (Triggering unit)'s Cinematic Land animation
      • Wait 2.60 seconds
      • Animation - Reset (Triggering unit)'s animation
From here, if you want to work with JASS, you can select the trigger and go to "Edit > Convert to Custom Text". Or you can continue modifying it in GUI. :)
 

Attachments

  • OnyxiaSample.w3m
    1.9 MB · Views: 3
Level 4
Joined
Apr 21, 2016
Messages
31
This forum is more for miscellaneous programming. For your case, you'd be best off asking the question in the Triggers & Scripts forum!

It'd be good to share your code so far, even if it has errors! But when I was first learning, it was usually easiest to start with GUI and then adapt it to JASS later on (if you choose to do so, GUI is perfectly capable on its own).

At a high level, you would want to issue an order for Onyxia to move to the center of your region. By default, wc3 will play the unit's "Walk" animation during movement. To make her use her "flying" animation (Walk Alternate) instead of the default walk animation, you can add the animation tag "alternate" to the unit (this is the same concept used for characters that morph and should use a new set of animations, e.g. Illidan turning into his Metamorphosis form, or Druids turning into their beast forms).

You can then create a separate trigger to detect when she enters your region, and then you can trigger the "Cinematic Land" animation and remove the "alternate" animation tag.

I've attached a sample map that does what you describe (apart from deleting her). The triggers are listed below:
  • Move Onyxia
    • Events
      • Player - Player 1 (Red) skips a cinematic sequence
    • Conditions
    • Actions
      • Camera - Lock camera target for Player 1 (Red) to Onyxia 0001 <gen>, offset by (0.00, 0.00) using Default rotation
      • Animation - Add the alternate animation tag to Onyxia 0001 <gen>
      • Set VariableSet TempLoc = (Center of OnyxiaLandRegion <gen>)
      • Unit - Order Onyxia 0001 <gen> to Move To TempLoc
      • Custom script: call RemoveLocation(udg_TempLoc)
  • Onyxia Land
    • Events
      • Unit - A unit enters OnyxiaLandRegion <gen>
    • Conditions
      • (Unit-type of (Triggering unit)) Equal to Onyxia
    • Actions
      • Camera - Reset camera for Player 1 (Red) to standard game-view over 0.00 seconds
      • Unit - Order (Triggering unit) to Stop.
      • Animation - Remove the alternate animation tag to (Triggering unit)
      • Animation - Play (Triggering unit)'s Cinematic Land animation
      • Wait 2.60 seconds
      • Animation - Reset (Triggering unit)'s animation
From here, if you want to work with JASS, you can select the trigger and go to "Edit > Convert to Custom Text". Or you can continue modifying it in GUI. :)

You are wonderful!
I'll sit and give it a study once my work schedule slows down. Thank you for advice and for the guidelines!!!
 
Top