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 → I need a good cog writing person!
I need a good cog writing person!
2002-02-16, 7:43 AM #1
I am terrible at writing cogs so I will just ask you guys to write one for me, if ya got the time. Anyway, I'm working on a level, and I put Jar Jar Binks in it. and I was wondering if there was anyway to make it so depending on where you shoot him he will make a noise and his limb will fall off! and then I need a cog to make him respawn when you push a button. thank you

-N8

------------------
THEY'RE HERE THEY'RE HERE GET OUT OF THE HOUSE!!!

P.S. I ate the noodles
---------------------

NO THANKS! I DRINK MY SUGAR WITHOUT COFFEEEEEE!!!!!!!!!
2002-02-18, 4:25 AM #2
please!
2002-02-18, 5:10 AM #3
I won't do the bloody stuff, but I'll help you with the respawn cog. [http://forums.massassi.net/html/smile.gif]

The code:

Code:
# jarspawn.cog
#
# Respawn Jar-Jar when a switch is pressed.
#
# [SM]
#======================================================================#
symbols

surface	switch
thing		pos_ghost
thing		orig_jarjar
template	jartemp

int		ok=0			local
thing		jarthing		local

message	activated
message	killed

end
#======================================================================#
code
#----------------------------------------------------------------
activated:
	if(!ok) Return;	// Don't let the player spawn multiple jar-jars.
	jarthing=CreateThing(jartemp, pos_ghost);
	CaptureThing(jarthing);
	ok=0;

Return;
#----------------------------------------------------------------
killed:
	ok=1;

Return;
#----------------------------------------------------------------
end


When you place this cog in the level, there are four values you need to pass to the cog.

1) The surface to press. The cog needs this so that the activated message will run when the surface is pressed.

2) A pos_ghost. Create a ghost somewhere in your level where you want the new Jar-Jar to spawn from.

3) The original Jar-Jar. This is the Jar-Jar that's already in the level. The cog needs his value passed so it can receive his killed message.

4) The template for the new Jar-Jar.

The cog isn't tested, but it should work. Reply if you have problems. Good luck [http://forums.massassi.net/html/wink.gif]

------------------
Each cog better than the next
Author of the JK DataMaster, Parsec, Scribe, and the EditPlus Cog Files.
2002-02-18, 7:41 AM #4
thank you very much

↑ Up to the top!