• 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.

Quick Cast System or alike Pre Reforged?

Level 6
Joined
Apr 15, 2016
Messages
118
I believe there isn't a Quick/Smart Cast System pre Reforged? Smart/Quick cast is the possibility to cast a spell with no need to target them.

I believe this could be achieved by actually making spells with no Target at all, just make their effects go towards the facing angle of the Caster, but then, how would the caster face the mouse position when the spell is casted?
 
Level 45
Joined
Feb 27, 2007
Messages
5,578
how would the caster face the mouse position when the spell is casted?
[vJASS] - [Snippet] Mouse Utility and other similar resources exist to easily query mouse position.
I believe this could be achieved by actually making spells with no Target at all, just make their effects go towards the facing angle of the Caster
Okay so I click Flamestrike and it casts "in front" of me. But where? How far in front? At what distance? Is anything prioritized? I think there is a lot more nuance here than it initially seems.
 
Level 6
Joined
Apr 15, 2016
Messages
118
[vJASS] - [Snippet] Mouse Utility and other similar resources exist to easily query mouse position.

Okay so I click Flamestrike and it casts "in front" of me. But where? How far in front? At what distance? Is anything prioritized? I think there is a lot more nuance here than it initially seems.
About the second part, it's because i didn't give a lot of info. Basically my needs are exclusive Wave Spells, which have a set distance. It's why facing angle would be the finest, if not for the fact that if I simply cast in front of the caster would have some inconsistencies if the caster didn't turn fast enough to the intended target.

About the first, I don't really know what is a Snippet and how to use that. What event do I have to call to make that script work?
 
Level 45
Joined
Feb 27, 2007
Messages
5,578
Ah yeah that will be fine for waves like that. An alternative solution: you can give the casters no cast point and cast backswing, then play cast animations with Uncle's system. Won't allow instant casting or turning because presumably these units have movement, but you can kind of copy the way dummy casters work.

Snippet just usually means something that is useful and polished that you can leverage in some way, but is not a explicit larger complex system that does things for you. Often refers to something that is just code/text with no example map, since it is simple enough and can easily be pasted into a map in one step.

I don't mean to be rude but as I said in the xe thread: you could read the documentation. I'll gladly answer questions you have (or you could post in the resource threads), but I would be remiss if I didn't point out that people write documentation/API overviews/comments specifically to help understand what things can be done and how to do them. It's quite simple, here:
JASS:
local player someP = GetOwningPlayer(GetTriggerUnit())
local real mx = UserMouse[someP].mouseX
local real my = UserMouse[someP].mouseY

//equivant 'JASS-style' functions work the same way:
local real mx = GetPlayerMouseX(someP)
local real my = GetPlayerMouseY(someP)
That snippet does more things but that's the most direct way you'd use it. It's constantly querying the mouse positions and buttons behind the scenes and whenever you want to know the current position you just read it. I believe the mouse will return (0,0) as its position when located on the UI rather than the game world? It's been a while since I mucked with it; might just preserve the last known value.
 
Top