Login x
User Name:
Password:
Social Links Facebook Twitter YouTube Steam RSS News Feeds

Members Online

»
0 Active | 12 Guests
Online:

LATEST FORUM THREADS

»
warfare
CoD4 Map + Mod Releases
Voting menu on maps
CoD+UO General
Hauling 911
CoDBO3 General

Forums

»

Welcome to the MODSonline.com forums. Looking for Frequently Asked Questions? Check out our FAQs section or search it out using the SEARCH link below. If you are new here, you may want to check out our rules and this great user's guide to the forums and the website.
For more mapping and modding information, see our Wiki: MODSonWiki.com

Jump To:
Forum: All Forums : Call of Duty
Category: CoDUO Mapping
CoD United Offensive mapping and level design.
Moderators: foyleman, Foxhound, Mystic, StrYdeR, batistablr, Welshy, DrBiggzz, supersword
Latest Posts
Subscribed Posts
Search
Restricted Access Topic is Locked
Page
Next Page
subscribe
Author Topic: elevator timing?
Maddogg8472
General Member
Since: Jun 18, 2004
Posts: 55
Last: Aug 22, 2008
[view latest posts]
Level 3
Category: CoDUO Mapping
Posted: Thursday, Feb. 16, 2006 12:35 am
hey all.

ive been building my map for some months now and have finally got two working elevators. There are also a pair of doors for each lift at the top of the elevator shaft, that are in a fixed position, dont move with the elevator.
Now at the moment you open the doors seperate from the control of the lift which i dont like.
Can anyone tell me how i could sync the lift doors with the control switch for the lift, so when you press the button to call the lift the doors open as the lift arrives?

thanks
[wave]
Share |
={W}=DEVIL
General Member
Since: Aug 23, 2004
Posts: 1670
Last: Dec 14, 2007
[view latest posts]
Level 8
Category: CoDUO Mapping
Posted: Thursday, Feb. 16, 2006 02:52 am
maybe you could link the doors to the trigger of your elevator. So if your elevator takes 6 seconds to reach the top, just script your elevator doors to open 6 seconds after the trigger is triggered. I'm not expert at scripting, but it sounds like a shabby way to get it done. I'm not sure how you'd go about boarding the elevator though...maybe a better scripter(RICSTA? RASTA?) might be able to help you out with this.
Share |
DadofAzz
General Member
Since: May 24, 2005
Posts: 1233
Last: Oct 17, 2009
[view latest posts]
Level 8
MODSCON
Category: CoDUO Mapping
Posted: Friday, Feb. 17, 2006 06:04 pm
Hi md, if you download my last map for CODuo called Heavy water Plant (CODuo maps section) take a look at the .gsc I have in there for the lift. I have remarked all the function lines indicating what they do so you should be able to understand it after a bit of study.

Watch out for the missing sound file in that pk3, there is a link for a quick fix.

regards doa
Share |
Maddogg8472
General Member
Since: Jun 18, 2004
Posts: 55
Last: Aug 22, 2008
[view latest posts]
Level 3
Category: CoDUO Mapping
Posted: Friday, Feb. 17, 2006 07:12 pm
ok thanks...i think that should work.

each of my lifts have double doors top and bottom but i should

be able to figure it out...ill post again if i get stuck

[wave]
Share |
Maddogg8472
General Member
Since: Jun 18, 2004
Posts: 55
Last: Aug 22, 2008
[view latest posts]
Level 3
Category: CoDUO Mapping
Posted: Friday, Feb. 17, 2006 08:10 pm
ok im not sure how to do this but this is the script as ive edited so far. As each of my lifts has two doors top and two at the bottom. Is there a way i can use my existing lift gsc file somewhere in this script?

main()
{
thread gate_init();
}
gate_init(){
level.gatemoving=false;
level.gate1 = getent("lift1top","targetname");
level.gate2 = getent("lift1bottom","targetname");

level.gate3 = getent("lift2DL","targetname");
level.gate4 = getent("lift2DR","targetname");

level.trig = getentarray ("lift1doors","targetname");

if (isdefined(level.trig))
for (i=0;i level.trigthread gate_handler();
}

gate_handler() {
while (1) {
self waittill ("trigger");
if (!level.gatemoving)
thread move_gate();
wait(1);
}
}
move_gate() {
level.gatemoving = true;
level.gate1 movez (83,2,0.5,0.5); //the top doors open
level.gate2 movez (-59,2,0.5,0.5);
wait (10); //this is the time to get in lift at top
level.gate1 movez (-83,2,0.5,0.5); //the top doors close
level.gate2 movez (59,2,0.5,0.5);
wait (14);
level.gate3 rotateto ((0,-90,0),2); //the lower doors open
level.gate4 rotateto ((0,90,0),2); //the lower doors open
wait (10);
level.gate3 rotateto ((0,90,0),2); //the lower doors close
level.gate4 rotateto ((0,-90,0),2); //the lower doors close

wait (3);
level.gatemoving=false;
}
Share |
Mystic
General Member
Since: Apr 10, 2004
Posts: 6147
Last: Apr 15, 2018
[view latest posts]
Level 10
Forum Moderator
Im a fan of MODSonair
Category: CoDUO Mapping
Posted: Friday, Feb. 17, 2006 08:58 pm
You can add more to a script by calling a new thread. The thread your calling in this script is 'thread gate_init();'

You can add a line such as thread elevator(); then add the new script at the bottom of the existing script, so:

Code:
main()
{
thread gate_init();
thread elevator();
}
gate_init(){
level.gatemoving=false;
level.gate1 = getent("lift1top","targetname");
level.gate2 = getent("lift1bottom","targetname");

level.gate3 = getent("lift2DL","targetname");
level.gate4 = getent("lift2DR","targetname");

level.trig = getentarray ("lift1doors","targetname");

if (isdefined(level.trig))
for (i=0;i
level.trigthread gate_handler();
}

gate_handler() {
while (1) {
self waittill ("trigger");
if (!level.gatemoving)
thread move_gate();
wait(1);
}
}
move_gate() {
level.gatemoving = true;
level.gate1 movez (83,2,0.5,0.5); //the top doors open
level.gate2 movez (-59,2,0.5,0.5);
wait (10); //this is the time to get in lift at top
level.gate1 movez (-83,2,0.5,0.5); //the top doors close
level.gate2 movez (59,2,0.5,0.5);
wait (14);
level.gate3 rotateto ((0,-90,0),2); //the lower doors open
level.gate4 rotateto ((0,90,0),2); //the lower doors open
wait (10);
level.gate3 rotateto ((0,90,0),2); //the lower doors close
level.gate4 rotateto ((0,-90,0),2); //the lower doors close

wait (3);
level.gatemoving=false;
}
elevator() {


ELEVATOR SCRIPT GOES HERE!


}
Share |
Maddogg8472
General Member
Since: Jun 18, 2004
Posts: 55
Last: Aug 22, 2008
[view latest posts]
Level 3
Category: CoDUO Mapping
Posted: Friday, Feb. 17, 2006 10:20 pm

dont i have to put the lift script at a certain point in the gsc file above for the lift to move at the right time? like after the top two doors close?



edited on Feb. 17, 2006 05:22 pm by Maddogg8472
Share |
Mystic
General Member
Since: Apr 10, 2004
Posts: 6147
Last: Apr 15, 2018
[view latest posts]
Level 10
Forum Moderator
Im a fan of MODSonair
Category: CoDUO Mapping
Posted: Friday, Feb. 17, 2006 10:24 pm
Post your elevator script!
Share |
Maddogg8472
General Member
Since: Jun 18, 2004
Posts: 55
Last: Aug 22, 2008
[view latest posts]
Level 3
Category: CoDUO Mapping
Posted: Friday, Feb. 17, 2006 10:35 pm
ok but b4 i do i did try pasteing it into the space but when i ran map i got a script compile error - bad syntax i think.

main() {
level.elevatorDown = true; // elevator starts at bottom: true/false
level.elevatorMoving = false; // elevator is not currently moving
thread elevator_start();
}

elevator_start() {
elevator = getentarray ("elevatorswitch_1","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 ("elevatormodel_1", "targetname");
level.elevatorMoving = true;
speed = 8;
height = 608;
wait (1);
if (level.elevatorDown) { // moves to top
elevatormodel playsound ("elevator1"); // sound definition for soundaliases.csv
wait (1); // wait a second to hear the motor start and then start the movement of the lift - feels more realistic
elevatormodel movez (height, speed);
elevatormodel waittill ("movedone");
level.elevatorDown = false;
}
else { // moves to bottom
elevatormodel playsound ("elevator1"); // sound definition for soundaliases.csv
wait (1); // wait a second to hear the motor start and then start the movement of the lift - feels more realistic
elevatormodel movez (height - (height * 2), speed);
elevatormodel waittill ("movedone");
level.elevatorDown = true;
}
level.elevatorMoving = false;
}



edited on Feb. 17, 2006 05:39 pm by Maddogg8472
Share |
Maddogg8472
General Member
Since: Jun 18, 2004
Posts: 55
Last: Aug 22, 2008
[view latest posts]
Level 3
Category: CoDUO Mapping
Posted: Saturday, Feb. 18, 2006 11:57 pm
ok im still stuck on the lift doors, but heres my latest attempt which doesnt work.

But the lower lift doors open but only the left one of these doors close. lift goes up but then it just sits at the top and nothing else happens. Eventually the lift goes back down again.....
can anyone help here please[ohwell]

main()
{
thread gate_init();

}
gate_init(){
level.gatemoving=false;
level.gate1 = getent("lift2DL","targetname");
level.gate2 = getent("lift2DR","targetname");
level.gate3 = getent("lift1bottom","targetname");
level.gate4 = getent("lift1top","targetname");
level.gate5 = getent("elevatormodel_2","targetname");
level.trig = getentarray ("elevatorswitch_2","targetname");

if (isdefined(level.trig))
for (i=0;i level.trigthread gate_handler();
}

gate_handler() {
while (1) {
self waittill ("trigger");
if (!level.gatemoving)
thread move_gate();
wait(1);
}
}
move_gate() {
level.gatemoving = true;
level.gate1 rotateto ((0,-90,0),2); //the bottom left door opens
level.gate2 rotateto ((0,90,0),2); //the bottom right door opens
wait (10); //this is the time to get in lift at top
level.gate1 rotateto ((0,0,0),2); //the bottom left door closes
level.gate1 rotateto ((0,0,0),2); //the bottom right door closes
wait (4);
level.gate5 movez (608,8,0,0,6); //the lift moves up
level.gate1 waittill ("movedone");
level.gate2 waittill ("movedone");
level.gate3 movez (-59,2,0.5,0.5); //top door lower opens
level.gate4 movez (83,2,0.5,0.5); //top door upper opens
wait (10);
level.gate3 movez (59,2,0.5,0.5); //top door lower closes
level.gate3 movez (-83,2,0.5,0.5); //top door upper closes
wait (4);
level.gate5 movez (-608,8,0,0,6); //the lift goes back down
level.gate1 waittill ("movedone");
level.gate2 waittill ("movedone");
level.gate1 rotateto ((0,-90,0),2); //the bottom left door opens
level.gate2 rotateto ((0,90,0),2); //the bottom right door opens
wait (10);
level.gate1 rotateto ((0,0,0),2); //the bottom left door closes
level.gate1 rotateto ((0,0,0),2); //the bottom right door closes
//wait (3);

level.gatemoving=false;
}
Share |
Restricted Access Topic is Locked
Page
Next Page
subscribe
MODSonline.com Forums : Call of Duty : CoDUO Mapping

Latest Syndicated News

»
Codutility.com up and runn...
Nice, and there still using the logo and template for the screenshots, which...
Codutility.com up and runn...
dundy writes...Quote:Call of Duty modding and mapping is barly alive only a ...
Codutility.com up and runn...
Mystic writes...Quote:It seems to me the like the site is completely dead? ...
Codutility.com up and runn...
It seems to me the like the site is completely dead?

Partners & Friends

»