Posted by Elanthil01 on February 21, 1998 at 20:51:56:
Hi..Cogking or anyone else whos a cog guru, I have a cog that I pulled from the DCJRUMBLE level called 'tiepatrol'. its based off the JK cog 'alwayselev.cog'.
Currently its set to movetoframe, then wait, then return to the original position.
I need to know, what would I do to add a second and/or third 'frame' to it?
What I want is for the object to move to a frame, perform an action there (i.e. another frame, but this frame will be used to perform an action such as rotating the object), then move to the next frame, etc.
I'll go ahead and post the cogfile text below (if this is illegal, then please delete it!)
# Jedi Knight Cog Script
#
# ALWAYSELEV.COG
#
# Dual Elevator Script for C3
#
# This will simply move an elevator between its two frames.
# It was originally handling two elevators, hence the legacy name...
#
# [YB]
#
#This COG was orriginally written by the fine folks at Lucas Arts. But I PSXPat have editied it to fit my needs
#
#
# (C) 1997 LucasArts Entertainment Co. All Rights Reserved
symbols
thing elevator desc=elevator_object
flex speed=6.0 desc=movement_speed
flex waittime=1.5 desc=wait_time_at_stop
message startup
message pulse
message arrived
message timer
message blocked
end
# ========================================================================================
code
startup:
// SERVER ONLY startup:
if(IsServer() || !IsMulti())
{
SetPulse(1);
}
Return;
# ........................................................................................
pulse:
SetPulse(0);
MoveToFrame(elevator, 1, speed);
Return;
# ........................................................................................
arrived:
SetTimerEx(waittime, 1, 0, 0);
Return;
# ........................................................................................
timer:
if(GetCurFrame(elevator) == 1)
MoveToFrame(elevator, 0, speed);
else
MoveToFrame(elevator, 1, speed);
Return;
# ........................................................................................
blocked:
KillTimerEx(1);
MoveToFrame(elevator, 1 - GetGoalFrame(elevator), speed);
Return;
end
thats all of it. I want to add, ideally, 4 more two-frame sets to it so I can let the object cross a room, turn and rotate, move out and down, turn, move again, etc.
I have some more coging ?'s, but I'll post them in a separate message(s).
Im trying to figure this stuff out myself, but a lot of it is very strange..
one other thing..I assume, since I see the same variables in most scripts, that there is an internal list of variables for the cog language?
If so, there a file listing them and what they do anywhere? that will probably help me a lot.
Thanks
(btw..redoing level from scratch..making it huge).