| 02-24-2009, 05:22 AM | #1 |
So I've hit a bit of a dilemma. I want to know when a unit is struck by the Stampede abilty. I tried all my usual work arounds such as giving the ability a buff then checking units for the specific buff. So which would be best / most efficient: a) Use a damage detection system b) Use a particle system and recreate Stampede by hand c) Are there any other solutions? |
| 02-24-2009, 06:11 AM | #2 |
I would say damage detection is the more efficient way, though there is no way of detecting whether or not it was damaged by Stampede or any other spell since it doesn't give a buff. You wouldn't need to use a particle system to re-create Stampede, its a fairly easy ability to make using triggers. |
| 02-24-2009, 08:12 AM | #3 |
I technically don't need to detect the damage, I just need to detect when it collides. I want the function of the spell for a different purpose. |
| 02-24-2009, 08:51 AM | #4 |
This is easy.... 1) Dummy cast stampede from dummy (hero cast null stampede, dummy cast real one) 2) Any damage that comes from dummy is stampede collusion. Set stampede damage to something LOW ex 1 or 0.01, zero damage will not trigger event. 3) OFC you will need damage detection system. |
| 02-24-2009, 09:00 AM | #5 | |
Quote:
Zero damage does.. (example: Faerie Fire) 1. create dummy with real stampede 2. dummy cast when hero casts 3. a unit is damaged event fires, check if the unit is equal to the type of (dummy unit) and do actions. |
| 02-24-2009, 07:48 PM | #6 |
That actually is quite the simple solution. Here's my next problem that I'm going to need some hand holding for... I don't know JASS. If someone could give me a trigger in JASS with the unit is damaged event, the condition pointing to a unit type, and an action to run a different trigger, that would be amazing. I can understand code enough to alter it to my liking, but I don't know JASS's syntax to create it, so I need something to work off of :( |
| 02-24-2009, 07:58 PM | #7 |
Look at IDDS in the systems section |
| 02-24-2009, 08:07 PM | #8 |
Using the IDDS would make your life easy. JASS:scope StampedeCollision initializer Init globals private constant integer DUMMY_RAW_ID = 'hfoo' private constant integer TRIG_PRIORITY = 4 endglobals private function Conditions takes nothing returns boolean return GetUnitTypeId(GetTriggerDamageSource()) == DUMMY_RAW_ID endfunction private function Actions takes nothing returns nothing local unit u = GetTriggerDamageSource() local unit t = GetTriggerDamageTarget() //Do whatever you want to do with the collision thing here. set t = null set u = null endfunction private function Init takes nothing returns nothing local trigger trg = CreateTrigger() call TriggerAddAction(trg, function Actions) call TriggerAddCondition(trg, Condition(function Conditions)) call TriggerRegisterDamageEvent(trg, TRIG_PRIORITY) set trg = null endfunction endscope |
| 02-24-2009, 08:22 PM | #9 |
It would actually probably be easier to only have the stampede ability added to that dummy when you create it, then just check if they have the ability And are you on Forums at work Dusk? Blasphemy! |
| 02-24-2009, 08:27 PM | #10 | ||
Quote:
JASS:scope StampedeCollision initializer Init globals private constant integer DUMMY_SPELL_ID = 'A000' private constant integer TRIG_PRIORITY = 4 endglobals private function Conditions takes nothing returns boolean return GetUnitAbilityLevel(GetTriggerDamageSource(), DUMMY_SPELL_ID) > 0 endfunction private function Actions takes nothing returns nothing local unit u = GetTriggerDamageSource() local unit t = GetTriggerDamageTarget() //Do whatever you want to do with the collision thing here. set t = null set u = null endfunction private function Init takes nothing returns nothing local trigger trg = CreateTrigger() call TriggerAddAction(trg, function Actions) call TriggerAddCondition(trg, Condition(function Conditions)) call TriggerRegisterDamageEvent(trg, TRIG_PRIORITY) set trg = null endfunction endscope Quote:
|
| 02-24-2009, 09:25 PM | #11 |
You guys are awesome, and I am using your IDDS Dusk, so thank you. Credit will be given of course. So all I have to do is add JASS:call TriggerExecute( gg_trg_InsertTriggerHere ) What's the easiest method to obtain the id value for an ability? Good point in detecting the level of the dummy ability rather than the unit type, that makes it a lot more versatile. |
| 02-24-2009, 09:41 PM | #12 | |
Quote:
I don't know what the heck I was thinkin. |
| 02-25-2009, 02:39 AM | #13 | ||
Quote:
Quote:
|
| 02-25-2009, 03:26 AM | #14 |
Well that's nifty. Learn something every day. Thanks! |
