Cog help


[ Follow Ups ] [ Post Followup ] [ The Massassi Temple Message Board ]

Posted by Entropy on May 05, 1998 at 22:00:55:

well, i'm trying to make a cog that will turn and off the sector thrust for a level at the flip of a switch. we'll i know nothing bout cog, i'm trying to learn from the specs and it's not working, (so when's the tutor gonna be out?:)) but here's the deal, from existing cogs and the little i know i tried to fashion this from existing cogs-
Symbols
message activated
message entered
message timer
int currentThing local
sector thrustsec
vector playerVec local
vector vec desc=thrust_direction
float thrustspeed=1.0 desc=thrust_speed
surface switch linkid=1
int status=0
flex wait=5.0 ##how long b4 u can shut it down?
sound wav0
sound wav1
sound wav2
end
code
activated:
If(status=0)
{
SetWallCel(switch,1);
PlaySoundPos(wav1, SurfaceCenter(switch), 1, -1, -1, 0);
Sleep(sounddelay);
PlaySoundPos(wav1, SurfaceCenter(switch), 1, -1, -1, 0);
Sleep(sounddelay);
PlaySoundPos(wav1, SurfaceCenter(switch), 1, -1, -1, 0);
Sleep(sounddelay);
PlaySoundPos(wav2, SurfaceCenter(switch), 1, -1, -1, 0);
Sleep(talkdelay);
PlaySoundPos(wav0, SurfaceCenter(switch), 1, -1, -1, 0);
SectorThrust(thrustsec, vec, speed);

// 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);



SetTimer(wait);
}
Else
{
SetWallCel(switch,0);
SetSectorThrust(thrustsec,vec,0);
status=0;
}
Return;
Timer:
status=1;
settimer(0);
Return;

well, that doesn't work. quick easy answer to why not? the switch won't even work... i probably slaughtered the cog, and you're laughing, but, hey... thanks :)


Follow Ups:



Post a Followup

Name:
E-Mail:

Subject:

Comments:

Optional Link URL:
Link Title:
Optional Image URL:


[ Follow Ups ] [ Post Followup ] [ The Massassi Temple Message Board ]