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

Members Online

»
1 Active | 8 Guests
Online:

LATEST FORUM THREADS

»
water
CoD4 MP Mapping
Rainbow HELP....
CoD4 MP Mapping

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, supersword
Latest Posts
Subscribed Posts
Search
Restricted Access Restricted Access subscribe
Author Topic: Elevator wont work
Astarathia
General Member
Since: Jan 19, 2011
Posts: 2
Last: Jul 25, 2012
[view latest posts]
Level 0
Category: CoDUO Mapping
Posted: Wednesday, Jul. 25, 2012 05:15 am
Dear modsonline community,

I built an elevator into my map and followed exactly the tutorial.

http://modsonline.com/Tutorials-read-169.html

I wanted to make my elevator start at the top and go down to the next position, but even when I copy pasted the script it didn't even move a centimetre. The brushmodel is targetname elevatormodel, the trigger use is the elevatorswitch...

I want it to move down by 1194 blocks in 11 seconds...
The model itself is 112 blocks high.

Here's the code:

Code:
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","targetname"); 
if ( isdefined(elevator) ) 
for (i = 0; i < elevator.size; i++) 
elevator[i] thread elevator_think(); 
} 

elevator_think() { 
while (1) { 
self waittill ("trigger"); 
if (!level.elevatorMoving) 
thread elevator_move(); 
} 
} 

elevator_move() { 
elevatormodel = getent ("elevatormodel", "targetname"); 
level.elevatorMoving = true; 
speed = 2; 
height = 1192; 
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 (-1192,11,2,2); 
elevatormodel waittill ("movedone"); 
level.elevatorDown = true; 
} 
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 (1192,11,2,2); 
elevatormodel waittill ("movedone"); 
level.elevatorDown = false; 
} 
level.elevatorMoving2 = false; 
} 


Any ideas? Thx

edited on Jul. 25, 2012 08:37 am by Astarathia
Share |
Astarathia
General Member
Since: Jan 19, 2011
Posts: 2
Last: Jul 25, 2012
[view latest posts]
Level 0
Category: CoDUO Mapping
Posted: Wednesday, Jul. 25, 2012 08:38 am
Noone ? [confused]
Share |
Johnno
General Member
Since: Mar 21, 2006
Posts: 139
Last: May 5, 2013
[view latest posts]
Level 4
Im a fan of MODSonair
Category: CoDUO Mapping
Posted: Wednesday, Jul. 25, 2012 10:23 am
I havn't used uo for a while now but i think that this used to work for me

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","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", "targetname");
level.elevatorMoving = true;
speed = 2;
height = 226;
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;
}


Now i look at yours again, it looks the same, so it should work


edited on Jul. 25, 2012 10:23 am by Johnno

edited on Jul. 25, 2012 10:28 am by Johnno
Share |
Restricted Access Restricted Access subscribe
MODSonline.com Forums : Call of Duty : CoDUO Mapping

Latest Syndicated News

»
Why console gaming is dying
Quote:Consider this: Dedicated gaming sales — including living-room consoles...
Devs: Games are being dumb...
Click 'read more' to view the contents of this post.
Loadout
Gun Crafting to the Max. edited on Sep. 25, 2012 06:57 pm by Morp...
Introducing the Source Fil...
Surprised this wasn't made a long time ago. Sounds like a nice little feature.
Introducing the Source Fil...
The Source Filmmaker (SFM) is the movie-making tool built and used by us he...

Partners & Friends

»