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 → Cog Help!
Cog Help!
2002-11-15, 1:48 PM #1
I have a cog that changes a ghost object into a blue key. When the player picks up the blue key, an objective is supposed to be completed, however, when the blue key is taken, nothing happens. Any explanation?

Code:
# Jedi Knight Cog Script 
# 
# Findthekey.COG 
# 
# Enter the sector and plays Find the key sound, then generates the key in an office. 
# BSR 6-13-01 
# 
# This Cog is Not supported by LucasArts Entertainment Co 

symbols 

message startup 
message entered 
message taken 
message trigger 

thing adminkeyghost 
thing gregoryghost 

template bluekey 
template gregory 

sector treeceoffice 

thing player local 
int enteredx=0 local 
int goaheadx=0 local 

sound lenkey=lenkey.wav 
sound goalsound=Accomplish1.wav 

end 

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

code 

startup: 
player=JKGetLocalPlayerThing; 
Return; 

trigger: 

goaheadx=1; 
Return; 

entered: 
if ((enteredx == 0) && (goaheadx == 1) && (GetSenderRef() == treeceoffice)) 
{enteredx=1; 
sleep(5.0); 
PlaySoundThing(lenkey, player, 1.0, 1, 1, 0x80); 
Print("Crap! The key is not here! Maybe another officer took it before I got here."); 
sleep(5.0); 
Print("Maybe I should try those two offices above the officers' briefing room."); 
CreateThing(bluekey, adminkeyghost); 
CreateThing(gregory, gregoryghost); 
} 
Return; 

taken: 
if (GetSenderRef() == adminkeyghost) 
{ 
player=JKGetLocalPlayerThing; 
SetGoalFlags(player, 3, 2); 
PlaySoundThing(goalsound, player, 1.0, 1, 1, 0x80); 
Print("Mission Objective Accomplished!"); 
}Return; 


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

end


edit: Just added the code tags...


------------------
Donny Versiga
ICQ: 85623400
E-mail: Nirvan5599@aol.com
Wasting away my life building levels and playing guitar


[This message has been edited by GBK (edited November 15, 2002).]
Donny Versiga
ICQ: 85623400
E-mail: punkindrublic5@aol.com
Wasting away my life building levels and playing guitar
2002-11-15, 4:00 PM #2
Well, Taken is only sent to object's class cogs, so its not going to help here... You might try using Touched instead.
And when the moment is right, I'm gonna fly a kite.

↑ Up to the top!