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 → Help me, Hideki!
Help me, Hideki!
2001-04-04, 9:26 AM #1
I've got this airlock in my level, that has all the appropriate things set in the slots, but it's supposed to flood after the doors close behind you, then the doors in front of you open after the flood, only mine won't flood! I have the 3do that's textured like water that's supposed to move up, only it just sits there and never floods. Here's the cog:
Code:
# Jedi Knight Cog Script
# airlockdoors.cog
#
# A set of airlock doors
#
# -Obsidian 1-28-00

symbols

thing		DryDoor1		linkid=1
thing		DryDoor2.		linkid=1

thing		WetDoor1		linkid=2
thing		WetDoor2		linkid=2

surface	DrySwitch		linkid=1
surface	WetSwitch		linkid=2
surface	CenterSwitch	linkid=3

flex		DoorSpeed		nolink

thing		water3do		linkid=4
flex		FloodSpeed		nolink
# sound		FloodingSound	nolink

sector	FloodSector		
vector	FloodTint		nolink

int		running		local
int		flooded=0		local

int		open=1		local
int		close=0		local
int		DryDoors=1		local
int		WetDoors=2		local

int		LastMoveDoor	local

int		channel		local
vector	oldtint		local

message	startup
message	activated
message	arrived
message	timer


end

# ==========

code

Startup:

SetThingFlags(water3do, 0x10);
OldTint = GetSectorTint(FloodSector);
SetTimerEx(0, 1, open, drydoors);

return;

# ..........

Activated:

If(GetSenderType() != 6) return;

If(IsThingMoving(water3do)) return;

If(GetSenderID() == 1)
{
   running = 1;
   If(GetCurFrame(DryDoor1) != open) SetTimerEx(0, 1, close, wetdoors);
}

If(GetSenderID() == 2)
{
   running = 1;
   If(GetCurFrame(wetDoor1) != open) SetTimerEx(0, 1, close, drydoors);
}

If(GetSenderID() == 3)
{
   running = 1;
   If(GetCurFrame(DryDoor1) != Close) SetTimerEx(0, 1, close, drydoors);
   If(GetCurFrame(wetDoor1) != Close) SetTimerEx(0, 1, close, wetdoors);
}

return;

# ..........

Arrived:

running = 0;

If((GetSenderRef() == DryDoor1) && (GetCurFrame(DryDoor1) == close)) Call FloodSector;
If((GetSenderRef() == WetDoor1) && (GetCurFrame(WetDoor1) == close)) Call UnFloodSector;

If(GetSenderRef() == water3do) 
{
   If(GetCurFrame(water3do) == 1) 
   {
      If(flooded)
      {
	   SetSectorTint(FloodSector, FloodTint);
	   SetSectorFlags(FloodSector, 0x2);
	   MoveToFrame(water3do, 2, floodspeed);
      }
      else
      {
	   SetSectorTint(FloodSector, oldtint);
	   ClearSectorFlags(FloodSector, 0x2);
	   MoveToFrame(water3do, 0, floodspeed);
      }
   }

   If(GetCurFrame(water3do) == 0) 
   {
	SetTimerEx(0, 1, open, drydoors);
      SetThingFlags(water3do, 0x10); 
   }

   If(GetCurFrame(water3do) == 2) 
   {
	SetTimerEx(0, 1, open, wetdoors);
      SetThingFlags(water3do, 0x10); 
   }
}

return;

# ..........

Timer:

If(GetSenderID() != 1) return;

If(GetParam(1) == DryDoors)
{
   MoveToFrame(DryDoor1, GetParam(0), doorspeed);
   MoveToFrame(DryDoor2, GetParam(0), doorspeed);
}

If(GetParam(1) == WetDoors)
{
   MoveToFrame(WetDoor1, GetParam(0), doorspeed);
   MoveToFrame(WetDoor2, GetParam(0), doorspeed);
}

return;

# ..........

FloodSector:

MoveToFrame(water3do, 1, floodspeed);
ClearThingFlags(water3do, 0x10);
//channel = PlaySoundThing(FloodingSound, water3do, 1, -1, -1, 0x81); 
//StopSound(channel, 3);
flooded = 1;

return;

# ..........

UnFloodSector:

MoveToFrame(water3do, 1, floodspeed);
ClearThingFlags(water3do, 0x10);
//channel = PlaySoundThing(FloodingSound, water3do, 1, -1, -1, 0x81); 
//StopSound(channel, 3);
flooded = 0;

return;

end


And here is what it looks like: [http://www.tbns.net/zell/cogpic.jpg]

CAn you help me?
DO NOT WANT.
2001-04-05, 12:23 AM #2
Try setting the timer to a second or something in the startup, I think 0 second time might not be working.

------------------
http://millennium.massassi.net/ - Millennium
2001-04-05, 1:29 PM #3
Er... there's several places it says 'startup'... could you just copy the text into notepad, from notepad copy it onto cogwriter, and edit it form there, then see me let? 9let me see it, and I'll copy it onto my proj directory, and use the cog from there.

[url="mailto:AllergicRug@aol.com"]mailto:AllergicRug@aol.com[/url]AllergicRug@aol.com</A>

[This message has been edited by Zell (edited April 07, 2001).]
DO NOT WANT.
2001-04-05, 1:59 PM #4
Er... there's several places it says 'startup'... could you just copy the text into notepad, from notepad copy it onto cogwriter, and edit it form there, then see me let? 9let me see it, and I'll copy it onto my proj directory, and use the cog from there.
DO NOT WANT.
2001-04-05, 9:44 PM #5
Wow I should lay off the drugs, I swore I saw you write that twice !
2001-04-06, 5:05 AM #6
Does it matter that all of your function names start with capitals even though in the symbols section they don't? Also, a couple of times you used Close, but it's defined as close (I'm pretty sure it's case sensitive)

------------------
LordVirus: His pot is blacker than his kettle!

Visit Virus Productions!
"And lo, let us open up into the holy book of Proxy2..." -genk
His pot is blacker than his kettle!
2001-04-06, 9:05 AM #7
Sorry.

------------------
http://millennium.massassi.net/ - Millennium
2001-04-06, 10:40 AM #8
Yup, seifer, guess I did post it twice, and- *puts on high shrilly voice* Why are you taking drugs, young man???
DO NOT WANT.

↑ Up to the top!