aceofpack's Forum Posts

  • JohnnySheffield

    Yes, GitHub would be great.

    I've amended this plugin to create a much better means of accessing events which I haven't released. GitHub will certainly help get our thoughts together. I'll set it up...

  • It's cool, thanks for the help guys - I've solved this with:

    (Touch) Is In Touch >> Set Y to touch.Y

    (System) If mouseY != mouse.Y >> Set Y to mouse.Y

                                     Set mouseY to mouse.Y

    Where mouseY is a global variable.

  • thehen

    Unfortunately, that's only when clicking is involed. You have to click and drag to emulate a touch swipe. In terms of just moving the x/y position without a click is missing.

  • Is On Mobile Device shouldn't really be used for this since laptops are also touch enabled nowadays.

    There are no click events either :)

  • No, for some reason Mouse.X & Y causes issues on the ipad. I fixed it with the below:

    (Touch) Is In Touch >> Set Y to touch.Y

    (System) If mouseY != mouse.Y >> Set Y to mouse.Y

                                     Set mouseY to mouse.Y

    This means that every tick, the touch won't be interfered with any computation of a mouse co-ordinate of 0. It seems a null mouse co-ordinate is interpreted as 0.

  • Hello,

    I have an ambition to move the object to my mouse position Mouse.Y every tick so it effectively moves up and down with mouse movements.

    I also want to repeat this for touch.Y.

    However I can't think of way to disable mouse if on ipad etc.

    I can't use the behaviour of the touch object as mouse because no clicking is involved. Just movement.

    Can anyone think of a smart way to do this?

    Cheers!

  • Rory

    I wouldn't know sorry. I do know that Socket.io itself is closing in on version 1 release and there are already frameworks such as multiplayer.js for node that are incorporating these features. I've not used them as yet.

    The challenge comes in designing configurable features that can suit lots of multiplayer game types.

  • Index

    The official websocket plugin is just concerned with sending messages between clients (like a chat feature). The good thing about this plugin is the ability to communicate objects of data (JSON) with clients and servers which is what you need for multiplayer gaming.

    These plugins will come on a lot over the next year or so as UDP becomes accepted in browsers.

    Yes, you are correct about the prediction. It's called Client Side Prediction and can vary depending on your game.

    Concepts such as CSP, Lag compensation and inter/extra-polation are difficult to grasp and because they integrate with the game mechanics, you don't often see 'plugins' for such things.

    Also, because of cheating, you need to simulate the game on the server so can't really get away from learning how to code. This could in theory be implemented into Construct but it would require major effort and good design thought from the developers.

  • UPDATE

    Subscribe to Construct videos now

    Notice I've changed the plugin to do away with csv's and instead implement a loop through events, checking their names and accessing data with a CurDataAtVar("var") expression.

    /UDPATE

  • Here's my realtime pong efforts thus far.

    youtube.com/watch

  • rexrainbow

    Thanks, I've updated the Socket IO plugin now to feature this event capturing and looping and works like a charm.

    Need to do some more testing with my example game and publish soon enough.

  • Try Construct 3

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

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

    I am indeed - I've updated this plugin further in fact. A bit of an overhaul as the LastEvent code was not capturing events that were in quick succession.

    It's hard work but want to demonstrate real time multiplayer so I'll be with you shortly!

  • rexrainbow

    Many thanks for your speedy help!

    I found the function. It accepts a parameter 'dims' (dimension of array to loop through) and within those loops calls another function using:

    this.doForEachTrigger(current_event);

    Which is:

         instanceProto.doForEachTrigger = function (current_event)

         {

              this.runtime.pushCopySol(current_event.solModifiers);

              current_event.retrigger();

              this.runtime.popSol(current_event.solModifiers);

         };

    What do these 3 lines of code do? I see a push and pop but not sure where the code for these functions are.

    Thanks for any help as always!

  • rexrainbow

    Many thanks but I couldn't see it...then discovered it's an Event not an action. Are we able to write events?

    Failing that, I could do a LoadArray type expression? Although a bit confused about the arrays in C2, do they take objects?

  • Hi all,

    I'm amending the socket.io plugin again and looking for some advice on actions:

    acts.ScriptName = function (params)

    {

    // do something

    };

    So I have an array called dataStack[].

    I'm pushing objects into it something like this:

    event = new instance.Event;

    event.name = blah; //String

    event.data = blah; //JSON

    event.time = Date.time(); //Time in ms

    dataStack.push(event);

    What I want to do is expose the looping through the array to C2.

    Something like a For Each Element action...

    How does this work and tie in with the loopIndex exposed to loops within C2?

    Many thanks for some pointers...