Need help with playeraction message...


[ Follow Ups ] [ Post Followup ] [ Jed Messages ]

Posted by Blue Angel on March 14, 1998 at 07:34:16:

I'm trying to change the IRgoggles to Electrobinoculars, ala the STrifle sight. I don't have MotS, but I'm making this for a friend, who is also testing it. The problem is that the playeraction message just doesn't run. I've tried putting print messages in it and found that the playeraction just doesn't run at all. I've copied almost all of it from the STrifle scope, and I can't tell what I'm doing wrong. Any help would be greatly appreciated.

Thanks in advance,
Blue Angel

P.S. Mail me if possible, I don't check here often

Code follows:

# Jedi Knight Cog Script
#
# ITEM_IRGOGGLES.COG
#
# INVENTORY SCRIPT - ElectroBinoculars
#
# [BA]
#
# (C) 1997 LucasArts Entertainment Co. All Rights Reserved


symbols

thing player local

flex magnification=4.0 local

int iZoomPoint=1 local

flex fZoomTable=0.0 local
flex fZoomTable1=4.0 local
flex fZoomTable2=11.0 local
flex fZoomTable3=23.0 local
flex fZoomTable4=0.0 local

message activated
message newplayer
message playeraction
message killed

sound goggleActivate=activate01.wav
sound goggleDeactivate=deactivate03.wav

end

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

code

activated:
player = GetSourceRef();
if(GetInv(player, 41))
{
if(IsInvActivated(player, 41) == 0)
{ // turn it on
Print("Electrobinoculars ON");
SetInvActivated(player, 41, 1);
PlaySoundThing(goggleActivate, player, 1.0, -1, -1, 0x80);
EnableIRMode(0.3, 1); // Set IR mode on
SetCurrentCamera(0); // Go to primary view.
SetActorFlags(player, 0x20000000); // Turn on Scope hud.
SetActionCog(GetSelfCog(), 0x4083); // take control of actions <-- Is there something wrong here?
magnification = fZoomTable[iZoomPoint]; // set the magnification factors
SetCameraZoom(0, magnification, 150.0); // zoom to mag. factor
}
else
{ // turn it off
Print("Electrobinoculars OFF");
SetInvActivated(player, 41, 0);
PlaySoundThing(goggleDeactivate, player, 1.0, -1, -1, 0x80);
if(!IsInvActivated(player, 23)) DisableIRMode(); // turn off IR mode if sight isn't on.
ClearActorFlags(player, 0x20000000); //remove the HUD
SetCameraZoom(0, 1.0, 500.0); // reset zoom factor
SetActionCog(-1, 0); // give the player his controls
}
}

Return;

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

newplayer:
SetCameraZoom(0, 1.0, 500.0);
ClearActorFlags(GetLocalPlayerThing(), 0x20000000);
Return;

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

playeraction;

if (GetParam(0) == 0.0) // Jump
{
if (GetParam(2) == 1.0)
{
iZoomPoint = iZoomPoint + 1;
if (fZoomTable[iZoomPoint] != 0.0)
{
magnification = fZoomTable[iZoomPoint];

if (magnification < 4.0)
magnification = 4.0;
else if (magnification > 23.0)
magnification = 23.0;

SetCameraZoom(0, magnification, 150.0);
}
else
{
iZoomPoint = iZoomPoint - 1;
}
}
}

if (GetParam(0) == 1.0) // Crouch
{
if (GetParam(2) == 1.0)
{
iZoomPoint = iZoomPoint - 1;
if (fZoomTable[iZoomPoint] != 0.0)
{
magnification = fZoomTable[iZoomPoint];

if (magnification < 4.0)
magnification = 4.0;
else if (magnification > 23.0)
magnification = 23.0;

SetCameraZoom(0, magnification, 150.0);
}
else
{
iZoomPoint = iZoomPoint + 1;
}
}
}

if (GetParam(0) == 7.0) // Select Weapon
{
ReturnEx(1.0);
return;
}

if (GetParam(0) == 14.0) // Other action
{
if (GetParam(2) != 0.0) // Everything is OK except cycle camera.
{
ReturnEx(1.0);
return;
}
}

ReturnEx(0.0);
return;

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

killed:
player = GetLocalPlayerThing();
if(GetSenderRef() != player) Return;

if(IsInvActivated(player, 41) == 1)
{
SetInvActivated(player, 41, 0);
DisableIRMode();
ClearActorFlags(player, 0x20000000); //remove the HUD
SetCameraZoom(0, 1.0, 500.0); // reset zoom factor
SetActionCog(-1, 0); // give the player his controls
}
Return;

end





Follow Ups:



Post a Followup

Name:
E-Mail:
Subject:
Comments:

Optional Link URL:
Link Title:
Optional Image URL:


[ Follow Ups ] [ Post Followup ] [ Jed Messages ]