Author Topic: How Wadjet Eye updated AGS to release commercial games on iOS  (Read 8563 times)

Monsieur OUXX

  • Cavefish
  • Mittens Vassal
  • Mittens Half Initiate
    • I can help with proof reading
    •  
    • I can help with translating
    •  
    • I can help with voice acting
    •  
I use a plugin to allow me to fake a keypress when a GUI button is pressed.
I don't understand why that would be required.
 

JanetC

  • Mittens Serf
I use a plugin to allow me to fake a keypress when a GUI button is pressed.
I don't understand why that would be required.

It's required for our games, maybe not for your games. Wadjet Eye games have a lot of puzzles where you need to type something into an in-game computer. Such as the scene in the Shivah where you must log into Rabbi Stone's computer to search for certain terms. So we need a keyboard system.

Snarky

  • Local Moderator
  • Mittens Earl
  • Private Insultant
    • I can help with proof reading
    •  
    • I can help with translating
    •  
I think M. Ouxx was wondering why you couldn't fake the keypress internally, rather than rely on a plugin. It's essentially just a question of appending a character to a string when a button in pressed, and that seems like it should be pretty straightforward.

JanetC

  • Mittens Serf
I think M. Ouxx was wondering why you couldn't fake the keypress internally, rather than rely on a plugin. It's essentially just a question of appending a character to a string when a button in pressed, and that seems like it should be pretty straightforward.

By "internally" do you mean "in script" or "in the engine"?

I used the plugin to allow you to activate the keypress from within the script. So when you tap on a GUI element, it calls the FakeKeyPress() function to fake a keypress, and this allows me to simulate a keypress without significant recoding of existing games.

Snarky

  • Local Moderator
  • Mittens Earl
  • Private Insultant
    • I can help with proof reading
    •  
    • I can help with translating
    •  
By "internally" do you mean "in script" or "in the engine"?

Both, I guess? I seem to remember that there's a built-in function for just this in the latest betas, but meanwhile it should be doable in AGS script:

The two possible results I can think of for a keypress is that either a textbox is edited, or the on_key_press() function is triggered. Am I overlooking anything else?

It shouldn't be difficult to trigger these same effects in a script (though if you have room-specific on_key_press() functions, that might require some slight refactoring of the code). It's a little fiddly to determine whether any textbox is active and absorbing keypresses, but using the guis[] and GUI.Controls[] arrays along with GUI.Visible, GUIControl.AsTextBox, GUIControl.Visible and GUIControl.Enabled it's possible to do so.

Quote
this allows me to simulate a keypress without significant recoding of existing games.

I assume this is really the answer. Still, I'm pretty sure it would be possible to make an AGS script module that would do essentially the same as your plugin while requiring minimal changes to existing code, if that should ever become useful.

JanetC

  • Mittens Serf
It would be useful to be able to do it in script only, if just to simplify things. But I couldn't find any functions that send a keypress to the engine.

Thank you so much for this, Janet!

This is probably a stupid question - but which URL directs me to the latest copy of the iOS libraries?
https://github.com/JanetGilbert/ags/tree/main/iOS/buildlibs
https://github.com/adventuregamestudio/ags/tree/master/iOS

Would seem to the second one, but it's hard to know which one is more modern.

Which one works for an iPhone 7/8?
Which one *doesn't* require a jailbroken phone?

Crimson Wizard

  • Local Moderator
  • AGS Project Tracker Admins
    • Best Innovation Award Winner 2013, for spearheading the AGS 3.3.0 project
    •  
    • Lifetime Achievement Award Winner
    •  
This is probably a stupid question - but which URL directs me to the latest copy of the iOS libraries?
https://github.com/JanetGilbert/ags/tree/main/iOS/buildlibs
https://github.com/adventuregamestudio/ags/tree/master/iOS

Would seem to the second one, but it's hard to know which one is more modern.

Regarding official repository, do not use master's top, because it contains in-development state. Look for stable release tags, such as 3.4.0.16 and release-3.4.0 branch (latest stable release).
I cannot answer other questions though.

The second one...?