Home   Help Search Login Register  

Author Topic: How i can make one Submenu?  (Read 2074 times)

0 Members and 1 Guest are viewing this topic.

Offline Praxtor

  • Members
  • *
    • Operflashpoint
How i can make one Submenu?
« on: 18 Nov 2005, 01:20:34 »
Hello guys!!

I am making one Acrobatic Plane and i would like know how i can make into the config file or in other site i donÂ't know but i can have into my addon into the player action menú one drop-down to keep all options of the acrobatic smoke close and that single unfolds when I activate the menu.
can somebody help me?
Regards

Offline Pilot

  • Contributing Member
  • **
Re:How i can make one Submenu?
« Reply #1 on: 18 Nov 2005, 03:51:38 »
You will need to call a script from an init eventhandler that will add the action to the plane.  I am about ready to go to sleep, so if you need an example tell me and I will write one up for you tomorrow.

-Pilot

Offline bedges

  • Administrator
  • *****
    • OFPEC The Editing Center
Re:How i can make one Submenu?
« Reply #2 on: 18 Nov 2005, 15:33:22 »
sounds like you need a dialog. player gets into the plane, and in the action menu appears "Smoke Menu" or something similar, then when the player clicks it, up comes a nice menu with all the smoke options. is this correct?

mhmm, dialogs. quite advanced, but if you're making acrobatic planes, it should be pretty easy for you ;)

Offline Planck

  • Honoured
  • Former Staff
  • ****
  • I'm never wrong ....I'm just not always right !
Re:How i can make one Submenu?
« Reply #3 on: 18 Nov 2005, 16:00:41 »
Quote
mhmm, dialogs. quite advanced, but if you're making acrobatic planes, it should be pretty easy for you


Yes, as long as you don't want to activate your dialog whilst flying everything should be fine.  ;D


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

Offline Pilot

  • Contributing Member
  • **
Re:How i can make one Submenu?
« Reply #4 on: 18 Nov 2005, 16:17:43 »
Maybe I am missing something here, but isn't Praxtor talking about the action menu?  I think he wants one action that says something like:
Smoke Options

Then when the player selects that, that action disappears and a few others take it's place to do the actual smoke effects.  Something like:
Blue Smoke
Red Smoke
Green Smoke

Or have I misunderstood?

-Pilot

Offline bedges

  • Administrator
  • *****
    • OFPEC The Editing Center
Re:How i can make one Submenu?
« Reply #5 on: 18 Nov 2005, 16:25:12 »
could be done that way also. if he's not too bothered about the plane 'pausing' at altitude while the player chooses a smoke effect - thankyou Planck :P - then a dialog would do a neater job, but i suppose multiple actions are also a possibility...
« Last Edit: 18 Nov 2005, 16:25:39 by bedges »

Offline Planck

  • Honoured
  • Former Staff
  • ****
  • I'm never wrong ....I'm just not always right !
Re:How i can make one Submenu?
« Reply #6 on: 18 Nov 2005, 16:35:36 »
The thing with dialogs is, if your plane is pointed towards the ground when you activate your dialog, it will continue towards the ground and you will not be able to change its heading until you cancel the dialog.   BOOM.....hehehe.....OOPS......pretty black smoke.   :P


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

Offline bedges

  • Administrator
  • *****
    • OFPEC The Editing Center
Re:How i can make one Submenu?
« Reply #7 on: 18 Nov 2005, 16:50:21 »
unless of course the designer uses the old setacctime 0 to freeze time until the choice is made, then un-freezing time so that crashing pilots have a chance to scroll through fewer action-menu items to click 'eject'...

 :P

Offline Pilot

  • Contributing Member
  • **
Re:How i can make one Submenu?
« Reply #8 on: 18 Nov 2005, 17:19:23 »
Quote
BOOM.....hehehe.....OOPS......pretty black smoke. :P
Lol!

Ok, I have a working smoke system.  Problem is, I am very sure it isn't MP compatible.  Just for demonstration purposes I have coded three smoke colors for it, Red, Green, and Blue.  If there was something specific you wanted, Praxtor, let me know and I will see if I can code it for you, or at least help you along.  It's a bit complex, for the three colors six scripts are required.  If you want me to post the six scripts and the bit you need for the config, let me know.  I won't post it until you tell me to.

-Pilot

Offline Praxtor

  • Members
  • *
    • Operflashpoint
Re:How i can make one Submenu?
« Reply #9 on: 20 Nov 2005, 16:07:25 »
Hei Guys sorry for the absence, i am working very hard in this last days  :).
Quote
Smoke Menu" or something similar, then when the player clicks it, up comes a nice menu with all the smoke options. is this correct?
Yes is it correct i can make it, because i have the plane and when it gear up appear into the user action menu 4 options  whith are
  • Red Smoke
  • Yellow Smoke
  • Write Smoke
  • Blue Smoke

And it is very unconfortable because the player has a lot of optionns in the action menú i would like group all this in one like "Smoke Menu" and when you clink here the menu open and you can select your option.

Regards to all

 ;)
« Last Edit: 20 Nov 2005, 16:08:38 by Praxtor »

Offline bedges

  • Administrator
  • *****
    • OFPEC The Editing Center
Re:How i can make one Submenu?
« Reply #10 on: 20 Nov 2005, 16:45:37 »
in the init file -

Code: [Select]
smokemenu = false
smoke_menuopen = unit_name addaction ["{Smoke Menu}","smokemenu.sqs"]

copy/paste and save as smokemenu.sqs

Code: [Select]
;cascaded action menu


;is the menu already open?

? smokemenu : goto "close"

;remove 'open menu' action

unit_name removeaction smoke_menuopen

;open the menu

smoke_menuclose = unit_name addaction ["{Close Menu}","smokemenu.sqs"]
sm1 = unit_name addaction ["{Red Smoke}","smoke_red.sqs"]
sm2 = unit_name addaction ["{Yellow Smoke}","smoke_yellow.sqs"]
sm3 = unit_name addaction ["{White Smoke}","smoke_white.sqs"]
sm4 = unit_name addaction ["{Blue Smoke}","smoke_blue.sqs"]

;declare the menu open

smokemenu = true

exit

#close

;remove actions

unit_name removeaction smoke_menuclose
unit_name removeaction sm1
unit_name removeaction sm2
unit_name removeaction sm3
unit_name removeaction sm4

;add 'open menu' action

smoke_menuopen = unit_name addaction ["{Smoke Menu}","smokemenu.sqs"]

;declare the menu closed

smokemenu = false

exit

untested, but that should do you for starters ;)

EDIT - forgot to say - if this is for an addon, be sure to use an identifier tag as a prefix to any global variables - take a look here.

EDIT 2 - just tested it myself and the script above works just fine, with a couple of minor changes ;)
« Last Edit: 21 Nov 2005, 21:36:04 by bedges »