PDA

View Full Version : Need help, Noob is failing with script..



Sexual-Healing
13th November 2012, 17:59
Okay so might seem a bit rude creating an account on here to ask 1 question but please forgive me.

Okay so i have been following a tutorial thats in a different language, and im english, so i am using google translator. I followed it fine and made the gsc, and everything in radiant as it said etc etc.. but the map gets "Bad Syntax" compile script error when i try to play it. I know what this error means, somthing wrong with one of the gsc's but becuase the tutorial i followed was in another language maybe i did something wrong, well here are the main, and secret.gsc's maybe someone can help me and i will be thankful for ever :confused: :cool: :rolleyes:

Main.gsc

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



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





}

Secret.gsc

main ()
{

secret thread ();

}

secret ()
{
fall = getent ("fall", "targetname");
trig = getent ("geheim_trig", "targetname");

while (true)
{
trig wait till ("trigger", user);

if ((user.name == "Jim") | | (user.name == "Terry") | | (user.name == "bob"))
{
fall notsolid ();
}
else
{
fall solid ();
}
}
}

KillerBoB
13th November 2012, 18:50
euhm in your secret gsc why not just do:

main ()
{
fall = getent ("fall", "targetname");
trig = getent ("geheim_trig", "targetname");

while (true)
{
trig wait till ("trigger", user);

if ((user.name == "Jim") | | (user.name == "Terry") | | (user.name == "bob"))
{
fall notsolid ();
}
else
{
fall solid ();
}
}
}

Sexual-Healing
13th November 2012, 18:59
Yes it did seem odd to do so as pictured, but i was following a tutorial word for word, i shall re do script and see if this fixes the problem, Thanks Alot for your time (: !

Sexual-Healing
13th November 2012, 19:05
Okay so i changed the gsc, im still getting script compile error bad syntax :confused:

kung foo man
13th November 2012, 19:20
try it this way (and please notice the
for your next source, so other ppl can read it better)

fixed around 4 errors and the indention:



main()
{
thread secret();
}

secret()
{
fall = getent("fall", "targetname");
trig = getent("geheim_trig", "targetname");
while (true)
{
trig waittill("trigger", user);
if ((user.name == "Jim") || (user.name == "Terry") || (user.name == "bob"))
{
fall notsolid ();
} else {
fall solid ();
}
}
}

Sexual-Healing
13th November 2012, 19:28
Thank you, and i am new, and wasnt sure which button allowed code.. i will rember next time for sure. This made it work, i owe you guys a bunch for even taking the time to read this thread (: thanks again!

kung foo man
13th November 2012, 19:31
You are welcome :)