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 → need help fixing my complex zero-g cog
need help fixing my complex zero-g cog
2001-01-08, 5:25 PM #1
Ok. i said "complex" so people wouldn't think i had trouble with that normal sector enter/exit zero-g cog here at massassi. The problem isn't really with the zero G part of my cog, but the prep room for it. Here's how i'm gonna do this,
I'll put a pic of the layout and stuff i am useing the cog in, then below that i will put the cog. and hopefully a great and wise cogger will come along and see what i am doing worng. the problem with this cog is that when i go to the "doorin" and try to open it, NOTHING AT ALL HAPPENS! it's really pissing me off, so please read on to help me out.
[http://64.177.149.248/personalfiles/zerog.gif]

Code:
# Jedi Knight Cog Script
#
# slzero-g.cog
#
# Cog for the zero-g and the prep room in SM HQ.
#
# This Cog is Not supported by LucasArts Entertainment Co

symbols

surface		prepswitch=-1	linkid=1

thing		doorin=-1	linkid=2
thing		doorout=-1	linkid=3

sector		preproom=-1	nolink
sector		enteringprep=-1	nolink
sector		exitingprep=-1	nolink
sector		entering=-1	nolink
sector		exiting=-1	nolink

sound		prepcomplete=-1
sound		prepinuse=-1
sound		noexit=-1
sound		only1=-1
sound		deprepcomplete=-1
sound		deprep=-1
sound		prep=-1

int		zeroed=0	local
int		pepsinprep	local

flex		speedofdoors=4
flex		delaytime=1

message		activated
message		killed

thing		user		local

end                                                                           

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

code
activated:

if( getsenderid() == 1 )
  {

  if( zeroged == 0 )
    {
    user = GetPlayerThing();
    setactorflags(user, 0xa00000);

    setwallcel(prepswitch, 1);

    ClearPhysicsFlags(user, 0x1);
    SetPhysicsFlags(user, 0x2000);

    playsoundthing(prepcomplete, user, 1, -1, 5, 0x80);
    delay(getsoundlen(prepcomplete));

    ClearActorFlags(user, 0xa00000);

    zeroed = 1;

    setwallcel(prepswitch, 0);
    return;
    }


  if( zeroged == 1 )
    {
    user = GetPlayerThing();
    setactorflags(user, 0xa00000);

    setwallcel(prepswitch, 1);

    ClearPhysicsFlags(user, 0x2000);
    SetPhysicsFlags(user, 0x1);

    playsoundthing(deprepcomplete, user, 1, -1, 5, 0x80);
    delay(getsoundlen(deprepcomplete));

    ClearActorFlags(user, 0xa00000);

    zeroed = 0;

    setwallcel(prepswitch, 0);
    return;
    }

  return;  
  }

if( getsenderid() == 2 )
  {

  user = GetPlayerThing();
  cursector = GetThingSector(user);
  if( cursector == entering )
    {
    call outsidein;
    }

  if( cursector == exiting )
    {
    call insideout;
    }

  return;
  }

if( getsenderid() == 3 )
  {

  user = GetPlayerThing();
  cursector = GetThingSector(user);
  if( cursector == enteringprep )
    {
    call outsideinprep;
    }

  if( cursector == exitingprep )
    {
    call insideoutprep;
    }

  return;
  }

return;


outsidein:

pepsinprep = GetSectorPlayerCount(preproom);
if( pepsinprep != 0 )
  {
  user = GetPlayerThing();
  playsoundthing(inuse, user, 1, -1, 5, 0x80);
  return;
  }

MoveToFrame(doorin, 1, speedofdoors);
waitforstop(doorin);
sleep(delaytime);
movetoframe(doorin, 0, speedofdoors);

return;


insideout:

if( zeroged == 1 )
  {
  user = GetPlayerThing();
  playsoundthing(deprep, user, 1, -1, 5, 0x80);
  return;
  }

pepsinprep = GetSectorPlayerCount(preproom);
if( pepsinprep != 1 )
  {
  user = GetPlayerThing();
  playsoundthing(only1, user, 1, -1, 5, 0x80);
  return;
  }

MoveToFrame(doorin, 1, speedofdoors);
waitforstop(doorin);
sleep(delaytime);
movetoframe(doorin, 0, speedofdoors);

return;


outsideinprep:

pepsinprep = GetSectorPlayerCount(preproom);
if( pepsinprep != 0 )
  {
  user = GetPlayerThing();
  playsoundthing(inuse, user, 1, -1, 5, 0x80);
  return;
  }

MoveToFrame(doorout, 1, speedofdoors);
waitforstop(doorout);
sleep(delaytime);
movetoframe(doorout, 0, speedofdoors);

return;


insideoutprep:

if( zeroged == 0 )
  {
  user = GetPlayerThing();
  playsoundthing(prep, user, 1, -1, 5, 0x80);
  return;
  }

pepsinprep = GetSectorPlayerCount(preproom);
if( pepsinprep != 1 )
  {
  user = GetPlayerThing();
  playsoundthing(only1, user, 1, -1, 5, 0x80);
  return;
  }

MoveToFrame(doorout, 1, speedofdoors);
waitforstop(doorout);
sleep(delaytime);
movetoframe(doorout, 0, speedofdoors);

return;


killed:

user = GetPlayerThing();
ClearPhysicsFlags(user, 0x2000);     
SetPhysicsFlags(user, 0x1);
return;


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

end


That's it! took me a while to write it cuz i'm a newbie cogger, so plz help me out here!

------------------
The Sith Mercenaries
www.sithmercenaries.8m.com
2001-01-09, 11:46 AM #2
You only use return; at the end of a message, not at the end of every if statement! [http://forums.massassi.net/html/smile.gif]

-Jipe
2001-01-09, 7:59 PM #3
hmm, i don't think you understand, if the cog goes into any of those IF statements, i want it to end the actviated message after it does what's inside the statement.
2001-01-10, 11:20 AM #4
you guys haven't forgot about me have you?
2001-01-16, 7:39 PM #5
Ok, this is my last plee for help. if nobody can help me after this, i'll go shoot my self in the head.

↑ Up to the top!