Jump to content

Mission Monitor Display


Recommended Posts

Hello! I was wondering if someone has any idea how to implement a Mission Monitor Display.

 

Something like this:

 

monitor.jpg

 

I wanna implement that in my DZMS missions so it displays when a mission comes up. 

 

I know its something to do with this code

 

This is the Mission Monitor for Wasteland.

_picture = getText (configFile >> "cfgVehicles" >> typeOf _vehicle >> "picture");
_vehicleName = getText (configFile >> "cfgVehicles" >> typeOf _vehicle >> "displayName");
_hint = parseText format ["<t align='center' color='%4' shadow='2' size='1.75'>Main Objective</t><br/><t align='center' color='%4'>------------------------------</t><br/><t align='center' color='%5' size='1.25'>%1</t><br/><t align='center'><img size='5' image='%2'/></t><br/><t align='center' color='%5'>A<t color='%4'> %3</t> has been immobilized; go get it for your team!</t>", _missionType, _picture, _vehicleName, mainMissionColor, subTextColor];

All tho i found a script on epoch like this.

	cutText ["Advanced drop control and debug functions enabled!", "PLAIN DOWN"];
		};
		_pic1 = (gettext (configFile >> 'CfgVehicles' >> _TheModel >> 'picture'));
		_txt1 = (gettext (configFile >> 'CfgVehicles' >> _TheModel >> 'displayName'));
		_txt2 = (gettext (configFile >> 'CfgVehicles' >> _randcont >> 'displayName'));
		_txt3 = (gettext (configFile >> 'CfgVehicles' >> _randombox >> 'displayName'));
		_dist = (_Drop_plane distance _wp_pos);
		_GPS = (mapGridPosition getpos _Drop_plane);
		hintsilent parseText format ["
		<t size='1'font='Bitstream'align='Center'>RandomDrop Enroute @</t><br/>
		<t size='1.25'font='Bitstream'align='Center'color='#5882FA'>***(%1)***</t><br/>
		<t size='1.25'font='Bitstream'align='Center'color='#c70000'>Transporter:</t><br/>
		<img size='5' image='%4'/><br/>
		<t size='1.25'font='Bitstream'align='Center'color='#FFCC00'>%2</t><br/>
		<t size='1'font='Bitstream'align='Center'>[%3]</t><br/>
		<t size='1.25'font='Bitstream'align='Center'color='#c70000'>Container:</t><br/>
		<t size='1.25'font='Bitstream'align='Center'color='#FFCC00'>%5</t><br/>
		<t size='1'font='Bitstream'align='Center'>[%6]</t><br/>
		<t size='1.25'font='Bitstream'align='Center'color='#c70000'>Final box:</t><br/>
		<t size='1.25'font='Bitstream'align='Center'color='#FFCC00'>%7</t><br/>
		<t size='1'font='Bitstream'align='Center'>[%8]</t><br/>
		<t size='1.25'font='Bitstream'align='left'>Distance:</t><t size='1.25'font='Bitstream'align='right'>Speed:</t><br/>
		<t size='1.5'font='Bitstream'align='left'>%9Km</t><t size='1.5'font='Bitstream'align='right'>%10Km/h</t><br/>
		",
		_GPS,
		_txt1,
		_TheModel,
		_pic1,
		_txt2,
		_randcont,
		_txt3,
		_randombox,
		(_dist/1000),
		(round(speed _Drop_plane))
		];

How would i implement this to DZMS? I know i would have to create one for each mission, i just dont know how to connect that code to DZMS, if anyone has any idea or if theres a tutorial out there, (i cant find it) i would really apreciate it! :)

 

 

Thanks in advance!

Link to comment
Share on other sites

Would it be something like?

private ["_missName","_coords","_net","_veh1","_veh2","_vehicle","_vehicle1","_crate","_crate1","_crate2","_crate3","_hint"];

//--------//

_hint = parseText format ["
<t size='1'font='Bitstream'align='Center'>Nato Weapons Cache</t><br/><br/>
<t size='1'font='Bitstream'align='Center'>Bandits have Overrun a NATO Weapons Cache!</t><br/>"
];
[nil,nil,rHINT,_hint] call RE;

Hmm my scripting skills are not that great :P so i go for the simpliest way ^^

 

If i wanted to add a picture would it be like?

private ["_missName","_coords","_net","_veh1","_veh2","_vehicle","_vehicle1","_crate","_crate1","_crate2","_crate3","_hint"];

//--------//

_picture = getText (configFile >> "cfgVehicles" >> typeOf _crate >> "picture");
_hint = parseText format ["
<t size='1'font='Bitstream'align='Center'>Nato Weapons Cache</t><br/><br/>
<t align='center'><img size='5' image='%2'/></t><br/>
<t size='1'font='Bitstream'align='Center'>Bandits have Overrun a NATO Weapons Cache!</t><br/>",
_picture
];
[nil,nil,rHINT,_hint] call RE;
Link to comment
Share on other sites

I use this in my debugmonitor: (changed it into your _crate)

_pic = (gettext (configFile >> 'CfgVehicles' >> (typeof vehicle _crate) >> 'picture'));

Try changing the %2 into %1. See if that works. 

 

//So like this:
<img size='5' image='%1'/><br/>
Link to comment
Share on other sites

Hmm i can try and make it like:

 

 

 

_pic = (gettext (configFile >> 'CfgVehicles' >> (typeof vehicle _crate) >> 'picture'));

 

 

All tho i already tried:

 

 

 

//So like this:
<img size='5' image='%1'/><br/>

 

When u told me in the beginning.

 

ill see if it make it look like urs works and let u know

Link to comment
Share on other sites

i use DZMS and WAI, i try to implement in both, for each mission i dont really know how to create functions like Vampire mentioned above :P

 

Well the Monitor works but doesn't display any picture, i thought if i call the variable "_crate" it would associate with: 

_crate = createVehicle ["USVehicleBox",_coords,[], 0, "CAN_COLLIDE"];

So therefore appear's a picture of a crate, or am i wrong?

 

Anyway here is an example of a mission i modified to include this monitor.

 

/*


AN-2 Bandit Supply Drop by Vampire
Example Code by Halv
*/

private ["_missName","_coords","_plane","_aiGrp","_pilot","_wp","_wp_pos","_loop","_half","_newPos","_plane2","_chute","_box","_dropDir","_wp2","_fallCount","_boxFin","_pic","_hint"];

//Name of the Mission
_missName = "Supply Drop";

//DZMSFindPos loops BIS_fnc_findSafePos until it gets a valid result
_coords = call DZMSFindPos;

_pic = (gettext (configFile >> 'CfgVehicles' >> (typeof vehicle _plane) >> 'picture'));
_hint = parseText format ["
<t size='1.4' font='Bitstream' align='center' color='#DDDDDD'>Supply Drop</t><br/><br/>
<t align='center'><img size='5' image='%1'/></t><br/>
<t size='1.15' font='Bitstream' align='center' color='#C70000'>An C130 with Bandit Supplies is Flying In!</t><br/><br/>
<t size='1.15' font='Bitstream' align='center' color='#C70000'>Get to the Location and Capture the Package!</t><br/><br/>
<t size='1' font='Bitstream' align='center' color='#16DB57'>Check your Map for the location!</t><br/>",

_pic
];
[nil,nil,rHINT,_hint] call RE;

[nil,nil,rTitleText,"An C130 with Bandit Supplies is Flying In!\nGet to the Location and Capture the Package!", "PLAIN",10] call RE;

//DZMSAddMajMarker is a simple script that adds a marker to the location
[_coords,_missname] ExecVM DZMSAddMajMarker;

//Lets get the C130 Flying
_plane = createVehicle ["C130J_US_EP1", [0,0,500], [], 0, "FLY"];
[_plane] call DZMSProtectObj;
_plane engineOn true;
_plane flyInHeight 150;
_plane forceSpeed 175;

//Empty the plane
clearMagazineCargoGlobal _plane;
clearWeaponCargoGlobal _plane;

//Lets make AI for the plane and get them in it
_aiGrp = creategroup east;

_pilot = _aiGrp createUnit ["SurvivorW2_DZ",getPos _plane,[],0,"FORM"];
_pilot moveindriver _plane;
_pilot assignAsDriver _plane;

_wp = _aiGrp addWaypoint [[(_coords select 0), (_coords select 1),150], 0];
_wp setWaypointType "MOVE";
_wp setWaypointBehaviour "CARELESS";
_wp_pos = waypointPosition [_aiGrp,1];

_pilot addWeapon 'NVGoggles';
_pilot addWeapon 'ItemCompass';
_pilot addWeapon 'ItemRadio';
_pilot addWeapon 'ItemMap';
_pilot addWeapon 'ItemGPS';
sleep 5;

//DZMSAISpawn spawns AI to the mission.
//Usage: [_coords, count, skillLevel, unitArray]
[_coords,6,1,"DZMSUnitsMajor"] call DZMSAISpawn;
sleep 5;
[_coords,6,1,"DZMSUnitsMajor"] call DZMSAISpawn;
sleep 5;
[_coords,4,1,"DZMSUnitsMajor"] call DZMSAISpawn;
sleep 5;

_loop = true;
_half = false;
while {_loop} do {
if (!Alive _plane OR !Alive _pilot) then {
sleep 5;

// We are going to pretend the plane was shot down nearby
deleteVehicle _plane;
deleteVehicle _pilot;

_newPos = [(_coords select 0) + (random(2000)),(_coords select 1) - (random(2000)),0];

if (surfaceIsWater _newPos) then {
//newPos is water, so lets just drop it on mark
//This is a temporary fix for needed logic
_newPos = _coords;
};

//Create the plane and kill it
_plane2 = createVehicle ["C130J_US_EP1", [(_newPos select 0),(_newPos select 1),200], [], 0, "FLY"];
[_plane2] call DZMSProtectObj;
_plane2 engineOn true;
_plane2 flyInHeight 150;
_plane2 forceSpeed 175;
sleep 2;
_plane2 setDamage 1;

//Update the location
[_coords,"C130J_wreck_EP1"] ExecVM DZMSAddMajMarker;
[nil,nil,rTitleText,"The C130 was shot down by UN Peacekeepers!\nGo Find the Supplies!", "PLAIN",10] call RE;

_chute = createVehicle ["ParachuteMediumEast", [(_newPos select 0),(_newPos select 1),200], [], 0, "FLY"];
[_chute] call DZMSProtectObj;
_box = createVehicle ["USVehicleBox", [(_newPos select 0),(_newPos select 1),200],[], 0, "CAN_COLLIDE"];
[_box] call DZMSProtectObj;
_box attachTo [_chute, [0, 0, 1]];

_loop = false;
};

if ((Alive _plane) AND (Alive _pilot) AND ((_plane distance _wp_pos) <= 1200) AND (!(_half))) then {
[nil,nil,rTitleText,"The C130 is only 1200m out from the drop point!", "PLAIN",10] call RE;

//Keep on truckin'
_plane forceSpeed 175;
_plane flyInHeight 135;
_plane setspeedmode "LIMITED";
_half = true;
};

if ((Alive _plane) AND (Alive _pilot) AND ((_plane distance _wp_pos) <= 200)) then {
//Drop the package

_dropDir = getDir _plane;
_newPos = [(getPosATL _plane select 0) - 15*sin(_dropDir), (getPosATL _plane select 1) - 15*cos(_dropDir), (getPosATL _plane select 2) - 10];

[nil,nil,rTitleText,"The C130 has reached the location and dropped the cargo!", "PLAIN",10] call RE;

_chute = createVehicle ["ParachuteMediumEast", _newPos, [], 0, "FLY"];
[_chute] call DZMSProtectObj;
_box = createVehicle ["USVehicleBox", _newPos,[], 0, "CAN_COLLIDE"];
[_box] call DZMSProtectObj;
_box attachTo [_chute, [0, 0, 1]];

deleteWaypoint [_aiGrp, 1];
_wp2 = _aiGrp addWaypoint [[0,0,150], 0];
_wp2 setWaypointType "MOVE";
_wp2 setWaypointBehaviour "CARELESS";
_plane forceSpeed 350;
_plane setSpeedmode "FULL";

_loop = false;
};
};

//The box was dropped, lets get it on the ground.
_fallCount = 0;
while {_fallCount < 45} do {
if (((getPos _box) select 2) < 1) then {_fallCount = 46};
sleep 0.1;
_fallCount = _fallCount + 0.1;
};

detach _box;
_box setpos [(getpos _box select 0), (getpos _box select 1), 0];
_boxFin = createVehicle ["USVehicleBox",[(getpos _box select 0),(getpos _box select 1), 0],[],0,"CAN_COLLIDE"];
deletevehicle _box;
deletevehicle _chute;
[[(getpos _boxFin select 0), (getpos _boxFin select 1), 0],"C130 Cargo"] ExecVM DZMSAddMajMarker;
clearWeaponCargoGlobal _boxFin;
clearMagazineCargoGlobal _boxFin;
clearBackpackCargoGlobal _boxFin;
[_boxFin,"supply"] ExecVM DZMSBoxSetup;
[_boxFin] call DZMSProtectObj;

//Wait until the player is within 30 meters and also meets the kill req
[position _boxFin,"DZMSUnitsMajor"] call DZMSWaitMissionComp;

//Let everyone know the mission is over
[nil,nil,rTitleText,"The C130 Cargo has been Secured by Survivors!", "PLAIN",6] call RE;
diag_log text format["[DZMS]: Major SM2 C130 Drop Mission has Ended."];
deleteMarker "DZMSMajMarker";
deleteMarker "DZMSMajDot";

//Let the timer know the mission is over
DZMSMajDone = true;

Link to comment
Share on other sites

The problem is: The script doesn't knows what "_plane" is, since the computer reads the scripts from up to down and "_plane = createVehicle.." is lower than "hint _plane". Try copy and pasting it under:

 

//Lets get the C130 Flying
_plane = createVehicle ["C130J_US_EP1", [0,0,500], [], 0, "FLY"];
[_plane] call DZMSProtectObj;
_plane engineOn true;
_plane flyInHeight 150;
_plane forceSpeed 175;

 

If that doesn't work, try to change the "_plane" into "_plane2":

_pic = (gettext (configFile >> 'CfgVehicles' >> (typeof vehicle _plane2) >> 'picture'));
Link to comment
Share on other sites

I guess calling it like

//DZMSBoxFill fills the box, DZMSProtectObj prevents it from disappearing
[_crate,"medical"] ExecVM DZMSBoxSetup;
[_crate] call DZMSProtectObj;

_crate2 = createVehicle ["USLaunchersBox",[(_coords select 0) - 8, _coords select 1,0],[], 0, "CAN_COLLIDE"];
[_crate2,"weapons"] ExecVM DZMSBoxSetup;
[_crate2] call DZMSProtectObj;

//DZMSAISpawn spawns AI to the mission.
//Usage: [_coords, count, skillLevel, unitArray]
[[(_coords select 0) - 20, (_coords select 1) - 15,0],4,0,"DZMSUnitsMinor"] call DZMSAISpawn;
sleep 3;
[[(_coords select 0) + 10, (_coords select 1) + 15,0],4,0,"DZMSUnitsMinor"] call DZMSAISpawn;
sleep 3;
[[(_coords select 0) - 10, (_coords select 1) - 15,0],4,0,"DZMSUnitsMinor"] call DZMSAISpawn;
sleep 3;
[[(_coords select 0) + 20, (_coords select 1) + 15,0],4,0,"DZMSUnitsMinor"] call DZMSAISpawn;
sleep 3;

 

_pic = (gettext (configFile >> 'CfgVehicles' >> (typeof vehicle _crate) >> 'picture'));
_hint = parseText format ["

<t size='1.4' font='Bitstream' align='center' color='#DDDDDD'>Medical Outpost</t><br/><br/>
<t align='center'><img size='5' image='%1'/></t><br/>
<t size='1.15' font='Bitstream' align='center' color='#C70000'>Bandits have taken over a Medical Outpost!</t><br/><br/>
<t size='1.15' font='Bitstream' align='center' color='#C70000'>Go take their Medical Supplies!</t><br/><br/>
<t size='1' font='Bitstream' align='center' color='#16DB57'>Check your Map for the location!</t><br/>",

_pic
];
[nil,nil,rHINT,_hint] call RE;

 

Doesn't even make my missions spawn, im gonna put like

 

//DZMSBoxFill fills the box, DZMSProtectObj prevents it from disappearing


[_crate,"medical"] ExecVM DZMSBoxSetup;
[_crate] call DZMSProtectObj;

_crate2 = createVehicle ["USLaunchersBox",[(_coords select 0) - 8, _coords select 1,0],[], 0, "CAN_COLLIDE"];
[_crate2,"weapons"] ExecVM DZMSBoxSetup;
[_crate2] call DZMSProtectObj;

_pic = (gettext (configFile >> 'CfgVehicles' >> (typeof vehicle _crate) >> 'picture'));
_hint = parseText format ["

 

<t size='1.4' font='Bitstream' align='center' color='#DDDDDD'>Medical Outpost</t><br/><br/>
<t align='center'><img size='5' image='%1'/></t><br/>
<t size='1.15' font='Bitstream' align='center' color='#C70000'>Bandits have taken over a Medical Outpost!</t><br/><br/>
<t size='1.15' font='Bitstream' align='center' color='#C70000'>Go take their Medical Supplies!</t><br/><br/>
<t size='1' font='Bitstream' align='center' color='#16DB57'>Check your Map for the location!</t><br/>",

_pic
];
[nil,nil,rHINT,_hint] call RE;

//DZMSAISpawn spawns AI to the mission.
//Usage: [_coords, count, skillLevel, unitArray]
[[(_coords select 0) - 20, (_coords select 1) - 15,0],4,0,"DZMSUnitsMinor"] call DZMSAISpawn;
sleep 3;
[[(_coords select 0) + 10, (_coords select 1) + 15,0],4,0,"DZMSUnitsMinor"] call DZMSAISpawn;
sleep 3;
[[(_coords select 0) - 10, (_coords select 1) - 15,0],4,0,"DZMSUnitsMinor"] call DZMSAISpawn;
sleep 3;
[[(_coords select 0) + 20, (_coords select 1) + 15,0],4,0,"DZMSUnitsMinor"] call DZMSAISpawn;
sleep 3;

 

And see if it works, probably derp from my part :O

Link to comment
Share on other sites

 

 

Hmm, interessting. So, the text spawns fine, but the picture doesn't show up?

 

After i added your changes after _plane was spawned, i think i added it wrong cause i added it after AI so missions didnt come up, but i already modified in order to be after the plane was created, all tho the crates might be the problem aswell since it doesn't recognize the _crate picture it blocks there, ill change everything now

 

 

:o All tho i though crates had pictures in the game files hmmm

 

Well ok thanks ill try it out

Link to comment
Share on other sites

Aparently my changes dont make missions spawn now, weird, im going thro the files see if i missed any , or ;

 

 

Would Calling the monitor after the plane/crate/vehicle is spawned make the mission not work?

 

 

Sorry for the late response (i dont own a test server, so everytime i wanna test something i have to wait a full restart)

Link to comment
Share on other sites

The default ones in DZMS, Major (SM1,SM2,SM3,SM4,SM5,SM6), Minor (SM1,SM2,SM3,SM4,SM5,SM6)

 

But i changed the Major Mission - SM2 to be a C130 instead of a AN-2 cause it looks cooler x)

 

And yea it would be awesome if u could send the files, thanks.

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
×
×
  • Create New...