Page 1 of 1

An elevator

PostPosted: Fri Mar 17, 2017 4:52 am
by KABOOM
This is an elevator that uses an overly long trigger code. When the player goes into the center of the lower platform, doors close on either side, the elevator moves, and the doors open. The elevator is set to alternate between moving down and up when entered, starting with down.

The local variable "length" at the beginning of the trigger code can be set to whatever number the designer wants to use (25 by default); each 1 unit of length is 8 pixels or 1/4 of a tile. The elevator moves 56 pixels total while starting and stopping in addition to this length, so keep that in mind.

I plan to work on making the elevator look nicer for a level I'm trying to make.

Code: Select all
llitem:9:elev4;312;952;;1,1;aB;all;0;0;5;300;0;100;0;90;30;0;3;3;5;5;5;5;30;30;128;128;0;0;0;0;3;10;10;30;0;1;1;-;0;1;64;5;0;0;1000;3;0;1;;0.5;0.5;0;0;1|9:elev3;312;952;;1,1;aB;all;0;0;5;300;0;100;0;90;30;0;3;3;5;5;5;5;30;30;128;128;0;0;0;0;3;10;10;30;0;1;1;-;0;1;64;5;0;0;1000;3;0;1;;0.5;0.5;0;0;1|9:elev2;312;952;;1,1;aB;all;0;0;5;300;0;100;0;90;30;0;3;3;5;5;5;5;30;30;128;128;0;0;0;0;3;10;10;30;0;1;1;-;0;1;64;5;0;0;1000;3;0;1;;0.5;0.5;0;0;1|9:elev1;312;952;;1,1;aB;all;0;0;5;300;0;100;0;90;30;0;3;3;5;5;5;5;30;30;128;128;0;0;0;0;3;10;10;30;0;1;1;-;0;1;64;5;0;0;1000;3;0;1;;0.5;0.5;0;0;1|9:elev4;264;952;;1,1;aB;all;0;0;5;300;0;100;0;90;30;0;3;3;5;5;5;5;30;30;128;128;0;0;0;0;3;10;10;30;0;1;1;-;0;1;64;5;0;0;1000;3;0;1;;0.5;0.5;0;0;1|9:elev3;264;952;;1,1;aB;all;0;0;5;300;0;100;0;90;30;0;3;3;5;5;5;5;30;30;128;128;0;0;0;0;3;10;10;30;0;1;1;-;0;1;64;5;0;0;1000;3;0;1;;0.5;0.5;0;0;1|9:elev2;264;952;;1,1;aB;all;0;0;5;300;0;100;0;90;30;0;3;3;5;5;5;5;30;30;128;128;0;0;0;0;3;10;10;30;0;1;1;-;0;1;64;5;0;0;1000;3;0;1;;0.5;0.5;0;0;1|9:elev1;264;952;;1,1;aB;all;0;0;5;300;0;100;0;90;30;0;3;3;5;5;5;5;30;30;128;128;0;0;0;0;3;10;10;30;0;1;1;-;0;1;64;5;0;0;1000;3;0;1;;0.5;0.5;0;0;1|9:elev;288;1032;;4,1;aB4;all;0;0;5;300;0;100;0;90;30;0;3;3;5;5;5;5;30;30;128;128;0;0;0;0;3;10;10;30;0;1;1;-;0;1;64;5;0;0;1000;3;0;1;;0.5;0.5;0;0;1|9:elev;288;952;;4,1;aB4;all;0;0;5;300;0;100;0;90;30;0;3;3;5;5;5;5;30;30;128;128;0;0;0;0;3;10;10;30;0;1;1;-;0;1;64;5;0;0;1000;3;0;1;;0.5;0.5;0;0;1|6:elev;280;960;16;64;0;1;set,length,25:movechar,this,0,0,0,0,1,0:cinemamode:c,%20door%20close:move,elev1,0,4,0,0:move,elev2,0,4,0,0:move,elev3,0,4,0,0:move,elev4,0,4,0,0:sleep,1:move,elev1,0,4,0,0:move,elev2,0,4,0,0:move,elev3,0,4,0,0:move,elev4,0,4,0,0:sleep,1:move,elev1,0,4,0,0:move,elev2,0,4,0,0:move,elev3,0,4,0,0:move,elev4,0,4,0,0:sleep,1:move,elev1,0,4,0,0:move,elev2,0,4,0,0:move,elev3,0,4,0,0:move,elev4,0,4,0,0:sleep,1:move,elev2,0,4,0,0:move,elev3,0,4,0,0:move,elev4,0,4,0,0:sleep,1:move,elev2,0,4,0,0:move,elev3,0,4,0,0:move,elev4,0,4,0,0:sleep,1:move,elev2,0,4,0,0:move,elev3,0,4,0,0:move,elev4,0,4,0,0:sleep,1:move,elev2,0,4,0,0:move,elev3,0,4,0,0:move,elev4,0,4,0,0:sleep,1:move,elev3,0,4,0,0:move,elev4,0,4,0,0:sleep,1:move,elev3,0,4,0,0:move,elev4,0,4,0,0:sleep,1:move,elev3,0,4,0,0:move,elev4,0,4,0,0:sleep,1:move,elev3,0,4,0,0:move,elev4,0,4,0,0:sleep,1:move,elev4,0,4,0,0:sleep,1:move,elev4,0,4,0,0:sleep,1:move,elev4,0,4,0,0:sleep,1:move,elev4,0,4,0,0:sleep,20:branch,5,171,g_el1,1:c,elevator%20down:add,g_el1,g_el1,1:move,elev,0,1,0,0:move,elev1,0,1,0,0:move,elev2,0,1,0,0:move,elev3,0,1,0,0:move,elev4,0,1,0,0:movechar,this,0,1,0,0,0,0:sleep,1:move,elev,0,2,0,0:move,elev1,0,2,0,0:move,elev2,0,2,0,0:move,elev3,0,2,0,0:move,elev4,0,2,0,0:movechar,this,0,2,0,0,0,0:sleep,1:move,elev,0,3,0,0:move,elev1,0,3,0,0:move,elev2,0,3,0,0:move,elev3,0,3,0,0:move,elev4,0,3,0,0:movechar,this,0,3,0,0,0,0:sleep,1:move,elev,0,4,0,0:move,elev1,0,4,0,0:move,elev2,0,4,0,0:move,elev3,0,4,0,0:move,elev4,0,4,0,0:movechar,this,0,4,0,0,0,0:sleep,1:move,elev,0,5,0,0:move,elev1,0,5,0,0:move,elev2,0,5,0,0:move,elev3,0,5,0,0:move,elev4,0,5,0,0:movechar,this,0,5,0,0,0,0:sleep,1:move,elev,0,6,0,0:move,elev1,0,6,0,0:move,elev2,0,6,0,0:move,elev3,0,6,0,0:move,elev4,0,6,0,0:movechar,this,0,6,0,0,0,0:sleep,1:move,elev,0,7,0,0:move,elev1,0,7,0,0:move,elev2,0,7,0,0:move,elev3,0,7,0,0:move,elev4,0,7,0,0:movechar,this,0,7,0,0,0,0:sleep,1:set,loop,0:move,elev,0,8,0,0:move,elev1,0,8,0,0:move,elev2,0,8,0,0:move,elev3,0,8,0,0:move,elev4,0,8,0,0:movechar,this,0,8,0,0,0,0:sleep,1:add,loop,loop,1:branch,2,113,loop,length:move,elev,0,7,0,0:move,elev1,0,7,0,0:move,elev2,0,7,0,0:move,elev3,0,7,0,0:move,elev4,0,7,0,0:movechar,this,0,7,0,0,0,0:sleep,1:move,elev,0,6,0,0:move,elev1,0,6,0,0:move,elev2,0,6,0,0:move,elev3,0,6,0,0:move,elev4,0,6,0,0:movechar,this,0,6,0,0,0,0:sleep,1:move,elev,0,5,0,0:move,elev1,0,5,0,0:move,elev2,0,5,0,0:move,elev3,0,5,0,0:move,elev4,0,5,0,0:movechar,this,0,5,0,0,0,0:sleep,1:move,elev,0,4,0,0:move,elev1,0,4,0,0:move,elev2,0,4,0,0:move,elev3,0,4,0,0:move,elev4,0,4,0,0:movechar,this,0,4,0,0,0,0:sleep,1:move,elev,0,3,0,0:move,elev1,0,3,0,0:move,elev2,0,3,0,0:move,elev3,0,3,0,0:move,elev4,0,3,0,0:movechar,this,0,3,0,0,0,0:sleep,1:move,elev,0,2,0,0:move,elev1,0,2,0,0:move,elev2,0,2,0,0:move,elev3,0,2,0,0:move,elev4,0,2,0,0:movechar,this,0,2,0,0,0,0:sleep,1:move,elev,0,1,0,0:move,elev1,0,1,0,0:move,elev2,0,1,0,0:move,elev3,0,1,0,0:move,elev4,0,1,0,0:movechar,this,0,1,0,0,0,0:goto,280:c,elevator%20up:sub,g_el1,g_el1,1:move,elev,0,-1,0,0:move,elev1,0,-1,0,0:move,elev2,0,-1,0,0:move,elev3,0,-1,0,0:move,elev4,0,-1,0,0:movechar,this,0,-1,0,0,0,0:sleep,1:move,elev,0,-2,0,0:move,elev1,0,-2,0,0:move,elev2,0,-2,0,0:move,elev3,0,-2,0,0:move,elev4,0,-2,0,0:movechar,this,0,-2,0,0,0,0:sleep,1:move,elev,0,-3,0,0:move,elev1,0,-3,0,0:move,elev2,0,-3,0,0:move,elev3,0,-3,0,0:move,elev4,0,-3,0,0:movechar,this,0,-3,0,0,0,0:sleep,1:move,elev,0,-4,0,0:move,elev1,0,-4,0,0:move,elev2,0,-4,0,0:move,elev3,0,-4,0,0:move,elev4,0,-4,0,0:movechar,this,0,-4,0,0,0,0:sleep,1:move,elev,0,-5,0,0:move,elev1,0,-5,0,0:move,elev2,0,-5,0,0:move,elev3,0,-5,0,0:move,elev4,0,-5,0,0:movechar,this,0,-5,0,0,0,0:sleep,1:move,elev,0,-6,0,0:move,elev1,0,-6,0,0:move,elev2,0,-6,0,0:move,elev3,0,-6,0,0:move,elev4,0,-6,0,0:movechar,this,0,-6,0,0,0,0:sleep,1:move,elev,0,-7,0,0:move,elev1,0,-7,0,0:move,elev2,0,-7,0,0:move,elev3,0,-7,0,0:move,elev4,0,-7,0,0:movechar,this,0,-7,0,0,0,0:sleep,1:set,loop,0:move,elev,0,-8,0,0:move,elev1,0,-8,0,0:move,elev2,0,-8,0,0:move,elev3,0,-8,0,0:move,elev4,0,-8,0,0:movechar,this,0,-8,0,0,0,0:sleep,1:add,loop,loop,1:branch,2,223,loop,length:move,elev,0,-7,0,0:move,elev1,0,-7,0,0:move,elev2,0,-7,0,0:move,elev3,0,-7,0,0:move,elev4,0,-7,0,0:movechar,this,0,-7,0,0,0,0:sleep,1:move,elev,0,-6,0,0:move,elev1,0,-6,0,0:move,elev2,0,-6,0,0:move,elev3,0,-6,0,0:move,elev4,0,-6,0,0:movechar,this,0,-6,0,0,0,0:sleep,1:move,elev,0,-5,0,0:move,elev1,0,-5,0,0:move,elev2,0,-5,0,0:move,elev3,0,-5,0,0:move,elev4,0,-5,0,0:movechar,this,0,-5,0,0,0,0:sleep,1:move,elev,0,-4,0,0:move,elev1,0,-4,0,0:move,elev2,0,-4,0,0:move,elev3,0,-4,0,0:move,elev4,0,-4,0,0:movechar,this,0,-4,0,0,0,0:sleep,1:move,elev,0,-3,0,0:move,elev1,0,-3,0,0:move,elev2,0,-3,0,0:move,elev3,0,-3,0,0:move,elev4,0,-3,0,0:movechar,this,0,-3,0,0,0,0:sleep,1:move,elev,0,-2,0,0:move,elev1,0,-2,0,0:move,elev2,0,-2,0,0:move,elev3,0,-2,0,0:move,elev4,0,-2,0,0:movechar,this,0,-2,0,0,0,0:sleep,1:move,elev,0,-1,0,0:move,elev1,0,-1,0,0:move,elev2,0,-1,0,0:move,elev3,0,-1,0,0:move,elev4,0,-1,0,0:movechar,this,0,-1,0,0,0,0:c,door%20open:move,elev4,0,-4,0,0:sleep,1:move,elev4,0,-4,0,0:sleep,1:move,elev4,0,-4,0,0:sleep,1:move,elev4,0,-4,0,0:sleep,1:move,elev3,0,-4,0,0:move,elev4,0,-4,0,0:sleep,1:move,elev3,0,-4,0,0:move,elev4,0,-4,0,0:sleep,1:move,elev3,0,-4,0,0:move,elev4,0,-4,0,0:sleep,1:move,elev3,0,-4,0,0:move,elev4,0,-4,0,0:sleep,1:move,elev2,0,-4,0,0:move,elev3,0,-4,0,0:move,elev4,0,-4,0,0:sleep,1:move,elev2,0,-4,0,0:move,elev3,0,-4,0,0:move,elev4,0,-4,0,0:sleep,1:move,elev2,0,-4,0,0:move,elev3,0,-4,0,0:move,elev4,0,-4,0,0:sleep,1:move,elev2,0,-4,0,0:move,elev3,0,-4,0,0:move,elev4,0,-4,0,0:sleep,1:move,elev1,0,-4,0,0:move,elev2,0,-4,0,0:move,elev3,0,-4,0,0:move,elev4,0,-4,0,0:sleep,1:move,elev1,0,-4,0,0:move,elev2,0,-4,0,0:move,elev3,0,-4,0,0:move,elev4,0,-4,0,0:sleep,1:move,elev1,0,-4,0,0:move,elev2,0,-4,0,0:move,elev3,0,-4,0,0:move,elev4,0,-4,0,0:sleep,1:move,elev1,0,-4,0,0:move,elev2,0,-4,0,0:move,elev3,0,-4,0,0:move,elev4,0,-4,0,0:sleep,1:cinemaoff:invis_wait:turnon,this