Login x
User Name:
Password:
Social Links Facebook Twitter YouTube Steam RSS News Feeds

Members Online

»
0 Active | 30 Guests
Online:

LATEST FORUM THREADS

»
CoD: Battle Royale
CoD+UO Map + Mod Releases
Damaged .pk3's
CoD Mapping
heli to attack ai
CoD4 SP Mapping

Forums

»

Welcome to the MODSonline.com forums. Looking for Frequently Asked Questions? Check out our FAQs section or search it out using the SEARCH link below. If you are new here, you may want to check out our rules and this great user's guide to the forums and the website.
For more mapping and modding information, see our Wiki: MODSonWiki.com

Jump To:
Forum: All Forums : Call of Duty 2
Category: CoD2 Scripting
Scripting and coding with Call of Duty 2.
Moderators: foyleman, Foxhound, Mystic, StrYdeR, batistablr, Welshy, DrBiggzz, supersword, playername
Latest Posts
Subscribed Posts
Search
Restricted Access Topic is Locked subscribe
Author Topic: Bad Syntx
predieanalien
General Member
Since: Dec 16, 2004
Posts: 19
Last: Apr 27, 2008
[view latest posts]
Level 1
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);

}

Share |
veef
General Member
Since: Apr 25, 2006
Posts: 1258
Last: Aug 29, 2006
[view latest posts]
Level 8
Category: CoD2 Scripting
Posted: Tuesday, Jun. 27, 2006 04:29 am
Before you start your map type /set developer 1 in the console and paste the error here.
Share |
predieanalien
General Member
Since: Dec 16, 2004
Posts: 19
Last: Apr 27, 2008
[view latest posts]
Level 1
Category: CoD2 Scripting
Posted: Tuesday, Jun. 27, 2006 04:44 am


there you go
Share |
veef
General Member
Since: Apr 25, 2006
Posts: 1258
Last: Aug 29, 2006
[view latest posts]
Level 8
Category: CoD2 Scripting
Posted: Tuesday, Jun. 27, 2006 05:11 am
You have a left over period in this line objective_add(1, "active", &"town_OBJ1",getent("obj1","targetname").129 -50 50); where you changed it from .origin I would think that it would not work without .origin but i'm sure you will let me know.
Share |
predieanalien
General Member
Since: Dec 16, 2004
Posts: 19
Last: Apr 27, 2008
[view latest posts]
Level 1
Category: CoD2 Scripting
Posted: Tuesday, Jun. 27, 2006 07:56 am
I removed the preiod and I still have the problem.
Share |
brillo
General Member
Since: May 4, 2006
Posts: 11
Last: Jul 28, 2006
[view latest posts]
Level 1
Category: CoD2 Scripting
Posted: Tuesday, Jun. 27, 2006 11:37 am
I think it must like this:

obj1 = getent("obj1","targetname");
obj1.origin = (129, -50, 50);
objective_add(1, "active", &"town_OBJ1",obj1.origin);
Share |
sentchy
General Member
Since: May 6, 2006
Posts: 212
Last: Oct 31, 2006
[view latest posts]
Level 4
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
Share |
predieanalien
General Member
Since: Dec 16, 2004
Posts: 19
Last: Apr 27, 2008
[view latest posts]
Level 1
Category: CoD2 Scripting
Posted: Tuesday, Jun. 27, 2006 05:58 pm
I used your script sentchy but now I get a error new error, something is wrong with this

Quote:

obj1 waittill("trigger"); //Waits till trigger_multiple is triggered




edited on Jun. 27, 2006 02:01 pm by predieanalien
Share |
sentchy
General Member
Since: May 6, 2006
Posts: 212
Last: Oct 31, 2006
[view latest posts]
Level 4
Category: CoD2 Scripting
Posted: Tuesday, Jun. 27, 2006 10:36 pm
Some of the copy/paste let the word "string" slide to the next line off the comment line.

Delete the line "string" before the "obj1 waittill" and "obj2 waittill" lines.

Let me know if you understand.

edited on Jun. 27, 2006 06:37 pm by sentchy
Share |
veef
General Member
Since: Apr 25, 2006
Posts: 1258
Last: Aug 29, 2006
[view latest posts]
Level 8
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. [wink]
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
Share |
Restricted Access Topic is Locked subscribe
MODSonline.com Forums : Call of Duty 2 : CoD2 Scripting

Latest Syndicated News

»
Codutility.com up and runn...
Nice, and there still using the logo and template for the screenshots, which...
Codutility.com up and runn...
dundy writes...Quote:Call of Duty modding and mapping is barly alive only a ...
Codutility.com up and runn...
Mystic writes...Quote:It seems to me the like the site is completely dead? ...
Codutility.com up and runn...
It seems to me the like the site is completely dead?

Partners & Friends

»