Jump to content
Sign in to follow this  
stayfrosty24

Help needed updating missionTasks marker position

Recommended Posts

Hello guys,

I'm trying to create a task where the player must enter a vehicle. The only problem is to update the task marker position.

I want to do this by script and not in the editor. See the code below, i think there is a simple solution for this problem someting like a while loop but i can't seem to figure this one out!

Any help would be much appreciated.

I have a MRAP called B_MRAP_1 and it's driving to a location where the player must get in.

But when i call the task the marker is placed on the location where the MRAP is driving on that time and it does not update.

missionTasks.sqf

case "task1" :
{
if (_taskState == "") then
{
	[
		player,
		_taskID,
		[
			"Get in the MRAP",
			"Get in",
			"GET IN"
		],
			[color="#FF0000"][b]getPos B_MRAP_1[/b][/color],
			true
	] call BIS_fnc_taskCreate;
};
};

Kind regards,

StayFrosty24

Share this post


Link to post
Share on other sites

Have you tried setSimpleTaskTarget?

[
	player,
	task01,
	["Get in the MRAP", "Get in", "GET IN"],
	getPos B_MRAP_1,
	true
] call BIS_fnc_taskCreate;

task01 setSimpleTaskTarget [B_MRAP_1, true];

If it doesn't attach to your target, you can try:
 

0 spawn { // use this if you are not using execVM or spawn
	while {true} do {
		task01 setSimpleTaskTarget [B_MRAP_1, true];
		sleep 1;
	};
};

Share this post


Link to post
Share on other sites

Icaruk,

 

Thanks for your reply, i tested it but it didn't work.

Have you tried it yourself? Can you let me know if it worked.

 

Regards,

StayFrosty24

Share this post


Link to post
Share on other sites

Icaruk,

 

Thanks for your reply, i tested it but it didn't work.

Have you tried it yourself? Can you let me know if it worked.

 

Regards,

StayFrosty24

I have no time to test it for myself, sorry.

I think that setSimpleTaskTarget is just for simple tasks (lol). You can try to create a simple task instead BIS_fnc_taskCreate.

Share this post


Link to post
Share on other sites

I have no time to test it for myself, sorry.

I think that setSimpleTaskTarget is just for simple tasks (lol). You can try to create a simple task instead BIS_fnc_taskCreate.

 

Icaruk,

 

Fair enough, i will give it a try.

Thanks for the help.

Share this post


Link to post
Share on other sites

Try to enter the object itself (and not its position) as destination for BIS_fnc_taskCreate.

If I remember correctly BIS_fnc_taskCreate is using - depending on the type of the destination argument - setSimpleTaskTarget (object) or setSimpleTaskDestination (position) internally.

i.e.

[
	player,
	_taskID,
	[
		"Get in the MRAP",
		"Get in",
		"GET IN"
	],
	B_MRAP_1,
	true
] call BIS_fnc_taskCreate;

Share this post


Link to post
Share on other sites

 

Try to enter the object itself (and not its position) as destination for BIS_fnc_taskCreate.

If I remember correctly BIS_fnc_taskCreate is using - depending on the type of the destination argument - setSimpleTaskTarget (object) or setSimpleTaskDestination (position) internally.

i.e.

[
	player,
	_taskID,
	[
		"Get in the MRAP",
		"Get in",
		"GET IN"
	],
	B_MRAP_1,
	true
] call BIS_fnc_taskCreate;

 

Master85,

 

Thank you very much! That did the trick.

 

Regards,

StayFrosty24

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  

×