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

[JASS] Combat/Normal Mode

Status
Not open for further replies.
Level 6
Joined
Jul 22, 2008
Messages
243
Hmm, not sure if this works but, you could try checking if any attack order is given to a unit, and make your choice of selections. Then play the music.
 
Level 16
Joined
Mar 3, 2006
Messages
1,564
Hmm, not sure if this works but, you could try checking if any attack order is given to a unit, and make your choice of selections. Then play the music.

The combat mode ends when the target dies, assuming there is a single enemy, or when you get out of sight of the unit and it stops following you to attack. I don't know how to check for those condition plus it will be complicated when there are more than one unit.
 
Level 3
Joined
Apr 1, 2005
Messages
53
Well I guess it WILL be complicated. But what exactly do you need it for? What's the context? Maybe it gets easier, depending on what's the surrounding. Or do you want to detect combat in general on let's say a normal melee map?
 
Level 16
Joined
Mar 3, 2006
Messages
1,564
Well I guess it WILL be complicated. But what exactly do you need it for? What's the context? Maybe it gets easier, depending on what's the surrounding. Or do you want to detect combat in general on let's say a normal melee map?

Melee or Campaign but specially in an RPG campaign as I am planing to make one but I haven't gathered enough data and JASS experience, so this is one of the things I'd like to make; Combat Mode.

Also, with combat mode I could make special effects and music at fighting bosses. So any help would be appreciated.
 
Level 3
Joined
Apr 1, 2005
Messages
53
Maybe you could work with "any unit is attacked" event then. Do you have 1 or multiple players? If only 1, it's easier as you could check if attack orders are given with his hero as target. Or if his hero is given an attack order.
Otherwise you'd have to check which player is attacked and play sounds for him etc...
But it should be possible. Sounds interesting.
I could try to write some functions, so you can imagine what I mean.
 
Level 16
Joined
Mar 3, 2006
Messages
1,564
Maybe you could work with "any unit is attacked" event then. Do you have 1 or multiple players? If only 1, it's easier as you could check if attack orders are given with his hero as target. Or if his hero is given an attack order.
Otherwise you'd have to check which player is attacked and play sounds for him etc...
But it should be possible. Sounds interesting.
I could try to write some functions, so you can imagine what I mean.

Well, thanks for your concern.


damage dection could work, start a timer that expier in 5 sec, and if the unit havn't taken any dmg during that time set it "out" of combat. or if it takes damage reset the timer to 5sec

I thought it in that way since you have to check if you are in combat or not using a periodic time it will give enough time to fade in/out music and will give more control in handling variable, for example: you want to start a dialogue or cinematic after a unit has been slain so you must give enough time then start the cinematic/dialogue.
 
Status
Not open for further replies.
Top