Game Development Community

Resolved - Need help with nested variable please

by Flybynight Studios · in Torque Game Engine · 07/19/2007 (12:17 am) · 4 replies

%npc[%counter] = new AIPlayer()
		{
			dataBlock = %rr.npcobject;
		}    	
		MissionCleanup.add(%npc[%counter]);
		%npc[%counter].setTransform(%rr.npcloc);
		%npc[%counter].setShapeName(%rr.npcname);

That code should work. it compiles the first line but crashes on the last 3...

I've used nested variables like this many times in teh past. I cant for the life of me figure out whats screwed..

Is it to do with passing the nested var into c++ via the .settransform? or.add?

Pulling my hair out.

Thanks

#1
07/19/2007 (3:36 am)
You're missing a semi-colon at the end of your new aiplayer declaration. It should be

%npc[%counter] = new AIPlayer()
		{
			dataBlock = %rr.npcobject;
		};    	
		MissionCleanup.add(%npc[%counter]);
		%npc[%counter].setTransform(%rr.npcloc);
		%npc[%counter].setShapeName(%rr.npcname);
#2
07/19/2007 (8:12 am)
I swear if thats the problem I'm going to get my son to kick me in the shins.... Checking now. Thanks Andy
#3
07/19/2007 (8:42 am)
Yes I do indeed have sore shins now..

Thank you Andy. Someday I'll actually stop coding when I startfalling asleep at the keyboard :)
#4
07/19/2007 (8:42 am)
Oh I've had more than one problem like that. Sometimes you almost wish it was a complicated solution.