[Ohrrpgce] script trigger when opening a menu

James Paige Bob at HamsterRepublic.com
Mon Oct 1 10:07:55 PDT 2012


On Tue, Oct 02, 2012 at 05:17:55AM +1300, Ralph Versteegen wrote:
> On 2 October 2012 04:55, James Paige <Bob at hamsterrepublic.com> wrote:
> > For a while I have been wanting a script trigger for when a menu is
> > opened, but I haven't implemented it because I have some doubts about
> > how it should work.
> >
> > Should it be a global script trigger for when the user presses the
> > button that opens the main menu?
> 
> Yes, but it should of course have a little be more context than that:
> it should only be called when ESC would open the main menu.
> 
> I've long wanted an editor to customise the game controls a little.
> One idea (actually think this needs some changes):
> 
> Cancel button 1: Alt
> Cancel button 2: Esc
> Cancel button 3: None
> Menu button 1: Alt
> Menu button 2: Esc
> Menu button 3: None
> Menu action:  either 'Open Menu X' or 'Run script Y' or Nothing
> Use button 1: Ctrl
> Use button 2: Space
> Use button 3: Enter
> NPC use action: 'Activate NPC' or 'Run Script X' (or 'Open Menu Y'?)
> 
> Of course the whole thing doesn't need to be implemented at once; just
> the menu action would be a good start.

Ah, yes. One thing I want to give special consideration to when we think 
about key customization is future platform support. When we have an iOS 
and Android port, there will need to be a floating control overlay, like 
Emulators on those systems use. If we plan our key-customization right, 
we can know which buttons need to be in the floating overlay.

This also reminds me of the 
http://rpg.hamsterrepublic.com/ohrrpgce/Plan_for_improved_joystick_support

And has me thinking about how to handle input in a future OUYA port 
(since I think user-input is the only way in which an OUYA version 
would have to differ from an Android version)

But for now, I can just make a simple "Menu Action" customization.

> > This is my main purpose for wanting the
> > feature, so people can override the menu without also having to override
> > other normal user controls in an onk-keypress script
> >
> > Or... should it be a menu-specific trigger which can run before a menu
> > is opened in any way. This is more flexible, and could be used for other
> > purposes besides my main objective, but it adds a lot of complications:
> >
> > Should it be a before-menu script? and instead-of-menu script? A script
> > run simultaneously with the opening of the script? Each of those choices
> > has different repercussions for how the script trigger would interact
> > with menus depending on whether or not the menu allows scripts and
> > gameplay to proceed.
> 
> I think instead-of-menu doesn't make sense since it seems it would
> only be useful for overriding the main menu, and assumably would
> prevent the menu from being openable at all.

Well, I was thinking it would pass in the ID number of the menu that 
would have been opened, so the script could open it with a call to 
"open menu" similar to how you can use the "instead of battle" script 
together with "fight formation"... but that whole plan is a little 
clumsy.

> I think a script to be run simultaneously with opening the menu would
> be a great feature. I would disable that option if the menu does not
> allow scripts to run.

That seems sensible.

> > Any opinions? Right now I am leaning towards the simple global trigger
> > option.

So now I am leaning towards first a Menu Action script, and then later a 
separate on-menu script.

---
James



More information about the Ohrrpgce mailing list