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 → Cogs, frames, & transport
Cogs, frames, & transport
2004-07-11, 5:38 AM #1
Hi, I am just wondering which is the most efficient/best way of making a troop transport move thru multiple frames. Would it be best if I make a .key? Or how about thingframes? Or even moving to ghost positions, all representing frames?

Here's what I made so far, is there a better way? (There are 3 stops, hence Sleep)
Code:
# Jedi Knight Cog Script
#
# myspeeder.cog
#
# The speeder will go to all frames & loop from to 0 when
# a ghost position is activated (ghost pos=near computer screen).
# 
# [F-Body]
#
# This cog was not made or supported by LucasArts Entertainment Company


symbols
	message	activate
	message	arrived

	thing		speeder 	linkid=1
	thing		ghost_activate 	linkid=2

	flex		sleeptime=3.0     local
end

code
activate:
	if (IsThingMoving(speeder)) return;
	if (GetSenderId() != 2) return;
      	if (GetCurFrame(speeder) == 0) 
	{
		MoveToFrame(speeder, 1, 8);
      	}
	return;

arrived:
	if (GetCurFrame(speeder) == 1)
	{
		MoveToFrame(speeder, 2, 10);
      	}
	if (GetCurFrame(speeder) == 2)
	{
		MoveToFrame(speeder, 3, 14);
      	}
	if (GetCurFrame(speeder) == 3)
	{
		Sleep(sleeptime);
		MoveToFrame(speeder, 4, 16);
      	}
	if (GetCurFrame(speeder) == 4)
	{
		MoveToFrame(speeder, 5, 8);
      	}
	if (GetCurFrame(speeder) == 5)
	{
		MoveToFrame(speeder, 6, 10);
      	}
	if (GetCurFrame(speeder) == 6)
	{
		MoveToFrame(speeder, 7, 10);
      	}
	if (GetCurFrame(speeder) == 7)
	{
		MoveToFrame(speeder, 8, 8);
      	}
	if (GetCurFrame(speeder) == 8)
	{	
		MoveToFrame(speeder, 9, 16);
      	}
	if (GetCurFrame(speeder) == 9)
	{
		MoveToFrame(speeder, 10, 20);
      	}
	if (GetCurFrame(speeder) == 10)
	{
		MoveToFrame(speeder, 11, 25);
      	}
	if (GetCurFrame(speeder) == 11)
	{
		MoveToFrame(speeder, 12, 25);
      	}
	if (GetCurFrame(speeder) == 12)
	{
		MoveToFrame(speeder, 13, 16);
      	}
	if (GetCurFrame(speeder) == 13)
	{
		MoveToFrame(speeder, 14, 12);
      	}
	if (GetCurFrame(speeder) == 14)
	{
		Sleep(sleeptime);
		MoveToFrame(speeder, 15, 8);
      	}
	if (GetCurFrame(speeder) == 15)
	{
		MoveToFrame(speeder, 0, 16);
      	}
	if (GetCurFrame(speeder) == 0)
	{
		Sleep(sleeptime);
		MoveToFrame(speeder, 1, 8);
      	}
	return;


end


------------------
nil nip nada zip zero naught lip zil
This is retarded, and I mean drooling at the mouth
2004-07-11, 9:23 AM #2
thats as effichiant as it gets unless you use a keyframe. however if you where to make it so it travled at the same speed all the way you could just use.
Code:
symbols
thing van
int numframes
flex speed
message activated
end
code
activated:
movetoframe(van,numframes-1,speed);
waitforstop(van);
skiptoframe(van,0,speed);
return;
end


NOTE: numframes MUST BE the same as the numframes of the thing for that to work perfectly...

to stop it going to the start at the end remove the skiptoframe line..

------------------
I am Darth PJB!
well, go on, run away!

i have a plastic lightsaber and a jedi cape.. am i a nerd?

If gravity is a crule mistress, and bar tenders with bad grammar are untrustworthy, what is air?
I am Darth PJB!
well, go on, run away!

i have a plastic lightsaber and a jedi cape.. am i a nerd?

If gravity is a crule mistress, and bar tenders with bad grammar are untrustworthy, what is air?
2004-07-12, 6:38 AM #3
also reading your code i realised that your thng when getting to the end will fly backwards to frame 0, to stop that use skiptoframe like i did

------------------
I am Darth PJB!
well, go on, run away!

i have a plastic lightsaber and a jedi cape.. am i a nerd?

If gravity is a crule mistress, and bar tenders with bad grammar are untrustworthy, what is air?
I am Darth PJB!
well, go on, run away!

i have a plastic lightsaber and a jedi cape.. am i a nerd?

If gravity is a crule mistress, and bar tenders with bad grammar are untrustworthy, what is air?
2004-07-14, 10:17 AM #4
OK thanks, I noticed that too. Is jumptoframe similar to teleportthing?

------------------
nil nip nada zip zero naught lip zil
This is retarded, and I mean drooling at the mouth
2004-07-14, 2:21 PM #5
Quote:
<font face="Verdana, Arial" size="2">Originally posted by F-Body:
Is jumptoframe similar to teleportthing?</font>

Apparently so (looking at the DM)

------------------
nytfyre m0d || f33l t3h p0w3r || t3h l0st c0gz || OMF > *
May the mass times acceleration be with you.
2004-07-15, 8:37 AM #6
its practicaly identical, except insted of going to the postion taken from thing it gose to a postion allready held in memory, theorteicaly saveng you a microsecond or two of prosessing.

not that thats any use! just thought i'd state it.

------------------
I am Darth PJB!
well, go on, run away!

i have a plastic lightsaber and a jedi cape.. am i a nerd?

If gravity is a crule mistress, and bar tenders with bad grammar are untrustworthy, what is air?
I am Darth PJB!
well, go on, run away!

i have a plastic lightsaber and a jedi cape.. am i a nerd?

If gravity is a crule mistress, and bar tenders with bad grammar are untrustworthy, what is air?
2004-07-15, 8:54 AM #7
Actually, there are some cases where it could be useful, suppose you've got a thing moving around, visible at times, in an sp level. Now player goes out of view, goes further in the level, quickly, and your object is supposed to fly by the sector he's at, but it's still a few frames back. Jumptoframe, just outta sight, then play anim. ... best use I can think of right now...

------------------
_ _ _____________ _ _
Wolf Moon
Cast Your Spell On Me
Beware
The Woods At Night
The Wolf Has Come
_ _ _____________ _ _
Wolf Moon
Cast Your Spell On Me
Beware
The Woods At Night
The Wolf Has Come
2004-07-15, 10:26 AM #8
First thing I think of is if you have a patrolling enemy that walks through a teleporter...

------------------
nytfyre m0d || f33l t3h p0w3r || t3h l0st c0gz || OMF > *
May the mass times acceleration be with you.

↑ Up to the top!