Jump to content
Sign in to follow this  
RommelFuchs

Issues with getMarkerPos and a "missing ;"

Recommended Posts

Hi all,

basically I wanted to play a little bit around with arrays ( a part of scripting I just started to learn). I wrote this very simple code:

 _convoglio = ["mas_ita_veh_LR_cd","mas_ita_veh_LR_medv"];
_puntadilancia= _convoglio select 1;

waitUntil {vialibera=true};
_puntadilancia getMarkerPos  "asd";


if (!alive _puntadilancia) then {
	hint "Hanno distrutto il convoglio!";
	}; 

"Convoglio" is Italian for convoy and "Puntadilancia" in the Italian militaries is the name given to the first vehicle in the convoy. However this code doesn't work: the problem, as stated by -showScriptErrors, is that there is a "missing ;" before "getMarkerPos". Something is certainly wrong in the syntax, but I still didn't figure out what.

Thanks in advice for the help.

Share this post


Link to post
Share on other sites
Hi all,

basically I wanted to play a little bit around with arrays ( a part of scripting I just started to learn). I wrote this very simple code:

 _convoglio = ["mas_ita_veh_LR_cd","mas_ita_veh_LR_medv"];
_puntadilancia= _convoglio select 1;

waitUntil {vialibera=true};
_puntadilancia getMarkerPos  "asd";


if (!alive _puntadilancia) then {
	hint "Hanno distrutto il convoglio!";
	}; 

"Convoglio" is Italian for convoy and "Puntadilancia" in the Italian militaries is the name given to the first vehicle in the convoy. However this code doesn't work: the problem, as stated by -showScriptErrors, is that there is a "missing ;" before "getMarkerPos". Something is certainly wrong in the syntax, but I still didn't figure out what.

Thanks in advice for the help.

you are right, the syntax is wrong.

you should use:

 _convoglio = ["mas_ita_veh_LR_cd","mas_ita_veh_LR_medv"];
_puntadilancia= _convoglio select 1;

waitUntil {vialibera = true};
_puntadilancia setPos  (getMarkerPos "asd");

if (!alive _puntadilancia) then {
hint "Hanno distrutto il convoglio!";
}; 

EDIT: a small fail of myself... :p

"setMarkerPos" is used for markers, and you vehicle is not a marker. in that case use "setPos"...

Edited by Silderoy

Share this post


Link to post
Share on other sites
you are right, the syntax is wrong.

you should use:

 _convoglio = ["mas_ita_veh_LR_cd","mas_ita_veh_LR_medv"];
_puntadilancia= _convoglio select 1;

waitUntil {vialibera = true};
_puntadilancia setMarkerPos  (getMarkerPos "asd");

if (!alive _puntadilancia) then {
hint "Hanno distrutto il convoglio!";
}; 

I'm feeling stupid, didn't notice that. Thanks!

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  

×