dop2000's Forum Posts

  • You mean you want to randomly set values 10,20,30,40,50 to five text boxes, without repeats?

    Try this:

    For Each TextBox Oredered By random(1)
    TextBox set text to (loopindex+1)*10
    

    If it doesn't need to be random, then it's even easier:

    TextBox set text to (Self.IID+1)*10
    
    
  • In C3 you don't need Rex's addons, just use the official MoveTo or TileMovement behaviors.

  • Ah, you need to add this behavior to Tilemap object, not to sprites.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Thanks for the coffee!

    It may be a difficult task when character has multiple animations and you need to prioritize and delay actions based on which animation is currently playing.

    It's hard to speculate without knowing your game, but it may be a good idea to use a state machine here. Assign a state to the character when an action starts, for example, "kick". Wait for the animation to finish (or use Timer behavior to wait a certain time), then reset the state to "idle". Allow new actions to occur only when the state is "idle".

  • Adavo It works fine for me with the latest C3 build.

    Is it any specific action/event of the behavior which throws this error?

  • There is an expression Family.ObjectTypeName

    You can pass it to the function, and inside the function use "Create object (by name)" action.

  • Adavo Make sure to download the latest version of the plugin from Eren's comment above.

  • I believe array object is essentially a Javascript array, so you can estimate its memory usage:

    mattzeunert.com/2016/07/24/javascript-array-object-sizes.html

    This way at least we can show the loading progress for feedback instead of nothing.

    I actually stopped using loadingprogress expression, as it often doesn't refresh. Instead I'm showing a fake progress counter, something like this:

    Every random(1,2) seconds
    Progress set to min(100, progress+choose(0,1,2,3))
    Text set text "Loading ..." & Progress & "%"
    
  • [removed]

    EDIT: Never mind, found "LocalStorage Set/Get Binary" actions. I don't know how I never noticed them before!

  • It is possible with BinaryData plugin - you can convert the image to base64 string and save it to Local Storage. However, to restore it you will have to load the image into a sprite first, and then paste the sprite to DrawingCanvas. There may be some quality loss if window size has changed, for example. Also, if the image is large, base64 string may be really long (many megabytes)

  • You need to multiply by that expression, and add a small delay before "Save image" action - because pasting a large image may take a few ticks.

    The result in my case was an image with resolution 1081x1922. Which is pretty close, but I don't know how to make it exactly 1080x1920..

  • when you create an event you can add only once "On Key Pressed", every other condition or sub-event will give only the option "Key is down".

    These are two different kinds of events. "On" event is a trigger, it fires only once when the key is pressed. Only one trigger is allowed per event. "Is" event is a condition, if this key is down, the event will run every tick, until the key is released.

    So the easiest way to fire the event once all three keys are pressed is this:

    On D pressed
    Is DownArrow down
    Is RightArrow down
    

    But of course it doesn't take into account how fast the keys were pressed and in what order. You need to save the time when each key was pressed. The array seems like an overkill for me, you can do it with a pair of variables - pressedRight and pressedDown.

    On DownKey pressed
    Set pressedDown to time
    
    On RightKey pressed
    Set pressedRight to time
    
    On D pressed
    Is DownArrow down
    Is RightArrow down
    pressedDown > (time-0.5)
    pressedRight > pressedDown
    ....... Play combo animation
    

    This event will fire when all three keys were pressed within 0.5s and in this order: Down->Right->D

  • I was going to suggest the same as lionz, but use a global variable instead of an instance variable on the button. The button won't remember its variable when you return to Layout1, unless it's set as global (which I don't recommend here) or has Persist behavior.

    So a global variable would be the easiest choice.

  • Ashley Ah, will do, thanks. I posted here mostly to see if anyone else have the same issue.

  • If you can reliably reproduce it please file an issue.

    You mean with Chrome support? How do I describe the problem? "Focus doesn't always work in some 3rd party app I'm using" - I really doubt they will look into it.