Toby R's Forum Posts

  • Right... it handles only string or numbers... I don't really have time to study C2 plugin SDK now. I code controller manually so I figured out that the best way would be to always send just a text which will be simply C2 dictionary JSON.

    Thanks for clarification R0J0hound

  • Meh this is frustrating...

    When AC sends this

    airconsole.message(AirConsole.SCREEN, {
                "message": "start"
              });[/code:16awribh]
    
    I can easily read the value ("start") just by reading [i]AirConsole.Message[/i] in C2.
    
    But when AC sends this
    [code:16awribh]
    airconsole.message(AirConsole.SCREEN, {
                "message": {
                  touch: 999
                }[/code:16awribh]
    
    ... then [i]AirConsole.Message[/i] returns "[object Object]", which is fine, but can't fetch the properties. 
    
    [i]Browser.ExecJS("var a="&AirConsole.Message&"; a.touch")[/i] and all other ways I have tried always return "0".
    
    Any other suggestions? I'm kinda out of ideas.... thanks
  • I just described the object's body. But it's not a string. It's an object. That's the point...

    EDIT: ah wait... right... I'll try that. Thanks

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • How much family friendly must it be Elliott? Is blood forbidden at all? Is zombie/horror topic forbidden? I have one mobile game awaiting for Intel XDK to be fixed, and actually I would likely submit it to the contest as well. However there is a bit of blood while you kill zombies. Zombies are small objects actually so blood is not big either, but still there is blood .

  • Is it possible to access raw JS object properties in C2?

    I've fetched the object from AirConsole message. The object ATM is hardcoded and looks like below

    { touch: 999 }[/code:34yoe00s]
    
    I'm trying to fetch this property but can't really find the way. So I tried to convert it to string so I could parse it, but it's also not that easy. Does C2 have some security parsing before? Is it possible to access/strinfigy  JS object anyhow?
    
    This is the latest thing I've tried, but it retuns 0;
    [img="http://i67.tinypic.com/2qw32ti.png"]
  • It looks like I found a workaround. In C2 AC plugin you have to set condition to On Message is "AirConsole.Message", and then you basically grab the whole content of the message and can parse it.

  • Sorry I'm not iOS developer at all. But just read

    [quote:2oe9gdlb]Right now it's only supported on PhoneGap Build (we hope to add support via the Intel XDK soon).

    So it won't help you with Intel XDK for now anyway.

  • matrixreal do you have the latest C2 r224? There is an iOS performance boost implemented https://www.scirra.com/construct2/releases/r224

  • Allright. I've spent several hours playing around with AirConsole and C2 now.

    There seems to be bigger problem. There is a very limited controller support in C2 AirConsole plugin.

    Basically C2 AC plugin listens for "message" key with the specific value. So you can set only "states", but you cannot make an action based on some generic parameters (like joystic move, degrees, cords etc.).

    AirConsole controller generator does not send "message" key at all. It sends various keys depends on the controller element you pick. Let's talk about Joystic.

    By default it sends something like this

    "touchmove": function(position) {
              airconsole.message(AirConsole.SCREEN, {
                "joystick_left": {
                  position: position
                }
              });
            }[/code:2w77hi4h]
    So as you can see the message key is "[u]joystick_left[/u]", not "[u]message[/u]". So it is not possible to grab this with C2 AC plugin. 
    
    [b]Now even if we set it to[/b]
    [code:2w77hi4h]
    "touchmove": function(position) {
              airconsole.message(AirConsole.SCREEN, {
                "message": {
                  position: position
                }
              });
            }[/code:2w77hi4h]
    ...we still cannot grab it, because in C2 AC plugin you need to [u]specify the value[/u] you are expecting. It is not possible to specify the position, because it is generic, so you cannot grab it.
    
    [b]What works is (C2 plugin can grab)[/b]
    [code:2w77hi4h]
    "touchmove": function(position) {
              airconsole.message(AirConsole.SCREEN, {
                "message": "move"
                }
              });
            }[/code:2w77hi4h]
    ... but this is obviously [u]useless[/u], because we need a specific cords here.
    
    So for now usage of AirConsole plugin is very limited, and still you have to code the controller.
    
    I already sent an email to AirConsole asking if there is any way to grab generated controller data with C2 AC plugin. Would be even enough if this plugin had something like "On any message recieved" then we could parse the message in C2 at least.
  • Allright. I took a look into the details, API etc.

    First of all AirConsole looks very promising. It's really cool! Even though local multiplayer is not so popular as it was years ago, this technology seems to be able to turn the time back in some manner ... and it gives us (C2 developers) one more platform where we can build very interesting games (cause this platform needs a specific approach) and monetize them.

    Regardging working with C2. For now there is an option to build only the screen part with C2, and the controller part has to be made manually (coded). I know there is a controller generator, but that is very limited if you don't know much about coding (and most of C2 people don't).

    It would be absolutely outstanding if you guys could make some official agreement... what I mean here:

    1. AirConsole Team: extend the C2 plugin to be able to send data from controller to the screen. That's basically just a send message, so your part is easy

    2. Scirra add an official export to AirConsole. This would be basically an HTML5 export but would have to cover an option while exporting to pick the screen export or controller export (the difference between those two is actually trivial). In this situation we would be able to build a C2 app for the screen and a C2 app for the controller separately which will give us a possibility to build nice fancy controllers with animations etc.

    So the AirConsole export would have to separate C2 data files into subdirectories basically so the output would be something like:

    For AirConsole export (with screen option selected)

    gameDirectory/
       screen.html  //this is just a renamed "index.html" with changed references to the libraries etc. to "screenDataDirectory/*" instead of "./*"
       screenDataDirectory/  //here would be all the C2 data files except the index.html
    [/code:pipaxeqy]
    
    [b]For AirConsole export (with controller option selected)[/b]
    [code:pipaxeqy]gameDirectory/
       controller.html
       controllerDataDirectory/[/code:pipaxeqy]
    
    [b]And the final output would be[/b]
    [code:pipaxeqy]gameDirectory/
       screen.html
       screenDataDirectory/
       controller.html
       controllerDataDirectory/[/code:pipaxeqy]
    
    As I believe the renaming index.html to controller.html (or screen.html) is trivial to do, I don't know how much work to do is to change all the files/libraries dependencies so the main html file would search for the data in the subdirectory.
    
    I took a quick look into c2runtime.js and I see there is no "path" variable, everything is being fetched relatively from the "./" folder, so it won't be just a matter of changing the variable. Anyway didn't go into details of this (huge ) file. 
    
    @Ashley could you tell if this is something that could be done with relatively no effort or it's pretty much of work? Or maybe you can give some hint's how to do this manually? I mean if there are just several places to change like:
    
    [code:pipaxeqy]var datajs_filename = "data.js";[/code:pipaxeqy]
    to
    [code:pipaxeqy]var datajs_filename = subDir + "data.js";[/code:pipaxeqy]
  • - I really liked the game. It was simple but addicting XD

    Good to hear! Thanks

  • Thanks fr0z3n <img src="{SMILIES_PATH}/icon_e_wink.gif" alt=";)" title="Wink">. There is an Android version available as well now https://play.google.com/store/apps/deta ... .blindship

    I've decreased a difficulty level a bit, cause it was a hardcore mode for most of the people <img src="{SMILIES_PATH}/icon_e_wink.gif" alt=";)" title="Wink">

  • Set it to On start of layout? Not sure what are you doing there exactly. Some screenshot or capx would clear the things out.

  • Which version of C2 and XDK do you use? Also you may want to try with Cordova AdMob instead of PhoneGap (it's deprecated).

  • sizcoz try with .htaccess file. Create ".htaccess" file in the directory where you have your script (the one which ajax is calling)... with the following content

    <IfModule mod_headers.c>
    Header set Access-Control-Allow-Origin "*"
    </IfModule> [/code:3ernqrjl]
    
    It basically does the same, but you might have some security restrictions enabled in Apache especially if you have shared hosting.