Jump to content
Sign in to follow this  
m1ndgames

Create map diary entries via Trigger - Script

Recommended Posts

Hi,

im just starting to learn the syntax...

In Theory the following script should create the triggers and set the trigger-options, if the parameter is 'init'. After the initial init, the script can be run again with, for example, 'isis_minefield' parameter to create the new Intel via createDiaryRecord.

But actually, it doesen't check the if statements and just enters all the intel when you connect to the (dedicated) server. So yes, this must work in mp too... :/

i call it via init.sqf:

["init"] execVM "scripts\intel.sqf";

_param = _this select 0;


if(_param == "init") then {
if (isServer) then {
	isis_minefield_trigger = createTrigger["EmptyDetector",[4113.7158,6.9900088,7145.6509]];
	publicVariable "isis_minefield_trigger";
	isis_base_trigger = createTrigger["EmptyDetector",[4583.1924,6.9900088,5228.8604]];
	publicVariable "isis_base_trigger";
	isis_airbase_trigger = createTrigger["EmptyDetector",[2921.3521,6.9900088,6405.4712]];
	publicVariable "isis_airbase_trigger";
};
if (!isDedicated) then { waitUntil {!isNil "isis_minefield_trigger"};
	isis_minefield_trigger setTriggerArea[2000,155,-2.61533,false];
	isis_minefield_trigger setTriggerActivation["WEST","PRESENT",true];
	isis_minefield_trigger setTriggerStatements["this", ["isis_minefield"] execVM "scripts\intel.sqf", ""];
};
if (!isDedicated) then { waitUntil {!isNil "isis_base_trigger"};
	isis_base_trigger setTriggerArea[250,250,0,false];
	isis_base_trigger setTriggerActivation["WEST","PRESENT",true];
	isis_base_trigger setTriggerStatements["this", ["isis_base"] execVM "scripts\intel.sqf", ""];
};
if (!isDedicated) then { waitUntil {!isNil "isis_airbase_trigger"};
	isis_airbase_trigger setTriggerArea[2000,155,-2.61533,false];
	isis_airbase_trigger setTriggerActivation["WEST","PRESENT",true];
	isis_airbase_trigger setTriggerStatements["this", ["isis_airbase"] execVM "scripts\intel.sqf", ""];
};
};

if(_param == "isis_minefield") then {
player createDiaryRecord["intel",
	[
		"ISIS",
			"
				<marker name='minefield_marker'>Minefield</marker><br/>
				<br/>
			"
	]
];
["New Intel:","Minefield"] call BIS_fnc_infoText;
};

if(_param == "isis_base") then {
player createDiaryRecord["intel",
	[
		"ISIS",
			"
				<marker name='base_marker'>ISIS HQ</marker><br/>
				<br/>
			"
	]
];
["New Intel:","ISIS HQ"] call BIS_fnc_infoText;
};

if(_param == "isis_airbase") then {
player createDiaryRecord["intel",
	[
		"ISIS",
			"
				<marker name='airbase_marker'>ISIS Airbase</marker><br/>
				<br/>
			"
	]
];
["New Intel:","ISIS Airbase"] call BIS_fnc_infoText;
};

Edited by m1ndgames

Share this post


Link to post
Share on other sites

It may not be your entire issue, but your syntax on the trigger statements is off, check your " ", and be sure to use ' ' within the double quotes.

...setTriggerStatements ["this", "['isis_mindfield'] execVM 'script/intel.sqf'", ""];

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  

×