A 3D Cursor for your mod

Post your example zscripts/ACS scripts/etc here.
Forum rules
The Projects forums are only for projects. If you are asking questions about a project, either find that project's thread, or start a thread in the General section instead.

Got a cool project idea but nothing else? Put it in the project ideas thread instead!

Projects for any Doom-based engine (especially 3DGE) are perfectly acceptable here too.

Please read the full rules for more details.
User avatar
Sir Robin
Posts: 398
Joined: Wed Dec 22, 2021 7:02 pm
Graphics Processor: Intel (Modern GZDoom)
Location: Medellin, Colombia

A 3D Cursor for your mod

Post by Sir Robin »

I first started working on this for my Look Cursor but have decoupled it to make it easy to use in other mods. I've also combined it with bits of Nash's Radius Debug mod, particularly the wireframe cubes as indicators.

What is it? Put it this way - does your mod have a need to the player to point to something specific? For example do you have minions that the player can tell to target certain monsters, or go get certain pickups, or to guard a certain area? Or to call an airstrike and have the player point to a specific area to target? This mod gives the player a 3d cursor to point to something specific.

To use it is pretty easy:
  • create a class that inherits the MWR_Cursor3dInv class
  • override the functions DoAfterEnable, DoWhileEnabled, DoBeforeDisable to tell what to do before, during, and after cursor activation: put calls to your mod here
  • give the player a way to call the EnableCursor and DisableCursor functions. Could do this from an event handler or from a weapon or whatever works for your mod.
  • give this new class to your player (it's an inventory item)
  • You're Done! It works!
Here is the MWR_Cursor3D mod along with an example mod showing how to put it to use:
Download MWR_Cursor3d_Example.zip
To try it out:
  • Load MWR_Cursor3D.pk3 file
  • Load Example folder
  • In game, press and hold the cursor key (default C) to see the cursor
  • By default cursor does nothing extraordinary. Open ExampleCursor.zs and uncomment some of the optional lines to see their effects
Also see the cursor mod in use in my Loot Markers mod.
User avatar
Sir Robin
Posts: 398
Joined: Wed Dec 22, 2021 7:02 pm
Graphics Processor: Intel (Modern GZDoom)
Location: Medellin, Colombia

Re: A 3D Cursor for your mod

Post by Sir Robin »

I posted a video of my Loot Marker mod which uses this cursor mod.
See the cursor usage starting at 3:00

Return to “Script Library”