Page 1 of 2

DAMN SCRIPTING

Posted: September 4th, 2006, 8:27 am
by Soviet
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...

Posted: September 4th, 2006, 10:13 am
by Drofder2004
/developer 1 and give us the exact error (screen it if you wish)

Posted: September 4th, 2006, 4:13 pm
by creator
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"

Posted: September 4th, 2006, 4:51 pm
by Soviet
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;
}
}

Posted: September 4th, 2006, 6:31 pm
by Drofder2004
At a guess your elevator script has the problem.

Does elevator.gsc have a "main()"?
If so, can you post the entire gsc up?

Posted: September 4th, 2006, 6:34 pm
by creator
yeh must be the elevator script for giving the error post it :P (dunno why i wrote this here )

Posted: September 4th, 2006, 7:04 pm
by Soviet
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

Posted: September 4th, 2006, 8:30 pm
by creator
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 (

Posted: September 4th, 2006, 8:47 pm
by Luke
What is it with you and trigger_multiple's? :P

Sorry not sure why its stopped working, from looking at that.

Posted: September 4th, 2006, 8:49 pm
by creator
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:

Posted: September 4th, 2006, 10:11 pm
by Soviet
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

Posted: September 4th, 2006, 10:54 pm
by Luke
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

Posted: September 4th, 2006, 11:51 pm
by Drofder2004
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.

Posted: September 5th, 2006, 3:08 am
by Soviet
i did what both of you suggested and now the elevator script works, but the message script still isnt working.

Posted: September 5th, 2006, 11:31 am
by creator
try my message script tested it and works check if ur trigger multiple or use are still trigger multiple or use