Massassi Forums Logo

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.

ForumsCog Forum → Hotkeys
Hotkeys
2000-10-21, 9:21 AM #1
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.
roses are red, violets are blue, I am schizophrenic, and I am too!
2000-10-21, 12:26 PM #2
Read this.

You need a jkstrings.uni.
And from the next time, put your code in a
\[code\] tag.

------------------
http://millennium.massassi.net/ - Millennium

[This message has been edited by Hideki (edited October 22, 2000).]
2000-10-21, 1:07 PM #3
yeah!

------------------
-Hebedee
He r0x0rz, j00 sux0rz.
2000-10-22, 2:19 PM #4
ok i your tutorial doesn't help it says in section 2 "scroll down unti you see" see what?!? Then it tells me to paste something, what do i paste?
roses are red, violets are blue, I am schizophrenic, and I am too!
2000-10-22, 3:39 PM #5
ahh, well, hehe, hmm maybe I lost those lines when I converted them into JavaScript, now it doesn't make sense!

So I fixed it. Even the files were linked wrong, oh well, things happen, now it works.

------------------
http://millennium.massassi.net/ - Millennium

↑ Up to the top!