Another question, though this one might be a little less brain fry. Some has been omited to keep the use of the cog a little secret, but you could probably guess anyways what it does. ![http://forums.massassi.net/html/wink.gif [http://forums.massassi.net/html/wink.gif]](http://forums.massassi.net/html/wink.gif)
------------------
The Sniper Missions. Current project, The Sniper Missions
The Magician Saber System.
![http://forums.massassi.net/html/wink.gif [http://forums.massassi.net/html/wink.gif]](http://forums.massassi.net/html/wink.gif)
Code:
Crashes when I turn on a second time.# Jedi Knight Cog Script
#
# OMIT.COG
#
# omit
# omit
#
# [DP]
#
symbols
thing console
vector camPos
vector camLvec
int camSector
vector pos
int posSector
vector Lvec local
int dummy local
int current=0 local
int pholo=0 local
int player local
int origanalCam local
int on=0 local
int canMove local
thing cam local
template ghost=ghost local
template sign
template sign1
template sign2
template sign3
template sign4
template sign5
template sign6
template sign7
template sign8
template sign9
template holo
template holo1
template holo2
template holo3
template holo4
template holo5
template holo6
template holo7
template holo8
template holo9
message Activated
message Pulse
message Timer
end
# ========================================================================================
code
Activated:
player = GetLocalPlayerThing();
If(!on)
{
SetInv(player, 68, 1);
cam = CreateThingAtPos(ghost, camSector, camPos, camLvec);
Lvec = GetThingLvec(player);
SetActorFlags(player, 0x40000);
origanalCam = GetCurrentCamera();
If(GetCurrentCamera()) CycleCamera();
SetCameraFocus(0, cam);
dummy = CreateThingAtPos(sign[current+pholo], posSector, pos, '0 0 0');
SetPulse(.05);
on = 1;
}
Else
{
SetInv(player, 68, 0);
DestroyThing(cam);
DestroyThing(dummy);
SetThingLook(player, Lvec);
ClearActorFlags(player, 0x40000);
If(GetCurrentCamera() != origanalCam) CycleCamera();
SetPulse(0);
on = 0;
}
canMove = 1;
Return;
# ........................................................................................
Pulse:
If(GetCurrentCamera()) CycleCamera();
SetThingLook(player, Lvec);
If(canMove)
{
If(IsThingCrouching(player))
{
pholo = 10 - pholo;
SetTimer(.5);
canMove = 0;
}
Else If(VectorY(GetThingRotVel(player)) > 0)
{
current = current + 1;
If(current > 9) current = 0;
SetTimer(.5);
canMove = 0;
}
Else If(VectorY(GetThingRotVel(player)) < 0)
{
current = current - 1;
If(current < 0) current = 9;
SetTimer(.5);
canMove = 0;
}
}
Else
{
DestroyThing(dummy);
dummy = CreateThingAtPos(sign[current+pholo], posSector, pos, '0 0 0');
}
Return;
# ........................................................................................
Timer:
canMove = 1;
Return;
end------------------
The Sniper Missions. Current project, The Sniper Missions
The Magician Saber System.
Major projects working on:
SATNRT, JK Pistol Mod, Aliens TC, Firearms
Completed
Judgement Day (HLP), My level pack
SATNRT, JK Pistol Mod, Aliens TC, Firearms
Completed
Judgement Day (HLP), My level pack
Set the view back before you destroy cam.