dop2000's Forum Posts

  • Thanks!

    I didn't realize Browser.language was not reliable. Will use UILanguage now.

    Ashley I wonder if you've discussed this with Chadori, Mikal and other big addon makers? Will you provide them support, ensure that their addons get converted before the deadline?

    C3 really lacks monetization features (to put it lightly), especially on mobile. Mobile developers fully rely on 3rd party monetization addons. You can't just brush them off and say "you knew the risks, you had plenty of time to contact the addon developer etc."

  • Which of these is the preferred method to automatically detect language in a Steam game?

    • Browser.Language: The browser's current language setting.
    • Steam API GameLanguage: The language set specifically for the game.
    • Steam API UILanguage: The language set for the Steam UI.

    Tagged:

  • I set the two actions to -275 and it worked.

    I see -1000 on your screenshot. Assuming that this object is on a layer with no parallax, then it's -1000 pixels up from the top edge of the screen.

    If swipe2 object has origin point at the top and you want to restrict its movement by top and bottom edges of the screen, you can use this more universal formula instead of the last two events on your screenshot:

    On every tick: swipe2 set Y to clamp(self.y, ViewportHeight(self.layer)-self.Height, 0)

    A couple of other things:

    Instead of pinning category names to swipe2, add them to a hierarchy in the layout editor.

    Use a single object categoryName with multiple instances instead of 17 different objects.

    Your code is not framerate independent, use delta time. For example: move forward swipespeed*20*dt

  • It's difficult to understand what's going on with all these timers and flowcharts. My guess is that with shorter timers the enemy state changes before the timer expires.

    I suggest debugging with one enemy instance. And add console logging (Browser->Log) to key events to see when they are triggered.

  • I would probably do this with hierarchies. Assuming that all objects stored in small grid are instances of the same sprite (say, Icons), you can create a hierarchy with SmallGrid + 9 icons on an unused layout. Then you can spawn the entire hierarchy with all icons already in place. Filling it will be a matter of setting the correct animation for each icon. Maybe you can store these animations in an array or something.

    Or you can even prepare the whole thing (BigGrid + 9 SmallGrids + 9*9 icons) on the layout in advance, and hide most of them. When you need to reveal the big grid - make them all visible.

  • You skip to the next entry in the table, see my first comment.

  • There are several ways to organize this.

    For example, if all players are instances of the same sprite or family, you can store control type in an instance variable. Then, in keyboard/gamepad events pick the player instance:

    Keyboard On Space pressed
    Players controlType="kbd" : Player simulate jump
    
    Gamepad 0 on A pressed
    Players controlType="gamepad1" : Player simulate jump
    
    Gamepad 1 on A pressed
    Players compare variable controlType="gamepad2" : Player simulate jump
    

    To optimize this code you can create functions or custom actions for each movement - PlayerMoveLeft, PlayerMoveRight, PlayerJump etc. Then call these functions/custom_actions from keyboard and controller events:

    Keyboard On Space pressed
    Players controlType="kbd" : Player Jump
    
    Gamepad 0 on A pressed 
    Players controlType="gamepad1" : Player Jump
    
    Gamepad 1 on A pressed 
    Players controlType="gamepad1" : Player Jump
    
    Player Custom Action Jump 
     Player simulate jump
     Player set "jump" animation
    
    
  • If you don't need to keep another permutation table in AdvancedRandom active, then there shouldn't be any conflicts. You can re-generate permutation tables as often as you like.

  • There are other options:

    You can use a While loop - generate a random frame number, check if there is a button already with this frame. And either repeat or stop the loop.

    Or put all numbers into an array, pick random index and then delete it.

    Or use a string variable with the list of frames - pick random token and delete it.

    But permutation table is easier than any of those.

  • You can also do this without the AdvancedRandom. Add 20 button instances with frames from 0 to 19. Pick the correct one. Pick 4 other random instances, destroy the rest.

  • Create an AdvancedRandom permutation table. For each button set frame to AdvancedRandom.Permutation(loopindex)

    If you need to exclude the correct frame from the table, use a variable instead of loopindex. And skip one entry in the table if it equals the correct frame.

    For Each Button
    .. If AdvancedRandom.Permutation(i)=correct : Add 1 to i
    
    .. Button set frame to AdvancedRandom.Permutation(i)
    .. Add 1 to i
    
  • Try JSON.Get(".nome")

    The "." period should always be used for relative paths.

  • I have the code, but it does nothing. Debugging reveals that when I click on the object, it says that the inspected item is destroyed when it's not destroyed. Which makes me think it's destroying and creating on the same frame.

    That's probably what happens.

    In addition to Debug Mode, use browser logging.

    Add "Browser Log" action to the event where items are created and destroyed. In preview press F12 and open console - you will see how often they are created/destroyed.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Save the selected character in a global variable. In the new layout - use the value in the variable to spawn the character object or set the right animation.