aboutsummaryrefslogtreecommitdiff
path: root/Northstar.Custom/mod/scripts/vscripts/mp
diff options
context:
space:
mode:
Diffstat (limited to 'Northstar.Custom/mod/scripts/vscripts/mp')
-rw-r--r--Northstar.Custom/mod/scripts/vscripts/mp/levels/mp_bob.nut38
-rw-r--r--Northstar.Custom/mod/scripts/vscripts/mp/levels/mp_bob_temp_props.nut7
2 files changed, 45 insertions, 0 deletions
diff --git a/Northstar.Custom/mod/scripts/vscripts/mp/levels/mp_bob.nut b/Northstar.Custom/mod/scripts/vscripts/mp/levels/mp_bob.nut
new file mode 100644
index 00000000..afd4fc37
--- /dev/null
+++ b/Northstar.Custom/mod/scripts/vscripts/mp/levels/mp_bob.nut
@@ -0,0 +1,38 @@
+untyped
+global function CodeCallback_MapInit
+
+const float PLATFORM_TRAVEL_TIME = 20.0
+
+struct {
+ array<entity> platformMoverNodes
+ entity platformMover
+} file
+
+void function CodeCallback_MapInit()
+{
+ AddCallback_EntitiesDidLoad( BobMap_EntitiesDidLoad )
+}
+
+void function BobMap_EntitiesDidLoad()
+{
+ BobMap_InitTempProps()
+
+ file.platformMoverNodes = GetEntityLinkChain( GetEntByScriptName( "mp_bob_movingplatform_node_0" ) )
+ file.platformMover = GetEntByScriptName( "mp_bob_movingplatform" )
+ file.platformMover.SetOrigin( file.platformMoverNodes[ 0 ].GetOrigin() )
+
+ entity platformProp = CreatePropDynamic( file.platformMover.GetValueForModelKey(), file.platformMover.GetOrigin(), file.platformMover.GetAngles() )
+ platformProp.SetParent( file.platformMover )
+
+ thread MovingPlatformThink()
+}
+
+void function MovingPlatformThink()
+{
+ int currentNodeIdx = 0
+ while ( true )
+ {
+ file.platformMover.SetOrigin( file.platformMoverNodes[ currentNodeIdx % file.platformMoverNodes.len() ].GetOrigin() )
+ file.platformMover.MoveTo( file.platformMoverNodes[ ++currentNodeIdx % file.platformMoverNodes.len() ].GetOrigin(), PLATFORM_TRAVEL_TIME, 0, 0 )
+ }
+} \ No newline at end of file
diff --git a/Northstar.Custom/mod/scripts/vscripts/mp/levels/mp_bob_temp_props.nut b/Northstar.Custom/mod/scripts/vscripts/mp/levels/mp_bob_temp_props.nut
new file mode 100644
index 00000000..84ffe3e9
--- /dev/null
+++ b/Northstar.Custom/mod/scripts/vscripts/mp/levels/mp_bob_temp_props.nut
@@ -0,0 +1,7 @@
+global function BobMap_InitTempProps
+
+void function BobMap_InitTempProps()
+{
+ PrecacheModel( $"models/vistas/planet_blue_sun.mdl" )
+ CreatePropDynamic( $"models/vistas/planet_blue_sun.mdl", GetEnt( "skybox_cam_level" ).GetOrigin(), GetEnt( "skybox_cam_level" ).GetAngles() )
+} \ No newline at end of file