Fengist's Forum Posts

  • Fengist Dude, that was so rude of me, It didn't come out right and I didn't get a chance to edit when I got banned. I'm sorry, I misread.

    Apology accepted. Don't ever make me throw Monty Python at you again.

  • Eric Matyas is a local hero who has a huge collection of sound effects and music you can play with. Just to confirm that it may be in the conversion, go to his website, pick a sound file and test it.

    His thread is here:

    construct.net/en/forum/game-development/tools-and-resources-27/building-library-images-120828/page-8

    soundimage.org

  • Making a farce like that seems to just show ignorance.

    Oh, and if making a farce shows ignorance then the guys at Scirra should truly appreciate the humor in it.

    media.giphy.com/media/7cAGURf0zN2Bq/giphy.gif

  • The X & Y are inverted due to how early computer monitors work, so that's normal. Making a farce like that seems to just show ignorance.

    I've been writing code in one language or another since 1979 and I have never seen the x,y inverted on anything. X has always been the columns and y has always been the rows. So if I'm ignorant, I've been blissfully so for 40 years.

  • I've also popped a few neurons trying to decipher the debug output from 3D arrays.

    Ashley maybe it would make things a little bit more readable if the z layers were bracketed?

    Fengist's x=0 would then look like:

    (370,-1,-1,-1),(222,-1,-1,-1),(913,-1,-1,-1)...

    ...which is a lot easier to parse.

    That would have at least made me stop and realize it wasn't an x,y,z representation. I was working with hundreds of cells and didn't stop to count them so it never occured to me that it would be anything but x,y,z. Thank god it wasn't a 200x200x200 array, I would have lost my mind trying to figure out which was which.

  • Real simple setup. 10x10x4 array. Clear the array to -1 The test, loop through the x and y for the array, set the x,y on z=0 to a random number.

    + System: On start of layout
    -> Array: Clear to -1
    ----+ System: For "X" from 0 to 9
    --------+ System: For "Y" from 0 to 9
    ---------> Array: Set value at (LoopIndex("X"), LoopIndex("Y"), 0) to round(random(1,1000))
    

    and this is what debug showed me

    I kept thinking, "What the hell? It's skipping over the cells like it has a 'step 4' in the loop" Took me several hours (working with a much larger array, turning function bits on and off mind you) to realized what a jumbled mess that watch output is. It's not the x,y of the 0 layer like I expected. It's the y,z of the x row. What the??? Look guys, I know you Brits do things differently like driving on the wrong side of the road. But seriously, when you go to a museum, do you stand in FRONT of the painting or do you hug the wall and look at the edge of the frame (don't answer that, the dry British humor of an answer will escape me)? Because we Yanks are very x,y,z spatially oriented. Hell, we're even alphabetically oriented that way. That y,z,x thing, man, that's like... driving on the wrong side of the road.

  • I've written software in other languages that needed internet connections and what I've discovered is that many functions like .isOnline are querying some driver or some device and often don't really know if the device is connected or not.

    One of the easiest ways in Construct and one pretty much guaranteed to pass or fail, is to do an Ajax call to a website you know is going to be up and one that accepts Ajax calls from anyone. Or, create your own php file on a webserver and do an Ajax call to it.

    Google has a bunch of resources that accept open Ajax calls. One is for jquery, both current and past versions:

    ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js

    + System: On start of layout
    -> AJAX: Request "https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js" (tag "check")
    
    + AJAX: On "check" completed
    -> Text: Set text to "Passed"
    
    + AJAX: On any error
    -> Text: Set text to "Failed"
    

    That simple test will pass.

    So, in theory, if you set the url to the current jquery version, it should, I say should, still work years later. Version 1.2.6 came out in 2007 but if you put this url in that check:

    "https://ajax.googleapis.com/ajax/libs/jquery/1.2.6/jquery.min.js"

    It still passes.

    The thing you have to keep in mind is that Google has a HUGE history of changing their mind about things so having it check your own url is, most of the time, a safer bet. You'll still have to worry about your host servers crashing, internet outages and such but at least the domain is yours and you can take it wherever you wish.

  • I'd need to see an example of what you're trying to do.

  • Arrays (and a lot of other things) are typically 0 based. If you were doing 1 to 10 and it was a 10 wide array, the 10 didn't exist so it couldn't go there. I'm so used to 0 based stuff, I just put things like 0 to array.width-1 as a habit.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Here's an example of one of mine.

    Notice the boolean check is directly under the for loop, not the while.

    This one runs a bunch of for loops. If I need to keep repeating those loops, I set the found variable to true inside that for loop. That way, it keeps looping and looping until it doesn't find things I need to change and then, with found = false, exits the while.

    Again, Ashley says I'm doing it wrong, but hey, it works and I understand it!

  • I believe your else is in the wrong spot. Put it under the value at check. If you look at the lines, it's connected to the tap gesture and the value at check does nothing if it's true or false.

  • I think this can be done a bit easier, with a single string variable.

    Yea, but mine is elegant.

    *cough*

  • SDB is the correct sequence

    twistedvoid.com/c3examples/KeySequencing

    Download here:

    twistedvoid.com/c3examples/KeySequencing.c3p

    There's a timer. Each correct key adds 1 to the timer. Every tick the timer is reduced by the delta time. If it reaches 0, the sequence booleans are reset.

    Here's the catch. You can do SDS. In which case, it looks at the second S as if you're restarting the sequence and resets the timer back to 1 second. Anything else is regarded as an invalid sequence.

    Now, for just this one sequence, this will work fine. BUT, if you have a bunch of sequences, you'll need to play with array's.

    And for those who just want to see the code:

    | Global boolean SequenceCorrect1‎ = false
    | Global number Countdown‎ = 0
    | Global boolean SequenceCorrect2‎ = false
    
    + Keyboard: On any key pressed
    ----+ System: Is SequenceCorrect2
    --------+ Keyboard: B is down
    ---------> Text: Set text to "Correct Sequence"
    
    --------+ System: Else
    ---------> System: Set SequenceCorrect1 to False
    ---------> System: Set SequenceCorrect2 to False
    ---------> Text: Set text to "Incorrect Sequence"
    ---------> System: Set Countdown to 0
    
    ----+ System: Is SequenceCorrect1
    ----+ System: [X] Is SequenceCorrect2
    --------+ Keyboard: D is down
    ---------> System: Add 1 to Countdown
    ---------> System: Set SequenceCorrect2 to True
    ---------> Text: Set text to "Sequence 2 Completed"
    
    --------+ System: Else
    ---------> System: Set SequenceCorrect1 to False
    ---------> Text: Set text to "Incorrect Sequence"
    ---------> System: Set Countdown to 0
    
    ----+ System: [X] Is SequenceCorrect1
    ----+ System: [X] Is SequenceCorrect2
    --------+ Keyboard: S is down
    ---------> System: Set SequenceCorrect1 to True
    ---------> System: Set Countdown to 1
    ---------> Text: Set text to "Sequence 1 Completed"
    
    --------+ System: Else
    ---------> System: Set SequenceCorrect1 to False
    ---------> Text: Set text to "Incorrect Sequence"
    ---------> System: Set Countdown to 0
    
    + System: Is SequenceCorrect1
    -> System: Subtract dt from Countdown
    ----+ System: Countdown ≤ 0
    -----> System: Set SequenceCorrect1 to False
    -----> System: Set SequenceCorrect2 to False
    -----> Text: Set text to "Incorrect Sequence"
    
    
  • Wait, you want a random row and a random column from an array and not have it = 0?

    Use a while statement.

    While found = false
     x=floor(random(1,10))
     y=floor(random(1,10))
     array.at(x,y)) <> 0
     else
     found = true
     stop loop
    

    then, x & y hold the answer you seek

    I know Ashley will correct my method here but I'm old school so this makes sense to me.

    I believe this is the proper method

    While 
     x=floor(random(1,10))
     y=floor(random(1,10))
     array.at(x,y)) <> 0
     else
     stop loop
    
  • Nevermind. I had it looking in the wrong folder for the music. Schedule next play defaults to the sound folder, not the music folder. Something I didn't anticipate. And, apparently music has to be playing for it to schedule a next play.

    Before I submit a bug report, it appears that schedule next play isn't working for music. The code sample below works perfect until I add the schedule next play. The basic logic is, if the music has ended, check an array of songs available and pick one at random, except for the song last played, delay it to give some silence and then play it.

    + Audio: On "Background" ended
    + System: [X] Is Muted
    ----+ System: While
    --------+ System: MusicRandom = MusicLastPlayed
    ---------> System: Set MusicRandom to round(random(0,MusicSongCount-1))
    --------+ System: Else
    ---------> Audio: Schedule next play for Audio.CurrentTime+(random(MusicMinDelay,MusicMaxDelay))
    ---------> Audio: Play MusicList.At(0,MusicRandom) not looping from Music at 0 dB (tag "Background")
    ---------> System: Set MusicLastPlayed to MusicRandom
    ---------> System: Stop loop
    

    I wanted to make sure I'm doing this correctly before complaining.

    There was a mention of this in a previous post back in Feb. but I'm guessing no bug report was filed.