droffy....

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

Moderator: Core Staff

User avatar
Drofder2004
Core Staff
Core Staff
Posts: 13315
Joined: April 13th, 2005, 8:22 pm
Location: UK, London

Post by Drofder2004 » October 2nd, 2006, 11:45 am

post up your full gsc please.
Image
Virgin Media 20Mb Broadband:
"Perfect for families going online at the same time, downloading movies, online gaming and more."
Borked internet since: 22-07-2010

User avatar
Soviet
Core Staff
Core Staff
Posts: 7762
Joined: April 23rd, 2005, 9:12 pm

Post by Soviet » October 2nd, 2006, 5:49 pm

Code: Select all

main()
{
maps\mp\_load::main();
thread onConnect();

ambientPlay("ambient_france");
}

OnConnect()
{
   for(;;)
   {
      level waittill("connected", self); 
      self thread onPlayerSpawned();
   }
}

onPlayerSpawned()
{
   for(;;)
   {
      self waittill("spawned_player");
      self takeAllWeapons();
      self giveWeapon("kar98k_mp");
      self switchToWeapon("kar98k_mp");
   }
}

User avatar
Drofder2004
Core Staff
Core Staff
Posts: 13315
Joined: April 13th, 2005, 8:22 pm
Location: UK, London

Post by Drofder2004 » October 2nd, 2006, 6:22 pm

I am guessing the error comes from the fact this is CoD not CoD2.
I will check to find an alternative for vCoD.
Image
Virgin Media 20Mb Broadband:
"Perfect for families going online at the same time, downloading movies, online gaming and more."
Borked internet since: 22-07-2010

User avatar
Drofder2004
Core Staff
Core Staff
Posts: 13315
Joined: April 13th, 2005, 8:22 pm
Location: UK, London

Post by Drofder2004 » October 2nd, 2006, 6:28 pm

I am guessing the error comes from the fact this is CoD not CoD2.
I will check to find an alternative for vCoD.

---

Ok, CoD does not use the 'improved' waiting scripts, so this is a work around.

underneath the spawn points make a trigger multiple.
Then a slight change of code...

Code: Select all

main()
{
maps\mp\_load::main();
thread onSpawn();

ambientPlay("ambient_france");
}

onSpawn()
{
   trig = getent("trig","targetname");

   for(;;)
   {
      trig waittill("trigger", other); 
      other thread onPlayerSpawned();
   }
}

onPlayerSpawned()
{
      self takeAllWeapons();
      self giveWeapon("kar98k_mp");
      self switchToWeapon("kar98k_mp");
}
Image
Virgin Media 20Mb Broadband:
"Perfect for families going online at the same time, downloading movies, online gaming and more."
Borked internet since: 22-07-2010

User avatar
Soviet
Core Staff
Core Staff
Posts: 7762
Joined: April 23rd, 2005, 9:12 pm

Post by Soviet » October 2nd, 2006, 8:10 pm

will this effect occur every time the person walks over the trigger multiple, or only when they spawn?

User avatar
Drofder2004
Core Staff
Core Staff
Posts: 13315
Joined: April 13th, 2005, 8:22 pm
Location: UK, London

Post by Drofder2004 » October 2nd, 2006, 8:53 pm

Soviet wrote:will this effect occur every time the person walks over the trigger multiple, or only when they spawn?
everytime...
to stop it from happening you need to use some checks...

Code: Select all

onPlayerSpawned()
{
      weapon = self getWeaponSlotWeapon("primary");
      if(weapon != "kar98k_mp")
      {
            self takeAllWeapons();
            self giveWeapon("kar98k_mp");
            self switchToWeapon("kar98k_mp");
      }
}
Image
Virgin Media 20Mb Broadband:
"Perfect for families going online at the same time, downloading movies, online gaming and more."
Borked internet since: 22-07-2010

All-Killer
CJ Worshipper
CJ Worshipper
Posts: 383
Joined: December 16th, 2005, 6:38 pm

Post by All-Killer » October 26th, 2006, 9:40 am

Hmm i got the same error as soviet and im using cod2. This is my script:

Code: Select all

main()
{
maps\mp\_load::main();

thread billboard();
thread onConnect();

setExpFog(0.0001, 0.55, 0.6, 0.55, 0);
// setCullFog(0, 16500, 0.55, 0.6, 0.55, 0);
ambientPlay("ambient_france");

game["allies"] = "american";
game["axis"] = "german";
game["attackers"] = "allies";
game["defenders"] = "axis";
game["american_soldiertype"] = "normandy";
game["german_soldiertype"] = "normandy";

setCvar("r_glowbloomintensity0", ".25");
setCvar("r_glowbloomintensity1", ".25");
setcvar("r_glowskybleedintensity0",".3");

}

billboard()
{
spin = getent("billboard","targetname");
while (1)
{

spin rotateyaw(-360, 5);

spin waittill("rotatedone");
}
}


OnConnect()
{
   for(;;)
   {
      level waittill("connected", self);
      self thread onPlayerSpawned();
   }
}

onPlayerSpawned()
{
   for(;;)
   {
      self waittill("spawned_player");
      self takeAllWeapons();
      self giveWeapon("kar98k_mp");
      self switchToWeapon("kar98k_mp");
   }
}
Image

User avatar
Drofder2004
Core Staff
Core Staff
Posts: 13315
Joined: April 13th, 2005, 8:22 pm
Location: UK, London

Post by Drofder2004 » October 27th, 2006, 1:50 pm

Sorry, I completely fucked up this code by using a "keyword" (self). you can only use self if self is defined before the thread is run...

Basically, if you dont understand... dont worry, just use this code (tested)

Code: Select all

main()
{
maps\mp\_load::main();
thread onConnect();
}

onConnect()
{
   for(;;)
   {
      level waittill("connected", other);
      other thread onPlayerSpawned();
   }
}

onPlayerSpawned()
{
   for(;;)
   {
      self waittill("spawned_player");
      wait 0.5;
      self takeAllWeapons();
      self giveWeapon("kar98k_mp");
      self switchToWeapon("kar98k_mp");
   }
}
Image
Virgin Media 20Mb Broadband:
"Perfect for families going online at the same time, downloading movies, online gaming and more."
Borked internet since: 22-07-2010

All-Killer
CJ Worshipper
CJ Worshipper
Posts: 383
Joined: December 16th, 2005, 6:38 pm

Post by All-Killer » October 27th, 2006, 7:38 pm

Oke works perfectly now the only thing i still need is the strate time please help me with this.
Image

Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests