timmiej93 Posted July 28, 2014 Report Share Posted July 28, 2014 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++) } Quote Link to comment Share on other sites More sharing options...
Chris07 Posted July 29, 2014 Report Share Posted July 29, 2014 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 OR2. 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++) {} Quote Link to comment Share on other sites More sharing options...
timmiej93 Posted July 29, 2014 Author Report Share Posted July 29, 2014 Ohhh, I totally missed those. I copied over this part of the script, must've missed those. Thanks for showing me! Quote Link to comment Share on other sites More sharing options...