nutmix's Recent Forum Activity

  • If I have two text objects on the layout, e.g. one saying "balance" and the other saying "stake". I have 3 options:

    1) insert two new text objects

    2) insert one text object, then clone it & change text

    3) insert one text object, and copy and paste it & change text.

    All three methods seem to work, but which is best?

    I'm guessing copying is best, as it puts less objects in the "object types" project tree so is easier to navigate, but what are the gotchas to this approach? I.e. what are the limitations?

    I even seem to be able to assign different values of instance variables to copied (not cloned) objects.

  • I get the below error every time I try and update one of my posts. sometimes i can just hit back and resubmit and it works, sometimes nothing will get rid of this error. What is this? I am logged in, there is nothing wrong with my browsers cookie handling - it looks like a bug in the forum SW:

    Error

    Only members with sufficient permission can access this page.

    A security error has occurred with authentication.

    Please ensure that all cookies are enabled on your web browser, you are not using a saved or cached copy of the page, and your Firewall/Proxy settings are not hiding or masking your IP address.

  • I have a blank project and made the layer background light blue.

    I then put some text objects on, and changed the font to Verdana(18).

    all good.

    however, if I now change the font colour to white, and run it, the text comes out like some 8-bit font, totally different to if I change the font to red or black or any other colour (in which case it looks perfect).

    Any ideas why white text would go horribly wrong?

  • rexrainbow - good tip.

    I see that the flags are things like "ef_return_string". The is no ef_return_array. ef_return_any is an integer, float or string, according to the doc, so no way to return an array. I guess i could return JSON, or a coma separated string list, but parsing this is adding as much work than the plugin saves. I dont understand what ef_variadic_parameters are. These are designed for input, looks like the plugin system was not really designed to return data more complicated that a string or number. I need to return hundreds of numbers, unfortunately.

    The plugin stuff looks very clever, but pretty bewildering and daunting as i don't have the time to invest to reverse engine it from examples.

  • You guys are awesome!

    Great work.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I need to call javascript to do some calculations which would not be feasible in C2. I've read the plugin docs, and looked through some plugins which draw stuff, but cant see how to return a value.

    Could someone write a very simple plugin which say adds two numbers (passed to the plugin as parameters) and returns the result back the game?

    This would make a great tutorial too (there is one for drawing a grid, which is good, but not relevant in this case).

    Or is there another way to call a simple JS function without the complexity of plugins?

  • hmm, so you would use a horizontal image, and a separate vertical line image, then stretch them to the right hight and thickness, duplicate them, then place them in the right possitions? Would the corners not overlap/look ragged? i need to put numbers in the centers of the grid, which seems tricky too. This has to work on html5 mobile, so will have to scale for any screen size, and will need to move around to support landscape and portrait with a single layout (two layouts breaks the game state).

  • Imagine a simple bingo ticket - if we did it in HTML/CSS it could be a simple table containing numbers, and the table lines stroked with CSS.

    how would one do this in C2?

    I guess I could write a plugin, but expect this would take a number of days/weeks as, having read the SDK docs there is a lot of complexity and things to know to develop something like this.

    Anyone know any existing plugins?

  • I have looked at the plugin template, and under Parameter Types it lists things like:

    Number

    String

    CmpParam

    etc.

    These are for input (passed to the plugin).

    How are values passed back from the plugin call to the game? Either an action, like "connect()" or an event, such as "onError()"). I think events are called conditions in the SDK.

    If its possible pass data back, can a two dimensional array of numbers be passed back? If so, how, if no, is there a way to hack into arrays already defined in the project, and modify them?

    There is no mention of returning data in the SDK documentation that I can find, except for expressions.

    Many thanks for any help.

  • OK, being new to web sockets, and socket.io (but have been programming unix sockets for 30 years), i realise where i was going wrong.

    Socket.io is not compatible with web sockets.

    I installed the ws package on node.js, and changed the server side test program to this:

    var WebSocketServer = require('ws').Server

    , wss = new WebSocketServer({port: 8080});

    wss.on('connection', function(ws) {

        ws.on('message', function(message) {

            console.log('received: %s', message);

        });

        ws.send('something');

    });

    And it works with the C2 web sockets.

    However, web sockets suck compared with the features of socket.io and jwebsockets, so I will be developing plugins for one of those. (could not get Zacks socket.io to work).

  • Hi, the bingo logic, and server side stuff, and socket communication is my bag, baby. Where I fall down is the client side graphics. E.g. animating a ball rolling, or popping up like you get on say chitchatbingo.co.uk. Where I really fail is popping up things like "game starting in 5.4.3".

  • Ok, got it to connect now, but no joy on transferring messages in either direction. Neither side sees the messages from the other. I am guessing its because node.js uses two parameters, and the web socket implentation only uses one. I.e. the "balls" and "daub" in my example. Unfortunately, the official web socket manual page has no examples or info on what it expects on the server side, and i cant find a server side web socket implementation which is compatible with it.

    I think my only option here is to develop my own plugin, as my client and server javascript works fine, its just the 3 or 4 existing web socket and socket.io plugins for C2 dont work with node.js and socket.io.

    I chose node.js and socket.io for speed of prototyping and compatibility, but will probably switch to smartfoxserver 2x, kaazing or jwebsocket for production.

nutmix's avatar

nutmix

Member since 16 Aug, 2012

None one is following nutmix yet!

Trophy Case

  • 12-Year Club

Progress

12/44
How to earn trophies