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 would like to request a cog.
I would like to request a cog.
2004-08-22, 11:32 AM #1
And since I haven't bothered to learn the cog language, I figured I would ask here.

I need a cog that does this:

When a 3do is activated, it:
1. Changes the 3do into a different 3do
2. Changes the texture on a bunch of surfaces (like 16)
3. Changes the sector tint in a bunch of sectors
4. Changes the ambient sound and volume in a bunch of sectors
5. Changes everything back after a certain amount of time, or when the 3do is activated again.

Thanks in advance!

------------------
"The interesting thing about video games is the way you can take about 50 shotgun blasts to the head and be instantly healed by a little white box with a cross on it."
Stuff
2004-08-22, 11:43 AM #2
There is a cog

When you enter a sector a 3do wil change into another

------------------
SpriteMod (JO 2003) Roger Wilco Skin

[This message has been edited by G-Man (edited August 22, 2004).]

[This message has been edited by G-Man (edited August 22, 2004).]
SpriteMod (JO 2003) Roger Wilco Skin

Snail racing: (500 posts per line) ---@%
2004-08-22, 11:47 AM #3
Code:
# Jedi Knight Cog Script
#
# activesector2.cog
#
# Changes a thing's model upon entering/leaving of a sector
#
# zagibu@gmx.ch
#
# ========================================================================================

symbols

sector		room

model		off
model		on

thing		structure

message		entered
message		exited

end

# ========================================================================================

code

entered:
	if(GetSectorPlayerCount(GetSenderRef()) == 1)
		SetThingModel(structure, on);
	return;

# ........................................................................................

exited:
	if(GetSectorPlayerCount(GetSenderRef()) == 0)
		SetThingModel(structure, off);
	return;

end


maybe you can edit this...
------------------
SpriteMod (JO 2003) Roger Wilco Skin

[This message has been edited by G-Man (edited August 22, 2004).]

[This message has been edited by G-Man (edited August 22, 2004).]
SpriteMod (JO 2003) Roger Wilco Skin

Snail racing: (500 posts per line) ---@%
2004-08-22, 4:50 PM #4
This cog assumes that the sector has no existing sound applied to it; if your sectors have an ambient sound, this code will have to be modified to incorporate that.

Not tested, but has been parsed.
Since you'll likely need to add more surfaces than this cog will accept, add another instance of this cog, fill in the sector and surface info, and set the console variable to the same thing number in jed's cog window.

Code:
# Jedi Knight Cog Script
#
# k90-3dofx.COG
#
# When a 3do is activated, it:
# 1. Changes the 3do into a different 3do
# 2. Changes the texture on a bunch of surfaces (like 16)
# 3. Changes the sector tint in a bunch of sectors
# 4. Changes the ambient sound and volume in a bunch of sectors
# 5. Changes everything back after a certain amount of time, or when the 3do is activated again.
# 
# [Darth Slaw]
# 
# This Cog is Not supported by LucasArts Entertainment Co

symbols
message startup
message activated
message timer

int active=0 local
int mode=0		# 0 - stop fx by timer; 1 - stop fx by activating again
flex delay=1.0		# if mode is 0, the delay after setting fx to stop them

int i local

# Step 1
thing console=-1
model oldmodel local
model newmodel

# Step 2
material mat0 Local
material mat1 Local
material mat2 Local
material mat3 Local
material mat4 Local
material mat5 Local
material mat6 Local
material mat7 Local
material mat8 Local
material mat9 Local
material new_mat

surface surf0=-1
surface surf1=-1
surface surf2=-1
surface surf3=-1
surface surf4=-1
surface surf5=-1
surface surf6=-1
surface surf7=-1
surface surf8=-1
surface surf9=-1
int used_surf=0 local

# steps 3 and 4
sector sec0=-1
sector sec1=-1
sector sec2=-1
sector sec3=-1
sector sec4=-1
sector sec5=-1
sector sec6=-1
sector sec7=-1
sector sec8=-1
sector sec9=-1
int used_sec=0 local

# sector tint values
flex r0=0.0 Local
flex r1=0.0 Local
flex r2=0.0 Local
flex r3=0.0 Local
flex r4=0.0 Local
flex r5=0.0 Local
flex r6=0.0 Local
flex r7=0.0 Local
flex r8=0.0 Local
flex r9=0.0 Local
flex r=0.0

flex g0=0.0 Local
flex g1=0.0 Local
flex g2=0.0 Local
flex g3=0.0 Local
flex g4=0.0 Local
flex g5=0.0 Local
flex g6=0.0 Local
flex g7=0.0 Local
flex g8=0.0 Local
flex g9=0.0 Local
flex g=0.0

flex b0=0.0 Local
flex b1=0.0 Local
flex b2=0.0 Local
flex b3=0.0 Local
flex b4=0.0 Local
flex b5=0.0 Local
flex b6=0.0 Local
flex b7=0.0 Local
flex b8=0.0 Local
flex b9=0.0 Local
flex b=0.0

sound newsound

flex vol=1.0

end

# ========================================================================================

code
startup:
	Sleep(1);
	oldmodel = GetThingModel(console);
	for(i = 0; i < 10; i = i + 1)
	{
		if(surf0 != -1) mat0 = GetSurfaceMat(surf0);
		else 
		{
			used_surf = i;
			i = 20;
		}
	}
	for(i = 0; i < 10; i = i + 1)
	{
		if(sec0 != -1)
		{
			r0 = VectorX(GetSectorTint(sec0));
			g0 = VectorY(GetSectorTint(sec0));
			b0 = VectorZ(GetSectorTint(sec0));
		}
		else 
		{
			used_sec = i;
			i = 20;
		}
	}


stop;
# ........................................................................................
activated:
	if(mode == 0)	//timer
	{
		if(active) stop;
		active = 1;
		call set_fx;
		SetTimer(delay);
	}
	else		//no timer
	{
		if(active) call stop_fx;
		else call set_fx;
		active = 1 - active;
	}

stop;
# ........................................................................................
set_fx:
	SetThingModel(console, newmodel);
	for(i = 0; i < used_surf; i = i + 1) SetSurfaceMat(surf0, new_mat);
	for(i = 0; i < used_sec; i = i + 1)
	{
		SetSectorTint(sec0, VectorSet(r, g, b));
		SectorSound(sec0, newsound, vol);
	}

stop;
# ........................................................................................
stop_fx:
	SetThingModel(console, oldmodel);
	for(i = 0; i < used_surf; i = i + 1) SetSurfaceMat(surf0, mat0);
	for(i = 0; i < used_sec; i = i + 1)
	{
		SetSectorTint(sec0, VectorSet(r0, g0, b0));
		SectorSound(sec0, newsound, 0.0);
	}

stop;
# ........................................................................................
timer:
	call stop_fx;
	active = 0;

stop;
# ........................................................................................
end



------------------
nytfyre m0d || f33l t3h p0w3r || t3h l0st c0gz || OMF > *
May the mass times acceleration be with you.
2004-08-23, 3:43 AM #5
Stop;? [http://forums.massassi.net/html/frown.gif]


[http://forums.massassi.net/html/wink.gif]

------------------
Dear lady, can you hear the wind blow, and did you know
Your stairway lies on the whispering wind.
:wq!
And when the moment is right, I'm gonna fly a kite.
2004-08-23, 9:03 AM #6
Quote:
<font face="Verdana, Arial" size="2">Originally posted by GBK:
Stop;? [http://forums.massassi.net/html/frown.gif]

[http://forums.massassi.net/html/wink.gif]
</font>


One reason I picked up using "stop;" (about a month ago? I forget exactly when...) is because I tended to make typos when I used "return;" (like "reutrn;" and such); I also kind of naturally started thinking "stop;" instead, probably because I stumbled on that forgotten cache of your cogs and spent a while examining them [http://forums.massassi.net/html/smile.gif].

I occasionally make a "return;" instead, but stop; has become a habit and is quite dominant now.

It's going to be interesting when I start my Java classes again [http://forums.massassi.net/html/redface.gif]

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

↑ Up to the top!