Delphawi's Forum Posts

  • Hello,

    During debugging, one recursive function called itself a bit too much, and a "Uncaught (in promise) InternalError: too much recursion" exception showed in console.

    But the inspector showed something called "Loops" inside the System object. It is like an array with 230 entries, each one contains: "4 / 5".. except the last one: "0 / 5".

    I checked the docs but couldn't find anything.

    It looks like a handy feature, but I can't understand it!

    So, what is "Loops" and what does its content mean?

    Thank you.

  • Is it possible to feature some ideas here on the Construct.net site?

    I think visiting the suggestion platform is a bit "out-of-the-way" for most people (or those like me, at least..). I usually visit Construct.net weekly to check for updates, but visiting aha.io is not a priority for me.

    This matters because ideas now has limited time to get noticed, or they will be archived. Not because an idea is old does that mean it is now obsolete. Maybe there are good things in the pile!

    It would be more easier if there is some sort of "idea leaderboard" here on the site, which shows the ideas on top of the list at the moment, and links to aha.io for voting. This way, more traffic goes to the votes, and you can get more accurate data about what the users want (since more people are "actually" voting)

    I found that Aha.io offers a developer API, maybe you can use it to list the top 20 ideas on a new page here on Construct.net.

    Thank you.

  • You can find some here, here, and more on the Tutorials page.

    Good luck.

  • There'S a webworker example

    Thank you, that's what I was looking for.

    I solved the original issue using another method, but the worker example should come in handy.

    Thank you all for the help :)

  • All behaviors are framerate-independent, Sine including. Unless fps drop below 30, it should produce consistent results.

    It is below 30..

    Can you post your project file, demonstrating the problem? Maybe the framerate is not the issue.

    OK. I will do so soon.

    Thank you.

  • Hello!

    I need to plot a sine wave at high speeds.

    I used the value from a Sine behavior, but sometimes it is not consistent and the wave is messed up for a few frames then returns back to normal (probably affected by framerate).

    I tried to calculate the value every 0.1sec, which is more consistent, but the Sine behavior was smoother.

    Is there a way to make a function run in its own worker/thread.. and get the result to a variable, then draw it?

    (The Sin is just the base for other equations; so when the Sin is Slow or Not consistent, the other equations break).

  • Use int() function

    int(12.5659897) will return 12

  • I think the actions shown there would still work but the events below wouldn't be able to pick the sprite because of an availability thing. I'm guessing those 3 actions work and it breaks with the event conditions loopindex=0 and below?

    Yes.

    I thought they are all in the same sub-block so they should see the created object.

    But I found that to see the created object, the actions need to be in another sub-block under the Create action.

    I.e: Adjacent blocks won't see it. Only children blocks will see it.

  • Hello,

    I was following this great Rope tutorial by bartalluyn, and I made (almost)exactly the same steps, but my code didn't work.

    I found the error(!?), but still do not understand why.

    This works:

    This doesn't work (The rope/wire links are created, but not linked together, so they all fall down immediately):

    The only difference is that I moved the "Create" from the loop's block to a sub-block.

    Generally, the code works if the steps are in a Sub-block UNDER the Create block, not adjacent to it.

    I thought that since the steps are below the create, they will be executed after it. Or maybe the problem is related to how Picking works (i.e. the next steps cannot pick the recently created wire)?

    Why?

    Thanks!

  • Makes sense, Thank you.

    Another suggestion: is it possible to create a new type of folders; so the current normal Folders are for editor only, and the new "Runtime Folders" will exist in the exported game?

    I think this way, previous projects won't break. And for new projects, the developer can choose which folder he/she wants to add based on the use case.

    It is a useful feature for big projects, specially with scripts. I had to add a JS SDK (with lots of files) to a project once, and the sdk files got mixed up with my own export later.

    Another use case was that I used dictionary files to expose variables to the client (so he can change the data immediately without asking me to change, re-export, and re-send the whole project), and my design files were mixed with the rest of the export files, which made it a bit difficult for him to find a specific file (among other files I used).

    Thank you.

  • Folders are just for organisation in the editor. They're not used on export mainly because it's difficult to change now, as many projects exist that request names like "file.txt" and expect the fetch to work even if it's in a subfolder. If we change that, those projects will break.

    Could there be an option for that in Project Properties?

    A bit similar to legacy scripting; so people can choose to use folders in-editor only vs. editor+runtime.

    If it is not so much work, I think it will be a great addition.

    Thank you.

  • Hello,

    I noticed the foldera I create in the Project hierarchy are not used in the final export. I have different groups of files that need to be loaded at runtime, each group has the same number of files with the same names. So I put each group's files in one folder under Files.

    After export I noticed C3 puts all the files next to the index.html directly.

    Even calling the file using Load Image from URL ignored the folders I created. (e.g. had to write the URI as "name.png" instead of "group1/name.png".

    I recall the same happened with folders under Scripts.

    Folders are basically for organization while editing, not at runtime. If that's true, what's the reason please?

    Thank you.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Thanks a lot oosyrag and !

    For my case, I used a TBG and this code:

    Every tick :: Set TBG.ImageOffsetY = TiledBackground.ImageOffsetY + Speed * dt

  • Hello,

    I have tried different methods to make a background scroll and wrap around flawlessly.

    One way is using 2 instance and pinning/hierarchy them together. But when running the game, they look like one is dragging the other.

    I tried using Tiled Background and moving it around + resizing it at the same time, but it was a bit complex.

    The approach I used was using 2 instances with Bullet behavior with the same speed. It mostly worked, but there are noticeable tears where they meet. It is not noticeable when the bullet moves at high speed, but it is there.

    All approaches use the Wrap behavior. But the problem with it is that it needs the whole object to go outside of layout before it wraps around. Is there a way to make the object "partially" wrap? i.e. the parts outside of layout wrap around.

    I don't know if I need to change some options in the Layer/Project properties for this to work.

    Thank you.

  • Delphawi So if you set the inputbox font larger than 16px, the screen is not resized when mobile keyboard opens?

    Yes. I set up my CSS font-size to 18px, and Safari stopped auto-zooming.

    The SO answer said some browsers auto-zoom if they thought the font size is too small (below 16px in this case).

    You can test it on your browser, in case each browser defined a different limit on size.