Jump to content
timmiej93

Too many "}" error for almost every line

Recommended Posts

Hey guys,

 

I'm getting the Too many "}" error on pretty much every } in my script, very weird. 

Below you'll find the log and then the lines affected. Lines 1727 and 1737 are those where the If statement ends, after "for(int i=0; i < l2.GetNumObjects(); i++)"

 

How can this be fixed? I've checked, but there doesn't seem to be a syntax problem anywhere.

?(_LAFireStation8b7da): Error: Too many '}'?(_LAFireStation8b7da):  FILE:mod:/scripts/game/command/LAFireStation.script8b7da LINE:1727?(_LAFireStation8b7da): !!!Dictionary position rewound... ?(_LAFireStation8b7da): !!!Error recovered!!!?(_LAFireStation8b7da): Error: Too many '}'?(_LAFireStation8b7da):  FILE:mod:/scripts/game/command/LAFireStation.script8b7da LINE:1727?(_LAFireStation8b7da): !!!Dictionary position rewound... ?(_LAFireStation8b7da): !!!Error recovered!!!?(_LAFireStation8b7da): Error: Too many '}'?(_LAFireStation8b7da):  FILE:mod:/scripts/game/command/LAFireStation.script8b7da LINE:1737?(_LAFireStation8b7da): !!!Dictionary position rewound... ?(_LAFireStation8b7da): !!!Error recovered!!!
		else if(v.IsCollidingWithVirtualObject(VO_SQUAD02_PD))		{			ActorList l1 = Game::GetActors(VO_SPAWN_BACK);			if(l1.GetNumActors() > 0)			{				Vector Spawn = l1.GetActor(0)->GetPosition();			}			GameObjectList l2 = Game::GetGameObjects(NAME_POLICESTATION);			for(int i=0; i < l2.GetNumObjects(); i++)		}		else if(v.IsCollidingWithVirtualObject(VO_SQUAD03_PD))		{			ActorList l1 = Game::GetActors(VO_SPAWN_DONUT);			if(l1.GetNumActors() > 0)			{				Vector Spawn = l1.GetActor(0)->GetPosition();			}			GameObjectList l2 = Game::GetGameObjects(NAME_POLICESTATION);			for(int i=0; i < l2.GetNumObjects(); i++)		} 
Link to comment
Share on other sites

Your for() loops are empty! Why are you using them??

 

The error is probably because the for() loops think the closing bracket "}" belongs to it.

 

Fix:

1. Remove the for loop OR

2. add braces to it:

for(int i=0; i < l2.GetNumObjects(); i++){//logic here}

or if you insist of having an empty loop (why?)

for(int i=0; i < l2.GetNumObjects(); i++) {}
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...