Description:
This provides the ability to precisely grab, move and rotate entities freely with your mouse on all axis. I started this a while ago and decided to share. There are similar plugins, however I would consider mine geared more towards precision grabbing and movement as well as not only restricted to props. I highly doubt you'll find one with the rotation mode feature as well.
Demo Video on CS:S
Using Rotation Mode
General Notes:
This is very useful if you're using my TrackTrains plugin.
This should work on any game, please let me know otherwise.
The admin flag for use is set to ADMFLAG_CHEATS
This should work on most entities, not just props. Rotation will be iffy on non-props though.
If you just want v1.5 (no rotation mode), let me know.
Use Notes:
This works best if you bind +grabent to a key, otherwise you will have to manually do -grabent to release.
While grabbed: Reload Key will Enable/Disable Rotation Mode.
---
While grabbed and NOT on a Rotation axis: Primary Attack(Mouse1) will PUSH the entity farther away.
While grabbed and NOT on a Rotation axis: Secondary Attack(Mouse2) will PULL the entity closer.
The farther away the entity you're grabbing is from you, the faster it will be pushed/pulled.
The closer the entity you're grabbing is to you, the slower it will be pushed/pulled.
---
While grabbed and in Rotation Mode: Walk keys (A,S,D) will dictate the rotation axis. (W to show all rings).
While grabbed and in Rotation Mode: Holding A+S+D keys will reset the entities angles to 0
While grabbed and on a Rotation axis: Primary Attack(Mouse1) will +Rotate on selected axis.
While grabbed and on a Rotation axis: Secondary Attack(Mouse2) will -Rotate on selected axis.
---
You will not be able to use your weapon while grabbing (Mouse1/Mouse2 and Reload are used)
You will not be able to walk while in Rotation Mode, the keys are needed for settings.
---
By default, the grabbed entity will be frozen on release unless you change sm_grabent_freeze to 0
If you change the freeze value to 0, it will revert back to 1 on map change/reconnect.
Some entities will remain frozen regardless, as not all are geared for physics. Players will always be unfrozen.
Commands:
Code:
sm_grabent_freeze <0/1>
> This will determine whether or not the grabbed entity will be frozen when released.
> The default value is 1. Entities will be frozen on release
> Setting the value to 0 will mean entities will be unfrozen on release
+grabent
> Grab the entity you're looking at.
> While grabbed: reload key to enter/exit rotation mode
> While grabbed, and not on a rotation axis: mouse1 to push and mouse2 to pull.
> While grabbed, and on a rotation axis (A,S,D): mouse1 to +rotate and mouse2 to -rotate
-grabent
> Release the entity you're grabbing.
> Depending on your freeze setting, the entity will either remain frozen, or unfreeze.
> This is irrelevant if you bind +grabent to a key.
Installation:
1. Tap on "Get Plugin" below
2. Put the downloaded file GrabEnt.smx in your servers plugins folder: SERVER/GAME/addons/sourcemod/plugins/
(optional) Put the source fileGrabEnt.sp in your servers scripting folder: SERVER/GAME/addons/sourcemod/scripting/
Todo:
Spoiler
Maybe a setting to dictate the amount to rotate by.
I'm open to suggestions.
CHANGELOG:
Spoiler
V1.0 (October 13, 2019)
Initial Release
V1.1 (October 14, 2019)
Bullets no longer slip through from initial push/pull**Thanks@Silvers
Fixed a couple of other small bugs
V1.2 (October 15, 2019)
Grabbing players should no longer glitch out
Cleaned code up a little
V1.5 (October 16, 2019)
sm_grabent_freeze - Toggle freeze/unfreeze on entity release
V2.0 (October 17, 2019)
Rotation Mode - Interactive rotation of entities using mouse and keys
V2.2 (October 18, 2019)
Made some minor changes to Rotation Mode
W key no longer resets angles, it will only show all 3 rotation rings
Holding A+S+D keys will now reset the angles
Ents color when grabbed is now restored on release (if it was colored/transparent)
Cleaned the code up, fixed some minor bugs and optimized a few things
Updated video
Last edited by Stugger; 10-19-2019 at 16:58.
Reason: V2.2 - Some changes to rotation mode