Jump to content
Blackheart_Six

setUserActionText Command

Recommended Posts

Greetings and Salutations!

 

Situation: I am setting up a supply room for one of my missions. I have several shelves with multiple items on them. I.E. One shelf has a bipod, silencer, and flashlight.

 

I have this code in a script, with a game logic on the map named "R3S3". R3S3 equal "rack 3, shelf 3". 

 

R3S3 = "groundWeaponHolder" createVehicle getpos RACK_3; 
R3S3 addItemCargo ["muzzle_snds_M",1];
R3S3 addItemCargo ["bipod_01_F_blk",1]; 
R3S3 addItemCargo ["acc_flashlight",1]; 
R3S3 setPos [getPos RACK_3 select 0,getPos RACK_3 select 1,1.847]; 
R3S3 setdir random 360;
R3S3 setDamage 1; 
R3S3 addAction ["Take Flashlight (Scroll for more items)","player addItem 'acc_flashlight';",nil,6,true,false,"","true",-1,false,"",""];
R3S3 addAction ["Take Bipod","player addItem 'bipod_01_F_Blk';",nil,6,true,false,"","true",-1,false,"",""];
R3S3 addAction ["Take Silencer","player addItem 'muzzle_snds_M';",nil,6,true,false,"","true",-1,false,"",""];

It works great, and as intended at this point.

 

What I would like to do is replace the 3 individual "addAction" items with a single menu item, and then a sub-menu with the 3 items to select from.

 

Example:

"Select Item"

            ->add Flashlight

            ->add Bipod

            ->add Silencer

 

I found "setUserActionText" as a possible solution. But looks like it is for displaying additional information. I've seen examples of the command used as a switch for earplugs.

 

I can't get each individual addAction to work in the sub-menu. I can display them. So I don't know if it possible.

 

Question: Can you use "setUserActionText" to create sub-menus in the action menu for an "addAction" item?

 

Syntax:

object setUserActionText [actionIndex, textMenu, textWindowBackground, textWindowForeground]

 

Any input or thoughts would be appreciated.

 

I believe I need to wrap "setUserActionText" in the "addAction". I've tried several iterations but not working. I'll keep plugging away.

 

 

 

 

 

 

 

 

 

 

Share this post


Link to post
Share on other sites

Can try this

 

Share this post


Link to post
Share on other sites

Just to close this out.....

 

I found I like this option the best. I am using this to create a supply room with items on tables and shelves.

 

This will give the text "Use scroll wheel to select item" when you look at the table. Then scroll  and the "take item1", "take item2", etc. etc. will appear. Works well for when you have multiple items on one surface.

 

I know it's not pretty, and optimized. But not bad for reading the biki's. 

 

1. Place a table or shelf. 

2. Name it "Table_1".

3. Place a game logic on top of the table. Get the z height. Use it for the select 1 position. 

4. Replace the items in the code with what you want.

 

Note there is a limit to what you can put. 3 items work best. Play with the setDir number. Or use setDir random 360; 

 

T1 = "groundWeaponHolder" createVehicle getpos TABLE_1; 
T1 addItemCargo ["ItemGPS",1];
T1 addItemCargo ["ItemMap",1]; 
T1 addItemCargo ["ItemRadio",1]; 
T1 addItemCargo ["ItemCompass",1]; 
T1 setPos [getPos TABLE_1 select 0,getPos TABLE_1 select 1,1.407]; 
T1 setdir 0;
T1 setDamage 1; 
_GPS = T1 addAction ["Take GPS","player addItem 'ItemGPS';",nil,6,true,false,"","true",-1,false,"",""];
_map = T1 addAction ["Take Map","player addItem 'ItemMap';",nil,6,true,false,"","true",-1,false,"",""];
_radio = T1 addAction ["Take Radio","player addItem 'ItemRadio';",nil,6,true,false,"","true",-1,false,"",""];
_compass = T1 addAction ["Take Compass","player addItem 'ItemCompass';",nil,6,true,false,"","true",-1,false,"",""];
T1 setUserActionText [_gps,"Take GPS","Use Scroll Wheel<br/>to select item",""];
T1 setUserActionText [_map,"Take Map","Use Scroll Wheel<br/>to select item",""];
T1 setUserActionText [_compass,"Take Compass","Use Scroll Wheel<br/>to select item",""];
T1 setUserActionText [_radio,"Take Radio","Use Scroll Wheel<br/>to select item",""];

 

Share this post


Link to post
Share on other sites

I directly place the items on the tables/shelves in 3den... If you leave sufficient room between them, there is no problem to pick what you want.

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

×