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

Members Online

»
0 Active | 6 Guests
Online:

LATEST FORUM THREADS

»
warfare
CoD4 Map + Mod Releases
Voting menu on maps
CoD+UO General
Hauling 911
CoDBO3 General

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 4
Category: CoD4 SP Mapping
CoD 4 mapping and level design for single player.
Moderators: foyleman, Foxhound, Mystic, StrYdeR, batistablr, Welshy, DrBiggzz, supersword, playername, novemberdobby
Latest Posts
Subscribed Posts
Search
Restricted Access Topic is Locked
Page
Next Page
subscribe
Author Topic: Undefind is not an field object
All-Killer
General Member
Since: May 26, 2006
Posts: 140
Last: Nov 23, 2008
[view latest posts]
Level 4
Category: CoD4 SP Mapping
Posted: Tuesday, Sep. 23, 2008 11:27 am
Because of my other problem couldnt get fixed im trying to get a workaround working.

What i want to do is the following: Add an objective that points to a trigger damage to complete the objective. I used the following code:

Code:

	mggardentrigger = getent ("mggardentrigger","targetname");

mggardentrigger waittill("trigger");

		///Add Objective: Kill MG Gunner///

		mgobjectivetrig = getent ("mgobjectivetrig","targetname");

		objective_add(2, "active", &"SPMAP_OBJ2",getent("mgobjectivetrig","mgobjectivetrig").origin);

		objective_current(2);
		
		iprintlnbold (&"SPMAP_OBJ2"); 
		
		//////////////////////////////////////////////////////////


But when i pass the normal trigger to active this script, i get an error message saying:

Undefined is not an field object: objective_add(2, "active", &"SPMAP_OBJ2",getent("mgobjectivetrig","mgobjectivetrig").origin);

The funny thing is im sure the trigger is in the map, but the error says something different.

Anyone can tackle this one?

Thanks again
Share |
OLD_MAN_WITH_GUN
General Member
Since: May 13, 2006
Posts: 754
Last: Jan 23, 2010
[view latest posts]
Level 7
Category: CoD4 SP Mapping
Posted: Tuesday, Sep. 23, 2008 01:55 pm
objective_add(2, "active", &"SPMAP_OBJ2", mgobjectivetrig.origin);

Should do it.
Share |
All-Killer
General Member
Since: May 26, 2006
Posts: 140
Last: Nov 23, 2008
[view latest posts]
Level 4
Category: CoD4 SP Mapping
Posted: Tuesday, Sep. 23, 2008 02:15 pm
Nope not working. Also i saw i made a typo in my first post, needs to be: objective_add(2, "active", &"SPMAP_OBJ2",getent("mgobjectivetrig","targetname").origin);

Script runs but no golden star so no objective, also nothing when i finish the objective the script doenst run further.


edited on Sep. 23, 2008 10:15 am by All-Killer
Share |
SparkyMcSparks
General Member
Since: Feb 28, 2004
Posts: 1713
Last: Dec 29, 2016
[view latest posts]
Level 8
Im a fan of MODSonair
Category: CoD4 SP Mapping
Posted: Wednesday, Sep. 24, 2008 06:38 am
Try putting iPrintLnBolds in between every line in your script there to narrow it down where the script is getting a progression break at.

If only IW released their scriptDebugger. [ohwell]

EDIT: Looking at your script one more time, did you make sure your trigger has the []AI_AXIS checked in the entity window that way it knows to be triggered by an Axis AI?

edited on Sep. 24, 2008 02:43 am by Sparks.
Share |
All-Killer
General Member
Since: May 26, 2006
Posts: 140
Last: Nov 23, 2008
[view latest posts]
Level 4
Category: CoD4 SP Mapping
Posted: Wednesday, Sep. 24, 2008 01:46 pm
Oke sparks, tested it with the lines. Thats a good tip, need to use that in my own workflow.

Then about that []AI_AXIS, it doenst need to be triggered by an Axis, but by a grenade.

Oke this is the code i used:

Code:

mgobjective()
{
	iprintln ("1");
	
	mgobjectivetrig = getent ("mgobjectivetrig","targetname");	
	
	iprintln ("2");

	objective_add(2, "active", &"SPMAP_OBJ2",getent("mgobjectivetrig","targetname").origin);
	
	iprintln ("3");
		
	objective_current(2);
	
	iprintln ("4");
		
	iprintlnbold (&"SPMAP_OBJ2"); 
	
	iprintln ("5");
		
	mgobjectivetrig waittill("trigger");
	
	iprintln ("6");
	
	objective_state(2, "done");
	
	iprintln ("7");
	
	mgobjectivetrig delete();
	
	iprintln ("8");
	
	objective_current(1);
	
	iprintln ("9");
	
	thread centersquad();
}


The lines get prompt to number 5, and then nothing happens.

Picture of the entity window from the trigger



Any idea's?

edited on Sep. 24, 2008 09:47 am by All-Killer
Share |
babycop
General Member
Since: Feb 18, 2006
Posts: 488
Last: Feb 27, 2010
[view latest posts]
Level 5
Category: CoD4 SP Mapping
Posted: Wednesday, Sep. 24, 2008 02:04 pm
since you've already defined your trigger like this:

Code:
mgobjectivetrig = getent ("mgobjectivetrig","targetname");


you shouldn't be defining it in your objective again:

Code:
objective_add(2, "active", &"SPMAP_OBJ2",getent("mgobjectivetrig","targetname").origin);


instead, try it like this:

Code:
objective_add( 2, "active", &"SPMAP_OBJ2", mgobjectivetrig.origin );
Share |
All-Killer
General Member
Since: May 26, 2006
Posts: 140
Last: Nov 23, 2008
[view latest posts]
Level 4
Category: CoD4 SP Mapping
Posted: Wednesday, Sep. 24, 2008 03:32 pm
Babycop, doenst work for me. Also old man with gun pointed that out, but didnt work. Also calling it up like "my way" works because i already have it that way for another object and that works.
Share |
SparkyMcSparks
General Member
Since: Feb 28, 2004
Posts: 1713
Last: Dec 29, 2016
[view latest posts]
Level 8
Im a fan of MODSonair
Category: CoD4 SP Mapping
Posted: Wednesday, Sep. 24, 2008 09:52 pm
You can try replacing the waittill ( "trigger" ) line with this if there's an actual guy on the MG:

Code:
aiGuy thread magic_bullet_shield();

while( 1 )
{
	aiGuy  waittill ( "damage", damage, attacker, direction_vec, point, type )

	if( ( attacker == level.player ) && ( type == "MOD_EXPLOSIVE" ) )
	{
		aiGuy thread stop_magic_bullet_shield();
		aiGuy delete();
		break;
	}	
	wait ( 0. 2 );
}


edited on Sep. 24, 2008 05:55 pm by Sparks.
Share |
All-Killer
General Member
Since: May 26, 2006
Posts: 140
Last: Nov 23, 2008
[view latest posts]
Level 4
Category: CoD4 SP Mapping
Posted: Friday, Sep. 26, 2008 07:45 am
Going to try that also Sparks. I also had a little chat with babycop and he tested my map on his machine and it just worked. He ran a clean install so i deleted all the custom content, but no succes. Next thing im going to try is a clean install and stay on 1.0 and install the mod tools, and see if that helps.

Will report back soon.
Share |
All-Killer
General Member
Since: May 26, 2006
Posts: 140
Last: Nov 23, 2008
[view latest posts]
Level 4
Category: CoD4 SP Mapping
Posted: Saturday, Sep. 27, 2008 12:37 pm
Reinstalled CoD and tried it again. Good thing is, is that objective star shows up. But still it wont work the way it needs to work.

I first tried my own way again:

Code:

mgobjective()
{
	iprintln ("1");
	
	mgsoldier = getent ("mgsoldier","targetname");
	
	iprintln ("2");

	objective_add(2, "active", &"SPMAP_OBJ2",mgsoldier.origin);
	
	iprintln ("3");
		
	objective_current(2);
	
	iprintln ("4");
		
	iprintlnbold (&"SPMAP_OBJ2"); 
	
	iprintln ("5");

        mgsoldier waittill("death");
	
	iprintln ("6");
	
	objective_state(2, "done");
	
	iprintln ("7");
	
	objective_current(1);
	
	iprintln ("8");
	
	thread centersquad();
}


But no succes. Got the problem explained above. Then i tried your code:

Code:

mgobjective()
{
	iprintln ("1");	
	mgsoldier = getent ("mgsoldier","targetname");
	
	iprintln ("2");

	objective_add(2, "active", &"SPMAP_OBJ2",mgsoldier.origin);
	
	iprintln ("3");
		
	objective_current(2);
	
	iprintln ("4");
		
	iprintlnbold (&"SPMAP_OBJ2"); 
	
	iprintln ("5");

	mgsoldier thread magic_bullet_shield();

	while( 1 )
	{
		mgsoldier  waittill ( "damage", damage, attacker, direction_vec, point, type );

		if( ( attacker == level.player ) && ( type == "MOD_EXPLOSIVE" ) )
		{
			mgsoldier thread stop_magic_bullet_shield();
			mgsoldier delete();
			break;
		}	
		wait ( 0.2 );
	}
	
	iprintln ("6");
	
	objective_state(2, "done");
	
	iprintln ("7");
	
	objective_current(1);
	
	iprintln ("8");
	
	thread centersquad();
}


And that also didnt work. In both problems it only prompts till 5 again, so the waittill is still beeing the problem. Any more idea's?
Share |
Restricted Access Topic is Locked
Page
Next Page
subscribe
MODSonline.com Forums : Call of Duty 4 : CoD4 SP Mapping

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

»