Guizmus's Forum Posts

  • You could use an array.

    Let's say your map is 20x30 tiles, and that each tile could have up to 5 properties.

    Then if you have an array of 20x30x5, let's call it "TileProperties", you could decide that, in this array :

    • TileProperties.At(X,Y,0) = the defense of the tile at X,Y in the tilemap.
    • TileProperties.At(X,Y,1) = the movement cost of the tile at X,Y in the tilemap.
    • TileProperties.At(X,Y,3) = the property you want of that same tile at X,Y

    ...

    To do this, once the map is loaded, you should check every tile to store the properties in the array. Something like this.

    Once this is done, you can then know what is the property value for each property of each tile on the map with a single Array.At.

  • Hello everybody,

    The timer behavior is very nice, but I tend to use instead the timer behavior from RexRainbow, because it has the "timer is running" condition. I think this is possible in the current Timer behavior though, using a system:Compare two values and comparing the duration of a given tag to 0, but this isn't clear and, if I'm not mistaking, force you to add a For Each on the object that has the timer if you want to select the right elements. Using a boolean and set it to true as soon as the timer starts/false when it stops is also a solution, but you'll need a new boolean for every timer tag you need to check for.

    Am I missing something here, or is this the only method to check if a timer is running right now ? Would this be useful ? If so, could this be added in a future update ?

  • 1/ You can use the System condition "Pick by evaluate", and compare the X of your sprites to take the one you want. "The one in the middle" is rarely the criteria to select though, more like "the one with the highest speed" or something like that, where the System condition "Pick by lowest/highest" will help you.

    2/ No "official" advance tutorial. But lots of tutorials from people.

    For a good learning curve, I would suggest first taking a look the the manual each time you start using a new object type you didn't know. Then, look for tutorials on the specifics you need from those objects. Or just try to do something, fail, try again, ask for help here, discuss the logic behind your problem, understand the solutions that you will be given, ...

    A good way of learning is trying to do your own game. But don't go too big, go after the systems the ones after the others. All the first ideas you gave are simple :

  • Another bug I just saw (and didn't see in this topic) : if you try to reply while not connected, you are redirected to a new login page. This page, either with a right or wrong password/login will redirect you to the old login page, that will loose the exact page you were on before. Not a big issue compared to others, but still something.

    Great work here Tom, thanks a lot !

  • Unless you have complete different actions depending on the number of stars, you want to call a function here. This function would be called, giving it the star number as a parameter. It would then act by executing those actions and using its parameter if needed.

    Also, you can structure your events like this : ScreenCapture

    Less sub-events, easier to modify and improve/use.

  • You want to display in the same object 2 texts at the same time, so the last you call is displayed and hides the previous call.

    The function "display text" could be instead "queue text", a function that adds the text to an array of "buffered text". Another function would be called on regular intervals, and would check if the array is empty or not. If not, it would select the first text from it (remove it from the array too), and display it.

    This is a simple log system...

  • If the events you showed didn't work, this means one thing : the event "on text change" isn't triggered by adding text into the textbox.

    Let's take a step back here. Text box are native html form elements and thus dispatch specific events to the system. onTextChanged is triggered when the focus is moved from the box.

    So there is another solution : what if you didn't use the native textbox, but instead a 9patch (for the background of the box) and a text element. On click on the "falseBox", you would set it "active", meaning a cursor would start to blink in the text element (every 0.5s, add or remove a | from the text). If the box is active, you would also check for keyboard inputs, compare them to a list of authorized characters, check if the box isn't already full (max length), and finaly add the character if everything is good.

    The last trick I have here can help limit the number of character but not the authorized list : at the start of the layout, you could execute some JS to add an html attribute "maxlength" to the text box. This will natively prevent user from inputing more than X character

  • Well, in this tutorial, there is an event :

    Keep the X as it is, and don't change the Y (put "Self.Y" in the Y slot, or a constant).

    Even if there is no scroll on Y, you have to choose at what Y the camera is.

  • -Change the New member post limit to something else.I already have 200 posts and is still not able to view PMs

    Look at the first message from Tom, PMs are broken right now and it's a known issue. Nobody can view PMs

  • I have experienced the unlogin also, after some time spent on the same page, and having the "keep me logged in" checked.

    It seems that profile links aren't active right now either.

    Other than this (and the known issues), I like it a lot that you update this forum. It's been a little rusty for some time (quite slow mostly) and we can already see a big difference in performances. The new links (see your posts, unanswered topics...) are also very useful. (as for the new CSS, I like it, but doesn't seems to be the general feedback...)

  • It is possible. It's called "Confirm" in javascript, but the choices will be "OK" or "Cancel", and you can't change those. Creating your owns will be better in the long run.

  • There have been multiple threads about highscore recently (like this one).

    Having a "low score" instead of an high score just change 1 thing : the comparison sign.

    For a highscore, at the end of the game, you compare "newScore > highScore", and if it is true, you set a new highscore, display something on screen, ... Just change it to "newScore < highScore" and you will handle everything else exactly the same.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • If you absolutely want to have only 1 weapon loaded in the layout, I don't see other technique but a layout per weapon, and dynamic loading of everything else, as you can't create an object in a layout in C2 if it wasn't created at the start of the layout.

    In that case, I would still use the same layout for multiple weapons that have the same animations, as you may be able to spare a little more memory here too.

    That being said, you sure can put more than 1 weapon in a layout. Plus, if you destroy it at the start, depending on the device, the memory will be free automatically (I may be mistaking, if anyone has more precise info).

  • Or without a variable, and using dt for a smoother effect : events

  • If, on every Character Object you have a variable "Speed", then you can use the System event "Pick by comparison", or "Pick lowest/highest". This will let you select the one with the highest speed, and with a "flag" variable, saying if he has already played or not.

    Here, this is what the events would look like.

    This should all be put in a function you would call "next Character activation", or something like that, as you sure will need to wait for the player to choose an action before going to the next character.