random floors for elevators

Post your scripting questions / solutions here

Moderator: Moderators

Post Reply
Master-Of-Fungus-Foo-D
Muffin Man
Posts: 1544
Joined: Tue Jan 27, 2004 12:33 am
Location: cali, United States

random floors for elevators

Post 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...
Image
The Fungus Theme song!!!

Code: Select all

while (local.player istouching self)
Elgan
Site Admin
Posts: 890
Joined: Tue Apr 13, 2004 10:43 pm
Location: uk
Contact:

Post 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?
fuhrer
Captain
Posts: 253
Joined: Sun Mar 14, 2004 3:36 am

Post by fuhrer »

waypoints?

$elevator moveto $waypoint(randomness)

lol

<-----noob
Elgan
Site Admin
Posts: 890
Joined: Tue Apr 13, 2004 10:43 pm
Location: uk
Contact:

Post 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.
Master-Of-Fungus-Foo-D
Muffin Man
Posts: 1544
Joined: Tue Jan 27, 2004 12:33 am
Location: cali, United States

Post 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 :(
Image
The Fungus Theme song!!!

Code: Select all

while (local.player istouching self)
fuhrer
Captain
Posts: 253
Joined: Sun Mar 14, 2004 3:36 am

Post by fuhrer »

no i was callin me a noob lol
User avatar
tltrude
Chuck Norris
Posts: 4774
Joined: Sun Jul 07, 2002 4:03 am
Location: Oklahoma, USA
Contact:

Post 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.
Tom Trude,

Image
Grassy
First Lieutenant
Posts: 221
Joined: Sun Aug 22, 2004 11:36 am

Post 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
Post Reply