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 → I need a special trap door cog
I need a special trap door cog
2008-08-23, 1:19 PM #1
My current darktrooper project seems to be going quite well minus the problem where I can't seem to get a working assault cannon in my level.

Right now I need a cog that controls 2 doors. Controlled as follows:

When entering a sector the 2 doors which are currently open will close trapping you in the room. And then those doors will not open until you have defeated the darktroopers currently in the room. I'm thinking I'll need it work for up to 8 things; meaning up to 8 darktroopers currently in the room must be killed before the doors open.

So at startup the 2 doors are open and remain open until a player enters the trigger sector, when the player enters the trigger sector the doors will close and will remain closed until the darktrooper (things) are killed. Once they are killed the doors will open and remain opened throughout the remaining time spent in the level.

Help is apprecitated.
2008-08-26, 8:21 PM #2
Anyone?
2008-08-29, 6:13 PM #3
Heres something that worked for me. When you make your door, make the first frame as open, and the second as closed, so at startup they will be open already and we won't have to code that in. Besides that I think everything else is self explanitory. If there are any bugs tell me. :)


Code:
symbols
message entered
message killed
sector entersector
 
thing door0
thing door1
 
thing actor1
thing actor2
thing actor3
thing actor4
thing actor5
thing actor6
thing actor7
thing actor8
flex doorspeed =5.0 local
int done=0 local
int kill=0 local
 
end
 
code
entered:
if(done == 1)return;
MoveToFrame(door0, 1, doorspeed); 
MoveToFrame(door1, 1, doorspeed);
done =1;
return;
 
Killed:
kill = kill + 1;
 
If( kill == 8)
{
call open_doors;
}
return;
 
open_doors:
MoveToFrame(door0, 0, doorspeed); 
MoveToFrame(door1, 0, doorspeed);
return;
end
er...
2008-08-29, 8:46 PM #4
I'll test that tommorow as soon as I get home from work. thanks.
2008-08-30, 12:08 PM #5
Thanks that did work. However I had to modify it to get it to work. I noticed that for things 1 - 8 that you coded it thing 1, thing 2, etc instead of thing 0 for number 1 and thing 7 for number 8. I changed that and it still didnt work. So then I changed it to work with only 2 things and changed the if kill = 8 to 2 instead.

Works fine and thanks for helping :)

↑ Up to the top!