Juanito-cnstrct2's Forum Posts

  • istanto : It was a silly mistake, I was calling the my splice function with the wrong index in the plugin code *facepalm*. I tested it in my machine and it works. I put a new version out there, please download this latest version and let me know if it works for you.

  • istanto did you get this error with the new version? I saw that problem and I though I fixed it in the latest release. It was a problem with the code in the example_server.js file (I was not using the broadcast method in the socket).

    Shiva I have not tried R84 with the plugin yet, I will give it a spin.

  • Very nice!!! Just what I needed!

  • Shiva : are you opening the web page by double clicking on it? that might not work, it has to be hosted in some kind of webserver. It works in debug mode in C2 because C2 uses a local webserver (localhost:5000) to host the game.

    Thank you for using the plugin!

  • chromstruct and noranka: Interesting... what browsers are you using? The "info- handshake" message that you get, where do you see it?in the console or the screen?

    Also, I uploaded a new version with a small fix in the example server, can you please re-download the plugin.

    Thanks

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Bug in R.82:

    The Array plugin is setting the depth equal to the height when calling SetSize.

    In the method you can see that it reads:

    this.arr[x][y].length = h;

    instead of:

    this.arr[x][y].length = d;

  • Plague : I have never used openfeint before. For server side code, I always use GAE (google app engine), which is a free hosting (up to a limit) service that allows you to write custom server code in python. I suggest learning and using that because it will help you in the long run.

  • Plague : one way of doing the ghosting would be to record the key presses (up or down) that a player does and record the time (relative to the start of the turn, current_time - beginning_time) when that event happened. You could store that info into a string by appending to the string every time that event happens, and separate the info with commas to separate events and a ! for separating the time from the event type. At the end of the turn, your string would eb something like:

    L!D!3.10,L!U!7,L!D!14,L!U25...

    Where L is a code for the Left key, D is key down, U is key is up and the numbers are the seconds since the start of the turn. Now for smarthphone, I am not sure what events you will use to move the player, but you can use the same idea. When the turn ends, you can send the string via AJAX to your custom server (you or somebody will have to write the server-side code) and when the other player (player2) can chooses to refresh his screen to receive any new data, your C2 code will need to do another Ajax request to ask for any new data.

    Your server side code will need to return the string sent by the other player. Once the string arrives at player2 via Ajax, you can devise something to split the string into arrays and then call each of the events at the time associated with them by using the compare "Compare Time" condition to compare the relative time with the time registered in the string for the 1st event.

    The above is a very high level overview of what you could do, it will take you some time to tune up by trial and error and may or not work for you.

  • Thanks rgros, I did not know there was something already to lock the mouse in HTML5. I will try to integrate it with my 3D plugin in the future. Right now my sample FPS is a DOOM style FPS (no up or down movement; just left, right, forward, backward movement)

  • Rasmus : I think I had the same problem. If you are using Windows, I strongly suggest that you open the CMD, cd to C:\node_modules (create that folder is not present) and run the "npm install socket.io" from there. It seems that Node.js has "C:\node_modules" hardcoded as one of the paths to find the installed modules.

    Also, I did some small modification to the plugin to make my sample game work, please see my post here if you want to download the sample game and the modded plugin.

  • klukke: There should be a sample file named "loadimage_test.zip" in https://sites.google.com/site/jptarqu/downloads.

    Thanks

  • delgado : the copperlicht level won't work in C2's preview. The detailed explanation for this is in the 1st post of this thread; it basically comes down to the fact that I do not know how to embed the coppercube level file and its related files (everything that is in the "copperlichtdata" folder) into the Preview sever.

    If you want to run the game with 3d, you need to export to your local or external web server and make sure the "copperlichtdata" folder is in that server as well.

  • Thanks Kyatric, that is exactly what I needed!

    I updated the demo. Now you can shoot "bullets" by pressing 'Q'.

    I also added the download to both the plugin and the demo at:

    https://sites.google.com/site/jptarqu/downloads

    The name of the download is copperlicht-c2-plugin-v-0.9.zip.

    Please note that to run the sample capx, you will need to export it to your web server (either local server like IIS express, apache, etc. or to a external server). The reason behind this, is that copperlicht will try to load the external file containing the level made in Coppercube. I could not find a way of embedding that files and the texture files needed by that file in C2's debug server. I personally use IIS express to test demo in my computer.

    Another thing to note is that there is a lot of trial and error trying to match the coordinates between copperlicht and C2. For example, for the walls, I used coppercube to design the 3D level and "measured" the units there and put the objects in the same place in C2's layout.

  • smitchell: I have the following events and actions right now to allow the sprite to rotate left and right and to move forward or backward in the direction the sprite is facing:

    <img src="http://mathbattlegame.appspot.com/static/copperlicht/tutorial2/Capture.PNG" border="0" />

    The problem with this is that it does not use the built-in movement behaviours, so the object is not stopping when colliding with solids. newt suggested using the 8-direction behaviour, but that does not work because the sprite can only move in 8 directions and not any direction like the demo does right now. I could copy the the 8direction behavior and mod it in javascript to allow moving in any of direction (any of the 360 degrees) ; but before doing that I want to make sure I am not re-inventing the wheel by doing something that can be accomplished with the already-made behaviors. As always, thank you for your time helping me.

    Animmaniac: I did not know there was an irrlicht plugin for MMF :), I bet that was a very welcomed addition to it. The last click product I used was MMF classic (v1.0) and before that, Klick and Play. I loved the days of Klick and Play when every body was sharing their code files in the maxis website, a lot of people built on top of other people's work, that was my first exposure to "open source code" (if you can call it that :) ). Anyways, glad to see another ex-click here, I am very excited about C2, building plugins for it is like 10 times easier than building them for MMF 1.0.

  • ok, I tried set angle when left or right is pressed. I also added set speed(from the 8directions behaviour) when the up key is pressed. However, when i press Up, the sprite is resetting the angle to zero and then moves to the right.