Jump to content
Sign in to follow this  
Johnson11B2P

How make BIS functions work in BIS_fnc_MP

Recommended Posts

I'm trying to get some of the task functions to work using the MP. I keep getting an error looking for a bracket somewhere.

["[taskOne, Succeeded,true]"," BIS_fnc_taskSetState",nil,true] spawn BIS_fnc_MP;

---------- Post added at 13:38 ---------- Previous post was at 12:33 ----------

I get no errors but it doesn't change the task state. Also I found out these don't work too.

["[player,taskTwo,[Deliver Cool Breeze back to Command,Escort],true]","BIS_fnc_taskCreate",nil,true] spawn BIS_fnc_MP;

It says it created the task but the Strings didn't get passed correctly.

["[taskTwo,true,[Deliver Cool Breeze back to Command,Escort],CREATED,2,true,true]","BIS_fnc_setTask"] spawn BIS_fnc_MP;

No errors for this one but absolutely nothing happens

Edited by Johnson11B2P
changed the code to the correct way to us BIS_fnc_MP

Share this post


Link to post
Share on other sites

u cant use quotes for function arguments....

only function name should be string !

[player, "TAG_fnc_something", false, false] spawn BIS_fnc_MP;

EDIT:

i said that in wrong way....

ofc u can use string as argument....

so... simply....

this:

"[0, 0, 0]"

isnt array but string.....................................

Edited by LoonyWarrior

Share this post


Link to post
Share on other sites

I called this way to make my life simple and my blood pressure lower.

["Scripts\Mission Scripts\taskOneComplete.sqf","BIS_fnc_execVM",true,true] spawn BIS_fnc_MP;

Share this post


Link to post
Share on other sites

[["taskOne","Succeeded",true],"BIS_fnc_taskSetState",nil,true] spawn BIS_fnc_MP!

Share this post


Link to post
Share on other sites
[["taskOne","Succeeded",true],"BIS_fnc_taskSetState",nil,true] spawn BIS_fnc_MP!

That still didn't work, thanks for pointing me in the right direction.

Share this post


Link to post
Share on other sites
That still didn't work, thanks for pointing me in the right direction.

thats because nil isnt right target............

it can be object, boolean or player ID..

and question is if taskOne is object or name...

and it also depends on how the taskOne was created.....

and if the player may die between task creation and state change..

Share this post


Link to post
Share on other sites

taskOne is the task name assigned to it. I created all the task in my briefing.sqf the old fashion way. taskOne is assigned from the very beginning.

taskOne = player createSimpleTask ["Search for the real Informant"];
taskOne setSimpleTaskDescription ["The real informant is out there. Cool Breeze is located in one of three locations behind enemy lines. Rescue Cool Breeze", "Mission Objective", ""];
player setCurrentTask taskOne;

So should I change nil to true?

Edited by Johnson11B2P
typo

Share this post


Link to post
Share on other sites

taskObject = player createSimpleTask ["TaskName"];

look.. this cant work..

describe the task by words and i will giv you code...

when, for who, etc...

Share this post


Link to post
Share on other sites
taskObject = player createSimpleTask ["TaskName"];

look.. this cant work..

describe the task by words and i will giv you code...

when, for who, etc...

Here is what the Fx viewer says about BIS_fnc_setTaskState

/*
Author: Thomas Ryan & Karel Moricky

Description:
Set a task's state.

Parameters:
	0: STRING - Task name
	1: STRING - Task state
	2: BOOL - Show hint (default: true)

Returns:
BOOL
*/

private ["_taskName","_state","_hint"];
_taskName = [_this,0,"",[""]] call BIS_fnc_param;
_state = [_this,1,"",[""]] call BIS_fnc_param;
_hint = [_this,2,true,[true]] call BIS_fnc_param;

[_taskName,nil,nil,nil,_state,nil,_hint] call bis_fnc_setTask;

So what you are saying that _taskName is actually referring to "Search for the real Informant" and not taskOne?

---------- Post added at 01:03 ---------- Previous post was at 00:53 ----------

The mission is CO-OP and I have a briefing.sqf being called in the init.sqf and I have "player" as the object to have the task since only BLUFOR can only be played everyone in the mission will get it. I"m not trying to give different factions their own task. But I want the task to be for all blufor.

Share this post


Link to post
Share on other sites

if u use createSimpleTask alone, task name is displayed as task title... thats what confused u...

taskObject = player createSimpleTask ["TaskName"];
taskObject  setSimpleTaskDescription ["description", "title", "waypoint"];

once again...

you have to understand that u CANT use quotes for everything....

this is variable: taskObject

this is string (text): "taskObject"

this is array: [0, 0 , 0] - 3 values

this is string (text): "[0, 0 , 0]" - 1 value

...another thing is that u cant combine BIS task functions with simpleTask functions...

you can create task with BIS functions and then select it with BIS_fnc_taskReal and on task selected like that u can later use the simpleTask functions......

if u want your task from beginning for all west players...

init.sqf

if isServer then
{
 _null = [west, "taskName", ["description", "title", ""], objNull, true] spawn BIS_fnc_taskCreate;
};

u dont have to do anything more..

Share this post


Link to post
Share on other sites

Don't need a handle for scripts called with spawn! ;)

Share this post


Link to post
Share on other sites
Don't need a handle for scripts called with spawn! ;)

wonna fight ? :p

...i dont know any objective reasons for that..

anyway.. my subjective reason is.. that u can meet this expression in several BIS missions.. and i do that in same way... :cool:

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  

×