Escalator

Post your scripting questions / solutions here

Moderator: Moderators

nuggets
General
Posts: 1006
Joined: Fri Feb 28, 2003 2:57 am
Location: U-england-K (england in the UK) :P
Contact:

Post by nuggets »

the escalator script i used, only needs 1 thing editting, but it was supposed 2 b 4 wacko's shop level :( never got round 2 it though SORRY!

main:
$dummy hide //hides the step that is drawn as the "master step"
$dummy notsolid

level.modelstep = "*29"
level.stepspeed = 0.5

level.stepmovecount = 0 //counts the number of steps moved
level.stepset = 0 //counts the number of sets of steps

level.Anorth = ( 0 16 0 );level.Aeast = ( 16 0 270 );level.Asouth = ( 0 -16 180 );level.Awest = ( -16 0 90 );level waittill prespawn

level waittill spawn

wait 3 //to delete

iprintlnbold "is it working" //to delete

thread escalator_prep (level.stepset + 1 ) (1000 148 264) level.Awest 18;wait (1.25 + (level.stepsnumber * 0.05))
thread escalator_prep (level.stepset + 1 ) (912 148 264) level.Anorth 18 //position direction stepsnumber setnumber
end
// Moving Escalator !!!1st release!!!

//credit also goes to WACKO for escalator mapping :D


/////////////////////////////////////////////////////
//__________________the beginning__________________//
/////////////////////////////////////////////////////

//sets the steps to the typed in commands (positions and directions number_of_steps set_no.)
escalator_prep level.stepset level.escstepposition level.stepdirection level.stepsnumber:
level.idnumber = -2 //steps position in set
thread stepspawnertop
end

//setup to create the stairs
stepspawnertop:
wait 0.05;local.step = spawn script_object;local.step time level.stepspeed;local.step model level.modelstep;local.step.origin = ((level.escstepposition[0] + (level.idnumber * level.stepdirection[0])) (level.escstepposition[1] + (level.idnumber * level.stepdirection[1])) (level.escstepposition[2] + (level.idnumber * 0)));local.step.angles = (0 level.stepdirection[2] 0);local.step.targetname = ("escalator_step" + level.stepset);level.idnumber = (level.idnumber + 1)
if (level.idnumber < 1)
{thread stepspawnertop}
else
{thread stepspawnercentre}
end

//setup to create the stairs continued
stepspawnercentre:
wait 0.05;local.step = spawn script_object;local.step time level.stepspeed;local.step model level.modelstep;local.step.origin = ((level.escstepposition[0] + (level.idnumber * level.stepdirection[0])) (level.escstepposition[1] + (level.idnumber * level.stepdirection[1])) (level.escstepposition[2] + (level.idnumber * -16)));local.step.angles = (0 level.stepdirection[2] 0);local.step.targetname = ("escalator_step" + level.stepset);level.idnumber = (level.idnumber + 1)
if (level.idnumber < level.stepsnumber)
{thread stepspawnercentre}
else
{level.idnumberbottom = (level.idnumber - 1);thread stepspawnerbottom}
end

//setup to create the stairs end
stepspawnerbottom:
wait 0.05;local.step = spawn script_object;local.step time level.stepspeed;local.step model level.modelstep;local.step.origin = ((level.escstepposition[0] + (level.idnumber * level.stepdirection[0])) (level.escstepposition[1] + (level.idnumber * level.stepdirection[1])) (level.escstepposition[2] + (level.idnumberbottom * -16)));local.step.angles = (0 level.stepdirection[2] 0);local.step.targetname = ("escalator_step" + level.stepset);level.idnumber = (level.idnumber + 1)
if (level.idnumber < (level.stepsnumber + 3))
{thread stepspawnerbottom}
else
{iprintlnbold "completed"}
end

///////////////////////////////////////////////////
//__________________the calling__________________//
///////////////////////////////////////////////////

//finding the distance for stairs to move
//including test at top
escalator1_down:
thread escalator_down 2
end

escalator_down level.stepset:
$escalator1_trigger_down nottriggerable
if (level.stepmovecount < (level.stepsnumber + 7))
{
$(escalator_step + level.stepset) thread move_down1
wait level.stepspeed
level.stepmovecount = (level.stepmovecount + 1)
thread escalator1_down
}
else
{
level.stepmovecount = 0
$escalator1_trigger_down triggerable
}
// }
end

//////////////////////////////////////////////////
//__________________the motion__________________//
//////////////////////////////////////////////////

//moving stairs from top to bottom
move_down1:
//moving top steps //moving bottoms steps
if ((self.origin == (level.escstepposition + (0 -32 0))) || (self.origin == (level.escstepposition + (0 -16 0))))
{self thread showme;self moveNorth 16;self waitmove}
else
//moving bottoms steps
if (self.origin == (level.escstepposition + (0 272 -272))) //(912 420 -8))
{self moveNorth 16;self waitmove}
else
if (self.origin == (level.escstepposition + (0 288 -272))) //(912 436 -8))
{self moveNorth 16;self waitmove}
else
if (self.origin == (level.escstepposition + (0 304 -272))) //(912 452 -8))
{self thread hideme;self moveNorth 16;self waitmove}
else
if (self.origin == (level.escstepposition + (0 320 -272))) //(912 468 -8))
{self thread hideme;self moveto (level.escstepposition + (0 -32 0));self waitmove}
else
//moving centre steps
{self moveNorth 16;self moveDown 16;self waitmove}
end

//moving stairs from bottom to top
move_up1:
end

//////////////////////////////////////////////////////
//__________________the tricky bit__________________//
//////////////////////////////////////////////////////

////////////////////////////////////////////////////
//__________________the easy bit__________________//
////////////////////////////////////////////////////

//temporarily removes the object
hideme:
self hide
self notsolid
end

//retrieves the removed object
showme:
self show
self solid
end

////////////////////////////////////////////////////
//__________________the triggers__________________//
////////////////////////////////////////////////////

/*this will spawn the steps from 1 previously made otherwise moving
steps currently made will look odd with the lighting

if ur still wanting this then i'll finish it off within the week :D
*/
hope this helps, prob not cos it's all foreign 2 me :-/
User avatar
bdbodger
Moderator
Posts: 2596
Joined: Tue Feb 25, 2003 7:34 am
Location: canada
Contact:

Post by bdbodger »

how about makeing a test map I'd like to see this script in action nuggets
nuggets
General
Posts: 1006
Joined: Fri Feb 28, 2003 2:57 am
Location: U-england-K (england in the UK) :P
Contact:

Post by nuggets »

http://www.angelfire.com/alt/nuggets/test_escalator.map
right click, save target as

it's just got a couple of things to amend, but if you want to finish it off, then the ball is in your court :D

1. need to establish escstepposition[1] [2] etc... rather than just esstepposition
2. needs variables to find new posistions rather than prefound grid references
3. needs the move up script inputted
4. north south east and west direction for each step to be defined

if only i had more time :(
hope this helps, prob not cos it's all foreign 2 me :-/
User avatar
wacko
Field Marshal
Posts: 2085
Joined: Fri Jul 05, 2002 8:42 pm
Location: Germany

Post by wacko »

the link is not working :cry:
all it does is a 'internal error' in a 'test_escalator.htm'

script looks rather confusing too me, but i might find out once what it does...

thanks! 8)

did you see the 'eight bracket', this could become lethal to someone's code, as you enter 8 and ), in the forum it's 8) and after copy/paste in a textfile it's gone! In your script, though, it's just in remarks!
nuggets
General
Posts: 1006
Joined: Fri Feb 28, 2003 2:57 am
Location: U-england-K (england in the UK) :P
Contact:

Post by nuggets »

i'll look at the link... hmmm... ur right it's not working :P

leave it with me
hope this helps, prob not cos it's all foreign 2 me :-/
Post Reply