Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Messages - joshs1982

Could one of you please help me with my elevator code I'm not sure what I'm doing wrong? Here is my script.

main()
{
  level.elevDown=true;
  level.elevUp=true;
  level.elevMove=false;
  level.current_floor=0;
  level.current_floor=1;
  level.current_floor=2;
  switchTOP=getentarray("ups","targetname");
  for(i=0; i<switchTOP.size; i++)
   switchTOP[i] thread elev_think();
}

elev_think()
{
  IdoorLEFT=getent("leftindoor", "targetname");
  IdoorRIGHT=getent("rightindoor", "targetname");
  Odoor2L=getent("2leftdoor", "targetname");
  Odoor2R=getent("2rightdoor", "targetname");
  Odoor1L=getent("1leftdoor", "targetname");
  Odoor1R=getent("1rightdoor", "targetname");
  Odoor0L=getent("0leftdoor", "targetname");
  Odoor0R=getent("0rightdoor", "targetname");
  thread door_open(IdoorLEFT, IdoorRIGHT, OdoorBL, OdoorBR);
  while(1)
  {
   self waittill ("trigger");
   if(level.elevMove==false)
    {
     level.elevMove=true;
     thread elev_move();
    }
  }
}

elev_move()
{
  etime=5;
  zdirec="z";
  zdist1=376;
  zdist2=248;
  zdist3=0;
  IdoorLEFT=getent("leftindoor", "targetname");
  IdoorRIGHT=getent("rightindoor", "targetname");
  Odoor2L=getent("2leftdoor", "targetname");
  Odoor2R=getent("2rightdoor", "targetname");
  Odoor1L=getent("1leftdoor", "targetname");
  Odoor1R=getent("1rightdoor", "targetname");
  Odoor0L=getent("0leftdoor", "targetname");
  Odoor0R=getent("0rightdoor", "targetname");
  Elevator=getent("elevator", "targetname");
  if(level.current_floor==2)
   {
    door_close(IdoorLEFT, IdoorRIGHT, Odoor2L, Odoor2R);
    wait(.1);
    Elevator thread move_func(zdist1, etime, zdirec);
    IdoorLEFT thread move_func(zdist1, etime, zdirec);
    IdoorRIGHT thread move_func(zdist1, etime, zdirec);
    Elevator waittill ("movedone");
    door_open(IdoorLEFT, IdoorRIGHT, Odoor2L, Odoor2R);
    level.elevDown=true;
    level.elevUp=false;
    level.elevMove=false;
   }
   else if(level.current_floor==1)
   {
    door_close(IdoorLEFT, IdoorRIGHT, Odoor1L, Odoor1R);
    wait(.1);
    Elevator thread move_func(zdist2, etime, zdirec);
    IdoorLEFT thread move_func(zdist2, etime, zdirec);
    IdoorRIGHT thread move_func(zdist2, etime, zdirec);
    Elevator waittill ("movedone");
    door_open(IdoorLEFT, IdoorRIGHT, Odoor1L, Odoor1R);
    level.elevDown=true;
    level.elevUp=true;
    level.elevMove=false;
   }
  else(level.current_floor==0)
  {
   door_close(IdoorLEFT, IdoorRIGHT, OdoorTL, OdoorTR);
   wait(.1);
   Elevator thread move_func(zdist3, etime, zdirec);
   IdoorLEFT thread move_func(zdist3, etime, zdirec);
   IdoorRIGHT thread move_func(zdist3, etime, zdirec);
   Elevator waittill ("movedone");
   door_open(IdoorLEFT, IdoorRIGHT, Odoor0L, Odoor0R);
   level.elevDown=false;
   level.elevUp=true;
   level.elevMove=false;
  }
  wait(.1);
}

door_close(leftIN, rightIN, leftOUT, rightOUT)
{
  LDclose=-66.8;
  RDclose=-211.1;
  ydirec="x";
  dtime=1.1;
  leftIN thread move_func(LDclose,dtime, ydirec);
  rightIN thread move_func(RDclose,dtime, ydirec);
  wait(1);
  leftOUT thread move_func(LDclose,dtime, ydirec);
  rightOUT thread move_func(RDclose,dtime, ydirec);
  wait(1);
 }

door_open(leftyIN, rightyIN, leftyOUT, rightyOUT)
{
  LDopen=-26.8;
  RDopen=-251.1;
  ydirec="x";
  dtime=1.1;
  leftyOUT thread move_func(LDopen,dtime, ydirec);
  rightyOUT thread move_func(RDopen,dtime, ydirec);
  wait(1);
  leftyIN thread move_func(LDopen,dtime, ydirec);
  rightyIN thread move_func(RDopen,dtime, ydirec);
 }

move_func(dist,time,direc)
{
  if(direc=="z")
  self movez (dist, time, (time/2), (time/2));
  if(direc=="x")
   self movex (dist, time, (time/2), (time/2));
   self waittill ("movedone");
}
17 days ago
Hey guys, Ive looked everywhere and found nothing other than how to make all 4 players have a random spawn but every player spawns in the same zone. I would like each player to start in their own zone and each player start in a different zone each time. Any help would be much appreciated thanks in advance.

I figure each would have to be named start_zone, start_zone2, start_zone3 and start_zone4
I'm wondering if I just put the structs in different rooms they will spawn in different rooms but would not be random. I have not tested this theory yet though.
338 days ago
This is what I have so far, any help would be much appreciated. This is for a 3 floor freight elevator.

main()
{
  level.elevDown=true;
  level.elevUp=true;
  level.elevMove=false;
  level.current_floor=0;
  level.current_floor=1;
  level.current_floor=2;
  switchTOP=getentarray("ups","targetname");
  for(i=0; i<switchTOP.size; i++)
   switchTOP[i] thread elev_think();
}

elev_think()
{
  IdoorLEFT=getent("leftindoor", "targetname");
  IdoorRIGHT=getent("rightindoor", "targetname");
  Odoor2L=getent("2leftdoor", "targetname");
  Odoor2R=getent("2rightdoor", "targetname");
  Odoor1L=getent("1leftdoor", "targetname");
  Odoor1R=getent("1rightdoor", "targetname");
  Odoor0L=getent("0leftdoor", "targetname");
  Odoor0R=getent("0rightdoor", "targetname");
  thread door_open(IdoorLEFT, IdoorRIGHT, OdoorBL, OdoorBR);
  while(1)
  {
   self waittill ("trigger");
   if(level.elevMove==false)
    {
     level.elevMove=true;
     thread elev_move();
    }
  }
}

elev_move()
{
  etime=5;
  zdirec="z";
  zdist1=376;
  zdist2=248;
  zdist3=0;
  IdoorLEFT=getent("leftindoor", "targetname");
  IdoorRIGHT=getent("rightindoor", "targetname");
  Odoor2L=getent("2leftdoor", "targetname");
  Odoor2R=getent("2rightdoor", "targetname");
  Odoor1L=getent("1leftdoor", "targetname");
  Odoor1R=getent("1rightdoor", "targetname");
  Odoor0L=getent("0leftdoor", "targetname");
  Odoor0R=getent("0rightdoor", "targetname");
  Elevator=getent("elevator", "targetname");
  if(level.current_floor==2)
   {
    door_close(IdoorLEFT, IdoorRIGHT, Odoor2L, Odoor2R);
    wait(.1);
    Elevator thread move_func(zdist1, etime, zdirec);
    IdoorLEFT thread move_func(zdist1, etime, zdirec);
    IdoorRIGHT thread move_func(zdist1, etime, zdirec);
    Elevator waittill ("movedone");
    door_open(IdoorLEFT, IdoorRIGHT, Odoor2L, Odoor2R);
    level.elevDown=true;
    level.elevUp=false;
    level.elevMove=false;
   }
   else if(level.current_floor==1)
   {
    door_close(IdoorLEFT, IdoorRIGHT, Odoor1L, Odoor1R);
    wait(.1);
    Elevator thread move_func(zdist2, etime, zdirec);
    IdoorLEFT thread move_func(zdist2, etime, zdirec);
    IdoorRIGHT thread move_func(zdist2, etime, zdirec);
    Elevator waittill ("movedone");
    door_open(IdoorLEFT, IdoorRIGHT, Odoor1L, Odoor1R);
    level.elevDown=true;
    level.elevUp=true;
    level.elevMove=false;
   }
  else(level.current_floor==0)
  {
   door_close(IdoorLEFT, IdoorRIGHT, OdoorTL, OdoorTR);
   wait(.1);
   Elevator thread move_func(zdist3, etime, zdirec);
   IdoorLEFT thread move_func(zdist3, etime, zdirec);
   IdoorRIGHT thread move_func(zdist3, etime, zdirec);
   Elevator waittill ("movedone");
   door_open(IdoorLEFT, IdoorRIGHT, Odoor0L, Odoor0R);
   level.elevDown=false;
   level.elevUp=true;
   level.elevMove=false;
  }
  wait(.1);
}

door_close(leftIN, rightIN, leftOUT, rightOUT)
{
  LDclose=-66.8;
  RDclose=-211.1;
  ydirec="x";
  dtime=1.1;
  leftIN thread move_func(LDclose,dtime, ydirec);
  rightIN thread move_func(RDclose,dtime, ydirec);
  wait(1);
  leftOUT thread move_func(LDclose,dtime, ydirec);
  rightOUT thread move_func(RDclose,dtime, ydirec);
  wait(1);
 }

door_open(leftyIN, rightyIN, leftyOUT, rightyOUT)
{
  LDopen=-26.8;
  RDopen=-251.1;
  ydirec="x";
  dtime=1.1;
  leftyOUT thread move_func(LDopen,dtime, ydirec);
  rightyOUT thread move_func(RDopen,dtime, ydirec);
  wait(1);
  leftyIN thread move_func(LDopen,dtime, ydirec);
  rightyIN thread move_func(RDopen,dtime, ydirec);
 }

move_func(dist,time,direc)
{
  if(direc=="z")
  self movez (dist, time, (time/2), (time/2));
  if(direc=="x")
   self movex (dist, time, (time/2), (time/2));
   self waittill ("movedone");
}
405 days ago
I made a model in maya and exported it, it looks like this in assview
http://winpic.co/5zoe847a98525.jpg

But looks like this in game under low light, how can i make it react to the lighting like others do on brushs
http://winpic.co/5zp1ff806c02e.jpg

Other i made on brushes look like this
http://winpic.co/5zq5944ddda60.jpg

Thanks for looking.
407 days ago
Can anyone help me with a script for 3 elevators in my map, i have tried many times and failed but think i'm somewhat close. Any help would be much appreciated.

One elevator is 3 floors the others are 2, i also have a .menu file tombmx helped me with that will function the elevator from a trigger.
416 days ago

Login

or login with an authentication provider below
Sign In with Google
Sign In with Twitter
Sign In with Discord
Sign In with Steam
Sign In with Twitch
Loading ...