Jump to content
Sign in to follow this  
windies

Crash using execVM

Recommended Posts

Trying to run a script I wrote using execVM and everytime I trigger it my ArmA 3 game crashes and I cannot figure out why.

Currently what I'm using to call it

nul = [alpha, Infil] execVM "Eject.sqf";

The script being called Eject.sqf

_grp = this select 0;
_veh = this select 1;

if (isServer) then 

{
if ( (typename _grp != "GROUP") or (typename _veh != "OBJECT") ) exitwith {
hintSilent "Invalid Parameters parsed";
};

sleep 1;

{_x action ["EJECT", _veh]; 
sleep .5;
} ForEach units _grp;
}

Honestly have no clue why it keeps crashing and I actually tried calling a few other scripts using execVM and was getting crashes as well in the editor. I've used the actual script code in a trigger to eject the units so I know it works, but I need the sleep in there so they don't all get thrown out at once, hence I need to call a script. Any help is appreciated.

Share this post


Link to post
Share on other sites

alpha and Infil are the names of the _grp and _veh. It would be pointless to call the script without defining those variables since the whole point is to get _grp to eject out of _veh?

Share this post


Link to post
Share on other sites

like just exec it and then put the WHOLE script in an if statement for the _grp

so like

if (_grp = alpha) then {
//script
};

I actually don't know if that will work it's off the top of my head but its the concept that counts right :P

Share this post


Link to post
Share on other sites
like just exec it and then put the WHOLE script in an if statement for the _grp

so like

if (_grp = alpha) then {
//script
};

I actually don't know if that will work it's off the top of my head but its the concept that counts right :P

Well since I'm using groups alpha, bravo and charlie and I want the script to be dynamic based on vehicle name and group names and be able to be used with multiple groups and not just one's named alpha, it wouldn't work.

Share this post


Link to post
Share on other sites

Anything I try to run using execVM causes a crash. I've tried supposedly already working scripts and the game crashes. I'm pretty sure the script is fine, I've gone over it a bunch of times. Like I said, the code works I just need it in a script so I can use a sleep so every unit isn't ejected all at once. It's just when I call a script, the game crashes.

Share this post


Link to post
Share on other sites

That's fucking strange. The code you've posted looks legit to me. It shouldn't cause a ctd in any case even if there were an issue.

Share this post


Link to post
Share on other sites

I'm wondering if it's an addon issue, I'm gonna try removing addons one by one to see if I can find which one if that's the case. Truth is I rarely scripted in any of my missions but since I'm starting to make missions for my group and actually release missions, I need to learn it.

Share this post


Link to post
Share on other sites

CBA, JSRS, SThud, A2MP and that's it.

---------- Post added at 03:25 ---------- Previous post was at 03:22 ----------

Still getting the crash with no mods, gonna try a verify cache integrity check.

Share this post


Link to post
Share on other sites

none of them should create a crash when using ExecVM, i am using them and many more andy my games executes scripts just fine. also your script looks good too, so i guess you got a corrupted Arma version, try verifying the game cache, perhaps it finds something.

edit: ninja'd

Share this post


Link to post
Share on other sites

I know this may be a bit nit-picky, but you forgot a semi-colon in your code example (last character):

_grp = this select 0;
_veh = this select 1;

if (isServer) then 

{
if ( (typename _grp != "GROUP") or (typename _veh != "OBJECT") ) exitwith {
hintSilent "Invalid Parameters parsed";
};

sleep 1;

{_x action ["EJECT", _veh]; 
sleep .5;
} ForEach units _grp;
};

Anyways, sounds like you could have a file permissions issue with your sqf files (since they're created manually, and the mission.sqm is created by the Arma process) and Arma can't lock the file, so it CTD.

Try saving/exporting the mission as a PBO file, and see if it then works while running from the PBO (try the scenarios tab, I'm not sure where it goes though). If that works, then you have a permissions issue.

Share this post


Link to post
Share on other sites

Nothing in there should cause a crash. I don't believe at least. So like every single execVM crashes your computer? So like if you made a script welcome.sqf and executed it this way

[] execVM "welcome.sqf";

and in welcome

hint format ["Hello player!", "PLAIN"];

It would crash?

Share this post


Link to post
Share on other sites

Exporting to .pbo worked, it didn't crash but it threw up a bunch of errors like undefined variable _grp etc.. and didn't work. I had to give my admin account full access to modify files because it apparently only gives me read access by default.

Edited by Windies

Share this post


Link to post
Share on other sites
Exporting to .pbo worked, it didn't crash but it threw up a bunch of errors like undefined variable _grp etc.. and didn't work.

You need to change the global 'this' variables to the local variable '_this':

private ["_grp", "_veh"];
_grp = _this select 0;
_veh = _this select 1;

if (isServer) then 

{
if ( (typename _grp != "GROUP") or (typename _veh != "OBJECT") ) exitwith {
hintSilent "Invalid Parameters parsed";
};

sleep 1;

{_x action ["EJECT", _veh]; 
sleep .5;
} ForEach units _grp;
};

Check that again, and if the PBO is the only way it'll work, double-check the permissions on the .sqf files, or try running Arma as an administrator.

Share this post


Link to post
Share on other sites

For some reason Windows 7 didn't give me full control of files on any of my drives and I had to change it. That fixed the CTD issue and changing them to local variables fixed the errors and it worked flawlessly. Thanks for the help.

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
Sign in to follow this  

×