I have made hotkeys for items before and they work. I made i binoculars cog hooked it up and it did not even show up on the hotkey menu. This problem has happened to me I would have to say at least 20 times. I have had to trash some good projects because of that. I want to know what it is could someone help me. I put this under cog because i thought it might have something to do with my cog even though i don't see how that is possible since i set my bins up correctly.
Here is the code could you scan over it for mistakes.
# Jedi Knight Cog Script
#
# ITEM_BINOCULARS.COG
#
# ITEM Script - Binoculars
# Bin 116
#
# [(C) 2000 Han5678]
#================================================================================================#
symbols
int player local
int OldFocus local
int Stay local
int Dummy local
template CameraTpl=+zoom_cam local
int Zoom=1 local
int ZoomCount local
flex ZoomMag=0.15 local
vector ZoomFactor local
vector Temp_Vector local
int ZoomEffect=-1 local
sound ZoomSnd=zoom.wav local
message startup
message activated
message deactivated
message pulse
message killed
message newplayer
message stop_power
end
#================================================================================================#
code
startup:
player = GetLocalPlayerThing();
Return;
#................................................................................................#
activated:
if(Zoom)
{
OldFocus = GetCurrentCamera();
ParseArg(player, "maxrotvel=20 maxrotthrust=20");
SetPulse(0.01);
}
Stay = 0;
ZoomCount = 0;
Return;
#................................................................................................#
deactivated:
Zoom = 1 - Zoom;
Stay = 1;
if(ZoomCount <= 3) call stop_power;
# ........................................................................................
newplayer:
killed:
SetPulse(0);
if(ZoomEffect != -1)
{
StopSound(ZoomEffect, 0);
ZoomEffect = -1;
}
ParseArg(player, "maxrotvel=200 maxrotthrust=180");
SetCameraFocus(0, player);
SetInvActivated(player, 120, 0);
SetInv(player, 120, 0);
if( (OldFocus == 1) && (GetCurrentCamera() != 1) ) CycleCamera();
Zoom = 1;
ZoomMag = 0.15;
Return;
#................................................................................................#
stop_power:
SetPulse(0);
ZoomMag = 0.15;
ParseArg(player, "maxrotvel=200 maxrotthrust=180");
SetCameraFocus(0, player);
if( (OldFocus == 1) && (GetCurrentCamera() != 1) ) CycleCamera();
return;
#................................................................................................#
pulse:
if(!Stay)
{
if(Zoom)
{
ZoomMag = ZoomMag + ZoomCount * 0.005;
if(ZoomMag > 5) ZoomMag = 5;
}
else
{
ZoomMag = ZoomMag - ZoomCount * 0.005;
if(ZoomMag < 0.15) ZoomMag = 0.15;
}
ZoomFactor = VectorSet(0, ZoomMag, 0.037);
ZoomCount = ZoomCount + 1;
if( (ZoomMag == 0.15) && !Zoom)
call stop_power;
return;
}
Dummy = FireProjectile(player, CameraTpl, -1, -1, ZoomFactor, '0 0 0', 0, 0, 0, 0);
SetThingPos(Dummy, VectorAdd(GetThingPos(Dummy), VectorScale(VectorNorm(GetThingLVec(Dummy)), -0.1)));
if(GetCurrentCamera() == 1) CycleCamera();
Return;
end
#================================================================================================#
I have no idea whats wrong thanks fo reading all that.
Here is the code could you scan over it for mistakes.
# Jedi Knight Cog Script
#
# ITEM_BINOCULARS.COG
#
# ITEM Script - Binoculars
# Bin 116
#
# [(C) 2000 Han5678]
#================================================================================================#
symbols
int player local
int OldFocus local
int Stay local
int Dummy local
template CameraTpl=+zoom_cam local
int Zoom=1 local
int ZoomCount local
flex ZoomMag=0.15 local
vector ZoomFactor local
vector Temp_Vector local
int ZoomEffect=-1 local
sound ZoomSnd=zoom.wav local
message startup
message activated
message deactivated
message pulse
message killed
message newplayer
message stop_power
end
#================================================================================================#
code
startup:
player = GetLocalPlayerThing();
Return;
#................................................................................................#
activated:
if(Zoom)
{
OldFocus = GetCurrentCamera();
ParseArg(player, "maxrotvel=20 maxrotthrust=20");
SetPulse(0.01);
}
Stay = 0;
ZoomCount = 0;
Return;
#................................................................................................#
deactivated:
Zoom = 1 - Zoom;
Stay = 1;
if(ZoomCount <= 3) call stop_power;
# ........................................................................................
newplayer:
killed:
SetPulse(0);
if(ZoomEffect != -1)
{
StopSound(ZoomEffect, 0);
ZoomEffect = -1;
}
ParseArg(player, "maxrotvel=200 maxrotthrust=180");
SetCameraFocus(0, player);
SetInvActivated(player, 120, 0);
SetInv(player, 120, 0);
if( (OldFocus == 1) && (GetCurrentCamera() != 1) ) CycleCamera();
Zoom = 1;
ZoomMag = 0.15;
Return;
#................................................................................................#
stop_power:
SetPulse(0);
ZoomMag = 0.15;
ParseArg(player, "maxrotvel=200 maxrotthrust=180");
SetCameraFocus(0, player);
if( (OldFocus == 1) && (GetCurrentCamera() != 1) ) CycleCamera();
return;
#................................................................................................#
pulse:
if(!Stay)
{
if(Zoom)
{
ZoomMag = ZoomMag + ZoomCount * 0.005;
if(ZoomMag > 5) ZoomMag = 5;
}
else
{
ZoomMag = ZoomMag - ZoomCount * 0.005;
if(ZoomMag < 0.15) ZoomMag = 0.15;
}
ZoomFactor = VectorSet(0, ZoomMag, 0.037);
ZoomCount = ZoomCount + 1;
if( (ZoomMag == 0.15) && !Zoom)
call stop_power;
return;
}
Dummy = FireProjectile(player, CameraTpl, -1, -1, ZoomFactor, '0 0 0', 0, 0, 0, 0);
SetThingPos(Dummy, VectorAdd(GetThingPos(Dummy), VectorScale(VectorNorm(GetThingLVec(Dummy)), -0.1)));
if(GetCurrentCamera() == 1) CycleCamera();
Return;
end
#================================================================================================#
I have no idea whats wrong thanks fo reading all that.
roses are red, violets are blue, I am schizophrenic, and I am too!