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

Detect Cursor

Status
Not open for further replies.
Yes, it requires Trackables. They are a somewhat 'incomplete' function specific to JASS only.

They allow you to create a model on the map, and then you can detect when a player hovers over them or clicks them. The drawbacks of trackables:
  • There is no function to destroy trackables. This is the biggest drawback, since it means that you can't
    create full-fledged systems that would require tons of trackables. Once you create one, it will stay there in memory.
  • You can't retrieve the player who clicked the trackable. Not natively anyway. Using GetLocalPlayer(), such
    as in my system that bajaist linked, you can detect the player who clicked it. It means you'll end up generating a trackable
    for each player, but it is mostly useless if you don't know which player clicked it.
  • You can't create them on screen, and they must use a model. Sadly, they'll be created on the terrain, not the screen,
    so you can't really detect where the cursor is. That is why most inventory/talent tree systems are full-screen. It allows you to
    make a fixed set of trackables on one part of the screen, so you can detect where the cursor is (as long as the camera stays in that position).

There are some examples in the spells section which implement trackables using GUI, but they still resort to custom scripts and mostly JASS. Perhaps I should make GUI-friendly extensions for my system?

If you need more info, feel free to ask.
 
Here you go, http://www.hiveworkshop.com/forums/trigger-gui-editor-tutorials-279/trackables-176983/.
A tutorial and a demo map mostly all in GUI or compatible with GUI.

They aren't locked to JASS, never were. Just it was never discovered or nobody ever bothered.

Custom script == JASS, and that was what I meant when I said it was "specific to JASS only".

My map will supposedly be large and I heard that making trackables for a 256x256 map is a huge load on the memory.

So never mind. I'll just probably use channel.

Memory is overall pretty cheap, but it is indeed a lot. In 256x256, if you had one trackable per tile, you'd end up with 65536 trackables. And even that is pretty low in terms of precision.

If you wanted better precision, you would have 4 per tile, and that would be 262144 trackables.

Also, even when trackables use an untextured plane model, they will still take up performance. More trackables on screen == lower-fps. In general trackables aren't very practical except in fixed-camera locations, or in small maps. (... or when they are used for what Blizzard intended them to be used for ...)
 
Status
Not open for further replies.
Top