Jump to content

Recommended Posts

I've been editing my scripts in mission.sqm, seeing how they were getting pretty messy in the in-editor initialisation fields - but now when I try to load the mission in the editor, I get the following error:

t0n9rr.jpg

Can anyone help me with this? Is it that in the editor I shouldn't use Enter but something else? I'm editing in Notepad++, in case this helps.

 

Here's the code in question:

init="this addEventHandler [""fired"",
	{apc1 removeAllEventHandlers ""fired"";
	[] spawn {
		sleep 3; 
		task2a = player_a createSimpleTask [""Destroy the APC""];
		task2b = player_b createSimpleTask [""Destroy the APC""];
		task2c = player_c createSimpleTask [""Destroy the APC""];								
		task2d = player_d createSimpleTask [""Destroy the APC""];								
		task2e = player_e createSimpleTask [""Destroy the APC""];								
		task2f = player_f createSimpleTask [""Destroy the APC""];																
		{_x setSimpleTaskDestination (getPos apc1)} forEach [task2a, task2b, task2c, task2d, task2e, task2f];   
		player groupChat ""Are they heading for the airbase?"";
		taskHint [""Destroy the APC"", [1, 1, 1, 1], ""taskNew""];
		}
	}   
];";

Share this post


Link to post
Share on other sites

You're missing a bracket...

 

init="this addEventHandler [""fired""],

 

and maybe comma should be semicolon?

 

this doesn't look right either:

 

];";

 

Perhaps this is correct?

init="this addEventHandler [""fired""]";
	{apc1 removeAllEventHandlers ""fired"";
	[] spawn {
		sleep 3; 
		task2a = player_a createSimpleTask [""Destroy the APC""];
		task2b = player_b createSimpleTask [""Destroy the APC""];
		task2c = player_c createSimpleTask [""Destroy the APC""];								
		task2d = player_d createSimpleTask [""Destroy the APC""];								
		task2e = player_e createSimpleTask [""Destroy the APC""];								
		task2f = player_f createSimpleTask [""Destroy the APC""];																
		{_x setSimpleTaskDestination (getPos apc1)} forEach [task2a, task2b, task2c, task2d, task2e, task2f];   
		player groupChat ""Are they heading for the airbase?"";
		taskHint [""Destroy the APC"", [1, 1, 1, 1], ""taskNew""];
		}
	}   

Share this post


Link to post
Share on other sites

Super, thanks. I'll try your suggestions ASAP.

 

 

Edit: Brief addendum: some of the weirdness in the script above came directly from the editor, for instance the weird brackets and quotation marks. For instance, if I understand correctly, in mission.sqm you need the " (and probably the ; ) at the end, since the quotation marks envelop the entire init field.

 

Anyway... What I've started doing now is editing the scripts for initialization and On Act fields in Notepad++ (with the SQM plugin) and then copying them into the editor. It's when I have to debug or edit the script, it's a bit of a hassle. How do the pros juggle between the editor and editing the scripts directly? Are there recommended practices?

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

×