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

spell with Tigger

Status
Not open for further replies.

hdm

hdm

Level 9
Joined
Nov 19, 2011
Messages
384
I made a spell (or i just tried XD) that ,When used,creates a Tornado in every nearby unit and slows the them movement speed...and If Ima sure I made something Like :

(do u know,those things about Event - starting the effect...Conditions - ABility Being cast...)

Actions - Pick every unit in (that area,I made a variable [Sry,I can't post the tiggers cuz my map isn't in this Computer]) and do Create a special effect in picked unit using Tornado Spin

Action - Set Picked Unit movement speed to 100

Action - Wait 5 Seconds (or more maybe)

Action - Pick every unit in (variable) and Destroy last created special effect (something like it [I don't remember])

Action - Set Picked unit movement speed to default

Well my problem is ... The Special Effect Wont be destroyed...Everything was working as I wanted but the special effect (tornado) wont disapear...It still there 4Evar..Can someone heelp mee ?
 
Level 5
Joined
Dec 12, 2011
Messages
116
Hmm.... Look:
If I understood it the right way, all actions are made inside the Pick every unit in Area loop.
So, you are using a Wait action inside a loop. This is discouraged.
In that situations, problems like yours occur often. I am not sure, but I guess that the "last created [whatever]" function does not work properly inside loops that also contain Wait actions.

I'll create a code for you right now, and I'll post it through editing this post.

EDIT (40 mins of work later):

[EDIT2: changing things that Maker suggested]

  • AreaTornado Spell
    • Events
      • YOUR_EVENTS
    • Conditions
      • YOUR_CONDITIONS
    • Actions
      • -------- Variables and your region --------
      • Custom script: local group tornadoGroup
      • Custom script: local effect array tornadoEffects
      • Custom script: local integer counter
      • Set UnitGroup = SET_YOUR_GROUP_HERE ( FOR EXAMPLE: Units in (Your Area) )
      • Custom script: set tornadoGroup = udg_UnitGroup
      • -------- Apply the spell's effects --------
      • Set TempInteger = -1
      • Unit Group - Pick every unit in UnitGroup and do (Actions)
        • Loop - Actions
          • Unit - Set (Picked unit) movement speed to 100.00
          • Special Effect - Create a special effect attached to the origin of (Picked unit) using Abilities\Spells\Other\Tornado\TornadoElementalSmall.mdl
          • Set TempInteger = (TempInteger + 1)
          • Set TempSpecialEffect[TempInteger] = (Last created special effect)
      • For each (Integer A) from 0 to TempInteger, do (Actions)
        • Loop - Actions
          • Custom script: set tornadoEffects[ bj_forLoopAIndex ] = udg_TempSpecialEffect[ bj_forLoopAIndex ]
      • Custom script: set counter = udg_TempInteger
      • -------- Wait --------
      • Wait 5.00 game-time seconds
      • -------- Things back to normal --------
      • Custom script: set udg_TempInteger = counter
      • Custom script: set udg_UnitGroup = tornadoGroup
      • Unit Group - Pick every unit in UnitGroup and do (Actions)
        • Loop - Actions
          • Unit - Set (Picked unit) movement speed to (Default movement speed of (Picked unit))
      • For each (Integer A) from 0 to TempInteger, do (Actions)
        • Loop - Actions
          • Custom script: set udg_TempSpecialEffect[ bj_forLoopAIndex ] = tornadoEffects[ bj_forLoopAIndex ]
          • Special Effect - Destroy TempSpecialEffect[(Integer A)]
          • Custom script: call DestroyEffectBJ( tornadoEffects[ bj_forLoopAIndex ] )
          • Custom script: set udg_TempSpecialEffect[ bj_forLoopAIndex ] = null
          • Custom script: set tornadoEffects[ bj_forLoopAIndex ] = null
      • -------- Remove leaks --------
      • Custom script: call DestroyGroup(udg_UnitGroup)
      • Custom script: call DestroyGroup(tornadoGroup)
      • Custom script: set udg_UnitGroup = null
      • Custom script: set tornadoGroup = null
PS: This trigger is MUI, I mean, Multi-Instanceable. This means that you can have infinite instances of this spell running at the same time that it still works.
PS2: I've noticed that your spell works for buildings too. If you don't want this, be intelligent when setting your group.
PS3: This uses some JASS, so just don't touch the Custom Scripts (unless you know what you are doing, obviously)
PS4: I used the return to default movespeed idea, as you said. But I don't suggest it, because if there are other slows involved, this would not be interesting.
PS5: If you want this made at full JASS just tell me.
PS6: If you like my work please give me +rep xD


hamsterpellet
 
Last edited:
Level 17
Joined
Nov 13, 2006
Messages
1,814
I made a spell (or i just tried XD) that ,When used,creates a Tornado in every nearby unit and slows the them movement speed...and If Ima sure I made something Like :

(do u know,those things about Event - starting the effect...Conditions - ABility Being cast...)

Actions - Pick every unit in (that area,I made a variable [Sry,I can't post the tiggers cuz my map isn't in this Computer]) and do Create a special effect in picked unit using Tornado Spin

Action - Set Picked Unit movement speed to 100

Action - Wait 5 Seconds (or more maybe)

Action - Pick every unit in (variable) and Destroy last created special effect (something like it [I don't remember])

Action - Set Picked unit movement speed to default

Well my problem is ... The Special Effect Wont be destroyed...Everything was working as I wanted but the special effect (tornado) wont disapear...It still there 4Evar..Can someone heelp mee ?

u dont try make something like add invisble ability and make attachment to ability (like blood elf mage sphere) and after x second remove from everybody in that range? (problem is if somebody else do same ability like u or target go out of range) but another way maybe easier
 

hdm

hdm

Level 9
Joined
Nov 19, 2011
Messages
384
u dont try make something like add invisble ability and make attachment to ability (like blood elf mage sphere) and after x second remove from everybody in that range? (problem is if somebody else do same ability like u or target go out of range) but another way maybe easier

Ya I Tried ;O,but the unit wont appear IN the Picked Units,it appears in a area Next to them...When I get my PC Back I'll post the Tigger that I made and I'll Try the way that all u guys are telling me ;D
 
Status
Not open for further replies.
Top