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

Monsieur OUXX

  • Posts: 3,538
  • 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
  • Posts: 116
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

  • Global Moderator
  • Posts: 6,706
  • 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
  • Posts: 116
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

  • Global Moderator
  • Posts: 6,706
  • 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
  • Posts: 116
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.

manifest class

  • Posts: 540
Thank you so much for this, Janet!

bx83

  • Posts: 259
  • Get 'Er Doooooone
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
  • Posts: 8,730
    • Best Innovation Award Winner 2013, for spearheading the AGS 3.3.0 project
    • Lifetime Achievement Award Winner
    • Crimson Wizard worked on a game that was nominated for an AGS Award!
      Crimson Wizard worked on a game that won an AGS Award!
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.

bx83

  • Posts: 259
  • Get 'Er Doooooone
The second one...?

JanetC

  • Mittens Serf
  • Posts: 116
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?

My most recent version of the code is the following branch:

https://github.com/JanetGilbert/ags/tree/ios-technobabylon

Used for releasing our most recent iOS game, Technobabylon. I recommend using this if you want to release a game.

I don't know what state
https://github.com/adventuregamestudio/ags/tree/master/iOS
currently is in, whether it can be compiled for App store or not.

rmonic79

  • Posts: 210
Hi Janet and thanks for your help, I took a Mac  two days ago so I´m really a noob to Xcode. I´m trying to fill your code with my executable that I renamed ac2game.dat and put all compiled  in technobabilon/game folder, the vox and speech error is solved but it continues to tell me that he cannot find any ac2game.dat, its strange, any hint?

Crimson Wizard

  • Local Moderator
  • Posts: 8,730
    • Best Innovation Award Winner 2013, for spearheading the AGS 3.3.0 project
    • Lifetime Achievement Award Winner
    • Crimson Wizard worked on a game that was nominated for an AGS Award!
      Crimson Wizard worked on a game that won an AGS Award!
Hi Janet and thanks for your help, I took a Mac  two days ago so I´m really a noob to Xcode. I´m trying to fill your code with my executable that I renamed ac2game.dat and put all compiled  in technobabilon/game folder, the vox and speech error is solved but it continues to tell me that he cannot find any ac2game.dat, its strange, any hint?

What version of AGS was your game created with? Janet's ios branch seem to refer to 3.4.0.

Also, unless this is something specific to iOS port (which I am not aware of), you do not have to rename game file to ac2game.dat, this is very old instruction from the times of 3.3.0. In theory it should work with gamename.exe and gamename.ags files too.

rmonic79

  • Posts: 210
now i'm on 3.4.0 and the ide returns an error about ac2game.dat not found.

eri0o

  • Posts: 390
    • eri0o worked on a game that was nominated for an AGS Award!
github.com/sonneveld/agscommunity/blob/sdl2-port/

can you try the above repository and branch? It's still WIP but I found it easier to use. Requires game to be on 3.4.1.13

Edit: oops, now I read iOS instead of macOS. Don't know if the above works on iOS, never tried.

rmonic79

  • Posts: 210
this is a screenshot made today with xcode 8.3, the same with 9, ac2game.dat is in folder,



i don't pretend the game to run, but why this error? :)

EDIT:

At least the simulator starts now, for whom have the same problem, i don't understand why , deleting under build phase in project settings "bundle resources" let the simulator starts and the game crash :)
« Last Edit: 09 Aug 2018, 15:50 by rmonic79 »

rmonic79

  • Posts: 210
I'm on xcode 9 now and new errors come  "use of undeclared identifier assert" and "invalid use of non-static data member assert string.h"

Crimson Wizard

  • Local Moderator
  • Posts: 8,730
    • Best Innovation Award Winner 2013, for spearheading the AGS 3.3.0 project
    • Lifetime Achievement Award Winner
    • Crimson Wizard worked on a game that was nominated for an AGS Award!
      Crimson Wizard worked on a game that won an AGS Award!
I'm on xcode 9 now and new errors come  "use of undeclared identifier assert" and "invalid use of non-static data member assert string.h"

These are compilation errors? "assert" is a method, how come it's not declared...
Can you tell which source code you are using again?

rmonic79

  • Posts: 210
i'm trying this this one from janet branch https://github.com/JanetGilbert/ags/tree/ios-technobabylon
but in xcode 8.3 there's no error only in 9, i think that many things changed, i'm taking alook to all file script

rmonic79

  • Posts: 210
It works!!! But my game was made with P3 how can I procede? suggestion pls :grin: