Author |
Topic: Bad Syntx |
predieanalien |
General Member Since: Dec 16, 2004 Posts: 19 Last: Apr 27, 2008 [view latest posts] |
|
|
Category: CoD2 Scripting Posted: Tuesday, Jun. 27, 2006 04:20 am |
|
I'm sure this is in the right place so sorry if it isnt, but every time I try to run my map I get a bad syntx error with my script, well the console doesnt say what's wrong with it so I checked like 100 times and still didnt find anything that was wrong with it, so maybe the pros can help out.
Quote:
main()
{
maps\_load::main();
ambientPlay("ambient_town");
obj1();
}
obj1()
{
obj1 = getent("obj1", "targetname"); //Get entity(trigger_multiple) in map
objective_add(1, "active", &"town_OBJ1",getent("obj1",
"targetname").129 -50 50);
objective_current(1);
iprintlnbold (&"town_OBJECTIVES"); //Display objective in obj. list from
string
obj1 waittill("trigger"); //Waits till trigger_multiple is triggered
objective_state(1, "done"); //Objective 1 is done
obj1 delete(); //Delete trigger brush in-game so it will not be re-triggered
wait(2);
thread obj2(); //Move on to next objective
}
obj2()
{
obj2 = getent("obj2", "targetname"); //Get entity(trigger_multiple) in map
objective_add(2, "active", &"town_OBJ2",getent("obj2",
"targetname")-148 82 -228);
objective_current(2);
iprintlnbold (&"town_OBJ2"); //Display objective in obj. list from
string
obj2 waittill("trigger"); //Waits till trigger_multiple is triggered
objective_state(2, "done"); //Objective 1 is done
obj2 delete(); //Delete trigger brush in-game so it will not be re-triggered
wait(2);
}
|
|
|
|
veef |
General Member Since: Apr 25, 2006 Posts: 1258 Last: Aug 29, 2006 [view latest posts] |
|
|
|
predieanalien |
General Member Since: Dec 16, 2004 Posts: 19 Last: Apr 27, 2008 [view latest posts] |
|
|
|
veef |
General Member Since: Apr 25, 2006 Posts: 1258 Last: Aug 29, 2006 [view latest posts] |
|
|
|
predieanalien |
General Member Since: Dec 16, 2004 Posts: 19 Last: Apr 27, 2008 [view latest posts] |
|
|
|
brillo |
General Member Since: May 4, 2006 Posts: 11 Last: Jul 28, 2006 [view latest posts] |
|
|
|
sentchy |
General Member Since: May 6, 2006 Posts: 212 Last: Oct 31, 2006 [view latest posts] |
|
|
Category: CoD2 Scripting Posted: Tuesday, Jun. 27, 2006 11:47 am |
|
As brillo wrote you need to correct the objective_add call in both of the function: obj1 and obj2.
I assume that you placed the trigger_multiple in codradiant at the positon you want them, therefore I migth even take off the coordinates specified in your script, which seem to be leftover from a copy/paste from some other code and not relevant to your map.
I posted the completely corrected script but in essence I changed the objective_add to the correct syntax in both. Since you already have a reference to your objective entity in both functions (obj1 and obj2) you do not need another getent.
o objective_add(1, "active", &"town_OBJ1",obj1.origin);
o objective_add(2, "active", &"town_OBJ2",obj2.origin);
Here is the corrected code:
Code: main()
{
maps\_load::main();
ambientPlay("ambient_town");
obj1();
}
obj1()
{
obj1 = getent("obj1", "targetname"); //Get entity(trigger_multiple) in map
objective_add(1, "active", &"town_OBJ1",obj1.origin);
objective_current(1);
iprintlnbold (&"town_OBJECTIVES"); //Display objective in obj. list from
string
obj1 waittill("trigger"); //Waits till trigger_multiple is triggered
objective_state(1, "done"); //Objective 1 is done
obj1 delete(); //Delete trigger brush in-game so it will not be re-triggered
wait(2);
thread obj2(); //Move on to next objective
}
obj2()
{
obj2 = getent("obj2", "targetname"); //Get entity(trigger_multiple) in map
objective_add(2, "active", &"town_OBJ2",obj2.origin);
objective_current(2);
iprintlnbold (&"town_OBJ2"); //Display objective in obj. list from
string
obj2 waittill("trigger"); //Waits till trigger_multiple is triggered
objective_state(2, "done"); //Objective 1 is done
obj2 delete(); //Delete trigger brush in-game so it will not be re-triggered
wait(2);
}
edited on Jun. 27, 2006 07:48 am by sentchy |
|
|
|
predieanalien |
General Member Since: Dec 16, 2004 Posts: 19 Last: Apr 27, 2008 [view latest posts] |
|
|
|
sentchy |
General Member Since: May 6, 2006 Posts: 212 Last: Oct 31, 2006 [view latest posts] |
|
|
|
veef |
General Member Since: Apr 25, 2006 Posts: 1258 Last: Aug 29, 2006 [view latest posts] |
|
|
Category: CoD2 Scripting Posted: Tuesday, Jun. 27, 2006 11:06 pm |
|
If you type /condump error.txt
in the console it will save the contents to the error.txt in your main directory. That way you can copy/paste instead of screenshots.
Quote: objective_current(2);
iprintlnbold (&"town_OBJ2"); //Display objective in obj. list from
string // the string sentchy mentioned to remove
obj2 waittill("trigger"); //Waits till trigger_multiple is triggered |
|
|
|