Hey, I was just wondering if you could rewrite that cog you sent me, you know the elevator one (I'll post it below). You see I realeased my level ( see this thread) but people said it would be much improved if I could just make it so that the elevators wouldn't trap people inside of thmem when the doors close. You might know what to do off the bat, but if not you can download and test the level via a link to website's downloads section from my thread. You can always accesss it from my sig. Thankyou very much lucky_jackpot (or anyone else who feels they know what to do), I'm planning on releasing a version 1.1! ![http://forums.massassi.net/html/biggrin.gif [http://forums.massassi.net/html/biggrin.gif]](http://forums.massassi.net/html/biggrin.gif)
------------------
~ Vader's Corner ~
![http://forums.massassi.net/html/biggrin.gif [http://forums.massassi.net/html/biggrin.gif]](http://forums.massassi.net/html/biggrin.gif)
Code:
## Jedi Knight COG Script # # 00_doubleDoorElevator.COG # # Base script for a double-door elevator. # (Cog script is fine for SP - will work in MP but should really be optimised for C/S conditions). # # Set verbose=1, if you want to see print out messages. # (More for test purposes than anything else...) # # # This COG script is NOT supported by LucasArts or LEC. # # Permission is granted to use this script by the author, as long as credit # is provided in the readme file for any add-on levels that use this script. # # Email: lucky_jackpot@hotmail.com # -Jackpot # [RJS] # ## #============================================================== symbols message startup message entered message timer thing door0 nolink # 1st floor thing door1 nolink # 1st floor thing door2 nolink # 2nd floor thing door3 nolink # 2nd floor thing elev nolink surface trigSurf0 linkid=1 # Used as the trigger surface at the ground/bottom floor (take lift UP) surface trigSurf1 linkid=2 # Used as the trigger surface at the top (take lift DOWN) flex waitTime=2.0 flex elevMoveSpeed=4.0 flex doorMoveSpeed=4.0 # int triggerID=666 local # Intended for client-side script --> needs to be tweaked.... int timerID=333 local int cnt=0 local int numDoors=4 local int inCycle=0 local # Specifies whether or not the cog is still in one of its cycles, as the # cog gets a bit funny, what with having the other trigger surface # at the opposing floor sending a new trigger, so we don't want to # process any more information than necessary... int verbose=0 # The debugging variable (as always) end code startup: if (IsServer() ) { // Make sure only the host places all the doors in the right frame placeholders for (cnt=0 ; cnt<numDoors ; cnt=cnt+1) { MoveToFrame (door0[cnt], 0, 10.0); } MoveToFrame (elev, 0, 10.0); } Return; ##################### entered: if (IsMoving(elev) ) // Don't waste any more resources if elev is already going... Return; if (GetSenderID() == 1) { if (inCycle) // Cog is already performing a cycle... Return; inCycle = 1; call openBottomDoors; SetTimerEx (waitTime, timerID+1, -1, -1); } else if (GetSenderID() == 2) { if (inCycle) Return; inCycle = 1; call openTopDoors; call moveElevUp; SetTimerEx (waitTime, timerID+2, -1, -1); } Return; ##################### timer: if (GetSenderID() == timerID+1) { // If approaching from the ground/bottom floor... if (verbose) PrintInt (timerID); call shutBottomDoors; call moveElevUp; call openTopDoors; SetTimerEx (waitTime, timerID+2, -1, -1); } else if (GetSenderID() == timerID+2) { // If approaching from the top floor... if (verbose) PrintInt (timerID); call shutTopDoors; call moveElevDown; call openBottomDoors; SetTimerEx (waitTime, timerID+3, -1, -1); } else if (GetSenderID() == timerID+3) { if (verbose) PrintInt (timerID); call shutBottomDoors; // Reset to original "natural" state. inCycle = 0; } Return; ##################### openBottomDoors: if (verbose) Print ("Open Bottom Doors..."); for (cnt=0 ; cnt<numDoors/2 ; cnt=cnt+1) { // OPEN BOTTOM doors MoveToFrame (door0[cnt], 1, doorMoveSpeed); } Return; shutBottomDoors: if (verbose) Print ("Shut Bottom Doors..."); for (cnt=0 ; cnt<numDoors/2 ; cnt=cnt+1) { // SHUT BOTTOM doors MoveToFrame (door0[cnt], 0, doorMoveSpeed); } Return; ##################### openTopDoors: if (verbose) Print ("Open Top Doors..."); for (cnt=numDoors/2 ; cnt<4 ; cnt=cnt+1) { // OPEN TOP doors MoveToFrame (door0[cnt], 1, doorMoveSpeed); } Return; shutTopDoors: if (verbose) Print ("Shut Top Doors..."); for (cnt=numDoors/2 ; cnt<4 ; cnt=cnt+1) { // SHUT TOP doors MoveToFrame (door0[cnt], 0, doorMoveSpeed); } Return; ###################### moveElevUp: MoveToFrame (elev, 1, elevMoveSpeed); // Elevator goes UP waitForStop (elev); Return; moveElevDown: MoveToFrame (elev, 0, elevMoveSpeed); // Elevator goes DOWN waitForStop (elev); Return; ###################### end
------------------
~ Vader's Corner ~