| 01-22-2010, 05:19 AM | #1 |
...the target of an ability is a Unit or a Destructible (for single target spells), or would I have to do what TKoK did and make seperate abilities for each thing? (I'm trying to get one "Interact" ability for both functions). |
| 01-22-2010, 07:02 AM | #2 |
Here you go JASS:if GetSpellTargetDestructable() != null then elseif GetSpellTargetUnit() != null then endif |
| 01-22-2010, 05:24 PM | #3 |
Thank you! (Opens Notepad) EDIT: It's been several months since I've seen code like this... Should I start the trigger on a 'casts an ability' event or 'is issued an order targeting an object'? |
| 01-22-2010, 06:05 PM | #4 |
Starts effect of ability, unless you want to interrupt it before it's cast. |
| 01-22-2010, 06:09 PM | #5 |
Alright. Do I have to add anything in the parentheses in the code Anachron posted? |
| 01-22-2010, 06:19 PM | #6 |
Nope. |
| 01-22-2010, 06:20 PM | #7 |
Alright. Here's what I've got. Gonna test to see if it works: JASS:function Trig_Interact_Conditions takes nothing returns boolean if ( not ( GetSpellAbilityId() == 'A600' ) ) then return false endif return true endfunction function Trig_Interact_Actions takes nothing returns nothing if GetSpellTargetDestructable() != null then call ConditionalTriggerExecute( gg_trg_DestCheck ) elseif GetSpellTargetUnit() != null then call ConditionalTriggerExecute( gg_trg_UnitCheck ) endif endfunction //=========================================================================== function InitTrig_Interact takes nothing returns nothing set gg_trg_Interact = CreateTrigger( ) call TriggerRegisterPlayerUnitEventSimple( gg_trg_Interact, Player(0), EVENT_PLAYER_UNIT_SPELL_EFFECT ) call TriggerAddCondition( gg_trg_Interact, Condition( function Trig_Interact_Conditions ) ) call TriggerAddAction( gg_trg_Interact, function Trig_Interact_Actions ) endfunction EDIT: It works, but the ability itself is checking to see if destructibles (like crates) are occupied by owls... What should I set the 'targets allowed' to? EDIT2: Should I use Channel instead of Purge as a base? |
| 01-22-2010, 07:28 PM | #8 | |
Quote:
Uhm, can we see UnitCheck and DestCheck? ![]() Targets allowed should be: "Air, Land, Neutral, Ally, Alive, Mechanical unit, Friend, Organic, Object (and *maybe* Enemy)" (if I got what you mean) Anyway... JASS:function Trig_Interact_Conditions takes nothing returns boolean return (GetSpellAbilityId() == 'A600') endfunction |
| 01-22-2010, 08:09 PM | #10 | |||
Quote:
Ah, ok Quote:
Quote:
![]() |
| 01-22-2010, 09:03 PM | #12 | |
Quote:
Check tree... you may want to change base ability, then... maybe "Sentinel" would be the best base ability for it. |
| 01-22-2010, 09:47 PM | #13 |
| 01-22-2010, 10:02 PM | #14 | |
Quote:
![]() |
| 01-22-2010, 10:15 PM | #15 |
Yes. I now have infinite owls. |
