Mapping CoD4 ( tuto )
305 : How to add ziplines on a map?
Radiant part
Create a trigger use brush anywhere like the following:
Add the following properties :
- targetname --> zip_trig
- target --> XXXX (where XXXX will be the name of the handle model used)
- script_noteworthy --> X,Y,Z (destination location without spaces)
- hintstring --> Optional message to be displayed nearby trigger
Add a model to act like a handle (you can use whatever xmodels of your choice).
- After adding your model, right click on it and hit script > model
- Add the property targetname with the value XXXX set in the above section.
Please note, that handle will slide to destination location and will come back at its original place afterwards.
The zipline is usable only when the handle is back at its origin.
Script part
First, add a file called maps/mp/_zipline.gsc
Paste this in your file:
main() {
thread ziplines();
}
ziplines() {
zip = getentarray("zip_trig","targetname");
for (i = 0; i < zip.size; i++) {
zip[i] thread zip();
}
}
zip() {
handle = getent (self.target, "targetname"); //The handles
org_start = handle GetOrigin();
while (1) {
self waittill ("trigger", user);
user setOrigin( org_start - (0,0,80) );
user linkto(handle);
vec = strtok(self.script_noteworthy, ",");
handle moveto((int(vec[0]), int(vec[1]), int(vec[2])), 6, 4, 2);
// You can add sound here if you'd like
//handle playsound( "rope" );
handle waittill ("movedone");
user unlink();
handle moveto(org_start, 6, 4, 2);
handle waittill ("movedone");
wait 1;
}
}
In your maps/mp/mp_xxx.gsc
add the following:
main() {
maps\mp\_load::main();
maps\mp\_zipline::main();
...
}
Do not forget to add this rawfile,maps/mp/_zipline.gsc to your zone file.
Tuto by Efaya