PDA

View Full Version : Hotkeys



Han5678
10-21-2000, 12:21 PM
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.

Hideki
10-21-2000, 03:26 PM
Read this (http://millennium.massassi.net/document/tutorial.shtml?Tutorial=HotKey).

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).]

herb
10-21-2000, 04:07 PM
yeah!

------------------
-Hebedee
He r0x0rz, j00 sux0rz.

Han5678
10-22-2000, 05:19 PM
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?

Hideki
10-22-2000, 06:39 PM
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