Page 1 of 1

script compile error.

Posted: November 1st, 2008, 9:58 am
by zipperdude
I launch my map, and it tells me in develepor "unexpected end of file line 30"
I cant figure out what this means. Here is my code please take a lok at it:

Code: Select all

main()
{
	thread barrel();
}
barrel()
{
	trig = getent("barrel_trigger","targetname");
	block = getent ("barrel","targetname");
	so = getent ("barrel_so","targetname");
	ex = getent("barrel_go","targetname");

	boom_s = loadfx("sound/Explosions/Explo_metal01.wav");
	boom = loadfx("fx/explosion/flakkcannon_exploder.efx");
	while (1)
	{
	trig waittill("trigger");
	{
		playfx(boom, so.origin);
		playsound(boom_s, ex.origin);
		block moveZ (400, 1, 0, 1);
		block waittill ("movedone");
		wait 0.05;
		block moveZ (-400, 1, 1, 0);
		block waittill ("movedone");
		block movez (8, .05, 0, 0);
		block waittill ("movedone");
		block movez (-8, .05, 0, 0);
		block waittill ("movedone");
	}
}

I also think i did the "boom_s = loadfx("sound/Explosions/Explo_metal01.wav");" wrong too ifso please let me know how i have no idea. Ive looked at nm_train and still cant figure it out :P

Re: script compile error.

Posted: November 1st, 2008, 8:11 pm
by Nightmare

Code: Select all

main()
{
   thread barrel();
}
barrel()
{
   trig = getent("barrel_trigger","targetname");
   block = getent ("barrel","targetname");
   so = getent ("barrel_so","targetname");
   ex = getent("barrel_go","targetname");

   boom_s = loadfx("sound/Explosions/Explo_metal01.wav");
   boom = loadfx("fx/explosion/flakkcannon_exploder.efx");
   while (1)
   {
   trig waittill("trigger");
   {
      playfx(boom, so.origin);
      playsound(boom_s, ex.origin);
      block moveZ (400, 1, 0, 1);
      block waittill ("movedone");
      wait 0.05;
      block moveZ (-400, 1, 1, 0);
      block waittill ("movedone");
      block movez (8, .05, 0, 0);
      block waittill ("movedone");
      block movez (-8, .05, 0, 0);
      block waittill ("movedone");
   }
   }
}
Don't forget to make sure you have an equal amount of { as }.
Also: I hope you will be changing those targetnames.

Re: script compile error.

Posted: November 1st, 2008, 8:19 pm
by zipperdude
Ya idk if ill use it in a map im just doing it because im bored lol. but i have an idea in a map im making taht could use these.

What would happen if i dont?.... Are you gunna give me a lower score on my map? lol