Home   Help Search Login Register  

Author Topic: Addaction ingame menu  (Read 1527 times)

0 Members and 1 Guest are viewing this topic.

Offline The Vulcan

  • Members
  • *
Addaction ingame menu
« on: 15 Sep 2007, 05:10:15 »

Attached to radio trigger Alpha....

Quote
thislist exec "radiomenu.sqs"


Code: [Select]
me = _this select 0
~0.2
IID = me addaction ["menu option 1","menu1.sqs"]
IID = me addaction ["menu option 2","menu2.sqs"]
IID = me addaction ["menu option 3","menu3.sqs"]
IID = me addaction ["menu option 4","menu4.sqs"]
IID = me addaction ["exit","exit.sqs"]

endthis=true

@!endthis
me removeaction IID

exit

QUESTION-1

Once the user selects one of the menu options, how do I remove the menu from the screen instantly ?


QUESTION-2

I only want the radio channel to be avaibile once so its trigger is set to "once".
However if they select "exit" and don't call on the radio function, I need to reset the Radio trigger to "once" so that they can call on it again later.
How would I code that ?



Thanks for any link or tips.   :good:



Offline Mandoble

  • Former Staff
  • ****
    • Grunt ONE and MandoMissile suite
Re: Addaction ingame menu
« Reply #1 on: 15 Sep 2007, 09:59:25 »
Code: [Select]
me = _this select 0
~0.2
IID1 = me addaction ["menu option 1","menu1.sqs"]
IID2 = me addaction ["menu option 2","menu2.sqs"]
IID3 = me addaction ["menu option 3","menu3.sqs"]
IID4 = me addaction ["menu option 4","menu4.sqs"]
IID5 = me addaction ["exit","exit.sqs"]

endthis=true

@!endthis
me removeaction IID1
me removeaction IID2
me removeaction IID3
me removeaction IID4
me removeaction IID5
exit

Dont understand your second question.

Offline Wolfrug

  • Addons Depot
  • Former Staff
  • ****
  • Official OFPEC Old Timer
Re: Addaction ingame menu
« Reply #2 on: 15 Sep 2007, 10:05:24 »
Question 2:

You mean that they can only select one option from 1-3 once, but they can do it whenever? Easy enough ->

Make the trigger "repeatedly".
Inside each of the "menu#.sqs" scripts, put something like this:

Code: [Select]
0 setRadioMsg "NULL"
Now, the number in front (in the example above '0') corresponds to the radio message number. So Radio Alpha is 0, Radio Bravo is 1 etc. Anyway, what the above command will do is simply make the radio disappear and be unusable. :)

If you want to use the same channel later, you'll have to play around with conditions and stuff, but for the easy use, the above is how to do it!

Good luck!

Wolfrug out.
"When 900 years YOU reach, look as good you will not!"

Offline Planck

  • Honoured
  • Former Staff
  • ****
  • I'm never wrong ....I'm just not always right !
Re: Addaction ingame menu
« Reply #3 on: 15 Sep 2007, 12:54:43 »
I seem to recall that the radio messages are numbered from 1 onwards and not 0, unless things have changed in ArmA.


Planck
I know a little about a lot, and a lot about a little.

Offline The Vulcan

  • Members
  • *
Re: Addaction ingame menu
« Reply #4 on: 15 Sep 2007, 13:03:02 »

Thanks for the response guys.
Ok I am not getting very far with this. :dunno: (only been in the editor for a few days) 

I am trying to change Mr-Murray's Arti example to suite my needs.
I want to set the radio as follows.

  • Alpha = Fire Mission 1
  • Bravo = Fire Mission 2
  • Charlie = Fire Mission 3

When you call say Alpha.

You get the on screen menu.
  • Call Alpha Fire Mission
  • Disregard

  • If you select Call Alpha Fire Mission.  = You then click on the map to set your target and Radio Alpha becomes greyed out.
  • If you select Disregard.  = Radio Alpha is reset to availible.


At the moment I have 2 problems.
1. Calling the script from the radio doesn't bring up the menu. (his is attached to a when present trigger)
2. When there is more then one option in the menu, the menu isn't removed after making a selection.


I have attached the file I am working with.