Guizmus's Recent Forum Activity

  • I didn't find a tutorial for you, so I made a commented example.

    Here it is.

    I did custom control for only 4 controls (up, right left and down) as it is exactly the same for others and that would have made the code harder to read.

    The thing is cut in 2 layouts. One is for the options, where the user will set the controls. The other one is for the game, but I only put a display in it.

    If you go in the options, click on a text box and then put an input using keyboard or gamepad, it should display in the box. Returning to the Display layout and inputing the same key should display that the key is recognised, and where it came from.

    To use it in a game, I separated 4 functions in the "Display" event sheet. Those 4 functions are respectively called by the 4 inputs, after all the custumization the user did. So if you had movements to map, or jump, everything can be put in there.

    As for the method I used :

    • An array "Control" will store the user settings : Controls.At(ControlDirection,InputMethod) = UserKey
    • the ExecuteKey function handles every input given by the user, and calls the corresponding function if it was a mapped key.

    For more details, the code is commented.

    For even more details, just ask

  • But aren't those buttons the same object ?

    If so, just create a function "Spawn button" and give it a parameter : the frame number.

    Example

  • nimos100 thanks for explaining it more clearly, that's exactly what I meant

    All those 20, 30 and 5 are, of course, variable. You can have how many properties you want on each tile, just increase the 5 I used.

    Having multiple tilemaps like Nimos100 said is also a nice solution, as it is easier to read/write in the events maybe. I'm not sure it is best performance-wise, but as the map isn't drawn, I don't see any problem. For a debug purpose it's a lot better this way (as you showed us).

    To simplify my solution, you could also use some global constants to represent the property you use in the array.

    Let's say "NAME" = 0, "DEFENSE" = 1, and "WALKABLE" = 2, then you could get a property for the tile at the position X,Y using :

    Array.At(X,Y,DEFENSE)

    It's more like a define in any other language, but you get the idea : simplify the writing/reading

  • 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 :

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • 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

Guizmus's avatar

Guizmus

Member since 26 Mar, 2013

None one is following Guizmus yet!

Trophy Case

  • 11-Year Club
  • x4
    Coach One of your tutorials has over 1,000 readers
  • Educator One of your tutorials has over 10,000 readers
  • RTFM Read the fabulous manual
  • Email Verified

Progress

15/44
How to earn trophies