Jump to content
  • 0

Mission information format!


Line2.lv

Question

Hi guys, I`m using WAI mission system and I want to change the information about the mission from middle screen to right top corner side (Like a debug monitor)

 

Lets take one mission for an example:

 

here is the line with the information about the mission:

[nil,nil,rTitleText,"Bandits have disabled an armed vehicle with lots of chain gun ammo in the gear! Check your map for the location!", "PLAIN",10] call RE;

If I change the rTitleText to rHINT then I get all the message in the debug monitor in the right top side of the screen and it`s working, but I want to customise the look of the debug a bit...

 

I tryed something like this..

 

Setup a new private array _hint

_hint = parseText format["<t align='center' color='#FFFF66' shadow='2' size='1.75'>Armored Vehicle</t><br/><t align='center' color='#ffffff'>Bandits have disabled an armed vehicle with lots of chain gun ammo in the gear! Check your map for the location!</t>"];

But seems that it`s not working, the message does not popup.

Could somebody with more experience in scripting could help me to make a format which does work?

I`m also adding whole original mission file in the end of the topic, if somebody need it to help me :)

 

I have also tryed to ask this question in main WAI mission topic, but nobody did answer, so I`m making a new topic in this section!

 

Thx!

 

P.S Sorry for such primitive grammer!

//Armed Vehicle

private ["_playerPresent","_cleanmission","_currenttime","_starttime","_missiontimeout","_vehname","_veh","_position","_vehclass","_vehdir","_objPosition"];

_vehclass = armed_vehicle call BIS_fnc_selectRandom;

_vehname    = getText (configFile >> "CfgVehicles" >> _vehclass >> "displayName");
_position = [getMarkerPos "center",0,5500,10,0,2000,0] call BIS_fnc_findSafePos;
diag_log format["WAI: Mission Armed Vehicle Started At %1",_position];

//Chain Bullet Box
_box = createVehicle ["USBasicWeaponsBox",[(_position select 0),(_position select 1) + 5,0], [], 0, "CAN_COLLIDE"];
[_box] call Chain_Bullet_Box;

//Armed Land Vehicle
_veh = createVehicle [_vehclass,_position, [], 0, "CAN_COLLIDE"];
_vehdir = round(random 360);
_veh setDir _vehdir;
_veh setVariable ["ObjectID","1",true];
PVDZE_serverObjectMonitor set [count PVDZE_serverObjectMonitor,_veh];
diag_log format["WAI: Mission Armed Vehicle spawned a %1",_vehname];

_objPosition = getPosATL _veh;
//[_veh,[_vehdir,_objPosition],_vehclass,true,"0"] call custom_publish;

//Troops
_rndnum = round (random 3) + 3;
[[_position select 0, _position select 1, 0],                  //position
_rndnum,                          //Number Of units
1,                          //Skill level 0-1. Has no effect if using custom skills
"Random",                  //Primary gun set number. "Random" for random weapon set.
4,                          //Number of magazines
"",                          //Backpack "" for random or classname here.
"Ins_Soldier_Sapper",              //Skin "" for random or classname here.
"Random",                  //Gearset number. "Random" for random gear set.
true                      // Mission true or false
] call spawn_group;

[[_position select 0, _position select 1, 0],                  //position
4,                          //Number Of units
1,                          //Skill level 0-1. Has no effect if using custom skills
"Random",                  //Primary gun set number. "Random" for random weapon set.
4,                          //Number of magazines
"",                          //Backpack "" for random or classname here.
"Ins_Soldier_Sapper",              //Skin "" for random or classname here.
"Random",                  //Gearset number. "Random" for random gear set.
true                      // Mission true or false
] call spawn_group;

[[_position select 0, _position select 1, 0],                  //position
4,                          //Number Of units
1,                          //Skill level 0-1. Has no effect if using custom skills
"Random",                  //Primary gun set number. "Random" for random weapon set.
4,                          //Number of magazines
"",                          //Backpack "" for random or classname here.
"Ins_Soldier_Sapper",                          //Skin "" for random or classname here.
"Random",                  //Gearset number. "Random" for random gear set.
true                        // mission true
] call spawn_group;

[[_position select 0, _position select 1, 0],                  //position
4,                          //Number Of units
1,                          //Skill level 0-1. Has no effect if using custom skills
"Random",                  //Primary gun set number. "Random" for random weapon set.
4,                          //Number of magazines
"",                          //Backpack "" for random or classname here.
"Ins_Soldier_Sapper",                          //Skin "" for random or classname here.
"Random",                  //Gearset number. "Random" for random gear set.
true                        // mission true
] call spawn_group;

//Turrets
[[[(_position select 0), (_position select 1) + 10, 0]], //position(s) (can be multiple).
"M2StaticMG",             //Classname of turret
0.8,                      //Skill level 0-1. Has no effect if using custom skills
"Ins_Soldier_Sapper",                          //Skin "" for random or classname here.
1,                          //Primary gun set number. "Random" for random weapon set. (not needed if ai_static_useweapon = False)
2,                          //Number of magazines. (not needed if ai_static_useweapon = False)
"",                          //Backpack "" for random or classname here. (not needed if ai_static_useweapon = False)
"Random",                  //Gearset number. "Random" for random gear set. (not needed if ai_static_useweapon = False)
True                      // Mission true or false
] call spawn_static;


[_position,_vehname] execVM "\z\addons\dayz_server\WAI\missions\compile\markers.sqf";
[nil,nil,rTitleText,"Bandits have disabled an armed vehicle with lots of chain gun ammo in the gear! Check your map for the location!", "PLAIN",10] call RE;
//rHINT

_missiontimeout = true;
_cleanmission = false;
_playerPresent = false;
_starttime = floor(time);
while {_missiontimeout} do {
    sleep 5;
    _currenttime = floor(time);
    {if((isPlayer _x) AND (_x distance _position <= 150)) then {_playerPresent = true};}forEach playableUnits;
    if (_currenttime - _starttime >= wai_mission_timeout) then {_cleanmission = true;};
    if ((_playerPresent) OR (_cleanmission)) then {_missiontimeout = false;};
};
if (_playerPresent) then {
    [_veh,[_vehdir,_objPosition],_vehclass,true,"0"] call custom_publish;
    waitUntil
    {
        sleep 5;
        _playerPresent = false;
        {if((isPlayer _x) AND (_x distance _position <= 30)) then {_playerPresent = true};}forEach playableUnits;
        (_playerPresent)
    };
    diag_log format["WAI: Mission Armed vehicle Ended At %1",_position];
    [nil,nil,rTitleText,"Survivors have secured the armed vehicle!", "PLAIN",10] call RE;
} else {
    clean_running_mission = True;
    deleteVehicle _veh;
    deleteVehicle _box;
    {_cleanunits = _x getVariable "missionclean";
    if (!isNil "_cleanunits") then {
        switch (_cleanunits) do {
            case "ground" :  {ai_ground_units = (ai_ground_units -1);};
            case "air" :     {ai_air_units = (ai_air_units -1);};
            case "vehicle" : {ai_vehicle_units = (ai_vehicle_units -1);};
            case "static" :  {ai_emplacement_units = (ai_emplacement_units -1);};
        };
        deleteVehicle _x;
        sleep 0.05;
    };    
    } forEach allUnits;
    
    diag_log format["WAI: Mission Armed vehicle Timed Out At %1",_position];
    [nil,nil,rTitleText,"Survivors did not secure the armed vehicle in time!", "PLAIN",10] call RE;
};

missionrunning = false;
Link to comment
Share on other sites

10 answers to this question

Recommended Posts

  • 0

 

Hi guys, I`m using WAI mission system and I want to change the information about the mission from middle screen to right top corner side (Like a debug monitor)

 

Lets take one mission for an example:

 

here is the line with the information about the mission:

[nil,nil,rTitleText,"Bandits have disabled an armed vehicle with lots of chain gun ammo in the gear! Check your map for the location!", "PLAIN",10] call RE;

If I change the rTitleText to rHINT then I get all the message in the debug monitor in the right top side of the screen and it`s working, but I want to customise the look of the debug a bit...

 

I tryed something like this..

 

Setup a new private array _hint

_hint = parseText format["<t align='center' color='#FFFF66' shadow='2' size='1.75'>Armored Vehicle</t><br/><t align='center' color='#ffffff'>Bandits have disabled an armed vehicle with lots of chain gun ammo in the gear! Check your map for the location!</t>"];

But seems that it`s not working, the message does not popup.

Could somebody with more experience in scripting could help me to make a format which does work?

I`m also adding whole original mission file in the end of the topic, if somebody need it to help me :)

 

I have also tryed to ask this question in main WAI mission topic, but nobody did answer, so I`m making a new topic in this section!

 

Thx!

 

P.S Sorry for such primitive grammer!

 

 

it looks about right, i think your error is most likely a typing error or somewhere else ... obviusly rhint does not have "PLAIN DOWN" and delay parameters, but im guessing you already knew that

Link to comment
Share on other sites

  • 0

it looks about right, i think your error is most likely a typing error or somewhere else ... obviusly rhint does not have "PLAIN DOWN" and delay parameters, but im guessing you already knew that

 

Yeah, I know about PLAIN DOWN and delay but the problem is when I change the code, the message does not popup, also there are no errors or no logs to see what`s wrong...

Have cheked for some missing comas or colon but I think that all is correct...

Link to comment
Share on other sites

  • 0

Yeah, I know about PLAIN DOWN and delay but the problem is when I change the code, the message does not popup, also there are no errors or no logs to see what`s wrong...

Have cheked for some missing comas or colon but I think that all is correct...

 

you made a small error:

 

Check your map for the location!</t>"];

 

should be:

Check your map for the location!</t><br/>"];
Link to comment
Share on other sites

  • 0

 

you made a small error:

 

 

should be:

Check your map for the location!</t><br/>"];

Man, it`s not error  that couses me the following problem about popup not showing, don`t be silly :D

 

Besdies you don`t need a </ br> to end the line if nothing follows....

Link to comment
Share on other sites

  • 0

Man, it`s not error  that couses me the following problem about popup not showing, don`t be silly :D

 

Besdies you don`t need a </ br> to end the line if nothing follows....

 

im pretty sure that br/ means a break, but i could be wrong, tbh idk ... pretty sure thats the problem tho, as i dont see anything else wrong (except for the fact that i dont see the rhint line anywhere in the script)

Link to comment
Share on other sites

  • 0

I've seen worse things that I thought was silly to be actually the root of the problem. If other people find things, I find it's always better to say thanks, maybe secretly try it even if I think they are bonkers (guy only have half a brain) ( <3 U Halvhjearne) . :) 

 

 

Answering your reply, I know a bit about HTML and script language, maybe my problem is silly for some one here, but I know a bit and </br>, </t> or any other tag is not relaited to situation, when message simple does not popup... Maybe it can cause some formating problems, not not working problems...

 

im pretty sure that br/ means a break, but i could be wrong, tbh idk ... pretty sure thats the problem tho, as i dont see anything else wrong (except for the fact that i dont see the rhint line anywhere in the script)

 

 

Yes, </ br> ir a break and it`s should be added only if you want to continue to write something, if it`s end of the text, then you can also not add it and it will not cause any problems.....

 

And about the fact, well you should read my topic a bit more properly because I said that I`m posting original code, not edited...

 

Any way thx for trying to help, but sometimes guessing can led others to fiding problem which is acually not there, if you understand what I meant ;)

 

I found my problem..., if somebody in future will want to change the mission information message from center to debug, then you will also need one more script that fix Epoch error and popups will work!

My code does work, it`s 100 % correct, I can paste it again ir somebody need it...

//comment standart message:
//[nil,nil,rTitleText,"Bandits have disabled a Convoy! Check your map for the location!", "PLAIN",10] call RE;
[_position,"Disabled Convoy"] execVM "\z\addons\dayz_server\WAI\missions\compile\markers.sqf";
// Send Top Right message to users , requires Remote message script
_hint = parseText format["<t align='left' color='#FFFF9F' shadow='2' size='1.75'>WAI mission:</t><br/><t align='left' color='#FFFFF9F'>Bandits have disabled a Convoy! Check your map for the location!</t>"];
customRemoteMessage = ['hint', _hint];
publicVariable "customRemoteMessage";

and put _hint in the private array

 

I paste the code, rename it to message.sqf for an example... and put it in the main mission folder

 

You will also need to this _nil = [] execVM "messages.sqf"; to your init.sqf

fnc_remote_message = {
	private ["_type", "_message", "_player"];
	_type = _this select 0;
	_message = _this select 1;
	if (count _this > 2) then {
		_player = _this select 2;
		if (_player == player) then {
			switch (_type) do {
				case "globalChat": {
					player globalChat _message;
				};
				case "hint": {
					hint _message;
				};
				case "titleCut": {
					titleCut [_message, "PLAIN DOWN", 3];
				};
				case "titleText": {
					titleText [_message, "PLAIN DOWN"]; titleFadeOut 10;
				};
			};
		};
	} else {
		switch (_type) do {
			case "hint": {
				hint _message;
			};
			case "titleCut": {
				titleCut [_message,"Plain Down",3];
			};
			case "titleText": {
				titleText [_message, "PLAIN DOWN"]; titleFadeOut 10;
			};
		};
	};
};

"customRemoteMessage" addPublicVariableEventHandler {(_this select 1) call fnc_remote_message;};
Link to comment
Share on other sites

  • 0

 

Answering your reply, I know a bit about HTML and script language, maybe my problem is silly for some one here, but I know a bit and </br>, </t> or any other tag is not relaited to situation, when message simple does not popup... Maybe it can cause some formating problems, not not working problems...

 

 

Yes, </ br> ir a break and it`s should be added only if you want to continue to write something, if it`s end of the text, then you can also not add it and it will not cause any problems.....

 

And about the fact, well you should read my topic a bit more properly because I said that I`m posting original code, not edited...

 

Any way thx for trying to help, but sometimes guessing can led others to fiding problem which is acually not there, if you understand what I meant ;)

 

I found my problem..., if somebody in future will want to change the mission information message from center to debug, then you will also need one more script that fix Epoch error and popups will work!

My code does work, it`s 100 % correct, I can paste it again ir somebody need it...

 

idk if you are acting stupid now or you just legitly did not know any better, but i kinda assumed that you knew how and where to add the line in the script, to actually broadcast the hint text you had formated, but i guess not ...

 

what you are doing here however could be refered to as "taking a shortcut around the moon", to do something that is already implemented wit re calls

 

this is how you could have done what you where asking (and what i assumed you had already done), the way you explained it, i assumed you already knew this and had added this line to your script:

[nil, nil, rHINT, "Hello World"] call RE;

for the record, i have often seen these hints do wierd unexplainable stuff, for the wierdest reasons ... i wouldnt be surprised if a missing break could cause no hint and no error

Link to comment
Share on other sites

  • 0

For the record, the problem was not about the hint text but about the way how to format it...

for an example if I would add

[nil, nil, rHINT, "<b>Hello World</b>"] call RE;

The text will be showed like this <b>Hello World</b> and the bold tag would not work....

 

So I come to conclusion that best way or the only was I know, how to format text in debug is following...

_hint = parseText format["<t align='left' color='#FFFF9F' shadow='2' size='1.75'>Topic Tittle:</t><br/><t align='left' color='#FFFFF9F'>Formated text!</t>"]
customRemoteMessage = ['hint', _hint];
publicVariable "customRemoteMessage";

That`s it, maybe I`m to stupid, maybe you did not understand my poor english grammer or maybe you are to lazy to fully read my problem...

I`m saying again, thank you for trying to help me :) I won`t reply anymore, moderators can close this topic...

Link to comment
Share on other sites

  • 0

For the record, the problem was not about the hint text but about the way how to format it...

for an example if I would add

[nil, nil, rHINT, "<b>Hello World</b>"] call RE;

The text will be showed like this <b>Hello World</b> and the bold tag would not work....

 

So I come to conclusion that best way or the only was I know, how to format text in debug is following...

 

thats why you format it and tell the engine to show it as text like this this:

 

 

_hint = parseText format["<t align='left' color='#FFFF9F' shadow='2' size='1.75'>Topic Tittle:</t><br/><t align='left' color='#FFFFF9F'>Formated text!</t>"]

 

 

then you broadcast said text, like this:

[nil, nil, rHINT, _hint] call RE;
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Advertisement
  • Discord

×
×
  • Create New...