• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

[Trigger] Simple Custom Spell Problem ( I Hope )

Status
Not open for further replies.
Level 2
Joined
Apr 29, 2012
Messages
20
Put other thread in wrong section.

I made a spell based off of thunder clap, and the idea is that it calls down lightning bolts to strike all enemies within a certain range of the caster.

here's my trigger:

  • Bolt Strike
    • Events
      • Unit - A unit Begins casting an ability
    • Conditions
      • (Ability being cast) Equal to Bolt Strike
    • Actions
      • Unit Group - Pick every unit in (Units within 50.00 of (Position of (Casting unit)) matching ((Owner of (Matching unit)) Equal to Player 11 (Dark Green))) and do (Actions)
        • Loop - Actions
          • Set tempPoint[1] = (Position of (Picked unit))
          • Special Effect - Create a special effect at tempPoint[1] using Doodads\Cinematic\Lightningbolt\Lightningbolt.mdl
          • Custom script: call RemoveLocation(udg_tempPoint[1])
Anybody have ideas how to get this to work? It probably has something to do with the "tempPoint", not sure if that works with multiples. Even then, though, wouldnt I see at least 1 lightning bolt? I dont see anything currently!

Thanks in advance
 
Level 16
Joined
Mar 3, 2006
Messages
1,564
off-topic: Save Position of (Casting unit) on another point variable

on-topic: You are not seeing the effect because you are removing the Location.

will edit soon.

<<< EDIT >>>

change the actions to this:
have not tried it though as I am in hurry so if there are further problem I will answer them but about 3~4 hours from now

  • Actions
    • Set Caster_Position = (Position of (Triggering unit))
    • Unit Group - Pick every unit in (Units within 50.00 of Caster_Position matching ((Owner of (Matching unit)) Equal to Player 11 (Dark Green))) and do (Actions)
      • Loop - Actions
        • Set temp_Point = (Position of (Picked unit))
        • Special Effect - Create a special effect at temp_Point using Doodads\Cinematic\Lightningbolt\Lightningbolt.mdl
        • Special Effect - Destroy (Last created special effect)
        • Custom script: call RemoveLocation(udg_temp_Point)
    • Custom script: call RemoveLocation(udg_Caster_Position)
 
Level 2
Joined
Apr 29, 2012
Messages
20
Awesome, sweet. Thanks to you and someone else I was able to work out the kinks, I think.

The spell is kind of quiet, though. I remember hearing a lightning type sound somewhere ingame, I'm off to locate it now.

Also, is there a way to turn off the "ground rolling" effect when casting thunder clap? doesnt really fit with my spells theme.

I appreciate the help.
 
Level 37
Joined
Mar 6, 2006
Messages
9,240
To avoid unit group leak:
  • Actions
    • Set Caster_Position = (Position of (Triggering unit))
    • Custom script: set bj_wantDestroyGroup = true
    • Unit Group - Pick every unit in (Units within 50.00 of Caster_Position matching ((Owner of (Matching unit)) Equal to Player 11 (Dark Green))) and do (Actions)
      • Loop - Actions
        • Set temp_Point = (Position of (Picked unit))
        • Special Effect - Create a special effect at temp_Point using Doodads\Cinematic\Lightningbolt\Lightningbolt.mdl
        • Special Effect - Destroy (Last created special effect)
        • Custom script: call RemoveLocation(udg_temp_Point)
    • Custom script: call RemoveLocation(udg_Caster_Position)
50 is kind of small radius, the selection circle of a footman has about 32 radius.
 
Level 16
Joined
Mar 3, 2006
Messages
1,564
@ Maker

I already know about adding the line bj_wantDestroyGroup

But there is another problem, create a map and put those triggers and test it and you will not find any special effect; it seems this effect is destroyed instantly without completing its animation unlike other special effect.

Sorry
for 2nd post, for notification
Ok here it is, (its not simple). Tested it and working.

I checked for leaks and there are none that I noticed.

  • Lightning Bolts Strike
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Thunder Clap
    • Actions
      • Set Caster_Position = (Position of (Triggering unit))
      • Custom script: set bj_wantDestroyGroup = true
      • Unit Group - Pick every unit in (Units within 200.00 of Caster_Position matching (((Matching unit) belongs to an enemy of (Owner of (Triggering unit))) Equal to True)) and do (Actions)
        • Loop - Actions
          • Special Effect - Create a special effect attached to the origin of (Picked unit) using Doodads\Cinematic\Lightningbolt\Lightningbolt.mdl
          • Set effect_counter = (effect_counter + 1)
          • Set temp_effect[effect_counter] = (Last created special effect)
      • Custom script: call RemoveLocation(udg_Caster_Position)
      • Set i = effect_counter
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • effect_counter Greater than 0
        • Then - Actions
          • Countdown Timer - Start Timer as a Repeating timer that will expire in 3.00 seconds
        • Else - Actions
  • Destroy Effects
    • Events
      • Time - Timer expires
    • Conditions
    • Actions
      • Special Effect - Destroy temp_effect[i]
      • Set i = (i - 1)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • i Less than or equal to 0
        • Then - Actions
          • Set effect_counter = 0
          • Countdown Timer - Pause Timer
        • Else - Actions
 
Last edited by a moderator:
Status
Not open for further replies.
Top