| 05-05-2007, 02:19 AM | #2 |
You might want to use Matching Unit instead of Triggering unit, and you may also want to look up dummy casting. |
| 05-05-2007, 02:28 AM | #3 |
Triggering unit does not go with 'Units Matching Condition' Make sure to read the gray text on the bottom of a trigger, function, which says some details. In this case, it reminds you you must use 'matching unit' |
| 05-05-2007, 03:23 AM | #5 |
Ah, i found another problem. Your ordering the unit too fast for it to cast. Keep your first trigger, but create a dummy before each order (with your spell) and order the dummy to cast. |
| 05-05-2007, 03:56 AM | #6 |
Trigger: Global Hex
Might not work well without dummy units, but using a similar action would probably help. |
| 05-05-2007, 04:53 AM | #8 |
No no no.. Thunder clap has no specific targets, which means that you can't use Target unit of ability being cast. And you also should use a loop.. Here I'll give you the code. JASS:function Trig_Global_Hex_Conditions takes nothing returns boolean if ( not ( GetSpellAbilityId() == 'AUan' ) ) then //Remember to change this to your spell's rawcode! return false endif return true endfunction function Trig_Global_Hex_Actions takes nothing returns nothing local unit u = GetTriggerUnit() local unit c = CreateUnit(GetOwningPlayer(u), 'DummyRawcode', GetUnitX(u), GetUnitY(u)) // Creates the dummy unit local unit targ local group g = CreateGroup() call UnitAddAbility( c, 'Hex Rawcode') call GroupEnumUnitsInRange(g, GetUnitX(u), GetUnitY(u), 9999999, null) loop set targ = FirstOfGroup(g) exitwhen targ == null call IssueTargetOrderBJ( c, "Global Hex OrderString", targ) call GroupRemoveUnitSimple(targ, g) endloop call DestroyGroup(g) set u = null set g = null set c = null endfunction //=========================================================================== function InitTrig_Global_Hex takes nothing returns nothing set gg_trg_Global_Hex = CreateTrigger( ) call TriggerRegisterAnyUnitEventBJ( gg_trg_Global_Hex, EVENT_PLAYER_UNIT_SPELL_EFFECT ) call TriggerAddCondition( gg_trg_Global_Hex, Condition( function Trig_Global_Hex_Conditions ) ) call TriggerAddAction( gg_trg_Global_Hex, function Trig_Global_Hex_Actions ) endfunction I didn't test it, but it should work. Remember to set the Hex(Not Global!)'s cast range to 9999999 |
| 05-05-2007, 04:56 AM | #10 |
Finally someone gets it right! (Zwan) Im too lazy lately to do this on my own lately >.<. |
| 05-05-2007, 05:05 AM | #11 |
So Zwan get's it right and I don't? Wtf, mine is even more efficent and MUI.. |
| 05-05-2007, 05:17 AM | #12 |
Slightly off topic, what does "Unit Group - Clear" not do that "call DestroyGroup (udg_Blah)" does? Like can they both be used to clear variables? On that mildly off topic thing, what about Remove Unit Group? BTW - Toink, notice how he was using GUI? |
| 05-05-2007, 05:19 AM | #14 |
I can post it flawless without leaks, but since they are not using my version of the editor they dont have custom actions like; Trigger: Set HexDummy = (Create a unit for (Owner of (Casting unit)) of type Dummy at ((X of (Picked unit)),(Y of (Picked unit))) facing (Facing of (Casting unit)) degrees)No point in telling them to do something they cant do. Also kinda defeats the point to post in jass when they don't understand loops (which is not a bad thing, gotta learn sometime) and posted in GUI to begin with. *edit Pyro is correct, remove should be add exp timer. My bad *edit Dammit Pyro.. =) He is correct on all counts. At any rate, you have your answer. |
| 05-05-2007, 05:20 AM | #15 |
Couldn't you always set the unit's casting time backswing to 0? |
