aboutsummaryrefslogtreecommitdiff
path: root/Northstar.Custom/mod/scripts/vscripts/sh_custom_air_accel.gnut
diff options
context:
space:
mode:
authorBobTheBob <32057864+BobTheBob9@users.noreply.github.com>2021-10-20 20:11:43 +0100
committerBobTheBob <32057864+BobTheBob9@users.noreply.github.com>2021-10-20 20:11:43 +0100
commite79a58640e1ef1ea1c3c954aefccd36c3cb55286 (patch)
tree8c7b822f8777ccdf6b0d86587da853b8451953c1 /Northstar.Custom/mod/scripts/vscripts/sh_custom_air_accel.gnut
parentd37c5ae333b4e622ebd0d18cf02a87d66aac62f9 (diff)
downloadNorthstarMods-e79a58640e1ef1ea1c3c954aefccd36c3cb55286.tar.gz
NorthstarMods-e79a58640e1ef1ea1c3c954aefccd36c3cb55286.zip
automatic mod enable/disable, refactors and item registration callbacks
Diffstat (limited to 'Northstar.Custom/mod/scripts/vscripts/sh_custom_air_accel.gnut')
-rw-r--r--Northstar.Custom/mod/scripts/vscripts/sh_custom_air_accel.gnut25
1 files changed, 25 insertions, 0 deletions
diff --git a/Northstar.Custom/mod/scripts/vscripts/sh_custom_air_accel.gnut b/Northstar.Custom/mod/scripts/vscripts/sh_custom_air_accel.gnut
new file mode 100644
index 000000000..faa924804
--- /dev/null
+++ b/Northstar.Custom/mod/scripts/vscripts/sh_custom_air_accel.gnut
@@ -0,0 +1,25 @@
+global function CustomAirAccelVars_Init
+
+void function CustomAirAccelVars_Init()
+{
+ #if MP
+ AddPrivateMatchModeSettingArbitrary( "#MODE_SETTING_CATEGORY_PILOT", "custom_air_accel_pilot", "500" ) // 500 is the default airaccel
+ #endif
+
+ #if SERVER
+ AddCallback_OnPlayerRespawned( ApplyCustomPlayerAirAccel )
+ AddCallback_OnPilotBecomesTitan( ApplyCustomPlayerAirAccelFromTitan ) // not sure if necessary but assuming it is
+ #endif
+}
+
+#if SERVER
+void function ApplyCustomPlayerAirAccel( entity player )
+{
+ player.kv.airAcceleration = GetCurrentPlaylistVarInt( "custom_air_accel_pilot", int( player.GetPlayerSettingsField( "airAcceleration" ) ) )
+}
+
+void function ApplyCustomPlayerAirAccelFromTitan( entity player, entity titan )
+{
+ player.kv.airAcceleration = GetCurrentPlaylistVarInt( "custom_air_accel_pilot", int( player.GetPlayerSettingsField( "airAcceleration" ) ) )
+}
+#endif \ No newline at end of file