XHXIAIEIN's Forum Posts

  • Yes, C3 is supported, and it works great! I often manage my objects this way, and it helps me to sort the same type of objects to show them together in debug layout. because the debug layout does not support object grouping.

    For example:

    I have some form controls, input boxes, buttons, sliders, etc. that I use as Debugger. I will prefix the names with 🎚️ or 🎛️ and they will appear at the top of the list for my debugging. That way I won't see them because they take up too long a list.

  • I made a few examples before:

    - JSON Branch Dialogue System

    cdn.discordapp.com/attachments/225550155531812865/1092398948607598672/JSON_BranchDialogueSystem.c3p

    - CSV to JSON

    cdn.discordapp.com/attachments/225550155531812865/1091824119928078457/CSVtoJSON.c3p

    ---------------------

    And these tutorials from many years ago:

    - Branch Dialogue System Tutorial by Laura

    construct.net/en/courses/displaying-dialogue-games-36

    - JSON dialogue Example by Kyatric

    cdn.discordapp.com/attachments/225550155531812865/1082234761596108800/JSON_dialog_system.c3p

  • Monster.X = Player.X + radius * cos(angle)
    Monster.Y = Player.Y + radius * sin(angle)
    
  • I made an example of this before, Convert CSV to JSON via JavaScript. You can export as a CSV file in Excel. Then convert to JSON in C3.

    CSV to JSON

    cdn.discordapp.com/attachments/225550155531812865/1091824119928078457/CSVtoJSON.c3p

    Another example JSON Branch Dialogue System

    cdn.discordapp.com/attachments/225550155531812865/1092398948607598672/JSON_BranchDialogueSystem.c3p

    ---

    and save them with their header as Key. if they have the same ID, they are stored as an array.

    ID,Name,Text
    Screen1_Intro,Alice,Hi!
    Screen1_Intro,Bob,"Hi, Alice! How are you today?"
    Screen1_Intro_A1,Alice,That's great! What are you up to today?
    Screen1_Intro_A2,Alice,"I'm okay, What about you?"
    

    Convert to JSON:

    {
     "Screen1_Intro": [
     {
     "Name": "Alice",
     "Text": "Hi!"
     },
     {
     "Name": "Bob",
     "Text": "Hi, Alice! How are you today?"
     }
     ],
     "Screen1_Intro_A1": [
     {
     "Name": "Alice",
     "Text": "That's great! What are you up to today?"
     }
     ],
     "Screen1_Intro_A2": [
     {
     "Name": "Alice",
     "Text": "I'm okay, What about you?"
     }
     ]
    }
    

    Here is the code to convert csv to JSON.

    Create a new js file in the Scripts folder and paste it in. Note that this Script properties need to set the Purpose to 'Imports for events'.

    function csvToJson(csv) {
     const lines = csv.split("\n");
     const headers = lines[0].split(",");
     const result = {};
    
     for (let i = 1; i < lines.length; i++) {
     const currentLine = lines[i].split(/,(?=(?:(?:[^"]*"){2})*[^"]*$)/);
     const obj = {};
     for (let j = 0; j < headers.length; j++) {
     const header = headers[j];
     const value = currentLine[j] ? currentLine[j].replace(/^"|"$/g, '') : '';
     if (header !== headers[0] && value) {
     obj[header] = value;
     }
     }
     if (Object.keys(obj).length) {
     const screen = currentLine[0].replace(/^"|"$/g, '');
     if (!result[screen]) {
     result[screen] = [];
     }
     result[screen].push(obj);
     }
     }
    
     return JSON.stringify(result);
    }

    It's also very easy to use in C3.

  • For example, you have a dictionary of object type named call 'PlayerData'. Then you added the 'Level' key to the dictionary.

    const playerData = runtime.objects.PlayerData.getFirstInstance().getDataMap();
    const playLevel = playerData.get('Level');
    console.log(playLevel);
    

    Set Value

    const playerData = runtime.objects.PlayerData.getFirstInstance().getDataMap();
    playerData.set('Level', 20);
    console.log(playerData.get('Level'));
    
  • here are many ways to implement:

    HTML element

    If you are using the HTML element, You can create a 'Text Input' object and set its Type to 'Textarea', which is the easiest way.And If you want to change its CSS style, you can create a new 'Stylesheet' file in the File Folder.Such as hiding scroll bars, Disable borders, changing text size, font, etc.

    Blend mode

    You can use the 'Destination out' effect in Blend mode to use a 'Mask' object to block the screen and only display part of the text.

    text Mask Scroll Clamped - Example by Federico Calchera

    cdn.discordapp.com/attachments/253490735268102144/1068598442294784040/textMaskScrollClamped.c3p

    Also, you can use only 1 Mask object to create the effect of a mask, as sub-layers.

    cdn.discordapp.com/attachments/225550155531812865/1115557475614216222/MaskTextScrolling.c3p

    String Expressions in text

    Use 'tokenat', 'tokencount', 'min', 'max', 'mid' system expressions to split the string to implement the text scrolling.And You can find the documentation for these expressions here:Manual - System expressions - Text

    Scroll Text - Example by Stan Merezhko

    dropbox.com/s/61tfvg3y1b8faby/ScrollText.c3p

    Text Scroll Mask - Example by Zackarotto

    cdn.discordapp.com/attachments/225550155531812865/923122064955674704/TextScroll-Mask.c3p

  • R344 Platform inconsistently when side close to the wall still moving. Since this is not a bug, it was not committed to github, just wanted to discuss it here.

    Take the built-in platform game example as an case: In the R366 version, the Platform will not be considered as 'is moving' when it side close to the wall, When he moves to the edge of the wall, he will stop and no particle animation will appear. But on R344 it behaves inconsistently.it will still be moving.

    R336: When walking on a wall, it stops.(Animation: Idle, particles: stop)

    R344: When walking on the wall, it will continue to be moving.(Animation: Walk, particles: playing)

    This is a screen recording of the same example in different versions, you can observe the difference between R336 and R344.

    Open Example .c3p R336 R344
    #open=world-to-hud-position Example1-R336 Example1-R344
    #open=shockwave-spell Example2-R336 Example2-R344

    details: Windows 10 / Chrome 113.0.5672.129 / Approx 8 GB / NVIDIA GeForce RTX 3050 / Direct3D11 / WebGL 2.0 / Monitor 60 Hz

    ----

    Is this a BUG? Not exactly. It's just a tricky way to rely on "abnormal" platform performance. Because on other monitors, the above situation is different. Here is an observation of the same case at 144Hz:

    Example2-R336

    R344: When walking on the wall, it's twitching

    R336: When walking on a wall, keep animation playing.

    Apparently R344 is look better.

    In order to adapt to this change, I had to change the method of control player animation, so that walking on the wall can stop and no longer create dust particles. For example, in the case of CAE BRIDGE(#open=cave-bridge) , VectorX is used to judge based on the speed of movement.

    If possible, I wish Platform could have more control over the behavior near the wall. For example when close to a wall:

    - keep moving

    - slow down until stop

    - stop immediately

  • In "Tween On Finished" event you can pick all sprites and check if any of them are still running tweens.

    I tried this method but it does not seem to work. I also tried using On "Tag & loopindex" Finished to judge the last played Tween, but that doesn't seem to work either.

    It is always displayed before the last one has finished playing.

  • I want to make an opening animation of the sprites entering in order and start the game when they are all done. But How do I wait for all Tween play finished in the 'For each' loop?

    This file is to want to wait until all Tween completed, and then display the button.

    cdn.discordapp.com/attachments/253490735268102144/1113389910553022484/tween-wait-complete.c3p

    I know I can hardcode it to wait 2 seconds and display it, but I'm wondering if there is a way to use 'wait for previous actions to complete'.

    One more question, how should I make sure that the AJAX requests for files, maybe three or five files, wait for them all to finish loading before starting the header animation?

  • template challenge room

    editor.construct.net

  • Maybe I need a 'Sine In' or 'Sine Out' wave

    Current:

    Expected:

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Cheatsheet:

    Level 1

    {
     "name": "Cheems",
     "age": 18,
     "score": 100
    }
    

    return "Cheems"

    JSON.Get("name")
    

    -----

    Level 2

    {
     "team": 
     {
     "name": "Cheems",
     "age": 18,
     "score": 100
     }
    }
    

    return "Cheems"

    JSON.Get("team.name")
    

    -----

    Level 3: Array

    {
     "array": [123, 456]
    }
    

    return 123

    JSON.Get("array.0")
    

    -----

    Level 4: Array

    {
     "team": 
     [
     { "name": "Cheems", "age": 18, "score": 100 },
     { "name": "Marmot", "age": 17, "score": 95 }
     ]
    }
    

    return "Cheems"

    JSON.Get("team.0.name")
    

    -----

    Level 5:

    Note that it does not start with {}, but [] as a JSON array

    [
     {
     "name": "Cheems",
     "age": 18,
     "score": 100
     },
     {
     "name": "Marmot",
     "age": 17,
     "score": 95
     }
    ]

    return "Cheems"

    JSON.Get("0.name")
    

    -----

    Level 6:

    {
     "team": [
     {
     "name": "Cheems",
     "age": 18,
     "score": 100,
     "fruit": ["Apple", "Banana", "Cherry", "Durian"]
     },
     {
     "name": "Marmot",
     "age": 17,
     "score": 95,
     "fruit": ["Apple","Berry"]
     }
     ]
    }
    

    return "Banana"

    JSON.Get("team.0.fruit.1")
    
  • Currently C3 typewriter unable to do this. You can vote for this feature here.

    construct23.ideas.aha.io/ideas/C23-I-24

    This is a way to use len() and mid() to make a typewriter.

    cdn.discordapp.com/attachments/225550155531812865/1100092755297980527/typewriter_pause.c3p

  • Maybe something like this?

    editor.construct.net