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

[Spell] How to make a free floating arrow

Status
Not open for further replies.
Level 3
Joined
Nov 19, 2014
Messages
39
Hi there, I'm looking to make an arrow that is like elune's arrow but without the stun-on-hit aspect. Basically I want an arrow that moves straight for a certain distance and damages anyone that goes through it, so it just keeps going for a certain limit and does not stop on impact. So exactly like windrunner's arrow in dota 2.

1) Is there any ways I could base it off a certain spell and edit it using GUI triggers? I tried using storm bolt and editing the "target's allowed" field to check only terrain and ground, but that doesn't seem to work.

2) Is there any way to avoid custom scripting and Jass for this ?

Your help is appreciated.
 
Level 1
Joined
Jun 1, 2016
Messages
6
So, basically, a shockwave/carrion swarm-like spell? An arrow flying, dealing damage to each enemy in a specific range of the projectile, then disappering after the maximum range?

Triggering is not easy (nor hard, medium difficulty), but it is really... long. ^^

At 1st: make a Dummy Projectile. Same thing as a Dummy Unit (infest skill etc) BUT with a model. This model should be the projectile you wanna use (here, an arrow).

You also want to know one important thing :
the max range your arrow can go. For our example (my carrion swarm triggered), it's 700.

I'm going to type a trigger that I once did in like 20-30 minutes so it might not being leakless and might also have some pointless uses of variables, but it works anyway, i've tested the spell 20+ times

You should have two triggers

First one the casting
Second one the loop

On the first one :

E
A unit casts a spell
C
Ability being cast = your ability
A
Set CasterSpell = (Triggering Unit)
Set PositionCaster = (Position of (Triggering unit))
Set TargetPointSpell = (Target point of ability being cast)
Unit - Create 1 Dummy Projectile for (Owner of (Triggering unit)) at PositionCaster facing TargetPointSpell
Set SpellDummyProjectile = (Last created unit)
Groupe unit - Add SpellDummyProjectile to SpellDummyGroup
Unit - Set the custom value of SpellDummyProjectile to 28*
Trigger - Turn on Loop Spell
custom script : call RemoveLocation (udg_PositionCaster)
custom script : call RemoveLocation (udg_TargetPointSpell)

*why 28 : it depends of you, and of the maximum range. The loop event is a periodic event, checking every 0,02 seconds. Every 0,02 second, the custom value will be reduced by 1. Every 0,02 second, the DummyProjectile will move 25 range forward. 700/25 = 28, meaning that after 28 loop event, the custom value will be 0, the projectile will have made its way through 700 range, and when the custom value is 0, you can check it thanks to a condition to stop running the spell.

So the number has to be fixed by this simple calculus:
Range Max / Range by second (here, 700 / 25). You can also modify the period : to get the spell to be even faster, make the 0,02 a 0,01. Slower, any value higher. The higher the value is, the less the loop will occur each second, meaning the projectile will move less. I recommand not setting anything higher to 0,06 to keep a fluid move animation.

So here's the second trigger. It might be hard to understand (sorry idk how does the code system works here i'm new), so i'm gonna post screenshots. HOWEVER, since I'm french, some parts will be french. Sorry.

Loop:

E
Time - Every 0,02 seconds of game time
C
A
Group Unit - Pick every unit in SpellDummyGroup and do (Actions)
- Loop Actions
- - Set SpellDummyProjectile = (Picked Unit)
- - Set SpellDummyPoint = (Position of SpellDummyProjectile)
- - Unit - Move SpellDummyProjectile instantly to (SpellDummyPoint offset by 25.00 towards (Facing of SpellDummyProjectile) degrees)
- - Unit - Set the custom value of SpellDummyProjectile to ((Custom value of SpellDummyProjectile) -1)
- - C : If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- - - If - Conditions
- - - - (Custom Value of SpellDummyProjectile) equals to 0
- - - Then
- - - - Unit - Remove SpellDummyProjectile from the game
- - - - Group Unit - Remove all units of SpellDummyGroup from SpellDummyGroup
- - - - Group Unit - Remove all units of TargetSpellGroup from TargetSpellGroup
- - - Else
- - - - Unit group - Pick every unit in (Units within 200.00 of (Position of SpellDummyProjectile) matching ((((Matching unit) belongs to an enemy of (Owner of SpellDummyProjectile)) equal to TRUE) and (((Matching unit) is in TargetSpellGroup) equals to FALSE))) and do
- - - - Loop Actions
- - - - - Unit - Cause CasterSpell to damage (Picked Unit), dealing 200.00 damage etc
- - - - - Group Unit - Add (Picked unit) to TargetSpellGroup
Custom script : call RemoveLocation (udg_SpellDummyPoint)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If
- - (Number of units in SpellDummyGroup) equals to 0
- Then
- - Trigger - Turn off (This Trigger)

There should be the two screenshots attached to the post.
There's also a test map, so you can check if the spell / trigger is what you want.
I added for my personal uses a stun to the shockwave (the three actions circled by the red rectangle) : if you don't want the shockwave/carrion to stun, simply delete it.
The name of the variables is "fleau" because it's a french word and my skill is in french.
The spell is based upon the Channel Spell.
You can change the model of the projectile to an arrow, so that it will look like a flying arrow that deals damage in a line.
 

Attachments

  • Ma Shockwave 2.png
    Ma Shockwave 2.png
    53.8 KB · Views: 138
  • Ma Shockwave 1.png
    Ma Shockwave 1.png
    16.3 KB · Views: 91
  • Test Shockwave.w3x
    21 KB · Views: 69
Level 22
Joined
Aug 27, 2013
Messages
3,973
You leak some locations:
"(SpellDummyPoint offset by 25.00 towards (Facing of SpellDummyProjectile)"
"(Position of SpellDummyProjectile)"

You don't need to modify custom value, just use real or integer variable for that.
Your spell is not MUI, try to cast it multiple times. It will become buggy.
Use Dynamic Indexing to make it MUI.
 
Level 1
Joined
Jun 1, 2016
Messages
6
You leak some locations:
"(SpellDummyPoint offset by 25.00 towards (Facing of SpellDummyProjectile)"
"(Position of SpellDummyProjectile)"

You don't need to modify custom value, just use real or integer variable for that.
Your spell is not MUI, try to cast it multiple times. It will become buggy.
Use Dynamic Indexing to make it MUI.

Multiple times with the same unit : done, no problem
Multiple times with different units at the same time : since only one hero is supposed to have this ability, he's going to be the only one to use it, so no problem... ;D nah, I know it's wrong, but I honestly don't know a thing about indexing, i've began to use the editor the 1st of June and tools like Bribe's DE or Unit Indexing... basically yesterday I guess. The author will have to make it MUI himself - which, from what you've said, doesn't seem like a lot of troubles.

And you're right about the real/integer instead of the custom value, i've even done so for other spells that used the same pattern, should have revised this trigger lol gonna edit that asap
Thanks for the two leaks btw, i'm gonna try fix them to avoid lags

amer -> There's a lot of shockwave MUI spells here or everywhere that you can download and modify, so just find one and take one. :)
 
Level 8
Joined
Jan 28, 2016
Messages
486
If you're interested, there's this PotM spellpack from The Helper that should be self-explanatory. Do note that the "arrow" should stop when it "strikes" a valid target, so you might have to tweak the trigger a bit. Try having a look at the Powershot in this Windrunner spellpack as well. They got a lot of recreated DotA spells at The Helper so if you ever need to know how to create one, have a look there.
 
Level 3
Joined
Nov 19, 2014
Messages
39
Thank you for your help guys.

Slifer62 your code might work, but you made me realize that there is a very easy solution to this without the use of triggering at all. I can easily use Dreadlord's carrion swarm and just change the missile to an arrow and viola!

I tried it and it worked, so no apparent problems till now.
 
Level 1
Joined
Jun 1, 2016
Messages
6
There is a problem with that, though.
hwBEGFJ.jpg

Here is how buggy it is if you cast it multiple times. Even only with one unit.

Did you cast it like without waiting some seconds? Because in the testmap the spell doesn't have a cd but it should have one in a real map of course! I've never tried to cast it twice at the same second, that might be why i've never came across this bug. :)
By multiple times, I meant : cast, wait the supposed cd, cast, wait the cd, cast, etc... ^^

I realize my spell triggering skills are still quite low lol, thanks Rheiko, I'll try to fix that by myself :)

amer -> really ? I thought I tried to change the projectile of the spell in the spell editor but it didn't work... but I'm glad it worked for you anyway, you now have your arrow spell! I've once found the Windrunner Spellpack somewhere (here I guess), just type "Warcraft 3 Windrunner Spellpack" on google and you'll find the other spells in case the other spells interest you =)
 
Last edited:
Level 3
Joined
Nov 19, 2014
Messages
39
yup, very easy solution. Btw slifer62 I could use another hand in my map which I am currently developing. Its a small hero arena pvp, im trying to make it as interesting and unique as possible. So would you like to join ?
 
Status
Not open for further replies.
Top