
Members Online»
0 Active | 21 Guests
Online:
|
LATEST FORUM THREADS»
by morgawr
Posts: 1 / 1058 Damaged .pk3's
CoD Mapping by lazygit
Posts: 1 / 1621 heli to attack ai
CoD4 SP Mapping by DrBiggzz
Posts: 11 / 824 New Cod UO Rifle Mod.
CoD Mapping by rr016
Posts: 2 / 3947 setting your own ai names
CoD4 SP Mapping by lazygit
Posts: 2 / 2764 couldnt find path to goal
CoD4 SP Mapping |
Polls»
|
Elevator in Multiplayer
This tutorial will show you how to add an elevator in your multiplayer map.
The majority of the process of putting an elevator in your map is script work - however i will walk you through the entire process.
First create your elevator out of brushes.
Select them all and right click in the 2d window and make them a script_brushmodel.
Press "N" to bring up the entity editor and give them the key targetname and the value elevatormodel.
Now we will add the button. Right click in the 2d window and click misc then model. Close the browser window and in the entity editor enter the key model and the value xmodel/switch1. (I accidentally created mine as a script_model - but it will work either way). Move the button into position.
Then, using textures common/trigger, draw out the trigger area. (this is where the button will be pressable).
Right click in the 2d view and click trigger and use.
Press "N" to bring up the entity editor and give the trigger_use the key of targetname and the value elevatorswitch.
Texture the visible faces of your elevator.
That is it for the map...now onto the scripting
First, for sounds - create a .csv file using the following information.
name,sequence,file,vol_min,vol_max,pitch_min,pitch_max,dist_min,dist_max,channel
,type,probability,loop,masterslave,loadspec,subtitle
null,,null.wav,,,,,,,,,,,,,
# Personal Sounddefinitions,,,,,,,,,,,,,,,
elevator1,,misc/elevator_med.wav,,,,,,,auto,,,,,,
.csv information courtesy of Sgt. Skywalker
Now we need a .gsc to make the elevator work...you can save it as whatever you want - just make sure you call on it in yourmap.gsc.
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 = 192;
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;
}
.gsc courtesy of LordBlank, enhanced by Snakeshift and modified by Sgt. Skywalker
Also note:
If you put in
movez(320,5,2,2)
it'll move upwards 320 units (z axis) in 5 seconds, however the elevator will accelerate the first two seconds then move one second at top speed and then take the last two seconds to slow down, i suggest you use that to make your elevator more realistic, ofcourse remember that you cant put in
movez(320,3,2,2)
because 2+2 is 4 and since that's more then three you'll get a script compile error
see the tutorial Getting Started in Scripting for more information on this.
Latest Syndicated News»
Comments: 5
Codutility.com up and runn...
Nice, and there still using the logo and template for the screenshots, which... Comments: 5
Codutility.com up and runn...
dundy writes...Quote:Call of Duty modding and mapping is barly alive only a ... Comments: 5
Codutility.com up and runn...
Mystic writes...Quote:It seems to me the like the site is completely dead?
... Comments: 5
Codutility.com up and runn...
It seems to me the like the site is completely dead? Comments: 5
Codutility.com up and runn...
Yeeaahhhh.........
|
Latest Downloads»
OHMY Don Quixote
Call of Duty 2: Maps: Multiplayer (5.76Mb) OHMY Neuburg
Call of Duty 2: Maps: Multiplayer (6.84Mb) OHMY Tebessa
Call of Duty 2: Maps: Multiplayer (7.36Mb) OHMY POW Camp
Call of Duty 2: Maps: Multiplayer (2.15Mb) OHMY Valley
Call of Duty 2: Maps: Multiplayer (5.7Mb) |
Partners & Friends»
|
Site Links and Information
|
Partners
|
Friends
|
Copyright © MODSonline LLC
Tresware Content Management System © 2011
Website Designed by LKFX and Developed by Tresware