Asmodean's Forum Posts

  • Try and catch should work in scripting:

    try {
    	rumtime.callFunction("myFunction","Parameter");
    } catch(e) {
    	//console.log(e);
    }
    

    e is the error code you can ignore it if you want

  • With autocomplete or at runtime?

    I think autocomplete works only with functions created in scripting.

  • -> System: Set oddNumber to round(random(1,100))

    -> System: Set oddNumber to oddNumber%2=0 ? oddNumber+1 : oddNumber

    If oddNumber is even it adds 1 to the even number or it gives back the odd number

  • "Web storage" is deprecated since 2015, I think. It's replaced with "local Storage".

    Note: as of r206, WebStorage is deprecated in favour of the new Local Storage plugin. This manual entry remains for any old projects which are still using WebStorage, but new projects should use Local Storage instead.

    https://www.construct.net/en/construct-2/manuals/construct-2/plugin-reference/webstorage

  • Here :

    https://drive.google.com/file/d/1LxO8UD9GFA8LeOzL5wCTe9Ns9MEP6_6l/view?usp=sharing

    It's the effect with one example.

    No guaranty that it's working.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • In Event 10 you add a value to the directions and don't set them. So after a few seconds direction variables should be above 3 and the events after won't be triggered.

  • I think that is all more or less hacky. If it works with the animation it's a good idea.

    The other idea I had is you could store the whole instance asJSON in a variable.

    + Top: On collision with Bottom
    -> Top: Disable Physics collisions with Bottom
    -> Top: Set temp to Top.AsJSON
    -> Top: Set Physics Immovable
    -> Top: Set Physics Movable
    -> Top: Set from JSON string Top.temp
    

    But I think that is more hacky than your solution.

  • I think after the collision the top object is in 'sleep mode' and disable the collision isn't changing this state.

    Try:

    + Mouse: On Left button Clicked on TopObject
    -> TopObject: Disable Physics collisions with BottomObject
    -> TopObject: Set Physics Immovable
    -> TopObject: Set Physics Movable
    

    Or you could disable and enable the physic-behavior of the top object. That should reset the state.

  • That is called jamming https://en.wikipedia.org/wiki/Rollover_(key)#Ghosting.

    Try another key instead of space like shift or control.

  • Try this:

    drive.google.com/file/d/1ts2b1xrHfNFUwfAhmLcfvuYFexrAPTtt/view

    Don't know if this exactly what you want.

  • May be I understand this all wrong, but would it not be easier to use pixel per tick instead?

    + System: ProgressBar.Width ≤ 208
    + Mouse: Left button is down
    -> ProgressBar: Set width to Self.Width+(208÷3)×dt
    
    + Mouse: On Left button released
    -> ProgressBar: Set width to 0
    

    With 208 the width and 3 the 3 seconds and if you have 60 FPS it would add (208/3) * (1/60) = 1.1556 pixel per tick to the width.

  • It seems that is a zipped project Folder. You only have to unpack it (you can also attach the suffix .zip, so it will be recognized as zip) and open the folder with Menu -> Project -> Open local project Folder.

  • Sorry my fault, answering before understanding the question completely.

    I think that is more a picking problem. In the second version the overlap (128,0) is already in (128,-128) covered. So it picked only the (128,-128), I guess. I also think that the for each is a problem. In this sub event it has only one choice, because the for each picked one raildetector.

    If you have an and event with two conditions it can only be one picked. If you want that all raildetectors with overlap (128,0) and (128,-128) are picked you need and 'or' event.

    I hope that makes sense. I'm not sure myself, without an example is only guessing.

  • The first one is an 'or' the second one is an 'and'. Make it an 'or' and it will work.