Excellent, I'll try it out now.
This is the static archive of the Massassi Forums. The forums are
closed indefinitely. Thanks for all the memories!
You can also download
Super Old Archived Message Boards
from when Massassi first started.
"View" counts are as of the day the forums were archived, and will no longer increase.
# Jedi Knight Cog Script # # qm_spectator.cog # # Let's a player spectate other players by activating a switch. # # [QM] # # (C) 1997 LucasArts Entertainment Co. All Rights Reserved flags=0x240 symbols surface spectate_button thing player=-1 local thing victim=-1 local thing camera=-1 local template camera_tpl=ghost local int pcount=-1 local int camera_sig=-1 local vector player_dir local vector player_loc local message activated message pulse message removed end # ======================================================================================== code activated: player = GetSourceRef(); player_dir = GetThingLVec(player); player_loc = GetThingPos(player); ClearActorFlags(player, 0x1); SetActorFlags(player, 0x840000); pcount = pcount + 1; if(pcount >= GetNumPlayers()) { pcount = -1; call stop_cam; Return; } if(GetPlayerThing(pcount) == player) { call activated; Return; } if(camera == -1) { camera = CreateThing(camera_tpl, player); camera_sig = GetThingSignature(camera); CaptureThing(camera); } else { DetachThing(camera); } victim = GetPlayerThing(pcount); TeleportThing(camera, victim); AttachThingToThingEx(camera, victim, 0x8); SetCameraFocus(1, camera); SetPulse(0.01); Return; # ........................................................................................ pulse: if(IsThingCrouching(player)) { call stop_cam; Return; } if(!(VectorDist(GetThingPos(player), player_loc) == 0)) { call stop_cam; Return; } if(!(VectorDist(GetThingLVec(player), player_dir) == 0)) SetThingLook(player, player_dir); SetCurrentCamera(1); Return; # ........................................................................................ removed: if(GetSenderRef() != camera) Return; SetCameraFocus(1, player); Return; # ........................................................................................ stop_cam: SetPulse(0); SetActorFlags(player, 0x1); ClearActorFlags(player, 0x840000); SetCameraFocus(1, player); if(GetThingSignature(camera) == camera_sig) DestroyThing(camera); camera = -1; CycleCamera(); CycleCamera(); Return; end