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 cog.
I need a cog.
2001-06-04, 7:39 AM #1
The cog I need is sorta like the neonsign.cog, except I need it to operate 2 signs/surfaces, and when 1 gets damaged, both signs/surfaces will go to the frame 1.
Example, I have 2 signs, I damage one and BOTH signs go to frame 1 so they looks damaged.
Can someone make this for me or tell me how to modify the existing neonsign.cog?

------------------
True life shimmers with the light of diamonds.
A fake life is as black as coal.
2001-06-04, 7:42 AM #2
Oh, and it is for multiplayer.

------------------
True life shimmers with the light of diamonds.
A fake life is as black as coal.
2001-06-04, 1:33 PM #3
Here's the cog modified for 2 signs. I don't edit in MP; if 00_neonsign.cog works in multiplayer than so will the modification. When you add this cog in JED you'll need to enter the numbers for the 2 sign surfaces and pick a sound for the explosion when the sign is damaged.

Code:
# Jedi Knight Cog Script
# 2_neonsign.cog modified from 00_neonsign.cog
#
# Use with 2 neon signs, if damaged, both go to frame 0.
#
# this cog will cycle through frames 0-(lastFrame-1), at framerate fps
# if damaged, it will go to frame lastFrame and stop, create sparks and sound
#
# Not supported by LucasArts Entertainment Co.


symbols
	message		startup
	message		damaged

	surface		sign1		mask=0x448
	surface		sign2		mask=0x448
	float		fps=2.0		desc=speed_of_anim
	template	sparks=+sparks	desc=created_when_shot
	sound		exp_sound	desc=played_when_shot

	int		garbage		local
end

code

//-----------------------------------------------------------------

startup:
	// Start the animation looping but skipping the first 2 frames
	SurfaceAnim(sign1, fps, 0x5);
	SurfaceAnim(sign2, fps, 0x5);
	return;

//-----------------------------------------------------------------

damaged:
	if (GetWallCel(sign1) == 0) return;

	StopSurfaceAnim(sign1);
	StopSurfaceAnim(sign2);

	if (exp_sound)
		PlaySoundPos(exp_sound, SurfaceCenter(sign1), 1.0, -1, -1, 0);

	garbage = SetWallCel(sign1, 0);
	garbage = SetWallCel(sign2, 0);

	garbage = CreateThing(sparks, GetSourceRef());
	return;
end


[edit] If you want sparks to show from both signs than use the following 2 lines instead of the last one in the code:

garbage = CreateThing(sparks, sign1);
garbage = CreateThing(sparks, sign2);

[/edit]
------------------
Sylvicolus JK homepage
If I have ever made any valuable discoveries, it has been owing more to
patient observation than to any other reason. -Isaac Newton

[This message has been edited by Sylvicolus (edited June 04, 2001).]
Sylvicolus JK homepage
If I have ever made any valuable discoveries, it has been owing more to
patient observation than to any other reason. -Isaac Newton
2001-06-05, 5:01 AM #4
Thanks, it works great.

------------------
True life shimmers with the light of diamonds.
A fake life is as black as coal.

↑ Up to the top!