briermay's Forum Posts

  • I could do it along with a .NET app for installing and updating the plugins been thinking about it for a while. I have 3 Servers in California doing nothing right now.

  • I'm not I'm simply loading a JSON array into a construct 2 array via the load function so that I can deal with the data later.

    its basically a map grid

  • Thank you works perfectly was pulling my hair out how to get the array data out of the message.

    loads a 900x900x20 array in 14 seconds so not bad :)

  • I'm trying to figure out something I'm using the new websocket plugin to communicate with a C# websocket server (which only communicates in JSON)

    so I'm using a Hashtable to load the JSON so I can work with it

    and example of what the server sends would be:

    {"Command":0,"Data":{"Value":somevalue,"anotherValue":anothervalue}}

    Hashtable is named MessageQue

    now if I use MessageQue.At("Data.Value") I get somevalue returned

    but if I try to do MessageQue.At("Data") I get 0 returned.

    how can I get the full "{Value":somevalue,"anotherValue":anothervalue}"

    reason I need this is because I have JSON formatted for the array load function in the Data section and I need to pull the entire string or the array load fails.

    eg {"Command":3,"Data":{"c2array":true,"size":[1,1,2],"data":[[[2,7]]]}}

    I need to pull out just the {"c2array":true,"size":[1,1,2],"data":[[[2,7]]]} part

    Thanks in advance

  • you would need to do a lot of "hacks" to get that to work as it expects JSON coming in and it sends JSON to the client. hence that if you read that it requires a "front end" script that the new websockets plugin doesn't supply.

    the websocket plugin as is has no JSON support

    I guess if you wanted to you could use rex's hash table to read the JSON and process the out going messages to JSON by hand but it looks funky.

    that setup with node expects stuff coming in to look like this

    {"Type":0,"Name":"Briermay"}

    most novice users will find the new websocket plugin useless as its just a bare-bones wrapper around the websocket protocol and would be better off to stick with the socket.io version for now.

  • I simply loaded an empty new project added the websocket and tried to connect to my node server I was running when I was using zakos plugin and watched the console (i had it in debugging mode) and it never even showed the connect.

    True websockets use a different protocol:

    example of websocket address: ws://host:port/service

    socket.io simply uses ip and port

    everything I can find on node and socket.io you need to use the socket.io client script as socket.io on node implements its own structure hence the emit events system.

    I fought with it for 4 hours and ended up just using a C# back-end server

  • I can confirm the following:

    1: the new websocket plug does NOT work with socket.io socket.io on node which is what the zackowack plugin is based on is not a *true* websockets protocol.

    2: it does work with a C# websocket server (I'm running one I've been developing now)

    3: if the C++ follows the proper standards and protocols it should work as well.

    I honestly prefer it over the socket.io I'm developing my server in C# for the simple fact that I can compile and test it on windows 8 and toss it on one of my Ubuntu servers and it will run without modifications as Linux can run native .Net applications via mono.

  • I've been working with it

    I'm using it instead of the zackowack one simply because of how it works.

    unlike zackowack socket the new websocket plugin uses true websocket type protocol.

    but be forewarned it will NOT work with node and socket.io from what I have been able to figure out.

    I'm using a Custom C# server that I've been developing to work with the true websocket protocol that the new one uses.

    I like this new one for the simple fact I can use C# (since its *true* webscokets protocol) and send JSON data back and forth via rex's hash table plugin.

  • there are no events involved just rex's boundary behavior applied to the tiled background.

    basically its all math so what I had to do was add a tiled background mine is 89000 x 52000 (i know its huge but its for a 800x800 map grid and each grid is 110x65 pixels) and add the boundary behavior.

    find the pixel point of the top and bottom of the window

    mine was 33 and 539

    the 33 is the bottom. add them together (572) subtract that from the background height (51428) enter that as a negative number for top (-51428)

    find the pixel point of the left and right of the window

    mine was 22 and 866

    the 22 is the right. add them together (888) subtract that from the background width (88112) enter that as a negative number for left (-88112)

    enter the numbers into the top, bottom, left and right properties for the boundary behavior on the tiled background.

  • never mind I figured it out had to set the boundary left right top and bottom based on the layout co-ords and not my HUD sprite took some math to figure out the x and y for each but it works

  • trying to do something like the way starcraft does and I've seen another html 5 based game that does it with JavaScript so I know its possible just figuring out how to do it construct is eluding me.

    I have 2 layers one is my "HUD" which has a sprite entire game size with a transparent "window" cut out, second layer has a tiled background 100 times the size of the game layout.

    trying to get where I can drag the tiled background around but constrain it to the "window" of the sprite HUD.

    I tried the drag&drop 2 with boundary plugins but then it makes it so I can't drag the background past the sides at all

    thanks for any help

  • I needed a way to format a string of numbers for a game I'm working on and couldn't find anything in the built in text plugin of construct so I modified the original text plugin to do what I needed and renamed it Label and thought I'd share incase anyone else needs it.

    only thing different than original text plugin is it auto formats the string with commas.

    for example:

    Label set text 9999   will render as 9,999

    Label set text 999999 will render as 999,999

    works with append text as well (not that I can find a use for that) removing original commas and re setting the commas

    apparently I don't have enough rep to post a direct link so you can download it at

    syndor.ca/Label.rar

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • oh and by the way I'm not new to programming been doing it for 14+ years in Perl, c, c++ and some JavaScript just new to construct2 which I'm liking just the manual tends to be a little vague in some areas.

    I already have a fully working multi-player server that this connects to using web sockets its just the weird way construct 2 works that I'm getting used to.

  • Pick Nth instance

    Pick the instance at a given place in the internal list of picked objects. This is most useful used in sub-events to act on separate instances. For example, in a "Sprite collided with Sprite" event, Pick 0th instance and Pick 1st instance can be used to act on each instance involved in the collision separately.

    as quoted by the link gives very little detail so I had no idea that was what it was for but thank you.

  • yes I understand that but reason I asked was I have another issue.

    I'm doing a multiplayer game I have the server working I have the connection working. upon connection it sends facebook info to the server which then retrieves their profil from MySQL and then will send back a series of indexes.

    it would look like

    B:0:0:1:0:2:10:3:2 etc (32 pairs in total)

    I then need to take the pairs eg 2:10 and set sprite 2's frame to 10

    that's the part I can't figure out how to manually "pick" a sprite instance.

    I can set an index variable on the sprites instance variables but how to pick the sprite with index 2 then set animation frame to 10 is where I can't find any documentation