bociakrodyl's Forum Posts

  • Thanks! But this arrangement does not work properly.

    It reads all phrases, but does not take any breaks.

    Does your Construct do pauses in this order of action?

  • I had r148 stable, now I ran r154 beta.

    Unfortunately, no matter where I place this new action, the effect is unchanged.

    drive.google.com/open

  • Thanks!

    But where will I find such an action?

    For me, there is no such thing in Construct.

    please see:

  • Thanks! I have removed the characters "" and now it is working with the appropriate intervals.

    This is great! But something with this speech synthesis is very strange.

    It speaks only the first sentence by X times.

    If I move the wait action below the speech synthesis, then it reads all the sentences, but does not keep the "wait" pauses.

    It looks like there will be either good breaks or good text :-D

    drive.google.com/open

  • I agree that LoopIndex is a good idea. Thanks!

    But for me it's strange, because I have had the counter.

    So I change the one counter to another form of counting,

    but the counter remains a counter :-)

    Earlier, during getting to know Construct, I found information on how to use "wait" in the loop.

    construct.net/en/tutorials/using-wait-in-loops-454

    So I put together the actions and the effect is:

    - The system says 3 times only the first sentence, it looks like LoopIndex did not work

    - "wait" is not run

    A very strange thing, because the logic looks OK. Maybe Construct needs something else?

    attach the file

    drive.google.com/open

  • Thanks! It's almost perfect :)

    1. I take the ID of the object with which the player has a collision.

    2. I have counted the number of elements kept in the instant variable called short_desc.

    3. I start reading the first text and here's the problem.

    The system reads the text from the first quotes without interruption as many times as there are counted items.

    So the system is not waiting.

    Besides, it does not take any more texts.

    What am I doing wrong here? I am asking for a hint.

    drive.google.com/open

  • You're trying to pass an array object through a function?

    Yes Plinkie, I'm trying!

    but Yoda said there is no try ;-)))

    and more seriously writing I would like to know how to do it. I will probably use this in several places of my code.

    However, the second and most important thing is to call a function with a parameter.

    In this parameter I will pass the selected Instant Variables of the selected object.

    For example, this ugly piece is trying to get this parameter works:

    room.UID(11).short_desc

    where short_desc is instant variable of object room with UID 11.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Thanks thanks thanks!

    This is a very big thank you, because I am very grateful for any help.

    I have learned a lot already, but I still meet the high walls, which I hope someone will show me how to beat.

    I could not test it, I was stuck on picking up the array as a parameter.

    First, I will describe the case with the array, but it seems to me that a better solution will be if I store data in instant variables.

    1. Array as parameter

    I want to call the speakArrWithDucking function and give my array as a parameter.

    At this point, Construct displays:

    '11_full_desc' needs an expression after it.

    This is an object name so you need a dot and an expression name after it.

    I looked through the possibilities following the dot, but I found nothing suitable.

    You wrote:

    The term array is a bit misleading since you are using a function string parameter.

    But I would like something other than a string as parameter, more specifically, I would like an object :-)

    But the object can not be selected while creating a function parameter.

    I chose the String because there is also Number and Boolean to choose from the list. So it seemed reasonable for me.

    2. Instant Variables

    I thought that a simpler solution would be to pass a string of texts and numbers in the Instance Variables.

    The reason for such thinking is the fact the array is more work when it comes to filling them on start the game.

    So I created an instance variable called short_desc.

    There, I put the test data.

    But after many combinations, I did not find out how to refer to this by calling the function.

    There is very little information about the Instance Variables in the documentation:

    construct.net/en/make-games/manuals/construct-3/project-primitives/objects/instance-variables

    I tried, among others, like this:

    object.its-UID.instant-variable

    room.UID=11(short_desc)

    room.UID(11).short_desc

    but nothing works, can I ask for a suggestion?

    Maybe there is some documentation about these types of queries?

  • I made the function: speakArrWithDucking.

    The function has one parameter: arrToSpeak.

    In this parameter I want to pass the array.

    My array will be built with text and number pairs one after another:

    "text 1", value in seconds, "text 2", another value in seconds, etc.

    In the function I will use a speech synthesis for the text, then wait for the number of seconds and so until the end of the array.

    To determine the array size I want to use:

    parametr.Width

    because I found a description in the documentation Width: Return the size of each of the array's dimensions.

    But the system does not accept such a command. I have a message: Not an object.

    Is there any way that I can specify the length of the array in the parameter?

  • I guess I had to be blind to not notice it!

    But the fact is that I'm learning this software.

    Thanks so much for the hint!

    I just created my function and muting of music during speech works just beautiful :-)

  • Oh, that's probably small thing that bothers only us ;-D

  • Should I report it somewhere?

    Is there any website reporting bugs?

  • Plinkie!

    That's exactly what it was about:

    The fix is replace : 'array.at(param)' in the first box with 'param'.

    I was depressed because I saw only two solutions:

    - I'm stupid

    - or Construct 3 was stupidly written

    Fortunately, you pulled me out of it!

    I was just overthinking :-D :-D :-D

    Thanks a lot!

    Sizcoz - thanks for your suggest, but the solution was mega simple, as Plinkie wrote before.

  • Thank you so much for your patience! :-)

    I have read the entire thread 3 times

    and I broke down :-|

    I thought if I wrote in Construct:

    Value at arr_potential_directions.At(arrayPosition) = 1

    I will get something similar to the function in JS:

    var arrPotentialDirections = [1, 0, 1, 1];
    
    function speakOneDirection(arrayPosition) {
    	if (arrPotentialDirections[arrayPosition] === 1) {
    		console.log("speak");
    	} else {
    		console.log("sorry, I can't speak about it...");
    	}
    }
    
    speakOneDirection(0);
    

    Does it not work that way?

    How can I get something like this?

  • Thanks for the answer! But I still do not understand.

    I'm sorry for tormenting with strange questions, but if I do not understand it, I will not be able to use array queries.

    I call the function by passing 0 in the parameter.

    This means that this condition:

    Value at arr_potential_directions.At(arrayPosition) = 1

    after inserting the value it will look like this:

    Value at arr_potential_directions.At(0) = 1

    and it does not work,

    it does not matter if I type arrayPosition or 0 in brackets.

    But if I save the condition in this way:

    Value at arr_potential_directions.At(1) = 1

    the speech synthesis will be launched.

    But my array looks like this:

    position / value:

    0 - 1

    1 - 0

    2 - 1

    3 - 1

    The code:

    Value at arr_potential_directions.At(0) = 1

    I understand:

    if the array "arr_potential_directions" at position 0 is the value 1 then run ...

    Am I thinking incorrectly?