Garry's Mod

Garry's Mod

388 ratings
CalcView Priority System
   
Award
Favorite
Favorited
Unfavorite
Content Type: Addon
Addon Type: Tool
Addon Tags: Fun, Scenic
File Size
Posted
Updated
6.282 KB
23 Jan, 2023 @ 8:38am
23 Jan, 2023 @ 12:01pm
2 Change Notes ( view )

Subscribe to download
CalcView Priority System

In 1 collection by 80Hg
Mods that use CalcView Priority System
3 items
Description
C.V.P.S.
CVPS is a library/system that allows you to create CalcView hook camera manipulation mods without every camera mod breaking the other one,
while also allowing you to have Layered CalcViews on top of the highest priority "Base" CalcView. (Useful for viewbob, breathing, etc.)



This is achieved by running only the highest priority CalcView hook and then adding to it the returned data from all the "Layered" ones.

The point of this library is to allow devs to create camera mods that do not interfere with each other in jarring ways.

For Developers
The library is contained inside a global table named "CalcViewPS" and runs a hook called "CalcViewPS_Initialized" when it has loaded.

ENUMs CalcViewPS.PerspectiveENUM = { FIRSTPERSON = 1, THIRDPERSON = 2, TOPDOWN = 3, ISOMETRIC = 4, OTHER = 5 } Argument Explanations name - Unique string ID for the hook func - The function to be ran if the hook is of the highest priority, or is a layered hook. Works like normal CalcView, function must return a table like a normal CalcView hook would. In the case of the hook being layered, the hook should not be layering the returned values on top of the provided base position, angles and FOV. The library already takes care of the layering. priority - The priority number the hook should have. The higher it is, the bigger the chance it will be the "camera" that is running. Value is clamped to be between -100000 and 100000 perspective - The perspective ENUM for the hook. Layered hooks will only be applied if they have the same perspective ENUM as the current running Base hook. This can be one of the ENUMs above or a number. Functions CalcViewPS.Add(name, func, priority, perspective) - Adds a "Base" hook to the queue with the specified priority. CalcViewPS.AddToTop(name, func, perspective) - Adds a "Base" hook to the queue above the current highest priority hook. (Priority 9000 if one does not exist.) CalcViewPS.AddToBottom(name, func, perspective) - Adds a "Base" hook to the queue below the current lowest priority hook. (Priority -9000 if one does not exist.) CalcViewPS.AddLayered(name, func, perspective) - Adds a "Layered" hook to the table, which will be layered on top of the current running "Base" hook. CalcViewPS.Remove(name) - Removes "Base" hook with the specified id from the queue CalcViewPS.RemoveLayered(name) - Removes "Layered" hook with the specified id from the layered hooks table. CalcViewPS.GetLowestPriority() - Returns the lowest priority number that is present in the current "Base" hook queue. CalcViewPS.GetLowestPriorityHook() - Returns the table of the lowest priority "Base" hook in the queue. Returns nil if no hooks exist. CalcViewPS.GetHighestPriority() - Returns the highest priority number that is present in the current "Base" hook queue. CalcViewPS.GetLowestPriority() - Returns the table of the highest priority "Base" hook in the queue. Returns nil if no hooks exist.

Support Links
[ko-fi.com]
[ko-fi.com]
32 Comments
Truskawka 10 May @ 6:11am 
Extended calcview
XxJustPlayxX 11 Apr @ 4:44pm 
when using this with mwbase it will caused error and mwbase weapon not showing in screen
gordon freeman 2 Apr @ 1:30pm 
i shit you not theres only 2 FUCKING ADDONS?
80Hg  [author] 18 Mar @ 3:41pm 
it's a dev resource
kabanosik 18 Mar @ 2:19pm 
how can i use it pls tell bruv <:(
spy_gaming 9 Feb @ 11:35am 
how to use pls tell me :(
хлоднокровие 12 Sep, 2024 @ 10:42am 
What commands and codes can I use to simulate aiming on a weapon? And how i do that? help please!!!
captain gurt 17 Jun, 2024 @ 3:58pm 
thanks for the quick response. after a little bit of fiddling with possible culprit mods, it seems to have been "Shmovment" that was causing the issue. very unfortunate
80Hg  [author] 17 Jun, 2024 @ 2:43pm 
I would consider any camera mod that changes "drawviewer" functionality to be an incompatibility.
General rule is this: If it's a camera mod and it's not using this, then it has a 99.9% chance of being incompatible.
captain gurt 17 Jun, 2024 @ 2:37pm 
are there any known compatibility errors? for me, any mods that use this system do work but don't actually have a visible player model during the animations (examples: Animated Ladder Climbing and Hard Landing / Safety Roll). the animations do play in third person, it's just that the player's body is not rendered during animations in first person