RadTT's Forum Posts

  • 4 posts
  • There's 3 easy ways that come to mind, which one works best will depend on your situation.

    1. Create an event sheet function that gets the value. This works because you can set the return value of the current event sheet function from JavaScript using runtime.setReturnValue.

    2. Create an event sheet function that sets the score label. You can call event sheet functions by name from JS using runtime.callFunction passing in your variable.

    3. Assign the value to a event sheet variable. It's possible to read/write the local variables of an event sheet from and event sheet script block, and the projects global variables from any script type.

    Nice solutions, thanks!

  • So in a Set Text event, I can do something like:

    "Score: " & score

    In this scenario, score is a global variable and the output is something like... Score: 123

    Instead of using the score variable here, is it possible to use a different variable I previously added to globalThis in a script?

    Something like...

    globalThis.myScore = 123;

    and in Set Text:

    "Score: " & globalThis.myScore

    Is this possible? In my attempt, it doesn't like me trying to use globalThis.myScore in the event.

  • Exactly, it usually happens when I'm escaping the auto-complete. Just something I do out of habit so whatever IDE I'm working in doesn't auto-complete for me when I don't want it to.

    A confirmation prompt would be perfectly fine for me. Make the confirmation itself escapable so I don't have to click out of it. Make the "Ok" option of "Are you sure?" clickable only, so losing progress can't be accidental.

    Honestly though, the sake of consistency here sounds a little counter-intuitive. I wouldn't want a comment I just wrote to undo itself either if I just hit escape. I guess if your user base is used to that being the thing, and you have a lot of users undoing their comments in this manner... ok... but do you? You already have the undo feature (ctrl+z) in place to handle this anyway. Personally, I would expect escape to remove focus from an element but never undo the progress regardless of what the element is (code or comment or whatever else).

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Hello!

    Just a couple questions/comments about the javascript functionality:

    1. While editing a script, hitting escape reverts all changes since you last clicked outside the script editor. I think a pop-up would be appropriate here - "You're about to lose your changes. Are you sure?" or something to that effect. I'm a javascript developer in my day job and while I feel comfortable using your built in editor, I've already run into a couple instances where I hit escape like I would normally in my IDE, and I ended up losing progress in the script I was working on. At the very least, is there an option to turn this into a save action instead of discard action?

    2. Will there be external IDE support in the future?

    Love the app so far! I can't believe how easy and quick it has been to get things working how I want them. Even being a programmer professionally, I've only started messing with the javascript feature just to test it because the visual event system has been so easy to use.

    Tagged:

  • 4 posts