DAMN SCRIPTING

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

Moderator: Core Staff

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

DAMN SCRIPTING

Post by Soviet » September 4th, 2006, 8:27 am

k, now that i got the caps out of me lets begin. I have been adding more scripting to my map. Right now i have a few .gsc files, and am getting scripting errors on the first lines of my main .gsc file, so ill just post that one first.

Code: Select all

main()
{
maps\mp\_load::main();
maps\mp\elevator::main();
maps\mp\elevator_start::main();
maps\mp\message::main();
maps\mp\svt_teleporter::main();

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");

}
//////////////////////////////////////////////////////
message()
{
trig = getent("ks_message","targetname");
while(1)
{
    trig waittill("trigger");
    iprintlnbold ("text");
    wait 2;
    iprintlnbold ("text");
    wait 8;
}
}
it is having trouble with the loading other .gsc files lines at the very beginning...

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

Post by Drofder2004 » September 4th, 2006, 10:13 am

/developer 1 and give us the exact error (screen it if you wish)
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

creator
CJ Worshipper
CJ Worshipper
Posts: 492
Joined: July 6th, 2006, 11:37 pm
Location: The Netherlands
Contact:

Post by creator » September 4th, 2006, 4:13 pm

dont know if its me and i dont know if its drofder thats blind (sorry :P ) but u got no thread

Code: Select all

thread message();
and the code

Code: Select all

setCvar("r_glowbloomintensity0", ".25");
setCvar("r_glowbloomintensity1", ".25");
setcvar("r_glowskybleedintensity0",".3"); 
never been tested so that might be the error (atleast i never saw anyone test it succes fully)
edit:

Code: Select all

maps\mp\message::main();
that and those others of maps\mp\ are only used if u got multiple scripts that are located in ur maps "maps\mp"
Cod 1 Mapper&Modder&Moddeler

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

Post by Soviet » September 4th, 2006, 4:51 pm

heres your error drofder:

Image

and here is the updated script according to creator's standards. For the record i have two other .gsc files in my call of duty 2\main\maps\mp folder, one is named elevator.gsc and the other is named svt_teleporter.gsc

Code: Select all

main()
{
maps\mp\_load::main();
maps\mp\elevator::main();
maps\mp\svt_teleporter::main();
thread message();

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";

}
//////////////////////////////////////////////////////
message()
{
trig = getent("ks_message","targetname");
while(1)
{
    trig waittill("trigger");
    iprintlnbold ("text");
    wait 2;
    iprintlnbold ("text");
    wait 8;
}
}

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

Post by Drofder2004 » September 4th, 2006, 6:31 pm

At a guess your elevator script has the problem.

Does elevator.gsc have a "main()"?
If so, can you post the entire gsc up?
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

creator
CJ Worshipper
CJ Worshipper
Posts: 492
Joined: July 6th, 2006, 11:37 pm
Location: The Netherlands
Contact:

Post by creator » September 4th, 2006, 6:34 pm

yeh must be the elevator script for giving the error post it :P (dunno why i wrote this here )
Last edited by creator on September 4th, 2006, 8:52 pm, edited 1 time in total.
Cod 1 Mapper&Modder&Moddeler

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

Post by Soviet » September 4th, 2006, 7:04 pm

excellent, i fixed the main on my two scripts and now the map loads....but my message script doesn't work, its in my main .gsc, am i not referencing it properly?

Code: Select all

main()
{
maps\mp\_load::main();
maps\mp\elevator::main();
maps\mp\svt_teleporter::main();
thread message();

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";

}
//////////////////////////////////////////////////////
message()
{
trig = getent("ks_message","targetname");
while(1)
{
    trig waittill("trigger");
    iprintlnbold ("text");
    wait 2;
    iprintlnbold ("text");
    wait 8;
}
}
oh and creator, your avatar explains why you posted that

creator
CJ Worshipper
CJ Worshipper
Posts: 492
Joined: July 6th, 2006, 11:37 pm
Location: The Netherlands
Contact:

Post by creator » September 4th, 2006, 8:30 pm

lol :P
Soviet wrote:trig waittill("trigger");
first check if its a triggermultiple and it has the targetname (Some times it be a worldspawn again)

Code: Select all

trig waittill ("trigger",user);
so only the user see it

Code: Select all

message()
{ 
trig = getent ("ks_message","targetname");

while (1)
{
trig waittill ("trigger",user);
iprintln("text");
wait 2;
iprintln("text");
}
}
problem might be:

Code: Select all

waittill( 
think it should be

Code: Select all

waittill (
Cod 1 Mapper&Modder&Moddeler

Luke
Past/Inactive Team Member
Past/Inactive Team Member
Posts: 1774
Joined: May 31st, 2005, 12:42 am
Location: Cornwall, UK

Post by Luke » September 4th, 2006, 8:47 pm

What is it with you and trigger_multiple's? :P

Sorry not sure why its stopped working, from looking at that.
Watch this before posting a question: http://www.albinoblacksheep.com/flash/posting.php

creator
CJ Worshipper
CJ Worshipper
Posts: 492
Joined: July 6th, 2006, 11:37 pm
Location: The Netherlands
Contact:

Post by creator » September 4th, 2006, 8:49 pm

lol i like the name :P and it might be the waittill( , my script works 100% so.. if it doesnt its a map or other script problem :wink:
Cod 1 Mapper&Modder&Moddeler

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

Post by Soviet » September 4th, 2006, 10:11 pm

i think i know whats causing it now. Both my elevator and my message script arent working, they havent been working since i got the teleport script working. So for some reason the teleport script is disabling the other two....or something of the sort. Here are all my scripts:

Main Script:

Code: Select all

main()
{
maps\mp\_load::main();
maps\mp\elevator::main();
maps\mp\svt_teleporter::main();
maps\mp\svt_message_1::main();

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"] = "russian";
game["axis"] = "german";
game["attackers"] = "allies";
game["defenders"] = "axis";
game["american_soldiertype"] = "normandy";
game["german_soldiertype"] = "normandy";

}
Elevator

Code: Select all

main()
{ 
level.elevatorDown = true; // elevator starts at bottom: true/false 
level.elevatorMoving = false; // elevator is not currently moving  
} 

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 moveZ (-1520,6,1,1); 
elevatormodel waittill ("movedone"); 
level.elevatorDown = false; 
wait (5);
elevatormodel moveZ (1520,6,1,1); 
elevatormodel waittill ("movedone"); 
level.elevatorDown = true; 
} 
level.elevatorMoving = false; 
} 
Svt_Teleporter

Code: Select all

main()
{
   while(1)
   {
      players = getentarray("player", "classname");

      for(i=0;i<players.size;i++)
      {
         finishtrig = getent ("teleport_entrance","targetname");
         finishtrig waittill ("trigger",user);

      user setOrigin( (272,-3504,888) );

      }
   wait .5;
   }
}
Svt_Message_1

Code: Select all

main()
{
trig = getent("ks_message","targetname");
while(1)
{
    trig waittill("trigger");
    iprintlnbold ("text");
    wait 2;
    iprintlnbold ("text");
    wait 8;
}
}
and yes, the trigger multiple is still a trigger multiple

Luke
Past/Inactive Team Member
Past/Inactive Team Member
Posts: 1774
Joined: May 31st, 2005, 12:42 am
Location: Cornwall, UK

Post by Luke » September 4th, 2006, 10:54 pm

Well i would do it like this for the elevator gsc

Code: Select all

main()
{
thread elevator_start();
}

elevator_start() 
{
level.elevatorDown = true; // elevator starts at bottom: true/false
level.elevatorMoving = false; // elevator is not currently moving 
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 moveZ (-1520,6,1,1);
elevatormodel waittill ("movedone");
level.elevatorDown = false;
wait (5);
elevatormodel moveZ (1520,6,1,1);
elevatormodel waittill ("movedone");
level.elevatorDown = true;
}
level.elevatorMoving = false;
}
for the message gsc

Code: Select all

main()
{
thread message();
}

message()
{
trig = getent("ks_message","targetname");
while(1)
{
    trig waittill("trigger");
    iprintlnbold ("text");
    wait 2;
    iprintlnbold ("text");
    wait 8;
}
}
Failing that, wait for you know who :P
Watch this before posting a question: http://www.albinoblacksheep.com/flash/posting.php

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

Post by Drofder2004 » September 4th, 2006, 11:51 pm

Nothing looks wrong but I only had a 30 second sweep of it. I sugest renaming the gsc as "elevator" will more than likely be in another map.
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 » September 5th, 2006, 3:08 am

i did what both of you suggested and now the elevator script works, but the message script still isnt working.

creator
CJ Worshipper
CJ Worshipper
Posts: 492
Joined: July 6th, 2006, 11:37 pm
Location: The Netherlands
Contact:

Post by creator » September 5th, 2006, 11:31 am

try my message script tested it and works check if ur trigger multiple or use are still trigger multiple or use
Cod 1 Mapper&Modder&Moddeler

Locked

Who is online

Users browsing this forum: Bing [Bot] and 1 guest