Jump to content

Recommended Posts

Hello,
I'd like to ask you if you could help me with this script. I'd like to make intel that is possible to collect by one side and that's BLUFOR. So there would be visible action on intel for BLUFOR but OPFOR would not see that action. Any ideas please? 

Share this post


Link to post
Share on other sites

i believe you need to work with this condition parameter in your addaction:

(side _this == west)

 

object addAction [title, script, arguments, priority, showWindow, hideOnUse, shortcut, condition, radius, unconscious, selection, memoryPoint]

 

im interessted as i need this for a script too.

test if you can and let me know, else i will test myself next occasion and post the result.

 

br

vd

 

 

  • Thanks 1

Share this post


Link to post
Share on other sites
3 hours ago, Vandeanson said:

i believe you need to work with this condition parameter in your addaction:

(side _this == west)

 

object addAction [title, script, arguments, priority, showWindow, hideOnUse, shortcut, condition, radius, unconscious, selection, memoryPoint]

 

im interessted as i need this for a script too.

test if you can and let me know, else i will test myself next occasion and post the result.

 

br

vd

 

 


Haa thanks, it's works! Used it this way in
Intel_1 init:

this addAction ["Collect Intel", "scripts\Intel.sqf", nil, 1.5, true, true, "", "(side _this == west)", 4, false, "", ""];

And as "debug" I used simpy
Intel.sqf

hint "BLUFOR found intel";

BLUFOR can see the action, OPFOR can't.
But any idea how I could shorter the addAction and bypass writing values that are default? I'm quite new in scripting and you can see I use very simple way how to reach what I need.
Also btw I'm using teleport script and I can't test it with others because I have nobody to play on LAN and I also don't have public IP. Will following script ( parseText and cutText ) see only the player who calls it via addAction on flagpole or anything? 
 

// Get the destination.
_dest = (_this select 3) select 0;

// Get a random direction
_dir = random 359;

// Get destination
_spot =  getPosATL _dest;

cutText ["","BLACK OUT",4];
[parseText "<t font='PuristaBold' size='1.6'>Moving in progress...</t><br />Hold on soldier", true, nil, 4, 0.7, 0] spawn BIS_fnc_textTiles;
sleep 5;

// Move the person a few meters away from the destination then turn in the direction of _dir)
player setDir _dir;
player SetPosATL (_spot vectorAdd [500 - random 500, 500 - random 500,0]);

cutText ["","BLACK IN",2];


*Edit
Actually trying to make Intel.sqf usable by any ammount of intels but I don't know what I'm doing wrong, it shows error that the _intelTask setTaskState "Succeeded"; is unknown variable. I have no idea where is mistake when _intelTask should be any of IntelTask_1 and IntelTask_2, these two are task IDs of separate tasks. 
Intel.sqf

_intelTask = (_this select 3) select 0;
//_intelObject = (_this select 0);

_intelTask setTaskState "Succeeded";
//deleteVehicle _intelObject;

Intel_1 init

this addAction ["Collect Intel", "scripts\Intel.sqf", ["IntelTask_1"], 1.5, true, true, "", "(side _this == west)", 4, false, "", ""];

Intel_2 init

this addAction ["Collect Intel", "scripts\Intel.sqf", ["IntelTask_2"], 1.5, true, true, "", "(side _this == west)", 4, false, "", ""];

 

Share this post


Link to post
Share on other sites
24 minutes ago, GEORGE FLOROS GR said:

I dont't know really , because i 'm not using the 3d editor at all !

 

But since you are exec a script then , i think that you can follow this :

https://community.bistudio.com/wiki/Tasks

I'm working mostly in 3D editor and testing scripts and everything I make in editor by running LAN server. I spent like two months on it and still learning how to edit and create scripts. I've done player bases, whole ALiVE system and now working on tasks to generate to players. I've done some tasks using just editor modules and some very simple scripts in triggers. I'm really not sure about the performance how it will look like when there will be 32 players lol. But it's running quite smoothly when playing there alone for hour and whole ALiVE system and scripts are running.
The problem I want to solve now is that I have two create task modules called IntelTask_1 and IntelTask_2. Tried to use the name in variable, task ID even in variable and task ID at same time and script still don't want accept the task ID. Still showing error. Paradox is that when I remove the // for delete the object after using the action - it deletes object without any problem... I'm then like "Oh really?". I'll tomorrow try delete the modules and try create these tasks by using script and I'll report how it's working, today is late for me. Thank you.

*Edit
Actually the BLUFOR base looks like this lol:
BLUFOR Base

  • Like 1

Share this post


Link to post
Share on other sites
19 hours ago, HonzaVinCZ said:

It does not work if task is created via module with given variable or task ID? 

Yes It does (with task id, not module name). blabla in task Id,  "blabla" when you refer to it in some functions like bis_fnc_tasksetstate . Task name is a string here. So, keep on mind the syntax. Always.

Share this post


Link to post
Share on other sites
41 minutes ago, HonzaVinCZ said:

Actually the BLUFOR base looks like this lol:
BLUFOR Ba

been there done that:)

 

Share this post


Link to post
Share on other sites
4 hours ago, HonzaVinCZ said:

Actually

 

Check my ex :

 

_Pos = getpos player;	//	Test

_Intel = [
			"Land_Wallet_01_F","EvPhoto","EvMoney","EvMap","EvKobalt","EvMoscow","EvDogTags","Leaflet_05_Old_F",
			"Leaflet_05_New_F","Leaflet_05_F","Land_Camera_01_F","Land_HandyCam_F","Land_Laptop_F","Land_MobilePhone_smart_F",
			"Land_MobilePhone_old_F","Land_PortableLongRangeRadio_F","Land_SatellitePhone_F","Land_Tablet_01_F"
			];
	
_Random_Intel = selectRandom _Intel;

_Spawn_Intel = createVehicle [_Random_Intel, _Pos, [], 0, "NONE"];


//	You can Execute a script on intel
//	_Spawn_Intel execVM "script.sqf";
	

//________________	GF_addaction_Intel	________________
	
GF_addaction_Intel = {

//	Add Picture
_this setVariable ["RscAttributeDiaryRecord_texture","a3\structures_f_epc\Items\Documents\Data\document_secret_01_co.paa", true];

//	Add	Diary
[_this,"RscAttributeDiaryRecord",["Intel Found","Intel Found about enemies",""]] call BIS_fnc_setServerVariable;	

//	addaction
[_this,[
    "<t size=""1.2"" font=""RobotoCondensedBold"" color=""#FF9933"">" + "Get Intel", 
    {
		[_this,"action"] spawn BIS_fnc_initIntelObject;
    },
    [],1.5,true,true,"","true",8,false,"", ""
]] remoteExec ["addAction",0,true];
};
publicVariable "GF_addaction_Intel";
	

_Spawn_Intel call GF_addaction_Intel;
	

[player,["Intel_task_1","GF_Missions_Pack"],["Search for Intel , we need to find informations about the enemy !","Search for Intel",""], getPos _Spawn_Intel,true,1,true,"intel",true] call BIS_fnc_taskCreate;
["Intel_task_1","ASSIGNED",true] spawn BIS_fnc_taskSetState;
		
waituntil {!alive _Spawn_Intel};	
["Intel_task_1","SUCCEEDED",true] spawn BIS_fnc_taskSetState;

 

Ps : i don't even know to do this in the editor !

  • Like 1

Share this post


Link to post
Share on other sites
9 hours ago, HonzaVinCZ said:

it shows error that the _intelTask setTaskState "Succeeded"; is unknown variable. I have no idea where is mistake when _intelTask should be any of IntelTask_1 and IntelTask_2, these two are task IDs of separate tasks. 

5 hours ago, HonzaVinCZ said:

It does not work if task is created via module with given variable or task ID? 

 

The BI task functions and modules hide the real task from the user and replace it with a user friendly taskID, a STRING representing a TASK. Of which TASK is its own variable type.

The task scripting commands expect a TASK, not a taskID.

To keep things simple and to make sure you do not break the task system, if you are using something that provides a taskID ( BI modules and functions ) always use the same to change/update them ( function or module ).

[ _taskID, "SUCCEEDED" ] call BIS_fnc_taskSetState;

 

  • Like 2
  • Thanks 1

Share this post


Link to post
Share on other sites
5 hours ago, Larrow said:

 

The BI task functions and modules hide the real task from the user and replace it with a user friendly taskID, a STRING representing a TASK. Of which TASK is its own variable type.

The task scripting commands expect a TASK, not a taskID.

To keep things simple and to make sure you do not break the task system, if you are using something that provides a taskID ( BI modules and functions ) always use the same to change/update them ( function or module ).


[ _taskID, "SUCCEEDED" ] call BIS_fnc_taskSetState;

 

That's great, it actually works! I didn't know it must be used with function. As I said... I still learning. Thank you a lot. 

Share this post


Link to post
Share on other sites
[ this ] call BIS_fnc_initIntelObject;    
 this setVariable [    
  "RscAttributeDiaryRecord_texture",    
  "INTEL_IMAGE.jpg",    
  true    
 ];    
 [    
  this,    
  "RscAttributeDiaryRecord",    
  ["INTEL_NAME","INTEL_DESC",""]    
 ] call BIS_fnc_setServerVariable;    
 this setVariable ["RscAttributeOwners", [west], true];  
 this setVariable ["recipients", west, true]; 
 [  
  this,  
  "IntelObjectFound",  
  {  
   params ["", "_foundBy"];  
   private _msg = format ["Intel found by %1", name _foundBy];  
   _msg remoteExec ["systemChat", 0];  
  }  
  ] call BIS_fnc_addScriptedEventHandler;  
  

 

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

×