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

Change cursor at runtime

Status
Not open for further replies.
Level 4
Joined
Mar 8, 2006
Messages
27
Now that blizzard has provided an API for mouse & keyboard, I was wondering if it is possible to change the cursor. The idea is, when you press a key (e.g. Q or 1), I want to change the cursor to the crosshair cursor or any custom cursor model to indicate your next click will be the location to cast at.

Alternatively, the ability to display the AoE target model at the position of your mouse could possibly work as well.

Couldn't find any natives or existing threads for this, anyone know if this is possible?
 
I don't think it's possible unless the cursor is a frame that can be retrieved through code. I tried a few but I wasn't able to get it and I'm not even sure if the cursor is a frame at all.

You can however ForceUIKey to press A for attack to show the crosshair cursor, as long as you have a unit with attack currently selected.
 
Level 4
Joined
Mar 8, 2006
Messages
27
Try these.

I don't think these are quite what I'm looking for, they'll just move the mouse or tell you what unit is at the mouse position


I don't think it's possible unless the cursor is a frame that can be retrieved through code. I tried a few but I wasn't able to get it and I'm not even sure if the cursor is a frame at all.

You can however ForceUIKey to press A for attack to show the crosshair cursor, as long as you have a unit with attack currently selected.

Yeah I actually never thought of the possibility that it's a frame - I might give that a go as well but it seems like you've already tried that without luck...

The `ForceUIKey` option is interesting - especially since I could use `SelectUnit` to select a dummy unit first just to get the crosshair - and then select whatever you had originally selected back, although I wonder if that would cancel the cursor...probably.

I'll experiment a bit to try to come up with a hack. Thanks for the help!
 
The `ForceUIKey` option is interesting - especially since I could use `SelectUnit` to select a dummy unit first just to get the crosshair - and then select whatever you had originally selected back, although I wonder if that would cancel the cursor...probably.

Selections are also synchronized in multiplayer so there might be a delay when going back and forth between units. And yeah, I don't think the cursor will stay as the crosshair when selecting a new unit.
 
Status
Not open for further replies.
Top