Death Barrier?

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

Moderator: Core Staff

Post Reply
Reality
CJ Newbie
CJ Newbie
Posts: 51
Joined: May 3rd, 2011, 9:57 pm

Death Barrier?

Post by Reality » July 10th, 2011, 4:43 pm

I'm making a pit and i need it so when players fall in it they die.. i've tried damage trigger but because its codjumper that doesnt work, how can i get a death barrier?

User avatar
Goro92
CJ Spammer!
CJ Spammer!
Posts: 605
Joined: March 7th, 2011, 5:54 pm
Location: Brescia, Italy

Re: Death Barrier?

Post by Goro92 » July 10th, 2011, 5:07 pm

Code: Select all

 
main()
 {
    thread kill();
 }
 
kill()
 {   
 your_trigger_name = getent("trigger","targetname");
   while (1)
   {
      trigger waittill ("trigger",player);
      if(player isTouching(trigger) )
      {
              player suicide();
         }
 
     }
  }
Image

Reality
CJ Newbie
CJ Newbie
Posts: 51
Joined: May 3rd, 2011, 9:57 pm

Re: Death Barrier?

Post by Reality » July 10th, 2011, 5:08 pm

Thanks.. but im a noob, so...?

Reality
CJ Newbie
CJ Newbie
Posts: 51
Joined: May 3rd, 2011, 9:57 pm

Re: Death Barrier?

Post by Reality » July 10th, 2011, 5:09 pm

Thanks.. but im a noob, so...?

User avatar
Opel
CJ Fan
CJ Fan
Posts: 188
Joined: September 15th, 2008, 12:28 pm
Location: Scotland

Re: Death Barrier?

Post by Opel » July 10th, 2011, 6:38 pm

Yep, they both do the same thing.

Reality
CJ Newbie
CJ Newbie
Posts: 51
Joined: May 3rd, 2011, 9:57 pm

Re: Death Barrier?

Post by Reality » July 10th, 2011, 10:27 pm

Sorry i really dont get coding or where to add that code, please can you add it for me and what do i have to do in radiant?

Code: Select all

main()
{
        //maps\mp\mp_levels_fx::main();
        //maps\createart\mp_levels_art::main();
        maps\mp\_load::main();
        //maps\mp\mp_levels_struct::main();     
        maps\mp\_teleport::main();
 
        //maps\mp\_compass::setupMiniMap("compass_map_mp_backlot");
 
        //setExpFog(500, 2200, 0.81, 0.75, 0.63, 0);
        //VisionSetNaked( "mp_levels" );
        ambientPlay("ambient_explicit_ext");
 
        game["allies"] = "marines";
        game["axis"] = "opfor";
        game["attackers"] = "axis";
        game["defenders"] = "allies";
        game["allies_soldiertype"] = "desert";
        game["axis_soldiertype"] = "desert";
 
        setdvar( "r_specularcolorscale", "1" );
 
        setdvar("r_glowbloomintensity0",".25");
        setdvar("r_glowbloomintensity1",".25");
        setdvar("r_glowskybleedintensity0",".3");
        setdvar("compassmaxrange","1800");
 
        thread quake();
}
 
 
 
quake()
 
{
trigger = getent("earthquake","targetname"); // this finds the entity you created (the trigger)
quake = getent("quake","targetname");      // this finds the entity you created (the origin named quke)
sound = getent("sound","targetname");      // this finds the entity you created (the origin named sound)
while (1)
 
   {
   trigger waittill ("trigger",user);
   wait 1;
   iprintlnbold( "EAARRTHHHQUUAAKKE!!!");    //prints inbold "EAARRTHHHQUUAAKKE!!!" to all the users on the map, feel free to change the text :)
   sound PlaySound( "elm_quake_sub_rumble");  //plays the sound of an earthquake at the origin "sound"
   Earthquake( 0.7, 8, quake.origin, 10000 ); // (magnitude of the earthquake, length, at what origin, and the radius) these values can be changed apart from the origin
   wait 2;
   }
}

User avatar
Goro92
CJ Spammer!
CJ Spammer!
Posts: 605
Joined: March 7th, 2011, 5:54 pm
Location: Brescia, Italy

Re: Death Barrier?

Post by Goro92 » July 11th, 2011, 7:52 am

Code: Select all

main()
{
        //maps\mp\mp_levels_fx::main();
        //maps\createart\mp_levels_art::main();
        maps\mp\_load::main();
        //maps\mp\mp_levels_struct::main();     
        maps\mp\_teleport::main();
 
        //maps\mp\_compass::setupMiniMap("compass_map_mp_backlot");
 
        //setExpFog(500, 2200, 0.81, 0.75, 0.63, 0);
        //VisionSetNaked( "mp_levels" );
        ambientPlay("ambient_explicit_ext");
 
        game["allies"] = "marines";
        game["axis"] = "opfor";
        game["attackers"] = "axis";
        game["defenders"] = "allies";
        game["allies_soldiertype"] = "desert";
        game["axis_soldiertype"] = "desert";
 
        setdvar( "r_specularcolorscale", "1" );
 
        setdvar("r_glowbloomintensity0",".25");
        setdvar("r_glowbloomintensity1",".25");
        setdvar("r_glowskybleedintensity0",".3");
        setdvar("compassmaxrange","1800");
 
        thread quake();
        thread kill();
}
 
 
 
quake()
 
{
trigger = getent("earthquake","targetname"); // this finds the entity you created (the trigger)
quake = getent("quake","targetname");      // this finds the entity you created (the origin named quke)
sound = getent("sound","targetname");      // this finds the entity you created (the origin named sound)
while (1)
 
   {
   trigger waittill ("trigger",user);
   wait 1;
   iprintlnbold( "EAARRTHHHQUUAAKKE!!!");    //prints inbold "EAARRTHHHQUUAAKKE!!!" to all the users on the map, feel free to change the text :)
   sound PlaySound( "elm_quake_sub_rumble");  //plays the sound of an earthquake at the origin "sound"
   Earthquake( 0.7, 8, quake.origin, 10000 ); // (magnitude of the earthquake, length, at what origin, and the radius) these values can be changed apart from the origin
   wait 2;
   }
}
 
 
 
 
 
 
    
 
 
 
 
 
kill()
 
 {  
 
 your_trigger_name = getent("trigger","targetname");
 
   while (1)
 
   {
 
      trigger waittill ("trigger",player);
 
              player suicide();
 
     }
 
  }
 
 
[/quote]


in radiant just create a trigger multiple....press N ---> key:targetname value:your_trigger_name
Image

User avatar
Goro92
CJ Spammer!
CJ Spammer!
Posts: 605
Joined: March 7th, 2011, 5:54 pm
Location: Brescia, Italy

Re: Death Barrier?

Post by Goro92 » July 11th, 2011, 7:57 am

or

Code: Select all

main()
{
        //maps\mp\mp_levels_fx::main();
        //maps\createart\mp_levels_art::main();
        maps\mp\_load::main();
        //maps\mp\mp_levels_struct::main();     
        maps\mp\_teleport::main();
        maps\mp\mp_yuormapname_kill::main();
 
        //maps\mp\_compass::setupMiniMap("compass_map_mp_backlot");
 
        //setExpFog(500, 2200, 0.81, 0.75, 0.63, 0);
        //VisionSetNaked( "mp_levels" );
        ambientPlay("ambient_explicit_ext");
 
        game["allies"] = "marines";
        game["axis"] = "opfor";
        game["attackers"] = "axis";
        game["defenders"] = "allies";
        game["allies_soldiertype"] = "desert";
        game["axis_soldiertype"] = "desert";
 
        setdvar( "r_specularcolorscale", "1" );
 
        setdvar("r_glowbloomintensity0",".25");
        setdvar("r_glowbloomintensity1",".25");
        setdvar("r_glowskybleedintensity0",".3");
        setdvar("compassmaxrange","1800");
 
        thread quake();
        thread kill();
}
 
 
 
quake()
 
{
trigger = getent("earthquake","targetname"); // this finds the entity you created (the trigger)
quake = getent("quake","targetname");      // this finds the entity you created (the origin named quke)
sound = getent("sound","targetname");      // this finds the entity you created (the origin named sound)
while (1)
 
   {
   trigger waittill ("trigger",user);
   wait 1;
   iprintlnbold( "EAARRTHHHQUUAAKKE!!!");    //prints inbold "EAARRTHHHQUUAAKKE!!!" to all the users on the map, feel free to change the text :)
   sound PlaySound( "elm_quake_sub_rumble");  //plays the sound of an earthquake at the origin "sound"
   Earthquake( 0.7, 8, quake.origin, 10000 ); // (magnitude of the earthquake, length, at what origin, and the radius) these values can be changed apart from the origin
   wait 2;
   }
}
 
 
 
then create a new .gsc file called mp_yourmapname_kill

Code: Select all

 
 
main()
 
 {
    thread kill();
 }
 
 
kill()
 
 {  
 
 your_trigger_name = getent("trigger","targetname");
 
   while (1)
 
   {
      trigger waittill ("trigger",player);
 
              player suicide();
     }
 
  }
finally in the upload zone file add this line:
rawfile,maps/mp/mp_yourmapname_kill.gsc
Image

Reality
CJ Newbie
CJ Newbie
Posts: 51
Joined: May 3rd, 2011, 9:57 pm

Re: Death Barrier?

Post by Reality » July 11th, 2011, 1:06 pm

it doesn't work:( something wrong with this line 'trigger waittill ("trigger",player);'

heres what my file looks like

Code: Select all

main()
{
    thread kill();
 }
 
kill()
{
your_trigger_name = getent( "trigger","targetname" );
while (1)
        {
        trigger waittill ("trigger",player);
        if(player isTouching(trigger) )
        }
 
         }
}
 

User avatar
Opel
CJ Fan
CJ Fan
Posts: 188
Joined: September 15th, 2008, 12:28 pm
Location: Scotland

Re: Death Barrier?

Post by Opel » July 11th, 2011, 1:20 pm

you have trigger waittill yet you have used your_trigger_name for the actual trigger, use one

Code: Select all

 
main()
{
    thread kill();
}
 
kill()
{
trigger = getent( "trigger","targetname" );
while (1)
   {
   trigger waittill ("trigger",player);
   if(player isTouching(trigger) )
   }
    player suicide();
   }
}
 

Nekoneko
CJ Fan
CJ Fan
Posts: 170
Joined: April 18th, 2011, 3:48 pm

Re: Death Barrier?

Post by Nekoneko » July 11th, 2011, 1:41 pm

I would change the name "trigger", since it can be confusing
And I would just add a new function to your .gsc, otherwise you will have to compile the new gsc too.

So, in your_map.gsc

Code: Select all

main()
{
    ........
    thread Deathtrigger();
}
 
 
Deathtrigger()
{
    trigger = getent( "Deathtrigger","targetname" );       // Deathtrigger is the name you need to give your trigger in radiant
    while (1)
    {
        trigger waittill ("trigger",player);
        player suicide();
    }
}

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest