Look here:
construct.net/en/free-online-games/inventory-example-692/play
There is a green button game.capx for download.
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.
Develop games in your browser. Powerful, performant & highly capable.
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.
Member since 31 Jul, 2015