Jump to content
Sign in to follow this  
Oglesbee

updating a marker position every second

Recommended Posts

I am using a marker attached to a unit. Here is the script code i have in markerpos.sqf

while { true } do {

"Obj6" setmarkerpos (getpos ed);

sleep 1;

};

the marker attaches but does not refresh itsef

how do i input the command for this to update his pos constantly.

do i need to refresh it in the setTaskDestination in the trigger every second or someother way.

the marker populates but stays where he is at when it first pulls it. He is in a plane that lands so you can see my dillemma

Edited by Oglesbee

Share this post


Link to post
Share on other sites

movemarker = true;
while (movemarker) do {
"Obj6" setMarkerPos (getPos ed);
sleep 1;
};

True is always true. ;)

Share this post


Link to post
Share on other sites

I asuming that you actually have named your unit

ed

Maybe you need to use vehicle ed, vehicle ed is ed when he is not in a vehicle.

while {true} do {
  "Obj6" setmarkerpos (getpos (vehicle ed));
  sleep 1;
};

else it was just your spaces in { true } wich put it off. dont use () in while loops like Grimes did above, always use

while {some condition} do {

Share this post


Link to post
Share on other sites

well i fixed the coding in the script however. I created this task as a hidden objective. It is not in the briefing it populates via a trigger once the 5th objective is complete. below is the code i used in the trigger's act field

tskObj6 = player createSimpleTask ["Capture Silva"];tskObj6 setSimpleTaskDescription ["Silva is Landing at the airstrip.Work your way there and arrest him do not kill him","Arrest Silva","Arrest Silva"];tskObj6 setSimpleTaskDestination (getMarkerPos "Obj6");taskhint ["Incoming Intel on Eduard Silvas Location", [1, 1, 1, 1], "taskNew"];

would my problem be in this portion or do i still not have something right

this is ed's init field

this moveInDriver plane1;this addAction ["Arrest","arrest.sqf",[TOO],1,false,true,"","(_target distance _this) < 3"];ok = [] execVM "obj6marker.sqf";

could this be my problem

ok = [] execVM "obj6marker.sqf";[/

and how do i get it to say code instead of quote like yours

Edited by Oglesbee

Share this post


Link to post
Share on other sites

click on "what to do when posting any kind of code dammit!!" in my sig ;)

Share this post


Link to post
Share on other sites

You mean like this

thanks for hooking me up.

I am still having the same issue with my task destination.

Share this post


Link to post
Share on other sites

a, i just realized what you were really asking.

you didnt mean marker does not move? you meant the task destination does not move?

if thats the case do this:

while {alive ed} do {
  tskObj6 setSimpleTaskDestination (getPos ed);
  sleep 1;
};

this should update the task destination every second until ed is dead.

Share this post


Link to post
Share on other sites

Hey you guys are great thanks for the help and your patience.

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  

×