Magistross's Recent Forum Activity

  • It might be a good idea to not use built-in collision at all and rely on an array representation of the grid to create your own collision detection.

  • There you go !

    I cooked this up in a hurry. Most of the functionnalities can be tested. It's all pretty basic, but might seem a bit hard to grasp if you're new to all this popping and shifting.

    Note that you need to add data with push or unshift before you can do anything. (Inserting at index 0 in an empty data structure won't cut it)

  • I don't know if the Construct 2 web server's configuration allow foreign connections. You COULD however build your own local server and host your C2 creations, and then test them with whatever compatible device.

  • Glad to hear that ! <img src="smileys/smiley20.gif" border="0" align="middle" />

  • What "recently" changed in the SDK ? Recently being between r55 and the current one.

  • One thing that could worth adding to this A* implementation is "teleporters". Special walkable tiles from which a path to other non-adjacent tiles can be found. Especially useful in creating wraps and warps alike !

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • atan2() exists in the Javascript Math object, but it can't be directly used in C2. But it seems Ashley proposed a working alternative using the already implemented angle function.

  • Hi all !

    I used my spare time at work to mess around with the plugin SDK. I decided to give a go at data structures and this little plugin was born !

    I basically implemented the basic JavaScript's array functions (pop, shift, splice, etc.) for vectors, with all vectors stored in an associative list. Actions add data, and expressions remove it, although you can still remove data with an action (but without retrieving it).

    Descriptions, names and such are a mess, but I think it's still pretty usable. If someone feels like cleaning the descriptions and giving more significative names to conditions, actions and expressions, or even adding more functionalities to the plugin, please do ! I did this just for kicks, but if it can be helpful for someone, then by all means use it !

  • I, too, checked the code. But it seems you didn't see things as I did. When the plugin receive a message, indeed the trigger happens, but the "lastData" variable also gets overridden with the new message. So in the unprobable (but possible) event of two messages received between two C2 tick, only the last message is returned via the "LastData" expression. As I said, storing them in an array via C2 WON'T help, and there is no workaround except by implementing stacks (or queues, or any other data structure) inside the plugin.

  • There is no way to tell if the plugin received more than one message during one tick. Storing them in an array is pointless, since you can process them punctually as they arrive. This is a kind of things that needs to be done internally.

  • Add an array to your project

    Add a global variable "step"

    Socket=>"on reception" (something like that, I can't have the plugin under my eyes)

    ..array. Set at X (where X is global step), value Socket.LastDataReceived

    ..array. Set size to X=step+1 ,Y=0,Z=0

    ..step. Add 1 to step

    This wouldn't solve anything since the problem comes from the plugin itself. I don't know anything about websocket, their implementation or anything, but I think the plugin should use a stack to store received messages instead of a simple string variable. That way, you could add an event like "While the messages stack is not empty, pop a message, parse it and do whatever needs to be done".

  • If you use the For each to loop for every instance of an object, then do as Kyatric said. You have to make use of the implicit looping when you can ! <img src="smileys/smiley2.gif" border="0" align="middle" />

Magistross's avatar

Magistross

Member since 4 Jul, 2011

Twitter
Magistross has 14 followers

Trophy Case

  • 13-Year Club
  • Entrepreneur Sold something in the asset store
  • Forum Contributor Made 100 posts in the forums
  • Forum Patron Made 500 posts in the forums
  • Forum Hero Made 1,000 posts in the forums
  • Regular Visitor Visited Construct.net 7 days in a row
  • RTFM Read the fabulous manual
  • Email Verified

Progress

20/44
How to earn trophies