Jump to content
  • 0

Origins Style Mission Descriptions Instead of map markers


Meowzors

Question

Need a little help here... I am trying to create something like what origins has in that instead of having large circles on the map displaying mission locations, you instead (if you have a radio) you have a pop stating that a new mission is available and to press 7 for details.  I am doing this by using a public variable passed to the client each time a mission pops... Here is what I have MAYBE someone will see what I am doing wrong... Current test only allows for one mission running at a time.

 

in my init.sqf I have:

 

...

    //Lights
    //[false,12] execVM "\z\addons\dayz_code\compile\local_lights_init.sqf";

    "WAIMissionMarker" addPublicVariableEventHandler { WAIMissionMarker execVM 'Custom\MissionInfo.sqf'; };

...

 

Inside Custom\MissionInfo.sqf :

//WAI Mission Notification
MissionPos = _this select 0;
ActiveMissionName = _this select 1;
ActiveMissionText = _this select 2;

systemChat "A mission is available press 7 to view details...";

 

uiSleep 120; //Change time here again - makes sure that the information gets reset every 2 minutes, if you put the Weapon/Item down, the Information will be removed after max. x seconds
if if(!("ItemRadio" in weapons player)
{
    ActiveMissionText="";
    ActiveMissionName="No Missions Available";
};

New code in dayz_spaceInterrupt.sqf

...

//Pressing 7 brings up Mission List
if (_dikCode == 0x08) then {
        if("ItemRadio" in weapons player) then {
            hintC format["Current Mission: %1 \n Description: %2",MissionName,MissionText];
            //_hndl = createdialog "help_dialog";
        };
    };

...

Inside WAI's Marker.sqf:

//WAI Mission Notification
if(!isServer) exitWith {};
private ["_position","_name","_units","_text"];
_position = _this select 0;
_name = _this select 1;
_text = _this select 2;
_units = [];
WAIMissionMarker = [_position, _name, _text];
while{missionrunning} do {
{
_units = [];
   if ((side _x) == West) then {  
        if("ItemRadio" in weapons _x) then { //Change Item/Weapon here use 'in magazines' if the item is no tool or weapon
            _units set [count _units, _x];
        };
   };
} forEach allUnits;
{
 (owner _x) publicVariableClient "WAIMissionMarker"
} foreach _units;
markerready = true;
uiSleep 120; //Change time here (in seconds) but dont make it too big or the script wont check for new players with the Item in inventory
};

Example Mission marker.sqf call:

...

 //Get Nearby City
    _nearestCity = nearestLocations [_position, ["NameCityCapital","NameCity","NameVillage","NameLocal"],750];
    _textCity = "Wilderness";
    if (count _nearestCity > 0) then {_textCity = text (_nearestCity select 0)};
_text = format["Bandit Base:  A jungle task force have set up a temporary encampment near %1! Go and ambush it to make it yours!!",_textCity];
[_position,"Bandit Base",_text] execVM "\z\addons\dayz_server\WAI\missions\compile\markers.sqf";

...

 

Currently when I press 7 when it alerts me that there is a mission it posts a hint that says 'mission name: __cur_map   description: any'

 

Any help would be great! Thanks.

Link to comment
Share on other sites

8 answers to this question

Recommended Posts

  • 0

Now it might be what you just posted, but in your spaceinterupt, I don't see anywhere where you define MissionName,MissionText so how would it know what to call? but better yet you could have it activate on a keypress.. like you have but instead of going through and creating the hintC there (which isn't the best solution) have it exec a .sqf file..

 

SO, your code would look like this (or something like it)

//Pressing 7 brings up Mission List
if (_dikCode == 0x08) then {
        if("ItemRadio" in weapons player) then {
            _nill = execvm "custom\hint.sqf";
        };
    };


//Inside hint.sqf

_MName = definehere;
_MText = definehere;
hintSilent parseText format ["Current Mission %1 \n Description: %2",_MName,_MText];


That would allow you to make more edits and keep it cleaner etc

Link to comment
Share on other sites

  • 0

Those two variables should be defined inside of missioninfo.sqf which is called when a mission starts... I didn't mark then as private so they should be public for other sqf files to use just as people use variables such as adminList=... Right? Could be a misunderstanding on my part as to how these variables are shareable?

Link to comment
Share on other sites

  • 0

Omg just looked at those files in my post above and it seems I used different names for them in the different sqf files and that MIGHT be the only issue with my logic there other than prettifying it and changing the variables to arrays so multiple mission Info can be displayed etc

Link to comment
Share on other sites

  • 0

Omg just looked at those files in my post above and it seems I used different names for them in the different sqf files and that MIGHT be the only issue with my logic there other than prettifying it and changing the variables to arrays so multiple mission Info can be displayed etc

Ha yea thats what I was looking at mainly :P

 

Edit- let me know if that change works out for you

Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
  • Advertisement
  • Discord

×
×
  • Create New...