Jump to content
Sign in to follow this  
jcarrest

Hint parseText global

Recommended Posts

I have a serious problem with "HINT PARSETEXT".

I can not be published to all players.

Try activated from a flag, but only you can read it,

the player who triggers the script.

Any idea in order to complete my script?

This is the script I'm creating:

switch (secundario) do
{

case "false":
{


SMunits = [];
secundario = true;
sleep 5;
_Cscomunicaciones = "<t align='center'><t size='2.2'>Mission Secundaria</t><br/><t size='1.5' color='#00B2EE'>COMPLETADA</t><br/>____________________<br/>Buen trabajo! <br/><br/>Torre Destruida</t>";


_scomunicaciones = "<t align='center'><t size='2.0'>OBJ. SECUNDARIO</t><br/><t size='1.5' color='#00B2EE'>COMUNICACIONES</t><br/>____________________<br/>Tenemos que destruir la Torre de Comunicaciones para desestabilizar al enemigo.</t>";
hint parsetext _scomunicaciones;
_position = ["water","out"] call BIS_fnc_randomPos;

sideObj = "Land_TTowerBig_1_F" createVehicle _position;
sideObj allowDamage false;
sideObj setdir random 360;
_normal = surfaceNormal (position sideObj);
sideObj setVectorUp _normal;
SMunits = SMunits + [sideObj];
	_random = (round(random 2) + 1);
	for "_i" from 0 to _random do 
	{
	_randompatrol = (round(random 200) + 200);
	_randomdistance = (round(random 150) + 200);
	_randomPos = [[[getPos sideObj,_randomdistance]],["water","out"]] call BIS_fnc_randomPos;
	_spawnGroup = [_randomPos, EAST, (configfile >> "CfgGroups" >> "East" >> "OPF_F" >> "Infantry" >> "OIA_InfTeam")] call BIS_fnc_spawnGroup;
	[_spawnGroup, getpos sideObj,_randompatrol] call BIS_fnc_taskPatrol;
	SMunits = SMunits + (units _spawnGroup);
	};

	/*
	{
	_randompatrol = (round(random 200) + 200);
	_randomdistance = (round(random 150) + 200);
	_randomPos = [[[getPos sideObj,_randomdistance]],["water","out"]] call BIS_fnc_randomPos;
	_spawnGroup = [_randomPos, EAST, (configfile >> "CfgGroups" >> "East" >> "OPF_F" >> "Infantry" >> "OIA_InfTeam")] call BIS_fnc_spawnGroup;
	[_spawnGroup, getpos sideObj,_randompatrol] call BIS_fnc_taskPatrol;
	SMunits = SMunits + (units _spawnGroup);
	};

	_randomPos = [[[getPos sideObj, 50]],["water","out"]] call BIS_fnc_randomPos;
	_spawnGroup = [_randomPos, EAST, (configfile >> "CfgGroups" >> "East" >> "OPF_F" >> "Infantry" >> "OIA_InfTeam_AT")] call BIS_fnc_spawnGroup;
	[_spawnGroup, getpos sideObj] call BIS_fnc_taskDefend;
	SMunits = SMunits + (units _spawnGroup);
	_randomPos = [[[getPos sideObj, 10]],["water","out"]] call BIS_fnc_randomPos;
	_spawnGroup = [_randomPos, EAST, (configfile >> "CfgGroups" >> "East" >> "OPF_F" >> "SpecOps" >> "OI_diverTeam_SDV")] call BIS_fnc_spawnGroup;
	[_spawnGroup, getpos sideObj] call BIS_fnc_taskDefend;

	SMunits = SMunits + (units _spawnGroup);
		*/
		"sideMarker" setmarkerpos (position sideobj);
		"sideMarker" setmarkertext "Destruir Torre";
		"sideMarker" setmarkercolor "ColorRed";

		trgc_0 = createTrigger["EmptyDetector", getPos sideObj];
		trgc_0 setTriggerArea[13,13,0,true];
		trgc_0 setTriggerActivation["WEST","PRESENT",false];
		trgc_0 setTriggerStatements["this"," sideobj allowDamage true ",""];

		publicVariable "trgc_0";




		waitUntil {!alive sideObj};
		"sideMarker" setMarkerPos [0,0,0];
		"sideMarker" setmarkertext "";
		//"sideMarker" setmarkeralpha 0;


		deleteVehicle trgc_0;
		hint parsetext format _Cscomunicaciones;
		secundario = "false";
		publicvariable "secundario";
		sleep 60;
		{deletevehicle _x} foreach SMunits;
		deleteVehicle trgc_0;
		exit
		};
		Default {

hint "Ya existe una misión secundaria asignada";};

};
};

Thanks!!!!

Share this post


Link to post
Share on other sites

NOTE: It is only a suggestion, try it..if it won't work, revert it.

_Cscomunicaciones = format ["<t align='center'>...</t>"];
GlobalHint = _Cscomunicaciones;
publicVariable "GlobalHint";
hintsilent parseText _Cscomunicaciones;

_scomunicaciones = format ["<t align='center'>...</t>"];
GlobalHint = _scomunicaciones;
publicVariable "GlobalHint";
hintsilent parseText _scomunicaciones;

Share this post


Link to post
Share on other sites

The public variable thing Valixx is talking about assumes you have a GlobalHint publicVariable function setup.

Share this post


Link to post
Share on other sites

waitUntil{!(isNull player)};
"GlobalHint" addPublicVariableEventHandler {
	hintSilent parseText GlobalHint;
};

PublicVariable of the hint will work just fine. Valixx just forgot to include the eventhandler for it.

Ninja'd by kylania

Share this post


Link to post
Share on other sites

First thank you all for the help.

I tried this:

_Cscomunicaciones = format ["<t align='center'>...</t>"];
GlobalHint = _Cscomunicaciones;
publicVariable "GlobalHint";
hintsilent parseText _Cscomunicaciones;

waitUntil{!(isNull player)};
   "GlobalHint" addPublicVariableEventHandler {
       hintSilent parseText GlobalHint;
   };  

_scomunicaciones = format ["<t align='center'>...</t>"];
GlobalHint = _scomunicaciones;
publicVariable "GlobalHint";
hintsilent parseText _scomunicaciones;  

waitUntil{!(isNull player)};
   "GlobalHint" addPublicVariableEventHandler {
       hintSilent parseText GlobalHint;
   };  

Not if I understand correctly but does not work.

If you guys could clarify, would you do me very happy...

in a trigger works but when I try to do it from the flag only sees the text the player to select the mission.

Edited by jcarrest

Share this post


Link to post
Share on other sites

Hi jcarrest,

I should of been more specific my fault.

The event handler code i posted should be put in your init.sqf. It is only needed to be run once by all clients. All client are then listening for a change to the GlobalHint variable.

On your other script setting the contents of GloablHint and then Public Variabling it , the clients publicVariableEventHandler notices the change and hints the contents to the client.

Hope that makes more sense.

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  

×