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 → Tell me if this is write...
Tell me if this is write...
2001-09-17, 1:56 PM #1
This is my first cog, tell me if it is right please!!!!!


# Jedi Knight Cog Script
#
# cutscene.COG
#
# Description
#
#
# This Cog is Not supported by LucasArts Entertainment Co

symbols
thing player
thing jerec
thing door
thing Camera
thing Camera2
float speed
float speed
message killed

end

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

code
killed:
jkBeginCutscene();
StopThing(player);
SetCameraFocus(0, Camera);
MoveToFrame(door, 1, speed);
MoveToFrame(Camera, 1, speed1);
SetCameraFocus(0, Camera2);
Sleep(4);
jkEndCutscene();
SetCameraFocus(0, player);

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

end

2001-09-17, 3:32 PM #2
First off, you defined "speed" two times, instead of "speed" and "speed1" and you forgot a "return;" at the end of the killed message. Also you should use "SetCameraFocus(0, jkGetLocalPlayer);" when returning the view to the player. I would also add in an if-sentence to the killed message, though I don't know if it really is necessary. Here's what I mean :
Code:
# Jedi Knight Cog Script
#
# cutscene.COG
#
# Description
# 
#
# This Cog is Not supported by LucasArts Entertainment Co


symbols
       thing player 
       thing jerec 
       thing door 
       thing Camera 
       thing Camera2 
       float speed 
       float speed1
       message killed 

end 
#==================================#
code

killed:
if(GetSenderId()==jerec)
  {
  jkBeginCutscene();
  StopThing(player);
  SetCameraFocus(0, Camera);
  MoveToFrame(door, 1, speed);
  MoveToFrame(Camera, 1, speed1);
  SetCameraFocus(0, Camera2);
  Sleep(4);
  jkEndCutscene();
  SetCameraFocus(0, jkGetLocalPlayer);
  }
return;
#=================================#
end

Anyway, not bad for your first self-made COG. [http://forums.massassi.net/html/smile.gif]


[This message has been edited by Maverick (edited September 17, 2001).]
Maverick
2001-09-18, 3:43 AM #3
thanks!! Guess i didn't notice the spped defined 2 times instead of speed1!! Thanks again.
2001-09-18, 11:57 AM #4
That cog won't work. You should use GetLocalPlayerThing() to define the player, and there is no jkGetPlayerThing(). I don't know what the senderid would be in the killed message, but you need to use GetSenderRef()

This cutscene will only work in internal view. -Not sure if you wanted it that way or not.

That's all I can see wrong with this cog, but then again, I've never done any cutscenes before so I don't know if it will work.

------------------
Fiction must be more realistic than truth or no one will believe it.
Author of the JK DataMaster, Parsec, Scribe, and the EditPlus Cog Files.
2001-09-19, 6:40 AM #5
Darn... damn GetSenderId() & GetSenderRef()... I always confuse those two.

Oh, but SaberMaster... go read again. I wrote jkGetLocalPlayer, meant jkGetLocalPlayer() though, not jkGetPlayerThing(). Just to point it out to you, I've got that jkGetLocalPlayer() from Anthony Espindolas Cutscene tutorial for MOTS (but that command doesn't show up in the MOTS-Section of the JKSpecs). Might be that it doesn't exist as I haven't checked, but then something's wrong with that tutorial as well.

So you suggest the following :
Code:
# Jedi Knight Cog Script
# cutscene.COG
# Description#
# This Cog is Not supported by LucasArts Entertainment Co

symbols      
        thing player
        thing jerec        
        thing door        
        thing Camera        
        thing Camera2        

        float speed        
        float speed1       

        message killed 
end 
#==================================#
code

killed:
if (GetSenderRef()==jerec)  
   {  
   player=GetLocalPlayerThing();
   jkBeginCutscene();
   StopThing(player);
   SetCameraFocus(0, Camera);
   MoveToFrame(door, 1, speed);
   MoveToFrame(Camera, 1, speed1);
   SetCameraFocus(0, Camera2);
   Sleep(4);  
   jkEndCutscene();  
   SetCameraFocus(0, player);
   }
return;
#=================================#
end

That is what you suggested, isn't it? Yeah... I've messed up by not doing "player=GetLocalPlayerThing();" first hand, but that's all I can see that was my own fault.
Maverick
2001-09-20, 11:30 AM #6
Here's how I would write it:

Code:
symbols

#Local Variables
thing	 player		local
flex speed1=1		local	 #Put in values for the speeds
flex speed2=1		local

#Global Variables - Make sure these are defined.
thing	 jerec
thing	 door
thing	 Camera
thing	 Camera2

message killed
message	timer

end
#==================================#
code
#==================================#
killed:
   player=GetLocalPlayerThing();
   jkBeginCutscene();
   StopThing(player);
   SetCameraFocus(0, Camera);
   SetCameraFocus(1, Camera);
   MoveToFrame(door, 1, speed1);
   MoveToFrame(Camera, 1, speed2);
   SetCameraFocus(0, Camera2);
   SetCameraFocus(1, Camera2);
   SetTimer(4);

Return;
#=================================#
timer:
   jkEndCutscene();
   SetCameraFocus(0, player);
   SetCameraFocus(1, player);

Return;
#=================================#
end


Several things to note:

1) I used flexes instead of floats because LEC didn't use them much. -They may have some sort of error.
2) I changed some of the variables to local, because they don't have to be global. Make sure that the Global variables are defined.3) Using sleeps has made JK crash for me. Though I was doing some complicated things, I think using timers is a lot more stable.
4) The speeds are now defined in the cog.
5) Camera now works in internal and external view.
6) And lastly, I removed the GetSenderRef() checking. I don't think there's any chance that GetSenderRef() is not going to be jerec

Other than those minor changes, the cog was alright, I think.

One thing more, how is jerec's killed message going to be sent to this cog? I've never worked with levels so maybe there's something you can do about that; But if there's no other way, you'll have to add this cog into jerec's actor cog so you can use it's killed message.

------------------
Fiction must be more realistic than truth or no one will believe it.
Author of the JK DataMaster, Parsec, Scribe, and the EditPlus Cog Files.
2001-09-20, 11:49 AM #7
In that COG you're right... it'll never come to anything else than jerec, because the only one else to send that message for that COG is the player, and then it'd ignored since JK stops all your level COGs when the player dies.

As to how it'll know it is assigned to the Jerec-Actor, that's why it is assigned in the symbols-section. The cog will react if the killed messages is sent by any of the things that are associated with it. In this COG this would refer to killed possibilities of all the the things you assigned.

[This message has been edited by Maverick (edited September 20, 2001).]
Maverick

↑ Up to the top!