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 → Cog request (anybody still here? ^_^ )
Cog request (anybody still here? ^_^ )
2008-07-13, 1:49 PM #1
Okay, I've been trying to get around this issue by mixing and matching LEC cogs but I'm not getting the result I want. Upon crossing an adjoin, I need a door to open and stay open. This involves AI, so adjoins in the door's sector must be shut off while the door is closed so they can't see through the door. A sound is played upon crossing the adjoin, but only the first time because I don't want an annoying sound playing every time the player crosses this adjoin.

I also need a copy of the cog which does NOT shut off adjoins, so I can do the same thing with an elevator and not get HOM.

Thanks :v:
2008-07-14, 6:16 AM #2
Piss off kitty :huh:
Render...
I guess this should work

Code:
symbols

message		startup
message		crossed


surface		adjoin01
surface		opening
sector		doorSector		local
thing		door0
sound		taadaa
int		done			local

float		moveSpeed=8.0

end
#--------------------------------------------
## Code Section

code
#--------------------------------------------
startup:
doorSector = GetThingSector(door0);
SetSectorAdjoins(doorSector, 0);
done=0;
	return;
#--------------------------------------------
crossed:

if(done == 0)
{
	SetSectorAdjoins(doorSector, 1); // delete for the 2nd cog?
	call OpenDoors;
	PlaySoundThing(taadaa, door0, 1, -1, -1, 0x80);
	done=1;
}
return;
#--------------------------------------------
OpenDoors:

MoveToFrame(door0, 1, moveSpeed);
return;
#--------------------------------------------
end
Code:
if(getThingFlags(source) & 0x8){
  do her}
elseif(getThingFlags(source) & 0x4){
  do other babe}
else{
  do a dude}
2008-07-14, 11:42 AM #3
Works great thanks ;)

What is the difference between Adjoin01 and Opening?
2008-07-14, 5:19 PM #4
Originally posted by Dash_rendar:
What is the difference between Adjoin01 and Opening?

Nothing, really. Looks like you can safely delete one of them.
And when the moment is right, I'm gonna fly a kite.
2008-07-14, 5:27 PM #5
holy sh** it worked?
Hey GBK, how you like dem apples. I can cog. IN your FACE
(i used your Cogpad to do it, Verb window saves :p)
Code:
if(getThingFlags(source) & 0x8){
  do her}
elseif(getThingFlags(source) & 0x4){
  do other babe}
else{
  do a dude}

↑ Up to the top!