Jump to content
Sign in to follow this  
GRS

I can exec an sqf but not execVM it? Also: "Lose" trigger in MP.

Recommended Posts

I'm not sure if it's an issue but I want to execute a script upon mission start to randomly delete two of three ammo dumps. The script works, but I seem to be having trouble executing it. If I use "[] exec "cache.sqf" ;", in the init field of an "empty" object, it works. I was under the impression that sqf required execVM though. However whenever I try to use execVM, no matter how I set it up, it simply does not work. Handle, no handle, brackets filled in or not, and any combination of the previous both in a unit's init field or in the init.sqf, does not work at all. Only the "exec" works. This is fine by me, so long as nothing else would be messed up?

I have a second issue. My mission works perfectly when played solo, so I'd guess it's client/server conflicts, but when I have a "lose" trigger with he condition: "(!alive engd) OR (!alive e) OR (!alive engh)" and on act: "tsk3 setTaskState "Failed" ; e sideChat "stuff and things."", it fires immediately and ends the mission for everyone but the host who continues to play without the tsk3 being failed. Note: none of the three units mentioned in the condition field are killed at any time when this happens. Suggestions for an MP new guy?

Share this post


Link to post
Share on other sites

I tried to guess your script but failed, so I'm afraid you have to post the script here. :p

Share this post


Link to post
Share on other sites

Do what lifted suggested. Also, what you're trying to do, can be achieved very simply by using probability of presence & condition of presence (combined) on each cache object. And since it's only 3 caches to choose from, this is certainly very quick, clean & easy. My 2c. :p

Share this post


Link to post
Share on other sites
I tried to guess your script but failed, so I'm afraid you have to post the script here. :p

Well then you better try harder! ;)

if (! isServer) exitwith {}; 

x1 = floor(random 3)
if (x1 == 0) then {deletevehicle cache1a ; deletevehicle cache1b ; deletevehicle cache2a ; deletevehicle cache2b; cache setpos getpos cache3a; cfind setpos getpos cache3a;};
if (x1 == 1) then {deletevehicle cache2a ; deletevehicle cache2b ; deletevehicle cache3a ; deletevehicle cache3b; cache setpos getpos cache1a; cfind setpos getpos cache1a;};
if (x1 == 2) then {deletevehicle cache3a ; deletevehicle cache3b ; deletevehicle cache1a ; deletevehicle cache1b; cache setpos getpos cache2a; cfind setpos getpos cache2a;};

Hope that's what you want. That is "cache.sqf".

I did try what lifted suggested and that's the weird part. That is how I have all the others, but for some reason this one only works when executed as "[] exec "cache.sqf".

I will definitely try what Iceman said as well. I've done similar things in the past so I can see it maybe being easier.

Share this post


Link to post
Share on other sites

You absolutely sure you tried

nul = [] execVM "cache.sqf";

That has to work.

Or it's just that you don't use -showscripterrors and didn't see the mission semicolon after (random 3) :P

Share this post


Link to post
Share on other sites
You absolutely sure you tried

nul = [] execVM "cache.sqf";

That has to work.

Absolutely positive I tried that.

You absolutely sure you tried

Or it's just that you don't use -showscripterrors and didn't see the mission semicolon after (random 3) :P

N-.... no.... :o That did it and the execVM works now because of it. That's just plain embarassing. Why do you guys always embarass me? :p

Share this post


Link to post
Share on other sites

You forgot the semicolon on line 3. :)

I can tell you're used to sqs.

EDIT:

Just read that you fixed it, my bad :p

Share this post


Link to post
Share on other sites
You forgot the semicolon on line 3. :)

I can tell you're used to sqs.

EDIT:

Just read that you fixed it, my bad :p

I am indeed a very recent convert to the ways of the sqf. :)

Anyone have any ideas regarding the second issue? I cannot imagine why it would do what it does. Does the lose trigger not work in MP or how might the clients be registering each a unit as dead when they are not? I thought AI was all handled server-side. I'll try adding an isServer check in there and test when I can but I still don't get it.

Edited by GRS

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  

×