Jump to content
pcc

Error in expression <};>

Recommended Posts

I'm getting these errors after adding if (Count _sites < 1) then {...}; in Commander_UpdateBase.sqs.

Error in expression <};>
  Error position: <};>
  Error Missing {

But it's not missing the brackets.

if (Count _sites < 1) then {
			_sites Set[_positionSlot,true]
			_script = _scripts Select _type
			[_type,_side,_position,_directions Select _positionSlot,true] ExecVM (corePath + Format["Server\Construction\Construction_%1.sqf",_script])
			[_type,_side,_position,_directions Select _positionSlot,true] ExecVM (corePath + Format["Server\Construction\Construction_%1.sqf",_script])
			};

What's wrong with the syntax? 

Share this post


Link to post
Share on other sites

SQS ??? As far as I know its has a complete different syntax than SQF. But I forgot nearly all about SQS ... It is so obsolete

 

Edit:

Those errors about brackets dont need to originate near the position given by the error message. You should check the whole script for missing brackets.

Edited by sarogahtyp

Share this post


Link to post
Share on other sites

If I were doing it, and it may not be the cause of the error, I'd prefer

[_type,_side,_position,_directions Select _positionSlot,true] ExecVM (Format["%1\Server\Construction\Construction_%2.sqf",corepath,_script])

 

Also, I'd diag_log the string you're ExecVM'ing to make sure it is formatting correctly

Share this post


Link to post
Share on other sites

It's from warfare module.  I want it to build the structure twice.  If I run it without the if statement no error, but with if statement it complains.

_sites Set[_positionSlot,true]
_script = _scripts Select _type
[_type,_side,_position,_directions Select _positionSlot,true] ExecVM (corePath + Format["Server\Construction\Construction_%1.sqf",_script])
[_type,_side,_position,_directions Select _positionSlot,true] ExecVM (corePath + Format["Server\Construction\Construction_%1.sqf",_script])

No error.

if (Count _sites < 1) then {
	_sites Set[_positionSlot,true]
	_script = _scripts Select _type
	[_type,_side,_position,_directions Select _positionSlot,true] ExecVM (corePath + Format["Server\Construction\Construction_%1.sqf",_script])
	[_type,_side,_position,_directions Select _positionSlot,true] ExecVM (corePath + Format["Server\Construction\Construction_%1.sqf",_script])
			};

Error.

Share this post


Link to post
Share on other sites

show us what _sites is pls... maybe it is not an array at the time you check with the if statement?

Share this post


Link to post
Share on other sites

Tried to post the .sqs file but its too long.  But yea, that's probably it.  _sites was an array.   Should be counting object instead.

Got a semi workaround but sometimes structures is still built 3 times instead of twice, but at least no errors.

_sites Set[_positionSlot,true]
			_script = _scripts Select _type
			[_type,_side,_position,_directions Select _positionSlot,true] ExecVM (corePath + Format["Server\Construction\Construction_%1.sqf",_script])
			_objects = NearestObjects[_position,["house"],15]
			if (Count _objects > 2) then {Goto "UpdateDefenses"};
			[_type,_side,_position,_directions Select _positionSlot,true] ExecVM (corePath + Format["Server\Construction\Construction_%1.sqf",_script])

Share this post


Link to post
Share on other sites

I think there's some issues if you're using sqs, instead of sqf:

The control structures listed in the article Control Structures may also be used in SQS syntax. Note that they must be written within a single line...

 

So, if you are using an sqs script to call the sqf script via ExecVM, try following the rules for sqs posted here

Share this post


Link to post
Share on other sites

The original error Error in expression <};> probably was reporting on the semicolon at the end of the if--then.  SQS uses keyboard returns to end a line.  Semicolon is a comment in SQS and goes at the beginning of a line.

 

Also _positionSlot and _position might be an issue.  There's a server base setup script (can't recall the name) that designates slots.  There are only so many slots for structures and defenses.  It can be brought into the mission folder to add more and reconfigure positions, you would have to calculate different distances from base center for each structure and defense to be set up.  Somewhere in its routine the server Init identifies the setup script.

  • Like 1

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

×