New spell idea- is it possible?

Rakaesa

Member
Reaction score
5
Okay, so just a few minutes ago i'm messing around in world editor and I got an idea for a different kind of spell I've never seen used before. I don't mean a different element, I mean a different way to deal damage.

Let's say I have a spell, "Fireball". This fireball is target specific, as in it only affects one unit.

Lets say the unit i'm targetting is right infront of me. The spell itself says it will deal 200 damage, so the target gets hurt by 200 damage. Right. That's completely easy.

But now my idea gets interesting. Lets say the target is a good 300-400 range away. I fire the spell. But NOW the spell has decreased accuracy because the target is farther away, so lets say 75% accuracy. It also decreases its damage, so 75% damage.

This will go on and on untill it reaches a range where the accuracy will be 0%, and the damage will be 0%.

So I wanted to know if it's possible to do this kind of thing. I'd make the spell have infinite range, but the farther the target the less chance the spell has of hitting and the less damage it deals. Any ideas on how to do this? if it MUST be done in JASS, please give me the code to put in custom script because I have no idea how to do JASS.
 

Ayanami

칼리
Reaction score
288
It's very possible to do it in GUI. However, you'd likely need a dummy unit to act as the projectile and move it periodically.
 

Ayanami

칼리
Reaction score
288
Well, there's an easier method. But that method would take account the distance between the caster and the target at the instance of damage, rather than the actual distance traveled by the projectile.
 

Rakaesa

Member
Reaction score
5
Couldn't that cause a few problems though? If the player and the target move closer together while the projectile is going, the range will be decreased (Which it's likely to happen unless the target is ranged and shooting at you when you fire it)

Edit: although I suppose that would happen with the first method anyways. Guess it'll have to stay that way. Okay, so how do I do this method as it seems easier?
 

Ayanami

칼리
Reaction score
288
Nope, with the first method, you'll be able to accurately track the actual distance traveled. If you don't know how to use dummy units, I could teach you how to right now. Better learn it that never :D
 

Rakaesa

Member
Reaction score
5
I know how to basicly use dummy units as said in another thread about dummy spells I had made, but I don't know how to do the things like periodically check them. Creating a dummy unit and moving it to the assigned target is easy, and I just have to remove the missle and all damage from the spell itself and trigger it onto the dummy unit. But I have no idea what you mean by periodically check. Is there a way to check the distanced traveled from where the unit is spawned to the target it's told to move to instead? If not just explain to me how to do the periodically checking thing.
 

Ayanami

칼리
Reaction score
288
Well, you do know that moving dummy units isn't actually ordering them to move, right? It's actually periodically, like 0.03 seconds, moving them instantly towards the desired direction in a very small distance. So moving them 10 distance every 0.03 seconds would result in 333.33 distance traveled in 1 second. Thus, every 0.03 seconds, you could update the distance traveled, using a real variable.

Hashtable would be the easiest method to accomplish this, in GUI of course.
 

Sajin

User title under construction.
Reaction score
56
by using a perodic event you can track it with a counting variable (ex. Every 0.01 seconds, Set Real = Real + 1) but im sure there is more then 1 way to ;)
edit:
What Ayanami said :)
 

Rakaesa

Member
Reaction score
5
Right, I sort of understand that now. But I still don't know where to go to make this trigger, as there is only a unit move (Instantly), and not something more like periodically. Also, wouldn't that make the moving dummy look a lot glitchier then a normal missles? lol
 

Ayanami

칼리
Reaction score
288
Well, you're supposed to utilize "Unit - Move (Instantly)". However, you're supposed to do that every 0.03 seconds or so. You need another trigger with an periodic time event of 0.03. Store the dummy in a variable and move it. You'd need to use Angle Between Points to determine the direction of the target, of course.

It won't look glitchy. You're moving it a extremely small distance in a very short period (0.01 - 0.04 works best), thus it'll look like a smooth movement.
 

Rakaesa

Member
Reaction score
5
Hmm, alright, i'll have to try this tomorrow and take a look at the periodic time event thing. I think I know how to store the unit in a variable already. Thanks for the help, it's getting late so i'll do that tomorrow.
 
General chit-chat
Help Users

      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