• Check out the results of the Techtree Contest #19!
  • 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.
  • Create a void inspired texture for Warcraft 3 and enter Hive's 34th Texturing Contest: Void! Click here to enter!
  • The Hive's 22nd Icon Contest: Creep Abilities is now concluded, time to vote for your favourite set of icons! Click here to vote!

[Spell] Laser Spell

Status
Not open for further replies.

sentrywiz

S

sentrywiz

Hi all.

I want to make a laser spell. But I have no idea how to start. I know its channeled spell but I have never created lightning effects from unit to point so idk how its done.

Also most laser spells I found seem to be in vJass. SO I can't learn from that.

I want to learn to make my own, not just copy paste one.
 
Since you wish to learn, I wont send exact triggers.

basically something like this.

1. you cast the spell
2. the trigger detects the spell is cast
3. pick every unit within X range
4. check if the angle between the caster and the picked unit is equal to the angle between the caster and the targeted location point.
5. if it matches, deal damage

If you don't want it to be an instant cast spell that only deal damage instantly, you just repeat the processes in a loop. Head over to the tutorial section if you want more info on how to do that.
 
4. check if the angle between the caster and the picked unit is equal to the angle between the caster and the targeted location point.
Also check if the angle is relevant (~45). For the 0-360 thing, if the angle is greater than 180, subtract 360 and turn to positive.
 
He means the phoenix spell of laser in DotA.

That's actually not that hard. You just have to collect some information before starting :
1- Channeling spell, so it means we use either (Unit - A Unit starts the effect of an abilty) or (Unit - A Unit starts channeling a spell)
2- It's damaging every unit every 1 seconds, it means there is a periodic trigger to damage units within its laser.
3- Once the caster turns for example 45, the laser will automatically turn with it 45 °, which means there is an updating trigger that changes the laser position and angle everytime.
4- It uses a linear laser == it means it uses lightning Effect.
5- When the phoenix stops channeling , maybe it's auto-timed spell , for example it's set to end after 5 seconds. Here we need timers.

Long story short, you need up to 4 triggers.

If you want me to create the spell no problem but first try it yourself :D
 
Since you wish to learn, I wont send exact triggers.

basically something like this.

1. you cast the spell
2. the trigger detects the spell is cast
3. pick every unit within X range
4. check if the angle between the caster and the picked unit is equal to the angle between the caster and the targeted location point.
5. if it matches, deal damage

If you don't want it to be an instant cast spell that only deal damage instantly, you just repeat the processes in a loop. Head over to the tutorial section if you want more info on how to do that.

The 4. point is where I don't understand. What is the angle thing you're talking about?

He means the phoenix spell of laser in DotA.

That's actually not that hard. You just have to collect some information before starting :
1- Channeling spell, so it means we use either (Unit - A Unit starts the effect of an abilty) or (Unit - A Unit starts channeling a spell)
2- It's damaging every unit every 1 seconds, it means there is a periodic trigger to damage units within its laser.
3- Once the caster turns for example 45, the laser will automatically turn with it 45 °, which means there is an updating trigger that changes the laser position and angle everytime.
4- It uses a linear laser == it means it uses lightning Effect.
5- When the phoenix stops channeling , maybe it's auto-timed spell , for example it's set to end after 5 seconds. Here we need timers.

Long story short, you need up to 4 triggers.

If you want me to create the spell no problem but first try it yourself :D

Oh no no no... i want a simple laser spell. it doesn't move. you cast it once and it shoots there until you stop or until it finishes.

I just don't know these points:

1. I found a fire laser on the hive that I want to use as the 'laser'
2. I can import it, but how do I use it? Do I make a dummy unit, put the fire laser as it and then create the dummy unit from point A to point B when the spell is cast?

Since you wish to learn, I wont send exact triggers.

That's fine, but its better for me if you do. Because I already understand 80% of how to make the spell.
The only things I don't are the laser animation.

Basically I've made a channeling spell that damages all enemies in point A for X damage every Y seconds until laser finishes or its cancelled.
Now I just want to attach the cool fire laser model I found on hive so that it looks cooler.
That's basically it.
 
Oh it's simple bro... Since it doesn't move then it's very very simple.

You have to create a dummy for example named 'LaserDummy' , change its model to the one you imported.

In the triggers, create the dummy one after one, one after one until it creates a line. Otherwise use lightning effect.

Here is an example for how to create a one-by-one linear path of laser.

  • Set LaserStartReal = 100
  • For each Integer Variable LaserInteger from 1 to (Distance) and do :
    • Loop - Actions
      • Set DummySpawnPoint = ( (CasterPoint) offset by LaserStartReal towards (Facing of (Caster) Angle)
      • Unit - Create 1 LaserDummy in DummySpawn Point facing (Facing of Caster Angle)
      • Set LaserStartReal = (LaserStartReal) + 100 ( It may be 200 or 300 , depends again on your dummy's scaling value)
      • Custom script: call RemoveLocation(udg_DummySpawnPoint)
 
Oh it's simple bro... Since it doesn't move then it's very very simple.

You have to create a dummy for example named 'LaserDummy' , change its model to the one you imported.

In the triggers, create the dummy one after one, one after one until it creates a line. Otherwise use lightning effect.

Here is an example for how to create a one-by-one linear path of laser.

  • Set LaserStartReal = 100
  • For each Integer Variable LaserInteger from 1 to (Distance) and do :
    • Loop - Actions
      • Set DummySpawnPoint = ( (CasterPoint) offset by LaserStartReal towards (Facing of (Caster) Angle)
      • Unit - Create 1 LaserDummy in DummySpawn Point facing (Facing of Caster Angle)
      • Set LaserStartReal = (LaserStartReal) + 100 ( It may be 200 or 300 , depends again on your dummy's scaling value)
      • Custom script: call RemoveLocation(udg_DummySpawnPoint)

I see. Thanks. I was thinking of a lightning rather than make many dummies to form a laser.
 
Status
Not open for further replies.
Back
Top