| View previous topic :: View next topic |
| Author |
Message |
R1-mini
Joined: Apr 30, 2008 Posts: 4 Location: Coventry ( UK )
Status: Offline
|
Posted: Sat Jan 23, 2010 4:50 pm Post subject: Strange Prob with Elevators |
|
|
Hi Guys
Hope all is Doing Good and are Well
Me again with a problem
Ive added 2 Elevators to a test map
Both of them work fine apart from a strange thing
when the right Elevator is up and you go to use the left 1, The left Elevator goes down when it should go up? And it also happens to the right Elevator when you use the left
But when you use them both on there own they are fine once they go back to there starting positions and then go to use the other Elevator
Is there anything i can do to stop this?
The tut and script i used was from the RGN site
I dont know a great deal about scripting and what differant things do and how they go in the .gsc
Below is the code i used
main()
{
level.elevatorDown = true;
level.elevatorMoving = false;
thread elevator_start();
}
elevator_start()
{
elevator = getentarray ("switch","targetname");
if ( isdefined(elevator) )
for (i = 0; i < elevator.size; i++)
elevator thread elevator_think();
}
elevator_think()
{
while (1)
{
self waittill ("trigger");
if (!level.elevatorMoving)
thread elevator_move();
}
}
elevator_move()
{
elevatormodel = getent ("elevator", "targetname");
level.elevatorMoving = true;
speed = 2;
height =160;
if (level.elevatorDown)
{
elevatormodel playsound ("elevator");
elevatormodel movez (height, speed);
elevatormodel waittill ("movedone");
level.elevatorDown = false;
}
else
{
elevatormodel playsound ("elevator");
elevatormodel movez (height - (height * 2), speed);
elevatormodel waittill ("movedone");
level.elevatorDown = true;
}
level.elevatorMoving = false;
}
Thanx in advance for any help
Andy = R1-mini |
|
|
| Back to top |
|
 |
Ratt
Joined: Aug 17, 2006 Posts: 556 Location: KENTUCKY, USA
Status: Offline
|
Posted: Sat Jan 23, 2010 5:09 pm Post subject: Re: Strange Prob with Elevators |
|
|
| I'm no modder, but it looks to me that you have to give the elevators separate names, for each to do it's own thing, ei: one code per elevator. |
|
|
| Back to top |
|
 |
R1-mini
Joined: Apr 30, 2008 Posts: 4 Location: Coventry ( UK )
Status: Offline
|
Posted: Sat Jan 23, 2010 5:18 pm Post subject: Re: Strange Prob with Elevators |
|
|
Hi Ratt
I did that 2 .gsc files
And i called one Elevator and the other one Elevator1
And i did the same for the Triggers
Scripting is a minefield to me
Just starting myself really  |
|
|
| Back to top |
|
 |
R1-mini
Joined: Apr 30, 2008 Posts: 4 Location: Coventry ( UK )
Status: Offline
|
Posted: Sat Jan 23, 2010 8:20 pm Post subject: Re: Strange Prob with Elevators |
|
|
Hi guys
Thanx for your help
Got it sorted cheers
R1 |
|
|
| Back to top |
|
 |
Razor19119
Joined: Jul 04, 2010 Posts: 8
Status: Offline
|
Posted: Sat Jul 17, 2010 1:13 am Post subject: Re: Strange Prob with Elevators |
|
|
we have several mappers in our clan... if u need help on scripts and such.. get ahold of me .. and ill put ya thru to em..
Raz |
|
|
| Back to top |
|
 |
|