Jump to content
Sign in to follow this  
ra1n0fpa1n

Ingame GUI Menu with integrated with commands

Recommended Posts

Hey guys sorry for posting this a thread like this again its just i really want to get my mission done,

in the previous thread i want to create a menu activated by a trigger that would give me a list of things to select. In which case if i would select something i could spawn stuff like ai units, vehicles etc

for example

Text in the menu would be "Train Soldier"

the Script that would execute after

"FR_Assault_R" createUnit [position player, group player];

hint "Soldier Trained";

2nd text in the menu would be "Train Medic"

the Script that would execute after

"USMC_Soldier_Medic" createUnit [position player, group player];

hint "Medic Trained";

i was told to put this in an init.sqf and replace the expression and the create unit command with my scripts and double the syntax since its strict. because this is strict every time i enter my script the menu shows up as blank hence its strict

(In init.sqf)

infantryMenu_1 = [

["Squad Interface", false],

["Train Soldier",[2],"",-5,[["expression","create unit command"]],"1","1"],

["Train Medic",[3],"",-5,[["expression","create unit command"]],"1","1"]

];

Then going into the editor i would place this in a trigger as the activation

GUIMenu = [] spawn {while {true} do {sleep 10; showCommandingMenu "#USER:infantryMenu_1";}};

and this for the deactivation

terminate GUIMenu;

So The problem is can anyone give me a example the working init.sqf, im just getting confused on what im doing wrong since its so strict. its been basically trial and error for the past 3 days on this, if anyone can give me a proper example that would be great

Share this post


Link to post
Share on other sites

To fix the first post the init file would look like this

infantryMenu_1 = [
["Squad Interface", false],
["Train Soldier",[2],"",-5,[["expression","_unit = group player createUnit ['US_Soldier_Engineer_EP1', Position player, [], 0, 'FORM']; "]],"1","1"],
["Train Medic",[3],"",-5,[["expression","_unit = group player createUnit ['US_Soldier_Medic_EP1', Position player, [], 0, 'FORM'];   "]],"1","1"]
];

As the calling script has a 10 second delay you will have to wait for it to show.

I wish I could create menu's like Mikie boy posted but it's a bit beyond me, I've tried some of the tutorials and editors but they all see to be buggy.

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  

×