tlarkworthy's Forum Posts

  • Use AJAX plugin for ajax?

    see here

    If the response is JSON you can use HashTable to decode it into a key-value object

  • EDIT:IGNORE THIS

    Hi Rex,

    I prefer Hashtable format because its doesn't prepend "c2Dictionary" to the JSONs unlike dictionary. I can map hashtable directly onto JS object representation for Firebase JSON store. Its very nice.

    However, it doesn't seem to support containers, which is necessary to support lists of players (each with their own hashtable).

    Any motivation to support this C2 feature? Or shall I get hacking?

    Tom

    EDIT: weird, it seems to be working now without me changing anything... I am confused.com

  • It crashes on Chrome on Ubuntu after fade in fade out. Its the point when firefox pops up the offline storage prompt.

    I found the game absurdly difficult and hard to control. I was often clipping the enemies. I think the acceleration/deacceleration curve of the guy is non-intuitive. So I tended to overshoot when trying to stop, and tended to underestimate how long it takes to get my speed up to duck under things. Jumping the round this when you can't see them coming is totally impossible.

    I like the graphics and feel of the game though. I wanted to get furher but I could not do level 1.

  • Elite, first open ended game.

    Eve online, riches politics and human double agents.

    Homeworld, best space backdrops.

  • download plugin

    run LIVE multi-user demo

    Maybe its hard for non-git users to get to the plugin, so now the plugin is also distributed as a zip. I have also put up the exported demo application too. Try using it with multiple browsers at the same time, they all update at once! Magic!

    For those with a curious mind, I am using TravisCI to automatically zip up the source files on a git commit, and write the plugin and demo to the github page branch (gh-page). So you can be sure the plugin link is always the latest release, and any contributions made will be distributed promptly (its fully automatic)

  • I build robots normally

  • Hazzah!

    hopefully I have got rid of that error, and now it exports ok and also minifies ok.

    was a lot more involved than I bargained for. Oh and authentication is working with facebook or email/password

  • myeah so I have done async and pushed the load flag onto a $.Deferred object.

    I have wrapped my functions to wait for the loaded promise before using the library. This has the advantage of not pushing the async race conditions downstream to the user. But it is a massive pollutant to my codebase for the sake of not being able to do normal HTML 101 stuff.

    I am not particularly happy with this solution. Give use remote-dependancy! It will cause less bugs in the ecosystem in the long run!

    EDIT: well those pollutants were nothing compared with trying to evade the closure minification on a 3rd party asyncronously loaded library! lol

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • EDIT:

    deleted

    OK I will do async.

  • I want to add a remote JS library in a <script> tag in the HTML. I added the dependencies like so in the plugin properties:

    "dependency": "https://cdn.firebase.com/v0/firebase.js; https://cdn.firebase.com/v0/firebase-simple-login.js"

    which somewhat works (the exported HTML is correct) except that C2 installations with debugging turned on complain the dependency cannot be met (locally).

    But I do not want to include the JS libraries locally, as that is the mechanism by which you get around same origin policies. It's for *very useful* database-as-a-service integration Firebase. (http://www.scirra.com/forum/plugin-firebase_topic79393.html)

    Is there another way I can add my own <script> tags in the HTML. Dynamic loading of external JS is not an option (like how facebook does it), because the plugin needs the API immediately.

  • Great!

    Firebase needs to be an external API so you can get around the same origin policy and actually do database like things. There does not seem to be way of adding remote JS libraries in a nice way but I will ask elsewhere.

    I appreciate you giving it a spin and your debugging help a lot.

  • Oh ok. I think thats because I said the plugin depends on "https://cdn.firebase.com/v0/firebase.js", a remote file, which I did so it would insert

    <script src="https://cdn.firebase.com/v0/firebase.js"></script>

    in the HTML. I think it expects that file to be in the plugin directory though locally.

    I don't have a debug version of C2 so it does not pop that up for me. Ignore it until I find another method for altering the HTML? Does it work in the browser afterwards?

  • works on mine. Any clues in the javascript console? (CTRL + J)

    EDIT: just tested preview on Firefox, Chrome on Linux over network and fine. Does it boot the preview and die on the webpage or does C2 refuse to preview it (the later being a plugin install problem)? ***

    *** wait whats the directory the plugin is installed as??? on my machine its "firebase" but that might have got screwed when you cloned from github...

  • The basic API is now in place. Your Actions are

    (set, update, push*, remove) to (String, Number, JSON)

    *push is for lists

    you can register for real time updates of all event types:-

    ("value", "child_added", "child_removed", "child_updated", "child_moved")

    You associate a tag on registration like AJAX, so then your tagged conditions trigger when data is received from firebase.

    You can then use the expressions to get the data and URL references out

    (ValString, ValNumber, ValJSON, Ref)

    There is a capx demoing this functionality in github. A screen shot of the real-time database demo is at

    github.com/tomlarkworthy/construct2_firebase_plugin/blob/master/demo/firebase_ui.png

    MISSING FUNCTIONALITY from Firebase API:

    error callbacks

    transactions

    authentication

    filter queries

    list order priorities

    I probably won't implement all the missing parts, but I am quite keen to get my mits on authentication and transactions at some point (not massively urgent though)

  • The technical details of firebase are at

    firebase.com

    Firebase is a *very* capable serverless database.

    Authentication supports

    Facebook

    Twitter

    Github

    Persona

    Email & Password

    You can set validation rules via a web gui, which firebase checks. So you can prevent certain types of cheating (e.g. you can't buy X unless you have Y cash in the bank). More complex logic won't fit in its validation rules (e.g. the rules of a game of cards), but you can add your own server with different permissions onto the firebase for those cases.

    Firebase supports SSL (by default), so data is encrypted on the wire, its also compressed effeciently.

    Oh and transaction support, which is a pretty neat technical feat on a real time over-the-web store. The database caches all data locally, so local data writes are fast, and they sync global writes in the background (a bit like dropbox). This avoids slow downs during poor connectivity situations (remember transactions!). Its very smart.

    I have no idea if half these features can be mapped to construct 2. But just as a non-server database with validation rules its pretty hand.