Wetherby 10 Posted March 1, 2014 Hello everyone, I have a problem in my Arma mission, i want to spawn ennemi only if the distance between player and marker is less than the axis A plus 250 meters, i have search a lot and i have tried this command : _mark = _this select 0; _markaxisA = getMarkerSize _mark select 0; _calcul = _markaxisA + 250; _target = _calcul; waitUntil {(_mark distance player) <= _target}; but it does't work so I request your big knowledge about script Thank for your time and attention Share this post Link to post Share on other sites
KC Grimes 79 Posted March 1, 2014 Well, break it down. What "doesn't work"? Do you have -showscripterrors enabled? Are you receiving errors? How are you executing it? What does _this select 0 reference? It's difficult for us to help you if you only say "it doesn't work" and do not provide us the information to take a holistic approach. To start you off, make sure your first line of _this select 0 is actually referring to something, meaning a passed array. But for my example I'm going to guess it is not. _mark = "nameofmarkerhere"; _marksize = getMarkerSize _mark; _markaxisA = _marksize select 0; _target = _markaxisA + 250; waitUntil {(_mark distance player) <= _target}; Share this post Link to post Share on other sites
Wetherby 10 Posted March 1, 2014 Sorry, _this select 0 is refering to a trigger(No condition and no activation so is work) with an execVM with the marker array, i have trie a hint to say where is error and error is on player distance and i have no script error. Thank for your correction I have tried to indicate the name of marker like your script correction but it doesn't work always. Share this post Link to post Share on other sites
KC Grimes 79 Posted March 1, 2014 Sorry, wasn't thinking about the string. You can only judge distance from objects, and a marker is not an object. So you'll need to create a game logic or some object that represents the same position as the center of the marker. Or, just use the array from the return of getMarkerPos, which I've done. _mark = "testmkr"; _marksize = getMarkerSize _mark; _markaxisA = _marksize select 0; _target = _markaxisA + 250; _markpos = getMarkerPos _mark; waitUntil {(_markpos distance player) <= _target}; So, this works, however it isn't as you had expected, since it works from the marker's center. So I suggest you rely on a point, like the script. However, if you are doing this in a way that it works, go for it. Share this post Link to post Share on other sites
Wetherby 10 Posted March 1, 2014 Thank you a lot it work! Share this post Link to post Share on other sites