chunchun's Recent Forum Activity

  • Hi, Ashley

    How to use save and load correctly

    I used save In an old game.

    Then my game updated some of the props, plants in the scene.

    When I loaded in the new game, the newer props and plants disappeared.

    The game is constantly updated, adding some clouds, some decorations and so on

    But when you load the old games, those updates are gone.

    How am I going to fix this?

  • Hi, Ashley

    C3 is the Entity component system?

    I found the description of ECS to be very similar to how C 3 works

  • Just tested this:

    > function repeatEveryMillisecond(f, ms) { return new Promise(res => setInterval(f, ms)); }
    
    repeatEveryMillisecond(() => {
    const now = new Date(Date.now());
    console.log(`${now.getHours()}:${now.getMinutes()}:${now.getSeconds()}`);
    }, 5000);
    

    Thank you!!!

    It works in the browser.

    But execute this function in C3 tick(). He’s not functioning properly.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • > You can use

    >

    >

    > > function waitForMillisecond(ms) { return new Promise(res => setTimeout(res, ms)); }
    > 
    > console.time()
    > console.log("Wait 1000 milliseconds");
    > await waitForMillisecond(1000);
    > console.log("Waited");
    > console.timeEnd();
    > 

    >

    >

    >

    > > function repeatEveryMillisecond(f, ms) { return new Promise(res => setInterval(f, ms)); }
    > 
    > repeatEveryMillisecond(() => {console.log(Math.random())}, 1000);
    > 
    > 

    waitForMillisecond It’s working really well

    But repeatEveryMillisecond() It didn’t work out. Still waiting for * s, then every tick run

  • You can use

    > function waitForMillisecond(ms) { return new Promise(res => setTimeout(res, ms)); }
    
    console.time()
    console.log("Wait 1000 milliseconds");
    await waitForMillisecond(1000);
    console.log("Waited");
    console.timeEnd();
    

    > function repeatEveryMillisecond(f, ms) { return new Promise(res => setInterval(f, ms)); }
    
    repeatEveryMillisecond(() => {console.log(Math.random())}, 1000);
    
    

    thank you for your answer!!!

  • What I’m trying to say is that it’s not really code, it’s just a literal representation of the event table. You Don’t need it to have JS capabilities. It’s a literal representation of the event table, not the code!

    You might say there is JS. Don’t worry about the code form of the event table.

    But today it’s aimed at people who can do it on their own.

    The textual form of the event table, on the other hand, provides direct access to all the things that the event table can do.

    For example: all properties and methods of all behavior. JS can only access a small amount of behavior that exists in the API documentation

    All properties of all objects

    All of Syetem’s behavior and expressions

    All properties and expressions of the special effect

    All properties and expressions of particles

    (What I’m trying to say is, anything you can do in the event table, you can do here, because it’s just the text of the event table)

  • You can see how the event table is represented in JSON,

    is it possible that there are specific scripting rules that developers can choose from.

    Those who like the event table can continue to use the event table. Those who use code form can use code form themselves.

    The setting of special grammatical rules.

    For example, convert the above event table to:

    	if Keyboard.on-key-pressed(116):
    		System.go-to-layout("room1")
    
  • without posting screeshots if your events or sharing a copy of your project its impossible to determine why it happens

    I'm pretty sure it's this piece of code. He deletes it, and the memory is fine. The code means to findpayh every 0.3 seconds.

  • Ashley

  • I had a performance problem, memory grew wildly and eventually crashed. I looked at the code and found out it was Pathfinding What should I do?

    I have 23 objects and use PathFinding constantly. It is the cause of memory growth. How do I optimize it?

    The game has a whopping 12 gigabytes of RAM within 5 minutes of running and it's growing.

  • Don't add an object to the turret as a target. You need to acquire a target for each turret instance individually. But it will be really difficult to do without families.

    You should probably use another invisible sprite, pin it to each turret and acquire it as a target.

    Try something like this:

    For each Turret
    pick TargetSprite that is not pinned to this Turret, and nearest to this Turret
    Turret acquire TargetSprite as a target
    

    thank you,

    Success! Thank you again for your guidance.

  • I use Turret behavior, I want to aim at other Turret, but I can only aim at myself in the end.

    All the turrets are the same object. There are 10 of them in the scene, and I want them to aim at each other. In the case of not using family, how to make the Turret not aim at itself.

chunchun's avatar

chunchun

Member since 20 Jun, 2019

Twitter
chunchun has 1 followers

Trophy Case

  • 5-Year Club
  • Forum Contributor Made 100 posts in the forums
  • Regular Visitor Visited Construct.net 7 days in a row
  • RTFM Read the fabulous manual
  • Email Verified

Progress

9/44
How to earn trophies