Upcoming Socket.IO sneak peek
-
@DGames135 Yes. You would create a server using socket.io, then you can connect two iPads.
-
@Hamed OMG this will be the best Hyperpad update. When will this update comming? . Wait will this mean that when using the behaviour it will create a server???? 😍sorry so excited
-
@DGames135
No you need to create your own server.The left side with the web browser is the server/client side. The hyperPad app i simply connecting to his server.
See the "Socket" behaviour with the url: http://localhost:3000? That's where the connection is being made. The localhost is his server (it's using local host instead of a real IP or web address because it's a test server running on his own development machine).His server is running code to handle the chat. That's where the real part of all this is located. The hyperPad behaviours simply connect to it and know how to respond.
This isn't an easy behaviour to use, and isn't for beginners. This is why we held off on adding it for so long, because I firmly believed our community was not ready. Even still, I doubt it will be used much.. But the community keeps asking for it, so we decided to make it happen. Hopefully some cool stuff comes from this.
-
That being said, the server was only 20 lines of code and was also super easy to setup. I just used the example they have on socket.io
I should also mention that all networking behaviors are on developer tier, similar to the open URL behavior.
-
@Hamed I see a get array value behaviour... is this a networking behaviour or an actual behaviour? I'm currently working on implementing A* pathfinding into a project, but if arrays are in the next update and don't need developer, I think I'll wait for that... also, does socket.io mean we can have direct player to player connections where one player hosts a server?
-
arrays are not a networking feature. they will be available to everyone in the next update :)
-
As well as dictionaries (basically attributes but as a standalone behavior)
There's also bunch of other cool new behaviors related to arrays. We'll update the roadmap later today with more details.
-
@Hamed by networking, do you mean you need a server for it or is it just a category for behaviours?
-
Both. You need a server, and these are just a category (or subcategory) of networking behaviours.
These "networking" related behaviours (Socket, and HTTP requests) will connect to any server outside of hyperpad. This means you need a server, and code running on that server to send/receive and compute data.
We don't handle any of the server side stuff for you at all. That's on your end.
-
Updated roadmap: https://trello.com/b/EmwcGN1T/road-map-and-known-bugs
-
@Hamed wow I just looked at it...looks awesome!!!!!! When will it be out????!!!!!
-
@Murtaza never mind, I misread your previous post, I thought you said arrays ARE a networking behaviour but you said they AREN'T lol
-
@Hamed can an array be saved to file?
-
@iTap-Development said in Upcoming Socket.IO sneak peek:
@Hamed can an array be saved to file?
Yup :).
You can even put an array in an array. This next update should make hyperPad A LOT more powerful. -
@Murtaza can arrays be added dynamically like attributes?
-
@iTap-Development Values in arrays can be added dynamically. So think of the Array behaviour as something similar to a box container, you can pre-fill it with values if you want.
Then you would use the Modify Array behaviour to dynamically add items to the beginning, end, or a specific index of the array.
Another thing you can do with the Modify Array behaviour (and all the other array / dictionary behaviours) is type in an array as a JSON string. ie ["Cat", 2, 5 "Dog"] and use the modify array behaviour to add or remove values from the text dynamically. For example, the HTTP request behaviour can output values as JSON... you could input it into Get array and get the first index.
-
@Hamed so you can add an index, but can you make a completely new array dynamically. Like attributes being predefined or dynamic?
When will this update be out?! -
@iTap-Development you can only dynamically create it by typing out the json string. I feel like it will be more clear when you guys get your hands on it.
-
@Hamed ok...I think I get it.😂
-
That was great. That made my day :rofl: