Funkman 10 Posted June 29, 2011 (edited) I just have a couple of small scripts that arent working properly: Obj3.sqf: if (taskState tskWestObj4) != "SUCCEEDED" then {player setCurrentTask tskWestObj4}; if (taskState tskWestObj4) = "SUCCEEDED" then {nul = execVM "EndCam.sqf"}; EndCheck.sqf: If (taskState tskWestObj3) = "SUCCEEDED" then {nul = execVM "EndCam.sqf"}; If (taskState tskWestObj3) != "SUCCEEDED" then player setCurrentTask tskWestObj3; If someone could set me straight with these I would appreciate it. Thanks. Edited June 29, 2011 by Funkman Share this post Link to post Share on other sites
demonized 20 Posted June 29, 2011 missing paranteceses: if ((taskState tskWestObj4) != "SUCCEEDED") then {player setCurrentTask tskWestObj4}; if ((taskState tskWestObj4) = "SUCCEEDED") then {nul = execVM "EndCam.sqf"}; If ((taskState tskWestObj3) = "SUCCEEDED") then {nul = execVM "EndCam.sqf"}; Share this post Link to post Share on other sites
Double Doppler 10 Posted June 29, 2011 if ((taskState tskWestObj4) != "SUCCEEDED") then {player setCurrentTask tskWestObj4}; if ((taskState tskWestObj4) = "SUCCEEDED") then {nul = execVM "EndCam.sqf"}; Try the extra brackets. The condition code should be sent like an object, so you must make sure that the brackets cover it. Share this post Link to post Share on other sites
Funkman 10 Posted June 29, 2011 Oh thanks guys, it was telling me missing ; which was confusing the hell out of me. Share this post Link to post Share on other sites
Funkman 10 Posted June 29, 2011 Argh, one of the scripts is still giving me this error: "Type string, expected array" or was it "type object", something like that. It's this first line: If ((taskState tskWestObj3) = "SUCCEEDED") then {nul = execVM "EndCam.sqf"}; If ((taskState tskWestObj3) != "SUCCEEDED") then player setCurrentTask tskWestObj3; ---------- Post added at 02:38 PM ---------- Previous post was at 02:36 PM ---------- Should it be If ((taskState tskWestObj3) == "SUCCEEDED") then {nul = execVM "EndCam.sqf"}; ? Share this post Link to post Share on other sites
kylania 568 Posted June 29, 2011 I'd make the end thing a trigger on the map so it plays for everyone. Share this post Link to post Share on other sites
Funkman 10 Posted June 29, 2011 Its a SP mission... Share this post Link to post Share on other sites
kylania 568 Posted June 29, 2011 Still the same suggestion. Why script if you don't need to? :) Share this post Link to post Share on other sites
Funkman 10 Posted June 29, 2011 I do because I dont want the mission to end just if they have completed objective 4 (The last one), I want to also check that they have completed the other primary (Objective 3) incase they do things in a different order.... Thats why I cant use a simple trigger for it. Anyway, they script is fairly simple, surely someone can tell me whether what I have is right or not. Share this post Link to post Share on other sites
demonized 20 Posted June 29, 2011 try changing: nul = execVM "EndCam.sqf" to this: nul = [b][][/b] execVM "EndCam.sqf" Share this post Link to post Share on other sites
celery 8 Posted June 29, 2011 Argh, one of the scripts is still giving me this error: if (taskState tskWestObj3 == "Succeeded") then {execVM "EndCam.sqf"}; if (taskState tskWestObj3 != "Succeeded") then {player setCurrentTask tskWestObj3}; try changing: nul = execVM "EndCam.sqf" to this: nul = [b][][/b] execVM "EndCam.sqf" execVM doesn't need an argument array. Share this post Link to post Share on other sites
demonized 20 Posted June 29, 2011 execVM doesn't need an argument array. Are you really sure? are there special circumstances? when i try in a unit init line: execVM "start1.sqf"; i get a error popping up: type script, expected nothing and i cannot press ok, not acepted. Share this post Link to post Share on other sites
celery 8 Posted June 29, 2011 Are you really sure? are there special circumstances?when i try in a unit init line: execVM "start1.sqf"; i get a error popping up: and i cannot press ok, not acepted. You need a script handle (nul=, 0=) when execVMing in the editor. Share this post Link to post Share on other sites
demonized 20 Posted June 29, 2011 You need a script handle (nul=, 0=) when execVMing in the editor. right tnx, that works, saves me from those _null = [] lines ive always used before in scripts. Share this post Link to post Share on other sites
CarlGustaffa 4 Posted June 30, 2011 You need a script handle (nul=, 0=) when execVMing in the editor. Correct, but isn't that a bug? The execVM information doesn't state this, it says optional. I can't think of any reason why the editor needs different syntax compared to doing it from a script. Share this post Link to post Share on other sites
celery 8 Posted June 30, 2011 Correct, but isn't that a bug? The execVM information doesn't state this, it says optional. I can't think of any reason why the editor needs different syntax compared to doing it from a script. The editor has its own retarded rules, that's for sure. execVM and spawn need handles and you can't use local variables. Share this post Link to post Share on other sites