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 → Quick Cog Request
Quick Cog Request
2005-05-24, 9:59 AM #1
I'm sure I've seen this before, probably in MotS or in many custom levels, and I'm sure the TIE bomber cog from JK could be modified to do the same thing...

Can someone provide a cog that creates ships at ghost points and moves them to others to create an ambient appearance of ship traffic above and around the player?
Cordially,
Lord Tiberius Grismath
1473 for '1337' posts.
2005-05-24, 2:30 PM #2
Ive written this cog before. Many times, for many editors. Surely you could search the forums and find a previous thread... ;)
And when the moment is right, I'm gonna fly a kite.
2005-05-24, 5:09 PM #3
So you have... I'll try this one for now:

Code:
# Yet another generic frame-based flying ship cog.
# But this one has error correction!!
#
# 11/2002 GBK
Symbols
Message Startup
Message Crossed
Message Arrived
Message Timer
Thing Ghost
Template Ship_type
Thing Ship		Local
Int Num_frames	#Whatever JED reports as your number of frames, put it here. (count from 1)
Flex Speed=4
Sound Hum
Flex Hum_dist=10	#It is now in JKUs
Int Ch=0		Local
Int Destroy_end=1	#Destroy the ship when it reaches the end?
Int Recreate_end=1	#Recreate it?  This is unused if the above is 0.
Int Mode=0		#0 - on startup, start ship
			#1 - on crossing "Adjoin", start ship.
Surface Adjoin	#If your using mode 0, you dont need this.
Int C=0		Local
Int I=0		Local
End
Code
Startup:
Sleep(0.5);
Num_frames = Num_frames - 1;
If(Mode) Stop;
Call Go;
Stop;
Crossed:
If(!Mode) Stop;
Call Go;
Stop;
Go:
Ship = Creatething(Ship_type, Ghost);
If(Ship == -1) { Call Failure; Stop; }
Movetoframe(Ship, Num_frames, Speed);
Capturething(Ship);
Ch = Playsoundthing(Hum, Ship, 1, 0, Hum_dist*10.5, 0x81);
Stop;
Arrived:
If(Getcurframe(Ship) != Num_frames) Stop;
Stopsound(Ch, 0.1); 
If(Destroy_end) { Destroything(Ship);  Ship = -1;
If(Recreate_end) Call Go; } Stop;
Failure:
For(I=0;I<=640;I=I+1) If(Getthingsignature(I) != -1) C = C + 1;
JKstringclear(); If(Getthingcount() - C <= 10)
JKstringconcatformattedint(Getselfcog(), "Ship creation failure, cog %d. Likely cause:  Thing limit.");
Else JKstringconcatformattedint(Getselfcog(), "Ship creation failure, cog %d.  Likely cause:  Bad template.");
JKstringoutput(-1, -1);
Settimer(0.1);
Stop;
Timer: Call Go; Stop;
End


Thanks.
Cordially,
Lord Tiberius Grismath
1473 for '1337' posts.

↑ Up to the top!