Whats wrong with my cog?


[ Follow Ups ] [ Post Followup ] [ Jed Messages ]

Posted by GMS_Necare on February 16, 1998 at 20:20:40:

I am trying to change the m4_reactorthrust.cog so that it can be stoped before the time runs out, i also got rid of the doors and lights. But it does nothing. Someone please tell me whats wrong with it so i can fix it. Here it is....

ymbols

message startup
message activate
message entered
message timer

int currentThing local
int i local

vector playerVec local
vector vec0 desc=thrust_direction

float thrustspeed=1.0 desc=thrust_speed

surface Switch linkid=1

sector sector0
sector sector1

sound wav0
sound wav1
thing thing0
float fadetime=4.0
end

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

code
startup:
SetTimer(0.1);
channel=PlaySoundThing(wav0, thing0, 0.01, -1, -1, 1);
return;

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

activate:
if ((GetWallCel(switch) == 0) && (GetSenderId() == 1))
{
SetWallCel(Switch, 1);
PlaySoundPos(wav1, SurfaceCenter(switch), 1, -1, -1, 0);
ChangeSoundVol(channel, 1.5, fadetime/2);
ChangeSoundPitch(channel, 1, fadetime/2);
SectorThrust(sector0, vec0, thrustspeed);
SectorThrust(sector1, vec0, thrustspeed);

// unattach all players in sectors
currentThing = FirstThingInSector(sector0);
while (currentThing != -1) {
call reactorpull;
currentThing = NextThingInSector(currentThing);
}

currentThing = FirstThingInSector(sector1);
while (currentThing != -1) {
call reactorpull;
currentThing = NextThingInSector(currentThing);
}}

else if ((GetWallCel(switch) == 1) && (GetSenderId() == 1))

{
SetWallCel(switch, 0);
PlaySoundPos(wav1, SurfaceCenter(switch), 1, -1, -1, 0);
SectorThrust(sector0, vec0, 0.0);
SectorThrust(sector1, vec0, 0.0);

else
{

ChangeSoundVol(channel, 0.1, fadetime);
ChangeSoundPitch(channel, 0.1, fadetime);
}}

return;

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

timer:
SetWallCel(switch, 1);
ChangeSoundPitch(channel, 0.1, 0.1);
return;

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

entered:
if (GetSenderId() !=0) return;
if (GetWallCel(switch) !=1) return;
currentThing = GetSourceRef();
// fall through

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

reactorpull:
if (GetThingType(currentThing) == 10) {
DetachThing(currentThing);
playerVec = GetThingVel(currentThing);
playerVec = VectorAdd(vec0, playerVec);
SetThingVel(currentThing, playerVec);
}
return;

end


Follow Ups:



Post a Followup

Name:
E-Mail:
Subject:
Comments:

Optional Link URL:
Link Title:
Optional Image URL:


[ Follow Ups ] [ Post Followup ] [ Jed Messages ]