script doesnt work and overall check

Have questions about CoD2 mapping that aren't covered in the tutorials section? Post here!

Moderator: Core Staff

Post Reply
User avatar
waywaaaard
Core Staff
Core Staff
Posts: 2214
Joined: February 6th, 2006, 3:18 pm
Location: Germany/Bayern

script doesnt work and overall check

Post by waywaaaard » June 17th, 2007, 6:27 pm

script doesnt work and overall check

thread scecretdoormove() goes fine I have to shoot around 5times with pistol on trigger to activate it but floor6_vent_des() doesnt work I can only get the trigger to work when i throw a nade; pls could u say what I've done wrong

and maybe check the whole script for mistakes or bad scripting - thx (I know it is much)

Code: Select all

main() {
		maps\mp\_load::main();
		maps\mp\boxmove::main();
		ambientPlay("ambient_mp_lev_facilities");
		maps\mp\teleportenter::main();
		
		thread trainfin();	
		thread drink();
		thread drink2();
		thread haltermove();
		thread zait2();
		thread secretdoormove();
		thread floor6_vent_des();
		thread el2();
		thread elevator3move();
		thread end();
		thread trainview();
		thread door1();
		thread sound01();
		thread sound02();
		thread sound03();
		thread haloroom();
		thread helpsystem1();
		thread helpsystem2();
		
		
		level.addDamage=0; 
		level.addDamagevent=0;
		}
	

trainfin()
{
triggertrainfin = getent ("trainfin_trig","targetname");
while(1)
{
triggertrainfin waittill ("trigger",user2);
user2 iprintlnbold ("You managed to do the training; you have got now all the basics! -> ^7do the real map now!!");
wait(2);
}
}
//iprintln(player.name + " ^7was the first to finish the map!");

door1()
{
doorside1 = getent ("doorside1","targetname");
doorside2 = getent ("doorside2","targetname");
doortrigger = getent ("door1_trig","targetname");
while(1)
{
doortrigger waittill ("trigger");
wait(1);
doorside2 moveY (1,2,0.5,0.5);
doorside1 moveY (-24,2,0.5,0.5);
wait(5);
doorside2 moveY (-1,2,0.5,0.5);
doorside1 moveY (24,2,0.5,0.5);
doorside1 waittill ("movedone"); 
doorside2 waittill ("movedone"); 
}
}

drink()
{
drink2_trig = getent ("drink2_trigger","targetname");

while(1)
{
drink2_trig waittill ("trigger",userdrink);
userdrink iprintlnbold ("Damn that was poison!! You will die in 3 seconds XD!");
wait(3);
userdrink suicide();
}
}

drink2()
{
drink1_trig = getent ("drink1_trigger","targetname");

while(1)
{
drink1_trig waittill ("trigger",userdrink);
userdrink iprintlnbold ("Oh you have chosen a coke!");
userdrink iprintlnbold ("One moment please!");
userdrink iprintlnbold ("Here you are");
wait(3);
userdrink iprintlnbold ("LOL did you really think i give you a drink for free?");
userdrink iprintlnbold ("Now you will die!");
wait(1);
userdrink suicide();
}
}

haltermove()
{
halter = getent ("halter_halter","targetname");
tuer = getent ("halter_gate","targetname");
while(1)
{
halter moveX (-293,2,0.5,0.5);
halter waittill ("movedone");
halter moveY (332,2,0.5,0.5);
halter waittill ("movedone");
halter moveX (293,2,0.5,0.5);
halter waittill ("movedone");
halter moveY (-332,2,0.5,0.5);
halter waittill ("movedone");
}
}

seilbahn()
{
liftclip = getent ("liftclip", "targetname");
lift = getent ("lev_facilities_lift","targetname");
liftclip linkto(lift);
lift moveto ((675,0,260),40,2,2);
lift waittill ("movedone");
wait(5);
lift moveto ((0,0,0),40,2,2);
lift waittill ("movedone");
wait(5);
liftclip unlink();
}

secretdoormove()
{
block = getent ("secretdoor1","targetname");
trig = getent ("damage_ss_trig","targetname");
while(1)
{
trig waittill ("damage", idamage);
level.addDamage=level.addDamage+idamage; 
if(level.addDamage > 300)
   {
        block moveZ (-64, 3, 1, 1);
        block waittill ("movedone");
        wait 2;
        block moveZ (64, 3, 1, 1);
        block waittill ("movedone");
        level.addDamage=0;
   }
wait 0.05; 
}
}

floor6_door_move()
{
fd_left = getent ("floor6_door_left", "targetname");
fd_right = getent ("floor6_door_right", "targetname");
fd_left moveY (-44, 0.5, 0.25, 0.25);
fd_left waittill ("movedone");
fd_right moveY (44, 0.5, 0.25, 0.25);
fd_right waittill ("movedone");
wait(5);
fd_left moveY (44, 0.5, 0.25, 0.25);
fd_left waittill ("movedone");
fd_right moveY (-44, 0.5, 0.25, 0.25);
fd_right waittill ("movedone");
wait(1);
}

floor6_vent_des()
{
des_trig = getent ("floor6_vent_trigger", "targetname");
fd_static = getent ("floor6_vent_static", "targetname");
while(1)
{
des_trig waittill ("damage", adamage);
level.addDamagevent=level.addDamagevent+adamage; 
if(level.addDamagevent > 300)
{
fd_static hide();
fd_static moveY (47, 1, 0.5, 0.5);
break;
}
}
}

elevator3move()
{
el3 = getent ("elevator3_move", "targetname");
while(1)
{
wait(5);
el3 moveZ (145, 4, 0.5, 0.5);
el3 waittill ("movedone");
wait(5);
el3 moveZ (-145, 4, 0.5, 0.5);
el3 waittill ("movedone");
}
}

el2()
{
el2m = getent ("el2_move", "targetname");
el2_trig = getent ("el2_trigger", "targetname");
el2_dl = getent ("el2_door_left", "targetname");
el2_dr = getent ("el2_door_right", "targetname");
el2_s = getent ("ele2_speaker", "targetname");
el2_trig enablelinkto();
el2_trig linkto(el2m);
while(1)
{
el2_trig waittill ("trigger");
el2_dl linkto(el2m);
el2_dr linkto(el2m);
el2m moveZ (521, 4, 0.5, 0.5);
el2m waittill ("movedone");
el2_dl unlink();
el2_dr unlink();
el2_dl moveY (44, 0.5, 0.25, 0.25);
el2_dl waittill ("movedone");
el2_dr moveY (-44, 0.5, 0.25, 0.25);
el2_dr waittill ("movedone");
floor6_door_move();
el2_dl moveY (-44, 0.5, 0.25, 0.25);
el2_dl waittill ("movedone");
el2_dr moveY (44, 0.5, 0.25, 0.25);
el2_dr waittill ("movedone");
el2_dl linkto(el2m);
el2_dr linkto(el2m);
el2m moveZ (-521, 4, 0.5, 0.5);
el2m waittill ("movedone");
}
}

end()
{
endspeaker = getent ("end_speaker", "targetname");
endtrig = getent ("end_trigger", "targetname");
while(1)
{
endtrig waittill ("trigger", enduser);
endspeaker playsound ("lev_facilities_sound9");
wait(4);
endspeaker playsound ("lev_facilities_sound10");
wait(3);
iprintln(enduser.name + " ^1was the first to finish the map!");
iprintln(enduser.name + " ^2was the first to finish the map!");
iprintln(enduser.name + " ^3was the first to finish the map!");
iprintln(enduser.name + " ^4was the first to finish the map!");
iprintln(enduser.name + " ^5was the first to finish the map!");
iprintln(enduser.name + " ^6was the first to finish the map!");
iprintln(enduser.name + " ^7was the first to finish the map!");
break;
}
}

zait2()
{
zait2trig = getent ("zait_trigger2","targetname");
dummy = getent ("zait_bot1","targetname");
while(1)
{
zait2trig waittill ("trigger", player);
player linkto(dummy);
dummy moveto((2100,-800,-30),3.5,.5,.5);
dummy waittill ("movedone");
dummy moveZ(-100,1,.5,.5);
dummy waittill ("movedone");
player unlink();
wait(1);
seilbahn();
}
}

trainview()
{
speakertrainview = getent ("lev_facilities_trainview_speaker","targetname");
gate = getent ("trainview1","targetname");
viewtrigger = getent ("trainview1_trig","targetname");
while(1)
{
viewtrigger waittill ("trigger",user);
speakertrainview playsound("lev_facilities_sound4");
user iprintlnbold ("Ok you found the first room now try to find the Zaitsev-Room!");
wait(3);
speakertrainview playsound("lev_facilities_sound6");
gate moveZ (60,2,0.5,0.5);
gate waittill ("movedone"); 
wait(15);
speakertrainview playsound("lev_facilities_sound6");
gate moveZ (-60,2,0.5,0.5);
gate waittill ("movedone"); 
}
}

helpsystem2()
{
help2 = getent ("helpsystem_2trig", "targetname");
while(1)
{
help2 waittill ("trigger", user);
user iprintlnbold ("Go onto the rail and jump from the rail to the barrel!");
}
}

helpsystem1()
{
help1 = getent ("helpsystem_1trig", "targetname");
while(1)
{
help1 waittill ("trigger", user);
user iprintlnbold ("Those jumps are Duck-Strafe-Jumps!");
}
}

sound01()
{
speaker = getent ("lev_facilities_speaker","targetname");
trigger = getent ("lev_facilities_trig","targetname");
while(1)
{
trigger waittill ("trigger");
speaker playsound("lev_facilities_sound1");
wait(7);
}
} 

sound02()
{
speakerwinfl = getent ("lev_facilities_winfl_speaker","targetname");
triggerwinfl = getent ("lev_facilities_winfl_trig","targetname");
while(1)
{
triggerwinfl waittill ("trigger");
speakerwinfl playsound("lev_facilities_sound2");
wait(1);
}
}

sound03()
{
speakerhighvoltage = getent ("lev_facilities_highvoltage_speaker","targetname");
triggerhighvoltage = getent ("lev_facilities_highvoltage_trig","targetname");
while(1)
{
triggerhighvoltage waittill ("trigger");
speakerhighvoltage playsound("lev_facilities_sound3");
wait(4);
}
}  

haloroom()
{
speakerhalo =  getent ("speaker_halo", "targetname");
halotrig = getent ("zait_end", "targetname");
while(1)
{
halotrig waittill ("trigger", user);
user iprintlnbold ("Congratz - You found the Zaitsev room!");
AmbientStop(2);
speakerhalo playsound("lev_facilities_sound7");
wait(117);
AmbientPlay("ambient_mp_lev_facilities");
}
THAT HANDS WERE NOT TRACED!
visit my blog: Link
Soviet wrote:Yeah, watch out, Peds will hit you with his +5 D-Battleaxe of homosexuality :roll:

User avatar
Nightmare
Core Staff
Core Staff
Posts: 2688
Joined: January 12th, 2006, 10:09 pm
Contact:

Post by Nightmare » June 17th, 2007, 11:21 pm

Easy: What I am thinking is that its not working because the variables are under the thread. Move them above. :)
Like so:

Code: Select all

main() {
      maps\mp\_load::main();
      maps\mp\boxmove::main();
      ambientPlay("ambient_mp_lev_facilities");
      maps\mp\teleportenter::main();

      level.addDamage=0;
      level.addDamagevent=0;
      
      thread trainfin();   
      thread drink();
      thread drink2();
      thread haltermove();
      thread zait2();
      thread secretdoormove();
      thread floor6_vent_des();
      thread el2();
      thread elevator3move();
      thread end();
      thread trainview();
      thread door1();
      thread sound01();
      thread sound02();
      thread sound03();
      thread haloroom();
      thread helpsystem1();
      thread helpsystem2();
      } 
Also, I have fixed up your scripting a bit.

Code: Select all

floor6_vent_des()
{
des_trig = getent ("floor6_vent_trigger", "targetname");
fd_static = getent ("floor6_vent_static", "targetname");
while(1)
{
des_trig waittill ("damage", idamage);
level.addDamagevent = level.addDamagevent + idamage;
if(level.addDamagevent > 300)
{
fd_static hide();
fd_static notsolid();
}
wait 0.05;
}
} 
Just wondering, what are these two things?
maps\mp\boxmove::main();
maps\mp\teleportenter::main();
If you are going to have the gsc get things outside of main script then make it more specific. i.e: map name in front.
Actually, looking through your script ALL of your entities do not have the map name in front.
How many times do I have to repeat myself?!?! Do NOT keep the entities name simple! Adding the map name in the front will avoid conflicting and future problems for other mappers!

Anyway, those are just my thoughts and hints for your script, do what you want with it, but doing this could really come back and kick you in the ass later on.
Coding is Poetry. Mapping is Art.
"Cause im the sexiest mapper ever...except for nm, that sexy man" - Soviet

-=[CoDJumper.com Movies]=-
[Ambush] || [Backlot] || [Bloc] || [Bog] || [Broadcast] || [Chinatown] || [Countdown]
[Crash] || [Creek] || [Crossfire] || [District] || [Downpour] || [Killhouse] || [Overgrown]
[Pipeline] || [Shipment & Wetwork] || [Showdown] || [Strike] || [Vacant]

User avatar
waywaaaard
Core Staff
Core Staff
Posts: 2214
Joined: February 6th, 2006, 3:18 pm
Location: Germany/Bayern

Post by waywaaaard » June 18th, 2007, 10:37 am

ok thanks I will give it a try
maps\mp\boxmove::main();
maps\mp\teleportenter::main();
thread 2 other scripts, which arent implemented yet in the main script

Ok i didnt really know that with the entities name and the rest is laziness
thx for haven look at the script
THAT HANDS WERE NOT TRACED!
visit my blog: Link
Soviet wrote:Yeah, watch out, Peds will hit you with his +5 D-Battleaxe of homosexuality :roll:

Post Reply

Who is online

Users browsing this forum: No registered users and 34 guests