multipoint patrol cant be done with tiepatrol.cog


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

Posted by Elanthil01 on February 22, 1998 at 01:17:14:

I discovered that you cant(In spite of what I was told) do more than 2 frames (0 and 1 to the script?) with the tiepatrol.cog from the dcjrumble level.

The PROBLEM is that the cog goes like this...

Moveframe((thing),int frame,speed)

in THIS script, the above line becomes:
moveframe((thing),1, speed)

the int frame is set to 1. that means move to frame 1..a hardcoded value

and later it says:

moveframe(thing),0, speed)

This means move the (thing) to frame 0 at the speed set in flex speed

Now..in the thing editor you can put as many 'frame' settings as you wish, but only the first two (0 and 1) will get used the way this script is set up.

What I need help with is this:

ok..I know I need to set a flex NUMFRAMES, and I need to set a MAXFRAMES variable, which I THINK should be NUMFRAMES+1 but Im not sure whether its a float, flex, int or what, also I think I need a NEXTFRAME which would be GETCURFRAME+1 but again, is it float or int or what?

Now..on structuring the startup vars I THINK it should be:
symbols

thing elevator desc=elevator_object
flex speed=6.0 desc=movement_speed
flex waittime=1.5 desc=wait_time_at_stop
flex numframes=2 desc=num_frames_in_patrol
int maxframes=2 desc=numframes+1
int nextframe=0
message startup
message pulse

message arrived
message timer
message blocked

end

Now..for structuring the program line to determine whether to return to frame 0 or go to another frame:

When it goes to decide if its near the end I THINK I need to make it:

if(GetCurFrame(elevator) == maxframes)
MoveToFrame(elevator, 0, speed);
else
MoveToFrame(elevator, nextframe, speed);
nextframe=(GetCurFrame(elevator)+1)
Return;

now...should I parse it like the above, or like this?

if(GetCurFrame(elevator) == (maxframes))
MoveToFrame(elevator, 0, speed);
else
MoveToFrame(elevator, (nextframe), speed);
Return;


Does this sound right?

this is ticking me off and none of the other cogs, even the ones from JK itself work for this.




Follow Ups:



Post a Followup

Name:
E-Mail:
Subject:
Comments:

Optional Link URL:
Link Title:
Optional Image URL:


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