aboutsummaryrefslogtreecommitdiff
path: root/Northstar.Custom/mod/scripts/vscripts/mp/levels
diff options
context:
space:
mode:
authorBobTheBob <32057864+BobTheBob9@users.noreply.github.com>2021-10-14 21:01:40 +0100
committerBobTheBob <32057864+BobTheBob9@users.noreply.github.com>2021-10-14 21:01:40 +0100
commit9a2778eabc7ba968968e41dda9f03525d6c5383d (patch)
tree6d1c5dc64754d542d68a7f47742a701a4eec9308 /Northstar.Custom/mod/scripts/vscripts/mp/levels
parentc0a0c7e502f2bc99185d79a485b965f63de7a203 (diff)
downloadNorthstarMods-9a2778eabc7ba968968e41dda9f03525d6c5383d.tar.gz
NorthstarMods-9a2778eabc7ba968968e41dda9f03525d6c5383d.zip
oh fuck i forgot to commit for a while
Diffstat (limited to 'Northstar.Custom/mod/scripts/vscripts/mp/levels')
-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