sunbeamuio's Recent Forum Activity

  • Instead of passing in a result from the AdvancedRandom object to the loadAudio function call, pass in the index value stored in the index variable of the MeaningSprite or WordSprite objects. Without knowing the language, I can tell you that the sound being played seems to be correct. Especially when the word was handkerchief. I believe this will solve your sound problems.

    -> Functions: Call loadAudio (index: MeaningSprites.​Index)

    it's perfect!!! aaah please let me know if you have any projects you'd like me to credit when I release this! if you don't want to mention it here, please feel free to let me know the details at midnparishnz@gmail.com !

  • Your sounds aren't playing because your sound names include the .webm extension. When you use the play by name method, don't include the .webm in the name of the sound. For the game as it is, you don't need to remove all the .webm extensions from the list of sounds. You can just do this:

    -> Audio: Play replace(DataN5.At(5,index), ".webm", "") not looping from Sounds at 0 dB (tag "")

    The replace statement will strip the extension off for you.

    fantastic! this got the audio to work so thank you so much! (and I hope you had a Happy New Year too!)

    However it seems to play a completely irrelevant sound form what it should be corresponding to in the array. Also it repeats the same sound for subsequent words that are matched.

    I'm surmising that maybe it's because it's only preloading audio once?

    But I'm guessing even if I got it to call audio more than once I'll just get random sounds.

    If I could just get the correct audio to play. T_T I'm so glad to hear the audio working when it should be though, thank you!

  • Gonna need that file

    That previous link should show the updated version? If not, please try use this: drive.google.com/file/d/1YYUL2FmeQhySWrP0tRFFZ3lf6DTD7R-6/view

    (also, happy new year!)

  • Doesnt that function just run once at start of layout? You want it to play sounds as they get answers correct then it should go in the drop logic.

    ok, I've put it into the drop logic (when object is destroyed) and it's still not working.

    I changed it into a function in order to call the audio during the time it's destroyed but still no success.

  • I'm not seeing any logic that tries to play audio? Also better if you explain more about what's going on in the game.

    sorry i thought i saved the audio at least as an object but I didn't . ^^"

    I tried the play function and it was showing me a dropped down list of audio I added which wasn't what I wanted so I didn't want to add that logic in.

    I tried a new method though and saved it but unfortunately it doesn't seem to be working either ._.

    I want to do the following:

    1. Word matches with meaning, it will disappear (which it currently does)

    2. When it disappears, I want the audio of the word to be heard (which is at the 5th column of the array.

    I've also made the words to two pairs to hopefully make it easier for a pair to be matched and make it easier to find out if the audio plays when a pair is successfully matched.

    You need to add the audio plugin. After you add it, there is an action "Play (By Name)." Pass the array value into this event.

    Thank you for the suggestion.

    I think this is up my alley of what I'm looking for but unfortunately its still not working. I've tried to add it in as the following:

  • I've really wracked my brains on how to try and do this but unfortunately I couldn't find anything. :(

    I want to play a sound once an object is destroyed according to the object's corresponding sound in the array.

    Since I am using a large amount of data, I've had to use advanced shuffle to get the randomisation I'm looking for when the game starts. Thus I'm finding difficulty playing audio the way I want to by the normal Construct 3 conventions, from what I can see so far.

    If you're able to figure it out I'd be more than happy to credit you by mentioning your work or something as well, once this game is released (because this is an extremely huge feature in the game and I would feel super bad if I wasn't able to show my gratitude in one way or another)

    Here is the link to the file of the game: drive.google.com/file/d/1v2L1e-elHwXcZ7vTxdFy56FUQ66gjfjY/view

    You can find the code under '15WordsN5 level' and it's linked to Game Layout.

    If anyone is able to figure this out. You will be my literal hero lol.

  • I'm not sure I understood exactly what you were trying to do, but here's my take.

    https://drive.google.com/file/d/1Om-Qr8qDfzjRqzDde0NpOvgG-iIgliSp/view?usp=sharing

    I load the array from the JSON, and pick 4 pairs of x-index 0 and 2 from the 653 possibilities. I load x-index 0 as "word" and x-index 2 as "meaning". Those get shuffled randomly, left side for "word", right side for "meaning". You have to match each "word" with its "meaning" to get points.

    Note that you can't create multiple permutation tables at once, so I had to store some in arrays (namely, slots for "word" and slots for "meaning").

    THIS IS EXACTLY WHAT I'M LOOKING FOR THANK YOU SOOO MUCH T____T

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • It seems you are using height for your expanding axis, so in that case, you should be using the permutation table value on the Y axis.

    Also, shuffling the permutation table as soon as it is created is pointless, as it is already randomized on creation.

    Keep in mind that using AdvancedRandom.Permutation(0) will always give you the first index. You should probably be using a variable (instead of 0) to keep track of which permutation you are currently using.

    If you share your c3p with a broad description of what you are trying to do, I might be able to help you further.

    I see. I kind of had a feeling that I would need to use a variable but since I'm new to coding in general and I really can't find anything on what I'm trying to do, trying to figure it out has been really difficult. ^^"

    Overall I want the game to match the words with each other as the basis of the game, but pick the words by random from an array (or dictionary).

    So for one game they may need to pull 15 random pairs from a list of 650 or 2000 word pairs or so. This is mainly the function of the game that I'm finding the most difficult to recreate.

    The project can be found here: drive.google.com/file/d/10nT5tc1O22xBHK45LJALKs8SmxtCC1CZ/view

    If you're able to figure this out I would honestly be soooo thankful to you because this is *always* the part I get stuck on coding for this project. T_T

  • AdvancedRandom.Permutation(0) gives you your first random index. So let's say you need to get values from an array, you'd use something like Array.At(AdvancedRandom.Permutation(0), 0).

    Thank you for the suggestion! But unfortunately it doesn't seem to be working. ><

    When I try to use this the value seems to come out as 0. :(

    This is what the layout currently looks like if it helps:

  • When you want to pick more than 1 element in a list of n elements with no repetition, you should think of a permutations table. The "Advanced Random" plugin makes it very easy to implement such a thing.

    If you have 6 matching pairs, you create a permutation table of length 6 starting at 0. It will create an array of values from 0 to 5 in a random order (basically, your indexes). You can then use AdvancedRandom.Permutation(0) to get the first random number, AdvancedRandom.Permutation(1) for the second, etc. assuring no repeating number.

    You can then use these values to index either your dictionary or array, depending on what you ended using.

    Thank you for suggesting the Advanced Random plugin, I think it makes the overall randomisation of the height easier to do without mismatching the data.

    However, because I'm painfully new to this, I'm having difficulty wondering where to put the AdvancedRandom.Permutation(0).

    Like, should I add it as a function? I changed it to an array since I wanted to try the overall amount of data I have with it. I think I've already linked the Permutation with associated array.

    > >

    > thank you for the reply!

    >

    > I remember trying to do this method but I couldn't get the code on how to generate the matching row for the other value, if that makes sense.

    >

    > In other words, I could pick a random value from the meaning part but I didn't know how to get the matching word part, if that makes sense.

    If all of the questions are at X,1 and all of the answers are at X,2, then all you need is X. So if x is 6 then the question is at 6,1 of the array and the answer is at 6,2. So the question is randomnum,1 and the matching answer is randomnum,2 every time.

    Thank you for this! I think this gave me a fair idea of how I should be approaching it overall. :)

  • I would move it to an array with 2 columns for question and matching answer, easy to write out in a file and import to array as you did with the dictionary. Then you can pick question and answer from the same row and each time pick a random row.

    thank you for the reply!

    I remember trying to do this method but I couldn't get the code on how to generate the matching row for the other value, if that makes sense.

    In other words, I could pick a random value from the meaning part but I didn't know how to get the matching word part, if that makes sense.

  • Hope everyone's having a good evening!

    I'm currently trying to:

    1. match words together from a large list of words in a sort of drag, drop and match sort of manner (but at the current moment I'm only using 6 matching pairs in a Dictionary and two pairs on the gameboard)

    2. Using an array and random command to extract this information and pin it to an object

    However instead of coming up with different words it's duplicating the first pair of words and I'm unfortunately not sure on how to change it so that every 'textMeaning' object is a different word, while also retrieving the matching 'textWord'.

    If I have to change it from a Dictionary to Array I don't mind.

    To take a look at the project so far you can find it here: drive.google.com/file/d/10nT5tc1O22xBHK45LJALKs8SmxtCC1CZ/view

    I'm sorry if this didn't make sense. ><

sunbeamuio's avatar

sunbeamuio

Member since 16 Oct, 2020

None one is following sunbeamuio yet!

Trophy Case

  • 4-Year Club
  • Email Verified

Progress

5/44
How to earn trophies