dop2000's Forum Posts

  • I do something similar in my projects. All texts are added to a single Texts family. It has a "tag" instance variable defined on it. I can specify unique tags for each text object on the layout, for example "player_score", "game_over" etc.

    There is an array containing all these tags with strings translated to different languages.

    And I have a single "Texts On Created" event, which looks up the string in the current language for each text by its tag.

    I chose to use an array because it's easy to edit, but this can be a dictionary or JSON.

    Here is a (paid) template with this and a few other useful mechanics for game localization:

    construct.net/en/game-assets/game-templates/multi-language-support-c3-2407

  • The only issue with Tween is that it will choose the shortest way. For example if you tell it to rotate from 0 to 270, it will rotate 90 degrees counter-clockwise.

    If you want to rotate 270 degrees clockwise, you need to use "Tween Value" action and set the angle to Sprite.Tween.Value("tag") while the tween is playing.

  • So a web game? Use Browser.QueryParam and Browser.QueryString expressions

  • Oof..

    I would suggest parsing the entire works of Shakespeare into a list of unique words first. This task itself is going to be tricky. You need to remove all punctuation, line breaks and other non-letter characters, replace them with spaces. Then extract every word using tokencount/tokenat. I suggest writing these words to a dictionary as keys, this is the easiest way to get rid of duplicates.

    Then you can start generating that continuous string, and after adding each letter loop through all dictionary keys and check if the string contain such key.

    For Each key in Dictionary
    find(LongString, Dictionary.currentKey)>=0
    ... // word found!
    ... Dictionary delete Dictionary.currentKey
    

    You'll need to use expressions like tokenat, tokencount, find, trim, replace etc. See this link:

    construct.net/en/make-games/manuals/construct-3/system-reference/system-expressions

    Oh, and the string doesn't need to be endless. If no words were found, you can safely trim the string, leaving only the last 20 or so characters. This should help with the performance.

  • I think it should be something like this. But it won't work in preview, you'll have to export it to NWJS to test.

  • What do you mean by "directly" - without prompting the user? You can only do this in NWJS export. Use NWJS action Write Binary File. I guess you'll have to load CanvasSnapshot into the BinaryData object first.

  • See this demo:

    howtoconstructdemos.com/chess-game

    Note, it's for two human players, it doesn't have an AI.

  • 1StepCloser Whoa, I'm guessing you are starting to push the limits of Construct. That's why you still have lags even after garbage collection. I suspect the number of object types is the main factor.

    Our project is much smaller: about 50MB in size, 10K events, 500 object types.

    Looks like we might have to condition ourselves to "F12 + Click Collect garbage icon", just as we've conditioned ourselves to "Ctrl + S".

    I now keep DevTools constantly open on a second screen, together with C3 Search window.

  • Again, without any WAIT actions, would this be correct, or would "Change SOMETHING ELSE into ONE MORE THING" still take place before the sub-event "Create SOMETHING ELSE" and thus fail?

    I Construct, both SOMETHING and SOMETHING ELSE will be created before the second top-level event. (if there are no waits)

    Yeah, Construct logic is a bit different from other languages, it takes time to get used to it. One of the most important concepts in Construct is picking. Once you understand how it works, it all starts to make sense!

  • If you export to NWjs, you can use NWJS.ArgumentCount and NWJS.ArgumentAt(n) expressions.

  • I was going to suggest using families. I don't think there is a better solution possible.

  • Ashley Every time you tell to file a bug with Google, I'm at a loss, because I really have no idea how to explain this in technical terms to their engineers. "An app I'm using in Chrome starts to lag until I force garbage collection"? They will probably redirect me back to you.

  • Hi Ashley,

    If you recall, there have been several posts about the poor performance of C3 editor in Chrome and Edge. When working with fairly large projects, there are random lags and freezes lasting from a fraction of a second to 10-20 seconds.

    What's weird is that these issues are isolated not just to the browser app, but to a single browser tab. I can have two or three editors open in Chrome and only one of them will be freezing and the other two tabs will be working perfectly fine.

    Seems like we found the possible cause of the issue - garbage collection!

    Clicking the "Collect garbage" icon in DevTools immediately reduces or completely removes the lags. Please see the videos in previous comments. Here is also a report from relixes on Discord:

    Unfortunately, the effect is temporary. In my case the lagging returns after 5-15 minutes, so I have to keep the DevTools open and click that button many times a day.

    Can you please do something about this? Perhaps there is some "garbage collection aggressiveness" setting which should be increased, or maybe you could force it to run every 1 minute or so.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • SnipG I don't use timelines. And I tried closing all tabs in the project, restarting the editor and only working in one or two event sheets - it still starts lagging randomly. So it doesn't look like the number of open UI windows/tabs is what's causing these freezes.

    The good news is that garbage collection definitely helps! Here it reduces 2-3 seconds lag to zero:

    Subscribe to Construct videos now
  • In C3 events are executed from top to bottom. Their order on the event sheet and the way they are nested is pretty important! It determines the order in which the actions are run, and the scope of picked instances.

    See this screenshot with my comments in it. The red numbers show the order in which the actions will run.