Experimental v75d now up! [MONKEY NEWS]

Monkey Forums/Monkey Programming/Experimental v75d now up! [MONKEY NEWS]

marksibly(Posted 2013) [#1]
Hi,

[edit]Now at v75d![/edit]

This release contains some semi-major tweaks to the preprocessor, so is probably worthy of a new topic:

* Preprocessor vars are now strongly typed.

* Non-existant preprocessor vars now evaluate to 'false'.

This makes it easier to write conditional code of the nature:

#If Not BLAH_IMPLEMENTED
#BLAH_IMPLEMENTED=True
'#Implement blah!
#Endif

There have been some low level compiler changes made to achieve this that may affect custom targets/translators: the GetCfgVar and SetCfgVar functions have been renamed to GetConfigVar and SetConfigVar, and the _cfgVars:StringMap<String> global has been changed to a GetConfigVars:StringMap<String>() function.


Fixed glfw WritePixels issue.

Fixed json parsing bug with empty objects/arrays.

Added support for more Ouya buttons - all buttons supported on my Ouya and Ps3 controllers now. Xbox360 controller a bit weird - always appears on port 3, and dpad not generating any button presses.

Added JOY_LSB (LSB='Left Stick Button'), JOY_RSB and JOY_MENU keycodes (only used on Ouya right now).

Fixed Android build issues.

Added GL_GLEXT_PROTOTYPES to linux target main.h

Fixed ${CD}, ${TARGET} etc in preprocessor strings.

Fixed html5 app resume causing last played sound to replay.

Fixed transcc +VAR=BLAH.

Fixed winphone 8 orientation bug.

Restored anrdroid_ouya target to release!

Fixed XNA music not suspending/resuming correctly.

Fixed XNA app resume causing last played sound to replay.

Updated reflection docs.

Tidied up lots of BLAH_IMPLEMENTED stuff.

Tidied up preprocessor a bit: Preprocessor vars are now strongly typed, and non-existant vars now return a 'False' value instead of generating an error. Note: Some global funcs in trans/config.monkey have changed, which may affect target authors.




AdamRedwoods(Posted 2013) [#2]
that may affect custom targets/translators

okey dokey!


computercoder(Posted 2013) [#3]
Thanks again Mark! :)


programmer(Posted 2013) [#4]
A-w-e-s-o-m-e!


computercoder(Posted 2013) [#5]
I played some with the OUYA target. I noticed its missing three button events: The Menu button Left Stick Button and Right Stick Button. I'm not sure (reading through the OUYA docs) if you can determine the difference for the touchpad movement and tap per controller. I think it would be awesome to have them track independently.

I know that XBOX and PlayStation controllers also have stick buttons, are they accessible through Monkey? If not, I was thinking perhaps adding three new (at the least two) joy events: JOY_LSB, JOY_RSB and possibly JOY_MENU, These would map respectively to: Left Stick Button, Right Stick Button and if you would, the MENU button (specifically for the OUYA). The MENU button could be remapped to JOY_BACK or JOY_START instead if you prefer.

The MENU button in OUYA is emulated, so you MUST trap it through the use of the KeyDown event AND treat it as a state - at least as far as I could get it. This will allow you to capture the single press for a Menu action to be allowed using it in-game. Double Tapping will throw you out to the Main OUYA screens. Just my two cents on my experience with it.

Other than that, I believe the controllers for OUYA are supported well :)


AdamRedwoods(Posted 2013) [#6]
my Ouya died, i was trying to test MiniB3D:
http://forums.ouya.tv/discussion/2583/it-died#latest


computercoder(Posted 2013) [#7]
@Adam:
Sorry to hear that :( Hopefully you can get a replacement soon(ish)? miniB3D seemed to be faring well on the platform too!


computercoder(Posted 2013) [#8]
@Mark Sibly:

I made s few adjustments to the Android (Ouya) Game target, with GREAT success! I got ALL three buttons Left Stick Button, Right Stick Button and the Menu Button to respond :)

In "androidgame.java" I made changes to the two methods:



So all thats left to do now is test it out. I modified the "joytest.monkey" code as follows:



Execute the new code, and then turn on at least two controllers. Test all the controls out. When testing the MENU Button, press it once and it will turn and stay 1, press it a second time with a slight pause between the taps and it will change back to 0. Double Tapping will set off the OUYA to terminate the app as expected :)

This code is yours for the taking should you choose to use it. :)


programmer(Posted 2013) [#9]
@marksibly, you forgot to add "mojo/driver.monkey" to the github repo.


programmer(Posted 2013) [#10]
@marksibly, also i can't compile iaptest on v75b:
brl/monkeystore.monkey<85> : Error : Type 'IAsyncEventSource' not found



programmer(Posted 2013) [#11]
@marksibly, sad but true:
the very useful feature +VARNAME=stringkey doesn't work anymore on v75b.

Command line:
transcc_macos -target=C++_Tool +EXAMPLE=hello test.monkey

Source code:
#Print("EXAMPLE = " + EXAMPLE)

Function Main:Int()
  Return 0
End Function

Output from <v75a:
TRANS monkey compiler V1.53
Parsing...
EXAMPLE = hello
Semanting...
Translating...
Building...

TRANS monkey compiler V1.54
Parsing...
EXAMPLE = hello
Semanting...
Translating...
Building...

Output from v75b:
TRANS monkey compiler V1.55
Parsing...
.../test.monkey<1> : Error : Cannot convert from Bool to String.



rIKmAN(Posted 2013) [#12]
Fixed XNA app resume causing last played sound to replay.

I've got this happening in HTML5 as well, using v73b - has it been fixed for HTML5 in v75?


programmer(Posted 2013) [#13]
@marksibly, also ${CD} doesn't work on v75b, i.e. Monkey won't copy libs in this code:
#LIBS+="${CD}/native/chartboost-3.2/ios/libChartboost.a"
#LIBS+="${CD}/native/chartboost-3.2/ios/Chartboost.h"



blabz(Posted 2013) [#14]
Great stuff!

Are there any plans to implement Metadata attributes?


marksibly(Posted 2013) [#15]
Most (all?) of the above issues should be fixed in v75c.


computercoder(Posted 2013) [#16]
Mark, you Sir, ROCK! Thank you for fixing the remaining OUYA controller issues :)

I think this can be laid to rest :)


Skn3(Posted 2013) [#17]
So many updates so little time!

Thanks for the ever continuing improvements to Monkey :D


Snader(Posted 2013) [#18]
Great work! (Again!)


fsoft(Posted 2013) [#19]
Hi Mark,

thank you for your work!

There is a small bug in brl.json: if the JSON file contains empty Objects / Array, the parser throws an error (but the JSON file is actually valid).

For example the following JSON file does not work:

{
   "hello" : [ 1, 2, 3 ],
   "world" : []
}


I tried to fix it by myself, with no luck :-(

Could you please provide a fix? THANKS


computercoder(Posted 2013) [#20]
@mark

This is nothing huge, but just for the sake of consistency.

I noticed the documentation in mojo.input for the JoyHit() and JoyDown() sections are missing the three new constants you created for JOY_LSB, JOY_RSB and JOY_MENU. They are listed in mojo.keycodes though.


marksibly(Posted 2013) [#21]
> There is a small bug in brl.json: if the JSON file contains empty Objects / Array, the parser throws an error (but the JSON file is actually valid).

Oops - fix here:

https://github.com/blitz-research/monkey/blob/develop/modules/brl/json.monkey


golomp(Posted 2013) [#22]
Thank you Mark !

I particulary appreciate conditionnal code implementation commands.


dopeyrulz(Posted 2013) [#23]
Mark,

If I wanted to extend the WinRT/WinPhone8 apps with c# code rather than c++ can this be done?

I'm thinking about adding some extensions for managing Live Tiles and Notifications (via Windows Azure) as they are quite easy to do but c++ is not my thing.


Amnesia(Posted 2013) [#24]
I have a simple game that uses the arrow keys for controls. The win8 build on Monkey73b works perfect, but I tried it in this build (75d) and it doesn't get the input from the keys. (i'm using KeyHit(KEY_LEFT), KeyHit(KEY_RIGHT) and KeyHit(KEY_UP), so... very simple)


Sammy(Posted 2013) [#25]
Strange problem with a gamepad (XBox 360 wired), if I plug it in by itself I get no response but if I plug it in at the same time as my only other controller (Competition Pro USB) both work fine? I was using the Joytest example with GLFW BTW.


SLotman(Posted 2013) [#26]
Checking TARGET_NAME doesn't work anymore? I'm trying:
#IF TARGET_NAME="name"
#End


And I get a "Cannot convert bool to string" error... (on HTML5)


programmer(Posted 2013) [#27]
Checking TARGET_NAME doesn't work anymore? I'm trying:
There is no such variable. Use "TARGET".
#If TARGET="name"
#End



SLotman(Posted 2013) [#28]
There used to be one. You can set it when creating custom targets, and it gets translated in code to CFG_TARGET_NAME.

Why I can't access it from Monkey code is a mystery to me.

And I need it really bad - It's the one thing stopping me from having a working Firefox OS target.


ImmutableOctet(SKNG)(Posted 2013) [#29]
Forgive me if I'm wrong, but aren't you talking about 'TARGET.monkey' with the current target system?

GLFW's 'TARGET.MONKEY' file:
#TARGET_NAME="Glfw Game"
#TARGET_SYSTEM="glfw"
#TARGET_BUILDER="glfw"



SLotman(Posted 2013) [#30]
Exactly. For example, with FirefoxOS I created:

#TARGET_NAME="FirefoxOS"
#TARGET_SYSTEM="html5"
#TARGET_BUILDER="html5"


And if I check on code, #If TARGET returns "html5". There should be a #If TARGET_NAME returning "FirefoxOS", so I could differentiate both.

(Someone even mentioned it on another thread to me, so that's why I figured it existed and somehow disappeared from recent versions?)


Xaron(Posted 2013) [#31]
Hey Mark,

Microsoft introduced a new Advertising SDK! Maybe that's easier to integrate?


SLotman(Posted 2013) [#32]

Microsoft introduced a new Advertising SDK! Maybe that's easier to integrate?


It's not. You still need XAML to display ads on windows phone 8... the 'new SDK' most involves in adding support to 'rich media ads' (flash?)