OFPEC Forum
Addons & Mods Depot => OFP - Addons & Mods General => Topic started by: Praxtor 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
-
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
-
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 (http://www.ofpec.com/editors/resource_view.php?id=66). quite advanced, but if you're making acrobatic planes, it should be pretty easy for you ;)
-
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
-
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
-
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...
-
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
-
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
-
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
-
Hei Guys sorry for the absence, i am working very hard in this last days :).
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
;)
-
in the init file -
smokemenu = false
smoke_menuopen = unit_name addaction ["{Smoke Menu}","smokemenu.sqs"]
copy/paste and save as smokemenu.sqs
;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 (http://www.ofpec.com/tags_about.php).
EDIT 2 - just tested it myself and the script above works just fine, with a couple of minor changes ;)