• 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.

fight system

Status
Not open for further replies.
Level 5
Joined
Sep 30, 2010
Messages
106
so, can someone send me a trigger system that will make a hero hit with his left/right hands using spells? I mean if I press Q for example a hero will punch his left hand when I press W he will punch right hand.. wit the animations, you can just use first attack animation on one spell and second on another and it will work for most units..

thanks for attention
 
Last edited:
Level 23
Joined
Apr 16, 2012
Messages
4,041
it requres model edit rather than triggering really
if the model doesnt have the animation for right/left hand punch, no matter how hard you try in the trigger editor, you will not make it work
if you have model with working animations, you can use:
  • Untitled Trigger 001
    • Events
      • Time - Every 5.00 seconds of game time
    • Conditions
    • Actions
      • Custom script: call SetUnitAnimationByIndex(gg_hpea_0000, udg_myinteger)
      • Game - Display to (All players) the text: (String(myinteger))
      • Set myinteger = (myinteger + 1)
to find out units animation indexes(just watch the model)
for the Q part, I think that would require to have ability on the unit because there is no way in Jass to detect what you pressed(excluding arrows but that is freacking slow)
than when you start the effect of an ability(your Q ability) than do
  • Custom script: call SetUnitAnimationByIndex(gg_hpea_0000, the index of the animation)
and then some wait or start a timer and then deal damage after small amount of time so it looks more realistic

In case you didnt find the animation, try using:
  • Animation - Add the punch animation tag to Peasant 0000 <gen>
or whatever the tag should be and then you can use
  • Animation - Play Peasant 0000 <gen>'s punch animation
if you are too lazy to find the index, but I think this way it stops the animation when you perform any action.

The gg_hpea_0000 is paesant preplaced on map so you have to change that to whatever unit you need

Hope this will help
 
Level 5
Joined
Sep 30, 2010
Messages
106
it requres model edit rather than triggering really
if the model doesnt have the animation for right/left hand punch, no matter how hard you try in the trigger editor, you will not make it work
if you have model with working animations, you can use:
  • Untitled Trigger 001
    • Events
      • Time - Every 5.00 seconds of game time
    • Conditions
    • Actions
      • Custom script: call SetUnitAnimationByIndex(gg_hpea_0000, udg_myinteger)
      • Game - Display to (All players) the text: (String(myinteger))
      • Set myinteger = (myinteger + 1)
to find out units animation indexes(just watch the model)
for the Q part, I think that would require to have ability on the unit because there is no way in Jass to detect what you pressed(excluding arrows but that is freacking slow)
than when you start the effect of an ability(your Q ability) than do
  • Custom script: call SetUnitAnimationByIndex(gg_hpea_0000, the index of the animation)
and then some wait or start a timer and then deal damage after small amount of time so it looks more realistic

In case you didnt find the animation, try using:
  • Animation - Add the punch animation tag to Peasant 0000 <gen>
or whatever the tag should be and then you can use
  • Animation - Play Peasant 0000 <gen>'s punch animation
if you are too lazy to find the index, but I think this way it stops the animation when you perform any action.

The gg_hpea_0000 is paesant preplaced on map so you have to change that to whatever unit you need

Hope this will help

yeah I have a model with both hand punches, I'll try that trigger :goblin_good_job:
 
Status
Not open for further replies.
Top