• 🏆 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!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

is it bug or error?

Status
Not open for further replies.
Level 3
Joined
Dec 24, 2009
Messages
22
So, I'm working a spell for me to play and from what I know, the spell doesn't work on the first time, and work on the second time.. here's the trigger

  • Lightning Strike
    • Events
      • Unit - A unit Begins casting an ability
    • Conditions
      • (Ability being cast) Equal to Lightning Strike
    • Actions
      • -------- -------------------------------------------------------------------------------- --------
      • -------- Let's start with the variable first --------
      • -------- -------------------------------------------------------------------------------- --------
      • Set Lightning_Caster = (Casting unit)
      • Set Lightning_Target = (Target unit of ability being cast)
      • Set Lightning_Point = (Position of Lightning_Caster)
      • Set Lightning_Repoint = (Last created hashtable)
      • -------- -------------------------------------------------------------------------------- --------
      • -------- The variable below is the damage for your lightning strike, you can change the damage to your likes. --------
      • -------- -------------------------------------------------------------------------------- --------
      • Set LightningDamage = 700.00
      • -------- -------------------------------------------------------------------------------- --------
      • -------- Variable is done. --------
      • -------- Hashtable can save your data. --------
      • -------- -------------------------------------------------------------------------------- --------
      • Hashtable - Create a hashtable
      • Hashtable - Save Handle OfLightning_Point as 1 of 1 in Lightning_Repoint
      • -------- -------------------------------------------------------------------------------- --------
      • -------- Here's the trigger, sound is optional --------
      • -------- -------------------------------------------------------------------------------- --------
      • Special Effect - Create a special effect at (Position of Lightning_Caster) using Abilities\Weapons\ChimaeraLightningMissile\ChimaeraLightningMissile.mdl
      • Special Effect - Destroy (Last created special effect)
      • Unit - Move Lightning_Caster instantly to (Position of Lightning_Target)
      • Sound - Play PurgeTarget1 <gen> at 100.00% volume, attached to Lightning_Target
      • Special Effect - Create a special effect attached to the origin of Lightning_Target using Abilities\Spells\Orc\Purge\PurgeBuffTarget.mdl
      • Unit - Cause Lightning_Caster to damage Lightning_Target, dealing LightningDamage damage of attack type Pierce and damage type Lightning
      • Special Effect - Destroy (Last created special effect)
      • Special Effect - Create a special effect at (Position of Lightning_Caster) using Abilities\Weapons\ChimaeraLightningMissile\ChimaeraLightningMissile.mdl
      • Trigger - Turn on Lightning Strike Countdown <gen>
  • Lightning Strike Countdown
    • Events
      • Time - Every 0.15 seconds of game time
    • Conditions
    • Actions
      • Set Counter = (Counter + 0.15)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Counter Greater than or equal to 0.75
        • Then - Actions
          • Unit - Move Lightning_Caster instantly to (Load 1 of 1 in Lightning_Repoint)
          • -------- ------------------------------- --------
          • Special Effect - Destroy (Last created special effect)
          • Sound - Destroy PurgeTarget1 <gen>
          • Custom script: call RemoveLocation(udg_Lightning_Point)
          • Trigger - Turn off (This trigger)
        • Else - Actions
So, is there any error about it? or leaks?
 
Level 16
Joined
May 1, 2008
Messages
1,605
Seas =)

The first view I can't see a directly mistake but this "Hashtable - Create a hashtable" should be used in the Initialization trigger. Also you should set the hashtable into a variable like this:

  • Initialization
    • Actions:
      • Hashtable - Create a Hashtable
      • Set <your hashtable variable> = Last Created Hashtable
Edit: What's about the "Special effect - Destroy (Last created Special Effect)" in the second trigger. I don't know, but can't this remove a wrong effect?
 
Level 15
Joined
Aug 14, 2007
Messages
936
Set Lightning_Caster = (Casting unit)
Set Lightning_Target = (Target unit of ability being cast)
_______________________________________

You should set lighttarget first before setting casting unit.. like shown below

_______________________________________

Set Lightning_Target = (Target unit of ability being cast)
Set Lightning_Caster = (Casting unit)





reason? because the engine will erase target of ability cast after 1 action
 
Status
Not open for further replies.
Top