DatapawWolf's Recent Forum Activity

  • Ashley oh ok. Someone had recommended Socket.IO, so I went ahead and tried it out.

    What is the difference, then, between all the WebSocket Nodejs modules? There are a handful, and Socket.IO seemed to be the most popular.

    But I will give ws a try. I'd seem some examples using it and it seems about the same code-wise as Socket.IO.

    Thanks!

  • Update: Please see the latest post, I'm trying to figure out this whole "events" thing with WebSocket modules and how to work with them using C2's WebSocket plugin, which can only send text strings.

    So I've been having some issues getting the WebSocket plugin to play with Nodejs and Socket.IO.

    My server file is as simple as I can make it:

          var server = require('http').createServer(server)

          var io = require('socket.io').listen(server);

          server.listen(8888);

    The WebSocket plugin's connect action is defined to connect to the URL: "ws://localhost:8888"

    What I get after running starting the server, and running my C2 game, is: "debug - destroying non-socket.io upgrade" spit out in the command prompt.

    I'm not sure if I am using the wrong URL, or what. I've looked up the issue and no one has a fix. There was another user with the same problem but no one commented on the post and he reported fixing it himself (without description) and left the forum.

    I'd really appreciate help. There's a surprising lack of people experimenting with WebSockets and C2. :P

  • Flattr is built for precisely this. Bitcoins could be an alternative, though.

    Edit: OGA also uses Flattr. It's extremely easy to set up.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • To avoid array-like dictionary keys, I'm current using a template like:

    LevelXGlyphYVariableZ

    Where X Y and Z are whatever values I need them to be. Honestly I'm not too keen on using the tokenat unless I have to.

    Each time a new glyphs is created, which is one at a time, I store three new keys, which are basically variations of, for example, Level2Glyph0VariableX, Level2Glyph0VariableY, Level2Glyph0VariableZ.

    To see if a glyph exists in the dictionary, I simply check if the key Level1Glyph5Variable0 exists.

    However, counting glyphs will be a pain unless, so I think when I "destroy" a glyphs, I will count the UID as zero, and while counting or going through the "list" of glyphs, ignore anything with a UID of 0. :)

    Again, thanks everyone for your input. I'm slowly getting my system converted to use a dictionary instead of an array.

    I can't wait to put my game together. In two weeks time I will be showing my Game Design club what I've finished! :D C2 has taught me much about using arrays, dictionaries, angular interpolation, and keeping my code tidy. :)

  • Would you have any suggestions for finding, say, the length of a level within the dictionary? Depending on the length, each glyph will be updated individually by their UID and positioned sequentially, with each level of glyphs in a different place.

    I also check the previous and next glyphs and change those accordingly, when one is clicked. Though I don't think it'd be too difficult based on what you've posted.

  • tulamide thanks for clearing that up. :)

    Would either of you happen to have some good tutorials or examples using dictionaries? I've only had experience with vectors and arrays from my C++ classes, nothing quite like dictionaries.

  • Darn. Well, thanks again for your input. I will check in to Dictionaries and see how they work.

  • blackhornet thanks for the reply. I probably should have worded my post better: right now, I store the UID in the array I already have, along with two other variables. This is done after I create a new glyph object.

    The reason I store the UID is because I use it later to check the order of the glyphs, and to be able to remove specific glyphs based on user interaction, while manipulating other glyphs.

    I have the arrays really integrated, and this is why I want an array solution at the moment. I would rather worry about streamlining the process after I have a working version of the current system, since I came to a stop about half way in the process of converting my 2D array to a 3D one, rather than just beginning it.

  • With my project, I'm using a 3D array to store information about on screen levels.

    Each level holds a variable number of glyphs, but each glyph index holds 3 variables.

    So say I wanted the current UID of one of my glyphs using the array; I'd have it stored as:

    array[level][glyph][UID index]

    The way I have my code set up, there are a different number of glyphs to each level.

    Since the number of glyphs is random, I don't need an array height of the total number of glyphs, or one with extra spaces that are 0 and wasting space. I simply want to be able to insert a value at a specific XY, not just X or Y or Z.

    Is this possible with Construct 2? I already have the code integrated, so trying to find a way to do this is boggling my mind. :S

  • <img src="http://i42.tinypic.com/rivti1.png" border="0" />

    Here's me. As you can see, I like giving thumbs up.

  • sweet. I was actually thinking of a project combining the FF theme (graphics, movement, and combat) and making a game using the WebSocket plugin to make an online game that could be played on pretty much any device (with WebSocket and HTML5/JS support, of course). :3

  • First of all I haven't tried it my self :)

    But if you need to setup a local server you could try to see if a WAMP server can do the trick. But if that works with what you are trying i have no clue. But guess its worth a try :D

    You can get it here:

    http://www.wampserver.com/en/I'll look into it. Although I hear Node and Socket are more recommended (if more for their relative ease of use than anything else) than other servers

    once i fixed some Bugs i will make you a tutorial how to do simple multiplayer Yonda, sounds great! ^-^ I'll be looking forward to more info. :)

DatapawWolf's avatar

DatapawWolf

Early Adopter

Member since 13 Jun, 2013

None one is following DatapawWolf yet!

Connect with DatapawWolf

Trophy Case

  • 11-Year Club
  • x8
    Coach One of your tutorials has over 1,000 readers
  • Email Verified

Progress

13/44
How to earn trophies