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 → Using Playeraction to Change Actions
Using Playeraction to Change Actions
2002-11-08, 6:23 AM #1
It's been a while since I used playeraction, but I started to wrok on something today and hit a problem straight away. Basically, I want to make something happen when a certain control is pressed, but not what the control is actually intended for (e.g. when you jump, the cog makes you crouch instead). So can anyone tell me what's wrong with this cog please? When you press jump, instead of crouching, it still makes you jump. The message is printed to the console OK though.

Code:
# Jedi Knight Cog Script
#
# playeraction.COG
#
# Why won't this work?!?
# 
# This Cog is Not supported by LucasArts Entertainment Co

symbols                                                         

message  entered
sector   startsec
message  playeraction

end                                                                           

# ========================================================================================

code

entered:

SetActionCog(GetSelfCog(),0x7fffffff);
return;

playeraction:

if(GetParam(0) == 0.0)             // Jump
{
print("Jumped, but should crouch!"); 
SetParam(0,1.0);
}
ReturnEx(1.0);
return;

# ........................................................................................

end
2002-11-08, 7:21 AM #2
Code:
if(GetParam(0) == 0.0)             // Jump
{
print("Jumped, but should crouch!"); 
SetParam(0,1.0);
ReturnEx(0.0);
}


That'll take care of the jumping bit.

------------------
His pot is blacker than his kettle!

Phoenix Swords

[This message has been edited by LordVirus (edited November 08, 2002).]
"And lo, let us open up into the holy book of Proxy2..." -genk
His pot is blacker than his kettle!
2002-11-08, 7:25 AM #3
DOH! Yeah, that should take care of it...

[This message has been edited by GBK (edited November 08, 2002).]
And when the moment is right, I'm gonna fly a kite.
2002-11-08, 8:35 AM #4
Nope, still doesn't work. If I use that code it doesn't jump or crouch at all...

Edit: What I actually want to do is make it so that a screenshot is taken when the player enters a certain sector. I assume the only way to do this is to use SetActionCog() when the sector is entered, and then check for the player moving forward, backward or strafing (which is what he'll be doing when he steps in). Then I'll set the params so that a screenshot is taken when those actions are detected. This relies on the basic code working at all though [http://forums.massassi.net/html/smile.gif]

[This message has been edited by Chris Swan (edited November 08, 2002).]
2002-11-08, 4:45 PM #5
Or you could just use the stupid entered message and use the screenshot verb thingy.

------------------
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
2002-11-08, 9:50 PM #6
DOH! I didn't check the JK Specs well enough... I can use jkScreenshot();. Thanks for the help.

↑ Up to the top!