Jump to content


Photo

Error: Symbol <NAME> is not defined in current scope


  • Please log in to reply
22 replies to this topic

#21 timmiej93

timmiej93

    Captain

  • Members
  • 206 posts
  • Gender:Male
  • Location:Netherlands

Posted 30 July 2014 - 02:14 AM

I'm not quite sure I get it right now. You are looking in the script that uses L99 till L96, and not the one with 4 times L99 right?

 

Should it look like this then?

			else if(StrCompare(v.GetPrototypeFileName(), OBJ_CRUISER04) == 0)
			{
				GameObjectlist l97
				Game::CollectObstaclesOnVirtualObject(VO_BACK01, l97, ACTOR_VEHICLE);
				if(l97.GetNumObjects() > 0)
				{
					Game::CollectObstaclesOnVirtualObject(VO_BACK02, l99, ACTOR_VEHICLE);
					if(l99.GetNumObjects() > 0)
					{
						v.PushActionExecuteCommand(ACTION_NEWLIST, CMD_PATROL, Caller, 0, false);
						return;
					}
					else
					{
						ActorList l1 = Game::GetActors(VO_TT_BACK02);
						ActorList l2 = Game::GetActors(VO_BACK02);
					}
				}
				else
				{
					ActorList l1 = Game::GetActors(VO_TT_BACK01);
					ActorList l2 = Game::GetActors(VO_BACK01);
				}	
			} else
			{
				Mission::PlayHint(HINT_NOTVALID);
				return;
			}


#22 Chris07

Chris07

    Senior Captain

  • Member
  • 292 posts
  • Gender:Male
  • Location:Los Angeles, CA, USA
  • Interests:Medicine & Computer Science...what a combo!

Posted 30 July 2014 - 02:28 AM

I was talking about lines 243-266

Yours will not work because in the post above, l99 is not initialized, only l97 is.

                        else if(StrCompare(v.GetPrototypeFileName(), OBJ_CRUISER04) == 0)
			{
				GameObjectlist l99;
				Game::CollectObstaclesOnVirtualObject(VO_BACK01, l99, ACTOR_VEHICLE);
				if(l99.GetNumObjects() > 0)
				{
					Game::CollectObstaclesOnVirtualObject(VO_BACK02, l99, ACTOR_VEHICLE); //Reuse l99, no need for a new variable
					if(l99.GetNumObjects() > 0)
					{
						v.PushActionExecuteCommand(ACTION_NEWLIST, CMD_PATROL, Caller, 0, false);
						return;
					}
					else
					{
						ActorList l1 = Game::GetActors(VO_TT_BACK02);
						ActorList l2 = Game::GetActors(VO_BACK02);
					}
				}
				else
				{
					ActorList l1 = Game::GetActors(VO_TT_BACK01);
					ActorList l2 = Game::GetActors(VO_BACK01);
				}	
			} else
			{
				Mission::PlayHint(HINT_NOTVALID);
				return;
			}


#23 timmiej93

timmiej93

    Captain

  • Members
  • 206 posts
  • Gender:Male
  • Location:Netherlands

Posted 30 July 2014 - 11:19 AM

Aha. After correcting everything, the cruiser no longer gives an error, but gives the same result as the VAN and SUV, saying L1 == 0, L2 is good.

 

Edit: Something I just noticed, when I get the L1==0 and L2 is good, the vehicles don't move, but the biggest thing: The bluelights stay on. This must have a hint in it somewhere, but I can't figure out how.

 

Edit2: Never mind that dumb notice, that's just a scripting error on my behalf  :laugh:

 

Another thing I found:

The to policestation script has a command to set Priority to 110 when transporting criminals, and set it to 0 when not. This should't have anything to do with it, but it raised my suspicion. 

 

 

 

------------------

 

Allright, so I've made some changes to the script to test some things, like changing l1 and l2 to l11 and l12, since l1 was already in use.

 

Here's the new version: Click, or below.

 

Spoiler

 

 

Of course, with new scripting, there's new errors:

?(_LAToPoliceStationa8392): Error: Symbol l11 is not defined in current scope 
?(_LAToPoliceStationa8392):  FILE:mod:/scripts/game/command/LAToPoliceStation.scripta8392 LINE:297
?(_LAToPoliceStationa8392): Error: Failed to evaluate l11.GetNumActors()
?(_LAToPoliceStationa8392): Possible candidates are...
?(_LAToPoliceStationa8392): filename       line:size busy function type and name  

I don't get why symbol l11 wouldn't be defined at that point.. any idea's?

 

 

 

---------------------

 

 

Breaktrough!

 

The CRUISER01 just parked, in its own parking space, saying l1 and l2 are good! Going to check what's going on!

 

Edit:

 

Well, I'm really stumped.

CRUISER01 works fine, every single time, parks like a charm, but the VAN, SUV and CRUISER04 just don't work. They still give an L11 error.

The only difference between those point that I can think of, is that the turnto vo's of the CRUISER01 are outside of the "squad" VO that is used in the PSStart script, and the turnto vo's of the other cars are inside their own squad vo.

Could this be of any influence? I can barely imagine that it would be, but it's all I can think of.

 

Edit2:

So I just ran a test.. That's the problem. The turnto VO's inside the other VO.

Not very logical, since the logic states 'more than 0'. Two is more then zero right?

But at least I know how to fix it now. Thank god.

 

----------------------

 

Alright, some final questions so I can finish this:

 

v.PushActionExecuteCommand(ACTION_APPEND, CMD_TOPOLICESTATION, Caller, 1, false);
 
Above statement should direct to the command ToPoliceStation, ChildID==1 right?