Page 1 of 1

random floors for elevators

Posted: Thu Feb 17, 2005 10:36 pm
by Master-Of-Fungus-Foo-D
how would i get an elevator to go to random floors?
i got the ( randomfloat 1 + 7 ) but i dont know how to get it to work to get an elevator to move to a floor OTHER than its own...

Posted: Thu Feb 17, 2005 11:31 pm
by Elgan
??

u mean

and u want randomint.

if (local.randnum == $lift.floor )
{
end
}

u mean, If the lift is on the floor of the num produced redo the cmd?

Posted: Thu Feb 17, 2005 11:32 pm
by fuhrer
waypoints?

$elevator moveto $waypoint(randomness)

lol

<-----noob

Posted: Thu Feb 17, 2005 11:42 pm
by Elgan
igot the ( randomfloat 1 + 7 ) but i dont know how to get it to work to get an elevator to move to a floor OTHER than its own...
fair enough. he says he has the random bit but huh for the whole thing.

Posted: Thu Feb 17, 2005 11:49 pm
by Master-Of-Fungus-Foo-D
fuhrer wrote: <-----noob
you callin me a noob ya lil butmunch?

i know how to make things move to ways, but i wanted a system to work for all of my elevators... ah forget it.. i always over complicate things :(

Posted: Fri Feb 18, 2005 12:17 am
by fuhrer
no i was callin me a noob lol

Posted: Fri Feb 18, 2005 2:31 am
by tltrude
Master-Of-Fungus-Foo-D, your problem isn't that you "over complicate things", but that you tend to under explain your ideas.

"I dont know how to get it to work to get an elevator to move to a floor OTHER than its own...".

That is very confusing to the readers of your post. No one likes to waste time trying to figure out what you ment to say.

If you need help with a script or thread, POST IT, and explain what you have tried already.

Posted: Fri Feb 18, 2005 3:07 pm
by Grassy
This is how I would do it for say a three level elevator with a single trigger in the actual elevator. If you have multiple triggers then it will make it more complicated. The $wp(x) are waypoints for the origin of the center of the elevator which must be made a script_object with a targetname of $vator.

Code: Select all

level.vatormoving = 0
thread ele_trig

//------------
ele_trig:
//------------
while (1)
{
   elevator_trigger waittill trigger
   local.player = parm.other

   if (level.vatormoving ==1)
   {
     local.player iprint "Wait till elevator has stopped fool"
   }
   else
   {
     switch (randomint(3)+1)
     {
       case 1: waitthread move_vator $wp1 ; break
       case 2: waitthread move_vator $wp2 ; break
       case 3: waitthread move_vator $wp3 ; break
      }
    }
 waitframe
}
end


//------------------------
move_vator local.dest:
//------------------------
  level.vatormoving = 1
  $vator moveto local.dest
  $vator loopsound somegoodvatormusic
  $vator waitmove
  $vator stoploopsound somegoodvatormusic
  level.vatormoving = 0
end