PDA

View Full Version : Weird CoD2 Script error/bug



MeGaBooM
10th March 2014, 18:38
Hi,
I get some weird bug when i try testing my map.
This bug happens when i add my ambient sound in the script: ambientPlay("airplane");
If i remove that line, the error still appears and i have to delete that .gsc and add an other .gsc (without the ambientPlay thing)

The error: ******* script compile error *******
bad token 'ï': (file 'maps/mp/mp_plane.gsc', line 1)
main()

Script:

main()
{
maps\mp\_load::main();
thread geilerBebenEffekt();
ambientPlay("ambient_france");




setExpFog(0.0001, 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");
}

geilerBebenEffekt()
{
level endon("endmap");

while(1) { //Endlosschleife, das Script darin wird immer wieder ausgeführt (mit ner unten mit 'wait' angegebenen Wartezeit dazwischen)
wait randomInt(120) + 360; //zuerst mal warten, mindestens 6 Minuten, dazu 0 bis 120 Sekunden zufällige Zeit sodass das erste Beben irgendwann nach 6 bis 8 Minuten kommt
thread machGeilenBebenEffekt(); //gleich geht's um die Wurscht
}
}

machGeilenBebenEffekt()
{
staerke = 1;
dauer = 5;
ausgangspunkt = (0, 0, 0);
radius = 4096;
schwerkraft = getCvar("g_gravity");
setCvar("g_gravity", "200");
earthquake(staerke, dauer, ausgangspunkt, radius); //lass wackeln!
wait dauer;
setCvar("g_gravity", schwerkraft);
}


Maybe the error is somehow in the .csv so i post it here too:

name,sequence,file,vol_min,vol_max,vol_mod,pitch_m in,pitch_max,dist_min,dist_max,channel,type,probab ility,loop,masterslave,loadspec,subtitle,compressi on,secondaryaliasname,volumefalloffcurve,startdela y,speakermap,reverb,lfe percentage


airplane,,ambient/mp_airplane/ambient.mp3,0.63,,,,,,,local,streamed,,looping,,mp _airplane


I already asked some ppl but they have no idea too :/

YuriJurek
10th March 2014, 18:45
Did you maybe script it in WordPad?

By default it saves files in RTF (Rich Text Format) for formatting purposes it does adds some extra formatting information even to .txt files on saving and it causes errors like yours, just use notepad or notepad++ much better.

serthy
10th March 2014, 18:45
there might be an invisible charackter before your main()
delete the first line and write it new
maybe copy'n'paste it to another editor to see them

YuriJurek
10th March 2014, 18:48
More Information just looked up in google some information about WordPad: webdesign.about.com/od/notepad/a/notepad-not-wordpad.htm

MeGaBooM
10th March 2014, 18:54
i use default windows editor not notepad ++

IzNoGoD
10th March 2014, 19:01
did you use notepad ("kladblok" in dutch) or wordpad ("wordpad" in dutch)?

MeGaBooM
10th March 2014, 19:03
in german its "textdokument". i use it and then save as .gsc so i guess its notepad

serthy
10th March 2014, 19:10
in german its "textdokument". i use it and then save as .gsc so i guess its notepad
download either notepad++ or sublime text
you really shouldnt use the default texteditor nor wordpad...
it makes you writing code 10x faster

if you dont: you should prefer wordpad imho

669

MeGaBooM
10th March 2014, 19:11
Just downloaded notepad++, the script works now with ambientPlay, well at least i dont get any errors but ingame theres still no sound :/

MeGaBooM
10th March 2014, 19:32
Well, everything works fine now, BIG THANKS to Pollo and thanks for the ppl who helped here ;)