• 🏆 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!

[Solved] Abnormal GUI Spell Trigger

Status
Not open for further replies.
Level 1
Joined
Feb 28, 2011
Messages
6
  • Spell Init
    • Events
      • Unit - A unit Begins casting an ability
    • Conditions
      • (Ability being cast) Equal to Deep Chill
    • Actions
      • Set SPELL_ANGLE = (Facing of UNIT_CASTER)
      • Set SPELL_SPEED = 5.00
      • Set UNIT_CASTER = (Triggering unit)
      • Set SPELL_DURATION = 10.00
      • Set SPELL_CASTER_POS = (Position of (Triggering unit))
      • Set SPELL_TARGET = (Target point of ability being cast)
      • Unit - Create 1 Dummy for (Owner of (Triggering unit)) at (Center of (Playable map area)) facing (Angle from SPELL_CASTER_POS to SPELL_TARGET) degrees
      • Set SPELL_MISSILE = (Last created unit)
      • Unit - Turn collision for SPELL_MISSILE Off
      • Unit - Move SPELL_MISSILE instantly to SPELL_CASTER_POS
      • Trigger - Turn on Spell Move <gen>
  • Spell Move
    • Events
      • Time - Every 0.03 seconds of game time
    • Conditions
    • Actions
      • Set SPELL_DURATION = (SPELL_DURATION - 0.03)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • SPELL_DURATION Greater than 0.00
        • Then - Actions
          • Set SPELL_CASTER_POS = (Position of SPELL_MISSILE)
          • Set SPELL_TARGET = (SPELL_CASTER_POS offset by SPELL_SPEED towards SPELL_ANGLE degrees)
          • Unit - Move SPELL_MISSILE instantly to SPELL_TARGET, facing SPELL_ANGLE degrees
        • Else - Actions
          • Unit - Kill SPELL_MISSILE
      • Unit Group - Pick every unit in (Units within 200.00 of SPELL_TARGET matching ((Owner of (Picked unit)) Equal to Neutral Hostile)) and do (Actions)
        • Loop - Actions
          • Unit - Cause UNIT_CASTER to damage (Picked unit), dealing 100.00 damage of attack type Spells and damage type Normal
          • Set SPELL_DURATION = 0.00
Hello there, This is my first attempt to create a GUI spell with moving the dummy unit as u see (I'm kinda new to spell making..Sorry).. So the problem is..The dummy moves in the direction the unit "was" facing even if the target point isn't in the angle the unit is facing..Also the dummy doesn't disappear after it reaches it's target but it continues on it's way..And finally it doesn't do any damage while it's moving on it's way..I really need help learning how to fix this spell..Any help would be appreciated..Thank you.
 
1- Lookup Hanky's Dynamic Indexing (I linked you to it a while ago)
It'll help you make the spell MUI

2-
  • Unit Group - Pick every unit in (Units within 200.00 of SPELL_TARGET matching ((Owner of (Picked unit)) Equal to Neutral Hostile)) and do (Actions)
You can't use (Picked unit) here because no unit was picked. You should replace it with (Matching unit)

Also, you're leaking a few locations (You're never destroying them

  • Center of (Playable map area)
leaks.

Also, try putting this custom script above the Pick every units line:
  • set bj_wantDestroyGroup = true
It make the function destroy the group by itself when it's done.

Plus, here's the real problem with the angle:
  • Set SPELL_ANGLE = (Facing of UNIT_CASTER)
  • Set SPELL_SPEED = 5.00
  • Set UNIT_CASTER = (Triggering unit)
You're using UNIT_CASTER before it's set ;)
 
Level 1
Joined
Feb 28, 2011
Messages
6
Umm I fixed the stuff he said but it's still bugging X.x

  • Spell Init
    • Events
      • Unit - A unit Begins casting an ability
    • Conditions
      • (Ability being cast) Equal to Deep Chill
    • Actions
      • Set UNIT_CASTER = (Triggering unit)
      • Set SPELL_CASTER_POS = (Position of (Triggering unit))
      • Set SPELL_ANGLE = (Angle from SPELL_CASTER_POS to SPELL_TARGET)
      • Set SPELL_SPEED = 5.00
      • Set SPELL_TARGET = (Target point of ability being cast)
      • Set SPELL_DISTANCE = (Distance between SPELL_CASTER_POS and SPELL_TARGET)
      • Set SPELL_DURATION = (SPELL_DISTANCE / (SPELL_SPEED x 33.33))
      • Unit - Create 1 Dummy for (Owner of (Triggering unit)) at SPELL_CASTER_POS facing (Angle from SPELL_CASTER_POS to SPELL_TARGET) degrees
      • Set SPELL_MISSILE = (Last created unit)
      • Unit - Turn collision for SPELL_MISSILE Off
      • Unit - Move SPELL_MISSILE instantly to SPELL_CASTER_POS
      • Trigger - Turn on Spell Move <gen>
  • Spell Move
    • Events
      • Time - Every 0.03 seconds of game time
    • Conditions
    • Actions
      • Set SPELL_DURATION = (SPELL_DURATION - 0.03)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • SPELL_DURATION Greater than 0.00
        • Then - Actions
          • Set SPELL_CASTER_POS = (Position of SPELL_MISSILE)
          • Set SPELL_TARGET = (SPELL_CASTER_POS offset by SPELL_SPEED towards SPELL_ANGLE degrees)
          • Unit - Move SPELL_MISSILE instantly to SPELL_TARGET, facing SPELL_ANGLE degrees
        • Else - Actions
          • Unit - Remove SPELL_MISSILE from the game
          • Trigger - Turn off (This trigger)
      • Custom script: set bj_wantDestroyGroup = true
      • Unit Group - Pick every unit in (Units within 200.00 of SPELL_TARGET matching (((Matching unit) belongs to an enemy of (Owner of SPELL_MISSILE)) Equal to True)) and do (Actions)
        • Loop - Actions
          • Unit - Cause UNIT_CASTER to damage (Picked unit), dealing 100.00 damage of attack type Spells and damage type Normal
So that's the latest fix..After following some instructions from Magtherdion :D and fixing alot of leaks..Here is it..But the angle is still bugged..The missile goes in random directions :S Need help!
 
Last edited by a moderator:
Status
Not open for further replies.
Top