Jump to content
Sign in to follow this  
jakkob4682

menu template for creating menu using BIS_fnc_createMenu:

Recommended Posts

I want to create a custom menu with different options and have each "main" option have sub-options. for when u press 0-9 or0-8, it creates a list of options. Then each of those options has a list of sub-options. I looked at the misc folder for the functions module and saw what I believe is the framework for it BIS_fnc_createMenu and showMenu etc, but not quite getting what the parameters mean or how to pass them w/ a called function.

Share this post


Link to post
Share on other sites

getting this is .rpt file

Warning Message: No entry 'bin\config.bin.USER:AirSupport_Menu'.

Warning Message: No entry '.title'.

Warning Message: '/' is not a value

Warning Message: No entry '.items'.

this is the script

AirSupport_Menu = 
[
["Air Support",False],
["CH 47",[2],"",-5,[["expression","nul = [player] execVM 'Helo\CH47.sqf'"]],"1","1"],
["CAS(Cobra)",[3],"",-5,[["expression","nul = [player] execVM 'Helo\Cobra.sqf'"]],"1","1"],
["CAS(A10)",[4],"",-5,[["expression","nul = [player] execVM 'Helo\A10.sqf'"]],"1","1"],
["LGB(F-18)",[5],"",-5,[["expression","nul = [player] execVM 'Airstrike\F18.sqf'"]],"1","1"],
["Transport(Blackhawk)","",-5,[["expression","nul = [player] execVM 'Helo\Transport.sqf'"]],"1","1"]
];

GroundSupport_Menu =
[
["Ground Support",False],
["Armored QRF",[2],"",-5,[["expression","nul = [player] execVM 'InfSupport\ArmorQRF.sqf'"]],"1","1"],
["Mobile QRF",[3],"",-5,[["expression","nul = [player] execVM 'InfSupport\MobileQRF.sqf'"]],"1","1"],
["Sniper Support",[4],"",-5,[["expression","nul = [player] execVM 'InfSupport\Snipers.sqf'"]],"1","1"],
["Transport",[5],"",-5,[["expression","nul = [player] execVM 'InfSupport\Transport.sqf'"]],"1","1"],
["Medic Support",[6],"",-5,[["expression","nul = [player] execVM 'InfSupport\Medic.sqf'"]],"1","1"]
];	

[] call BIS_fnc_commsMenuCreate; 

Main_Menu =
[
["Support Menu",False],
["Air Support Options",[2],"USER:AirSupport_Menu",-5,[["expression","player sideChat 'Pick an option'"]],"1","1"],
["Ground Support Options",[3],"USER:GroundSupport_Menu",-5,[["expression","player sideChat 'Pick an option'"]],"1","1"]
];
BIS_MENU_GroupCommunication = 
[
[localize "STR_SOM_COMMUNICATIONS", false],
["Support Menu",[2],"#USER:Main_Menu",-5,[["expression",""]],"1","1"]
];


showCommandingMenu "#USER:Main_Menu";
waituntil {!isnil "BIS_MENUS"};

Share this post


Link to post
Share on other sites

You're missing the # in front of the USER in the case the error is referring to.

Share this post


Link to post
Share on other sites

thanks, got it figured out.

---------- Post added at 02:14 AM ---------- Previous post was at 02:12 AM ----------

so I have another question... how do I go about deleting the vehicle/crew created within a script using a fired event handler.... i.e.

A10 or F-18 fires their LGB, I want to delete the vehicle and crew created inside the script so that if the user uses that option again they dont have 30 A10's flying around?

---------- Post added at 02:20 AM ---------- Previous post was at 02:14 AM ----------

I've gotten the the first two options working as intended... suppport menu comes up either infantry support or ground transport gets selected, the fire team or ground transport spawns moves to player position and script fired is fine. However, with the Close Air Support option I'm having an issue with deleting the crew and vehicle that is spawned, here is what I'm using

deleteThis.sqf

_veh = _this select 0;

{
deleteVehicle _x;
}forEach (crew _veh);

deleteVehicle _veh;
//addSwitchableUnit (driver _veh); used to check if driver was successfully deleted
hintSilent format ["%1",count (crew _veh)];

inside the CAS script

_pos = [position player,3000,random 360] call BIS_fnc_relPos;

_grp = createGroup west;
_pilot = _grp createUnit ["USMC_Soldier",_pos,[],0,"FORM"];
_vehicle = createVehicle ["A10_US_EP1",_pos,[],0,"FLY"];
_pilot assignAsDriver _vehicle;
_pilot moveInDriver _vehicle;

if(_pilot in _vehicle) then
{
player sideChat "A10 CAS Enroute";
(driver _vehicle) doMove (position player);
player addWeapon "LaserDesignator";
player addMagazine "LaserBatteries";
hintSilent "Use your laser designator!!";
};
waitUntil{_vehicle distance player < 1000};
hintSilent "A10 in close proximity get to safe distance";
_vehicle addEventHandler ["Fired",{[_vehicle] execVM "EH_Stuff\deleteThis.sqf"}];
if(isNull _pilot and isNull _veh)then
{
hintSilent "objects deleted";
};

Edited by jakkob4682
clarification

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  

×