Juanito-cnstrct2's Forum Posts

  • Schoening : yes, sort of. The count variable it would get massive if there is a massive amount of players joining. The count variable gets incremented only when a new player joins so that the server can assign a unique number to that player.

    The server script in the sample was not designed to be run forever. It works more like the old games: you would start the server part of the game every time you wanted to play a multiplayer game, let you friends know about the IP address of your game session and then close it when you were done with the match.

  • Schoening Exactly. The server script takes care of incrementing the player id every time a new player joins.

    The "Array int(Socket.LastDataElement(1))" part is basicaly saying:

    1. get the affected player id number from the message we receive from the server. In the sample, the messages always put the player id in the second position of the message, that is why you need to get the element from the last data that resides in index 1 in the internal message array. The first position is the type of message.

    2. Once the number if obtained, convert it to an int. This is because the raw network message is of text type.

    3. Once the affected player id is converted to an int, use that number to lookup the UUID of the sprite that belongs to that player.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Schoening : it gets set when C2 receives an I (initialization) or a C (create another player). Basically it gets assigned when a new player gets created (including the player that "owns" the current game instance.

    That array just holds the UID of the players' sprites to allow picking them when a network event arrives affecting them.

  • Is there any way of implementing a "cost" for each node? That way it would try to choose the path with less movement cost?

    Thank you!

  • bjadams I made a plugin that incorporates copperlicht to C2, allowing you to use 3d webgl graphic. Search the plugins forum.

  • sorry, I have only tried it on local networks. You can try serving from your home connection (if you have a good internet connection) or get a trial for a virtual hosted server.

  • LimonSpace and BarneyK : I recommend you use the following event/action code instead of the scroll to behavior:

    Condition:

    Every Tick

    Pick Player by UID (in my sample I store the player's UID in the Controller object's MineUID instance var)

    Action:

    System->Scroll to object (choose the player)

    That would allow C2 to pick the sprite owned by the player and scroll to it.

  • itza3985 controller is just a background object that I use for the sole purpose of holding variables that are used to "control" the flow of the game.

  • I just wanted to share some news about TypeScript which is basically a super-set of Javascript that allows static types and traditional classes (among other features):

    http://blogs.msdn.com/b/somasegar/archive/2012/10/01/typescript-javascript-development-at-application-scale.aspx

    The compiler compiles to regular javascript. If you like using Intellisense (some don't) then TypeScript could be a great way to write the guts of your plugin in Visual Studio.

  • ekalostz :

    1. Are you minifiying the export (un-check "Minify")

    2. Are you putting the exported files into a web server like IIS or Apache? (I don't think it will work if you just double click the generated index.html file)

    Thanks

  • LimonSpace A few things:

    1. when I go to 93.145.237.246/index.html, the game there is minified. Export the game to your apache server without minification. It will help when troubleshooting.

    2. When you were connecting using Firefox, were your connecting to the index file hosted in your apache server? sor some reson the error you got in Firefox is not minified and you got the following error:

    [18:51:17.860] TypeError: this.Y is undefined 127.0.0.1/c2runtime.js:132

    Is there any way in Firefox for you to copy and paste the code lines around that line (line 132 of c2runtime) so that we can see them?

    3. Why are you adding var socket = io.connect('http://93.145.237.246:8099') to your index file? The plugin is supposed to connect to server you tell it to inside your C2 event sheet. Connect to your node.js server using the plugin actions in C2. The above line will not help you and will only confuse you more.

    Thanks!

  • LimonSpace, hmm, you will need to get rid of those runtime errors first. Get the latest version of the plugin and make sure you put the runtime.js and edittime.js files in the correct place. Check if you are using the latest c2 version as well.

    also, after exporting the game delete the appcache file. do not minify yet.

    If u get the error again in Chrome, click on the blue link next to it and it will take u to the code line where the error occurred. Take a screenshot of that.

  • LimonSpace can your client run the game with chrome? If so can you check the console in chrome and look for any errors there?

    Also, what is the Url that the external client uses?

    If you connect within your home network, does it work?

  • actually there is another post in this forum (http://www.scirra.com/FORUM/xbox-360-internet-explorer-app-html5_topic57053.html) about a new IE app for the new xbox dashboard.

  • I second the suggestion to introduce some form of event re-usability in C2. IIRC, MMF had something called "behaviors" that were basically event sheets attached to the objects. Inside those events you would reference other "families" (I really don't remember the exact terms) so you could just copy and paste your object into another project and those events would work if the "families" were in the new project. I am sure Scirra has already thought of something similar and maybe they are working on it.