splitting door

Posted By: MDC

splitting door - 11/28/06 01:36

can someone please give me a detailed explanation on how to make a door that splits in the middle and goes back into the wall. hope that makes sence.
Posted By: Thickheaded

Re: splitting door - 11/29/06 20:24

I just figured it out recently myself. You have to create each part of the door seperately. Define each as an entity ( entity* door1; )

Then move the door pieces via actions.

If you need I can upload what I have used as an example or feel free to use it.

j
Posted By: MDC

Re: splitting door - 11/30/06 00:42

if you could that would be great.
Posted By: Thickheaded

Re: splitting door - 11/30/06 02:11

ok...

Save this as a script and include it in your game.
Create the following levels in your /work/yourgame folder. Remember to name them; leftdoor
Rightdoor
topdoor

Build these as Map Entities
attach the right answer action to a sprite or model as a trigger for the player to click to open the door

////This is the script ///////
entity* leftdoor;
entity* rightdoor;
entity* topdoor;




action tdoor ///////attach this action to the map entity topdoor
{
topdoor=me;

}

action ldoor//////// attach this action to the leftdoor map entity
{
leftdoor=me;
}

action rdoor/////attach this action to the rightdoor map entity
{
rightdoor=me;
}

var doorpos1=41; //////these are adjusted to how far you want the door entity
var doorpos2=41; ////// to move
var doorpos3=71;


function ord //// open right door function
{
while(rightdoor == null)
{
Wait(1);
}
While(doorpos2 > 0)
{
doorpos2 -= 1;
rightdoor.x += 3 * time; ////3 is how fast the door opens
wait(1);
}
}




function otd()/////open top door
{
While (doorpos3 > 0)
{
doorpos3 -= 1;
topdoor.z += 3;
wait(1);
}
}


function old /////open left door
{
While (doorpos1 > 0)
{
doorpos1 -= 1;
leftdoor.x -=3 * time ;
wait(1);
}
}

function com /////this function calls all 3 to happen at once
{
old();
ord();
otd();
}

action answer ///// attach this to a sprite or model to start everything
{
my.enable_click=on;
my.event=com;
}
© 2024 lite-C Forums