Laser Trouble

Mythes

Member
Reaction score
7
I'm trying to make a Laser Charging Spell...
So, the idea is, the hero starts the effect of the ability, and a countdown fires.
The longer he holds the countdown (meaning, he stands still), the farther the laser hits.
I made 4 triggers for that, as follows:


The Start of the ability (ONLY TRIGGER ENABLED FROM START)
Trigger:
  • Lasers
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to I'm Chargin Ma Lazerz
    • Actions
      • Set LaserCount = 0
      • Set LaserCaster = (Triggering unit)
      • Set LaserCasterLoc = (Position of LaserCaster)
      • Set LaserTargetLoc = (Target point of ability being cast)
      • Unit - Make LaserCaster face LaserCasterLoc over 0.01 seconds
      • Set LaserFacing = (Facing of LaserCaster)
      • Trigger - Turn on Laser Charge <gen>
      • Trigger - Turn on Laser Cancel <gen>
      • Custom script: call RemoveLocation (udg_LaserCasterLoc)
      • Custom script: call RemoveLocation (udg_LaserTargetLoc)


The Laser Counting (quite fast, up to 2 seconds..)

Trigger:
  • Laser Charge
    • Events
      • Time - Every 0.20 seconds of game time
    • Conditions
    • Actions
      • Set LaserCount = (LaserCount + 1)
      • Floating Text - Create floating text that reads (String(LaserCount)) at (Position of LaserCaster) with Z offset 0.00, using font size 18.00, color (100.00%, 100.00%, 0.00%), and 25.00% transparency
      • Floating Text - Set the velocity of (Last created floating text) to 64.00 towards 90.00 degrees
      • Floating Text - Change (Last created floating text): Disable permanence
      • Floating Text - Change the fading age of (Last created floating text) to 0.10 seconds
      • Floating Text - Change the lifespan of (Last created floating text) to 0.20 seconds
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • LaserCount Equal to 10
        • Then - Actions
          • Trigger - Turn off (This trigger)
          • Trigger - Turn on Laser Effect <gen>
        • Else - Actions


Canceling the charging, and releasing the laser...

Trigger:
  • Laser Cancel
    • Events
      • Unit - A unit Is issued an order targeting an object
      • Unit - A unit Is issued an order targeting a point
      • Unit - A unit Is issued an order with no target
    • Conditions
      • (Triggering unit) Equal to LaserCaster
    • Actions
      • Trigger - Turn off Laser Charge <gen>
      • Trigger - Turn off (This trigger)
      • Trigger - Turn on Laser Effect <gen>


The actual laser effect (just testing w/ thunderclap)

Trigger:
  • Laser Effect
    • Events
    • Conditions
    • Actions
      • Set LaserPosition2 = LaserCasterLoc
      • For each (Integer A) from 1 to LaserCount, do (Actions)
        • Loop - Actions
          • Special Effect - Create a special effect at (LaserPosition2 offset by ((Real(LaserCount)) x 100.00) towards 0.00 degrees) using Abilities\Spells\Human\ThunderClap\ThunderClapCaster.mdl
          • Special Effect - Destroy (Last created special effect)
      • Trigger - Turn off (This trigger)



My problem is only with the effect part... It doesn't appear... I have no idea why..
Help here?


Myt.
 

Weep

Godspeed to the sound of the pounding
Reaction score
400
Laser Effect has no event, and you only turn it on, not run it - so that trigger never runs...

Also, Laser Effect leaks a point (the point with polar offset).

Also, I'd simply use Stops Casting as the only necessary event for Laser Cancel.
 

Mythes

Member
Reaction score
7
I can't use stop casting, because the ability I based it on is a point ability (carrion swarm). You can't stop casting an instant =/

Still, now I'm getting only one effect... Instead of looping the effect in a line, with each effect being further away from the caster, I only get the last effect... Maybe a wait?
Any help here ?

BTW I'm posting a map...
 

Attachments

  • Laser Help.w3x
    21.2 KB · Views: 130

TomTTT

New Member
Reaction score
44
I can't use stop casting, because the ability I based it on is a point ability (carrion swarm). You can't stop casting an instant =/

Still, now I'm getting only one effect... Instead of looping the effect in a line, with each effect being further away from the caster, I only get the last effect... Maybe a wait?
Any help here ?

BTW I'm posting a map...

Try changing the distance/special effect. You may be just not noticing one.

By the way, why dont you MUI this?
 

Mythes

Member
Reaction score
7
Not necessary...
My map only allows one instance of each hero :)
Yet, I might MUI it someday (probably not though xD)

I don't think the distance is the problem, cause if I cast the spell with 1 second charge, the explosion is right next to my character (100 range). If I cast it with 2 seconds, it's a little further (200 range) and so on...
So it's strange that it doesn't create all the explosions at once...

Anybody else care to try solve this? xD
 

Mythes

Member
Reaction score
7
LOL!!!
Thanks!!!!


rep+ all
skills is working marvelous *-*

Edit:

I found a bug in the ability and I have fixed it.. I'm posting what happened and how I fixed it, if anyone needs ideas =)
I made the base ability off channel, and set it to a channel type spell. Then, I set the follow through time and duration of each lvl of channel to 7, 11 and 15.
When I cast the ability, sometimes the laser fires off in a totally wierd direction.
This happened when I walked in one direction and then casted to another... I fixed that with a little wait between Unit - Make Caster face point, and Set Facing = Facing of Caster.

the triggers are as follow...


Starting the ability.

Trigger:
  • Lasers
    • Events
      • Unit - A unit Begins channeling an ability
    • Conditions
      • (Ability being cast) Equal to Ima Charjin me Lazerz
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Level of Ima Charjin me Lazerz for LaserCaster) Equal to 1
        • Then - Actions
          • Set LaserCount = 0
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Level of Ima Charjin me Lazerz for LaserCaster) Equal to 2
        • Then - Actions
          • Set LaserCount = 4
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Level of Ima Charjin me Lazerz for LaserCaster) Equal to 3
        • Then - Actions
          • Set LaserCount = 8
        • Else - Actions
      • Set LaserCaster = (Triggering unit)
      • Set LaserCasterLoc = (Position of LaserCaster)
      • Set LaserTargetLoc = (Target point of ability being cast)
      • Unit - Make LaserCaster face LaserTargetLoc over 0.01 seconds
      • Wait 0.5 seconds <------------------------------------------------------------------------- HERE'S THE CRUCIAL PART!
      • Set LaserFacing = (Facing of LaserCaster)
      • Trigger - Turn on Laser Charge <gen>
      • Trigger - Turn on Laser Charging Effect <gen>
      • Trigger - Turn on Laser Cancel <gen>


Charging....

Trigger:
  • Laser Charge
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
    • Actions
      • Unit - Make LaserCaster face LaserTargetLoc over 0.01 seconds
      • Set LaserCount = (LaserCount + 1)
      • Floating Text - Create floating text that reads (String(LaserCount)) at (Position of LaserCaster) with Z offset 0.00, using font size 18.00, color (100.00%, 0.00%, 100.00%), and 25.00% transparency
      • Floating Text - Set the velocity of (Last created floating text) to 64.00 towards 90.00 degrees
      • Floating Text - Change (Last created floating text): Disable permanence
      • Floating Text - Change the fading age of (Last created floating text) to 0.60 seconds
      • Floating Text - Change the lifespan of (Last created floating text) to 0.80 seconds
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Level of Ima Charjin me Lazerz for LaserCaster) Equal to 1
        • Then - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • LaserCount Equal to 7
            • Then - Actions
              • Trigger - Turn on Laser Effect <gen>
              • Trigger - Turn off Laser Charging Effect <gen>
              • Trigger - Turn off Laser Cancel <gen>
              • Trigger - Turn off (This trigger)
            • Else - Actions
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Level of Ima Charjin me Lazerz for LaserCaster) Equal to 2
        • Then - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • LaserCount Equal to 11
            • Then - Actions
              • Trigger - Turn on Laser Effect <gen>
              • Trigger - Turn off Laser Charging Effect <gen>
              • Trigger - Turn off Laser Cancel <gen>
              • Trigger - Turn off (This trigger)
            • Else - Actions
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Level of Ima Charjin me Lazerz for LaserCaster) Equal to 3
        • Then - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • LaserCount Equal to 15
            • Then - Actions
              • Trigger - Turn on Laser Effect <gen>
              • Trigger - Turn off Laser Charging Effect <gen>
              • Trigger - Turn off Laser Cancel <gen>
              • Trigger - Turn off (This trigger)
            • Else - Actions
        • Else - Actions


Casting eye-candy *0*

Trigger:
  • Laser Charging Effect
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
    • Actions
      • Animation - Play LaserCaster's spell animation, using only Rare animations


The actual SFX and damage.

Trigger:
  • Laser Effect
    • Events
      • Time - Every 0.01 seconds of game time
    • Conditions
    • Actions
      • Set LaserPosition2 = LaserCasterLoc
      • For each (Integer A) from 1 to LaserCount, do (Actions)
        • Loop - Actions
          • Set LaserPoint = ((Position of LaserCaster) offset by ((Real((Integer A))) x 150.00) towards LaserFacing degrees)
          • Special Effect - Create a special effect at LaserPoint using Abilities\Spells\Items\TomeOfRetraining\TomeOfRetrainingCaster.mdl
          • Special Effect - Destroy (Last created special effect)
          • Unit Group - Pick every unit in (Units within 200.00 of LaserPoint matching ((((Matching unit) is A structure) Equal to False) and ((((Matching unit) belongs to an enemy of (Owner of LaserCaster)) Equal to True) and (((Matching unit) is alive) Equal to True)))) and do (Actions)
            • Loop - Actions
              • Unit - Cause LaserCaster to damage (Picked unit), dealing (40.00 + (80.00 x (Real((Level of Ima Charjin me Lazerz for LaserCaster))))) damage of attack type Spells and damage type Normal
          • Custom script: call RemoveLocation (udg_LaserPoint)
      • Trigger - Turn off Laser Cancel <gen>
      • Trigger - Turn off (This trigger)
      • Custom script: call RemoveLocation (udg_LaserCasterLoc)
      • Custom script: call RemoveLocation (udg_LaserTargetLoc)
      • Custom script: call RemoveLocation (udg_LaserPosition2)


Stop channel.

Trigger:
  • Laser Cancel
    • Events
      • Unit - A unit Finishes casting an ability
      • Unit - A unit Is issued an order targeting an object
      • Unit - A unit Is issued an order targeting a point
      • Unit - A unit Is issued an order with no target
    • Conditions
      • (Triggering unit) Equal to LaserCaster
    • Actions
      • Trigger - Turn off Laser Charge <gen>
      • Trigger - Turn off Laser Charging Effect <gen>
      • Trigger - Turn off (This trigger)
      • Trigger - Turn on Laser Effect <gen>




NOTE TO SELF:
REALS DO NOT LEAK.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top