This repository contains a tweaker for the in-game environment settings of Garry's mod. The addon simply stores your setting inside some CVARS so you must not run it every time the game starts.
Remember the following tweak when building an engine
lua_run physenv.SetPerformanceSettings({MaxVelocity = 100000, MaxAngularVelocity = 360000, MaxCollisionsPerObjectPerTimestep = 30, MaxCollisionChecksPerTimestep = 750})
This addon is here to make it run automatically on startup when enabled based on user-defined settings. My life was going to be much easier back then when I recorded this.
Yes I did. It's located in Santa Yotso, Ochindol, municipality of Mezdra, Vratsa region, Bulgaria and in fact, this is the exact street view
I've shot with my phone in march 2016. It was a panorama picture. After that I found a common icon for settings
using google.
Whenever you change a console variable, a callback for the environment settings adjustment will be triggered,
which will reload all the settings for the related member into the server user
environment. If you do agree
with this change you can call a user command to apply it, usually one of the following prefixed with envorg_
of course.
Syntax: envorg_<adjuster-member> <store-container>
( For example: envorg_setairdensity user
).
The value <adjuster-member>
must be one of the following:
setairdensity --> Applies the air density environment setting
setgravity --> Applies the gravity environment setting
setperformance --> Applies the performance environment settings
Value <store-container>
must be either user
or init
. When user
is selected,
the script adjusts the environment settings directly form the console variables
dedicated to the member called ( For the example above it will load console variable
envorg_airdensity
into the environment as the new air density value used by the game).
When init
is selected, the script adjusts the environment settings from the stored values
taken during the game initialization. This option represents a base/initial/default/fail-safe setting
that stores the original values, so the user can switch between the server defaults and the personal
ones on demand.
Here they are, prefixed with envorg_
of course:
- Member:
envSetAirDensity
manager:SetAirDensity
data type: NUMBER
airdensity --> The air density of the server
- Member:
envSetGravity
manager:SetGravity
data type: VECTOR
gravitydrx --> Component X of the gravity affecting props
gravitydry --> Component Y of the gravity affecting props
gravitydrz --> Component Z of the gravity affecting props
- Member:
envSetPerformance
manager:SetPerformanceSettings
data type: PHYSENV
perfmaxangvel --> Maximum rotation velocity
perfmaxlinvel --> Maximum speed of an object
perfminfrmass --> Minimum mass of an object to be affected by friction
perfmaxfrmass --> Maximum mass of an object to be affected by friction
perflooktmovo --> Maximum amount of seconds to recalculate collisions with objects
perflooktmovw --> Maximum amount of seconds to recalculate collisions with world
perfmaxcolchk --> Maximum collision checks per tick
perfmaxcolobj --> Maximum collision per object per tick
First the envorg_datasrc
is set to user
. You have to adjust
all the convars above to the desired values for your server,
then use the <adjuster-member>
commands to update the current settings. After you are done, they become
final as the game is currently using them. You must use envorg_storevalues <cutom-name>
. The
<cutom-name>
parameter can be anything. For example envorg_storevalues cupcake
will store all
the current environment settings used in files, located in envorganizer/
( grouped by cupcake
of course ) If you want to change these, just edit the files related with your <cutom-name>
( cupcake
). Do not worry
about the cvar spacers. You can use tabs, spaces, or both mixed, so you can align the values one under another
as you prefer. After you are done with all your changes, you must make the script load your custom settings
from that file by setting envorg_datasrc #<cutom-name>
( For the example above envorg_datasrc #cupcake
And yes I am a brony xD ). The hash tag command can be translated
to: When envorg_datasrc
is created assign to it <load-file><cutom-name>
where <load-file>
is #
.
Done! Now the settings will be loaded form the file chosen on startup
( Example file: envorganizer/cupcake_<adjuster-member>.txt
under DATA
)
Here is how the exports should look in case you are wondering:
envSetAirDensity,
envSetGravity,
envSetPerformance.
- Environment settings must be managed by a player, who is an admin in single player or on the server directly, otherwise the environment will not be modified.
- When loading saving setting to external custom file,
<cutom-name>
is checked for alphanumeric, otherwise nothing will be exported - A member's value for the environment setting is only set when number in a set of range is given, otherwise the
init
( default/fail-safe ) value is loaded. - The console commands check for a correct storage key and does not apply the settings when the key
is not either
user
,init
or#<cutom-name>
, defining the storage location the values will be taken from.
No! I will never give you my permission to upload this into a third-party website! Instead of doing stupid things, and confuse everybody with your actions, forcing them to use a malicious copy of this script, just put a link leading to this repository there in a comment. That was not so hard was it?