LoobyLoo's Forum Posts

  • I'm trying to include the value of a global variable in a JSON array or BBCode. Could anyone please help?

    For E.g.

    (Obviously,

    [@UserName_GV]

    doesn't work; I'm uncertain about the format through which it detects the global variable.)

    Tagged:

  • You do not have permission to view this post

  • So your solution involves an additional Text object (referred to as 'HideText') to store the array text initially. This 'HideText' is then set as the source for the visible text object. When the append button is clicked, the hidden text appends. Subsequently, if the comparison condition is met, the remaining text is extracted from the hidden text object 👏

    I appreciate your solution—it works well, though the solution is a bit lengthy. However, considering there isn't a direct way in C3 to achieve this, it's quite understandable.

    Thank you for your time and help!

  • I believe there might be a misunderstanding regarding my question. Allow me to elaborate in detail.

    I'm trying to create a typewriter effect in Construct 3 by appending text from an array to a Text object that already contains text. While I can use the 'Append text' action and it works perfectly, the issue is that if I simply append the text, the typewriter effect is lost.

  • Thanks for your response, it did confuse me a bit, I'm still figuring out why it is not working. :(

    Here the c3p.

  • 🙄, I use JSON Array, because it is convenient.

  • I'm trying to create a typewriter effect by appending text from an array to a Text object. But it doesn't work, what I'm doing wrong here? :(

    I found the logic here from an old post, based on that I tried with array but it doesn't work.

    Here the c3p.

    Tagged:

  • Hi 🦁!

    I can make it work with Global Variable,

    on every tick → set TestGV → Value MyArray.At(5,2)

    var valueOfTestGV = runtime.globalVars.TestGV;
    runtime.callFunction(valueOfTestGV);
    

    but it doest work with local variable, like this

    var valueOfTestLV = runtime.localVars.TestLV;
    runtime.callFunction(valueOfTestLV);
    

    (I'm not sure if "runtime.localVars." is valid code.)

    I didn't think passing a function name as an expression from an array could be this complicated.

    If anyone knows, please help.

  • var functionName = String(MyArray.At(5, 2));
    runtime.callFunction(functionName);
    

    It's not working; please help.

    I really like using arrays to control different parts of the code because they're so handy. :)

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I have created many functions in the event sheet, and I want to call them dynamically by fetching their names from an array. I have a JSON array that is converted to a local array using AJAX, and the array contains the names of the functions that I want to call. For example, one of the functions is called “MyRoseFunction”.

    To call the function by name, I have added a JavaScript script in the action area of the event sheet, and I have used the runtime.callFunction method. When I pass the function name as a string, like this:

    runtime.callFunction("MyRoseFunction");

    It works fine and the function is executed. However, when I try to pass the function name as an expression using the At method of the array object, like this:

    runtime.callFunction(MyArray.At(5,2));

    It doesn’t work. Please help.

  • Thank you so much. 😍

  • Yes, I fetched this ans from a Community post where the founder of construct says,

    You can use the web export and publish it to the Microsoft Store using PWABuilder. That's what we did for Construct 3 itself.

  • I have multiple instances of a sprite called 'BUTTONS,' each with a unique instance variable (String).

    Upon starting the layout, I'd like to create/spawn a new sprite over each 'BUTTONS' instance, using a specific animation from the 'MyLOGOSet' sprite, based on the instance variable value.

    For eg, if a 'BUTTONS' instance variable is set to LOGO1, I want to create a 'MyLOGOSet' sprite over it and set the animation set named LOGO1 of the 'MyLOGOSet' sprite.

    I hope this makes sense. Please guide me on how to achieve this. I believe it might be achievable with a For Each loop, but I'm not sure as I'm still learning loops.

  • Thank you. I have a question: Is there an alternative expression similar to "between" that allows me to specify certain values like 1, 2, 4, 20, 31...

    I tried using the bellow based on a suggestion in a post,

    but it didn't work. Then I referred to the manual and discovered this, I followed the same steps,

    but it still doesn't work. What am I missing?

  • You could reduce the number of events here; fewer lines of code would be more efficient to work with (maybe not the efficiency you're after though!)

    Touch: On tap gesture on TagText

    ---> TagText: TAGOrder_Text is between 1 and 3

    ------> System: Pick all TagText ... TagText Set font colour to rgbEx(0,0,0)

    ------> ... TagText Set font colour to rgbEx(0,0,0)

    Initially, I thought it would be quite challenging, assuming we would need to use a loop. However, the solution you provided is much easier and efficient. Thank you. It works.

    Just one doubt, generally what should I put for the value? I understand that in my specific case, since I have 3 TagText items, I should put Lower: 1 and Upper: 3. However, when it comes to the the value, I put 1 and it works fine.