mekonbekon's Recent Forum Activity

  • So Let say some questions of 4 answer choices, and some have 5 and some have 6. Should they be in seperate arrays?

    You can still use just one array. You would set the array width to the maximum number of answers. For those questions with less than the maximum number of answers leave the answer cells in the array blank. You can then do a check to see if the answer is blank (text = "") and if so set the corresponding spr_tickCross invisible.

    I've updated the demo to include this feature:

    dropbox.com/s/qc9dourwsf4f7g6/quizTemplate2.c3p

  • 1. Is 'totalquestions' a function? (event 1)

    No, it's a global variable that takes it value from the height of the a_questions array (i.e. the number of questions)

    2.What is BBoxRight (event 1)

    BBoxRight is the X coordinate of the right-hand edge of the spr_tickCross box.

    3.What is "i" (event 3)

    "i" is just a tag for the loopindex - in this instance it's not really needed, but when you use nested loops you give them different tags to be able to reference specific loop indices.

    4.What does permutation mean for advanced random?

    A permutation is an arrangement of values; the AdvancedRandom plugin can generate a random permutation of values without repetition - in this instance we randomise the order of questions and stick the values into a_questionOrder.

    5.What does 'Self.selected=0?rgbEx(0, 0, 0):rgbEx(0, 0, 255)' mean? (event 16)

    This expression uses the conditional operator to set the colour of the text. The conditional operator works as follows: Is this statement true ? If so do this : otherwise do this

    I'm sorry for all the questions :( But thnaks for all your help :)

    No problem :-)

  • Sorry, my bad - you also need to change the references to a_questionOrder:

    In event 4 change:

    -> txt_question: Set text to a_questions.At(0,a_questionOrder.At(currentQuestion),0)

    to

    -> txt_question: Set text to a_questions.At(0,currentQuestion,0)

    In event 5 change:

    -> txt_answer: Set text to a_questions.At(AdvancedRandom.Permutation(LoopIndex("j")),a_questionOrder.At(currentQuestion),0)

    to

    -> txt_answer: Set text to a_questions.At(AdvancedRandom.Permutation(LoopIndex("j")),currentQuestion,0)

    // Set the "correct" instance value on the answer.

    and

    -> txt_answer: Set correct to a_questions.At(AdvancedRandom.Permutation(LoopIndex("j")),a_questionOrder.At(currentQuestion),1)

    to

    -> txt_answer: Set correct to a_questions.At(AdvancedRandom.Permutation(LoopIndex("j")),currentQuestion,1)

    I've updated the demo to reflect these changes - the original actions are still there but disabled, in case you want to switch back. I also fixed a couple of other bugs, so it's worth grabbing again:

    dropbox.com/s/qc9dourwsf4f7g6/quizTemplate2.c3p

  • construct3.ideas.aha.io/ideas/C3-I-165

    Just sayin

    newt Added a vote - it's fun trying to figure it out in events though :)

  • jobel Thanks for the feedback :)

    one thing that is weird, when there's a potential head-on-collision the boid doesn't react, it just collides and moves through. Did you do this purposefully?

    Don't worry, nobody gets hurt, they're flying over and under one another ;P

    Seriously though, there's nothing in the conditions that factors in the angle of the neighbouring boid, only the angle to it, so it shouldn't really make a difference to its behaviour. If you turn up the strength to 1 it looks like they do react a little to boids coming directly at them, just not enough to guarantee missing each other.

    It could be that in the 10th of a second that they do the check there's another boid that's closer so they react to that one instead. Another reason could be that the maximum turn rate is too slow for avoiding head-on collisions so although they're reacting, by the time they start turning they've already collided.

    Ideally I'd work out a group angle with weighting for proximity but it hurts my head trying to figure it out - maybe for the next version.

  • I managed to find a fix:

    dropbox.com/s/3t7ngda18tx6i29/flock_02.c3p

    I think the issue was that the birb's picking for nearest neigbour was picking itself, so it was always trying to turn to avoid itself. Either way, I jiggled around the picking conditions to make sure the active birb was excluded and it seems to help.

    Other changes:

    - I swapped to using the range object for avoidance (like I do for the other flocking routines) to pare down the selected birbs, which made things a bit easier.

    - The birbs decelerate if they find a target in front of them, spacing them out

    - I now use a single range object for all birbs and shuttle it around for each check, rather than each birb having its own pinned range object.

    The sim works pretty well for about 100 or so birbs with all flocking routines running, but starts to slow down beyond that (still above 30fps but the lag is noticeable) - I'd be super appreciative of any optimisation suggestions.

  • Sorry, should have mentioned the other (most obvious) way to create the array json - right click on the Files folder, and select New>Array; you can then use the built-in array editor.

  • I create a json file by saving a txt file as a json then importing it into the files folder in the project bar by right-clicking on the folder icon and selecting import files.

    You might also be able to do it by right-clicking on the folder and selecting New>JSON - I haven't tried that method though.

  • You're welcome :-)

    If you don't want to shuffle the questions, disable the call to the shuffleQuestion function in the On Start event.

    If you don't want to shuffle the answers, in event 5 you can swap both references to AdvancedRandom.Permutation(loopindex("j") to just loopindex("j")

  • You can use either of the examples I've posted - you just need to add more questions to the array file. There may be an easier method (perhaps importing a csv?), but using json array files is a fairly straightforward way to do this.

  • 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 that lets you select answers and then submit:

    dropbox.com/s/qc9dourwsf4f7g6/quizTemplate2.c3p

  • Add each image to a different animation in your Symbol sprite object, e.g. "a", "b" and "c".

    Use the action: Symbol set animation to choose("a", "b", "c")

mekonbekon's avatar

mekonbekon

Early Adopter

Member since 9 May, 2014

Twitter
mekonbekon has 13 followers

Trophy Case

  • 10-Year Club
  • Forum Contributor Made 100 posts in the forums
  • Forum Patron Made 500 posts in the forums
  • x2
    Popular Game One of your games has over 1,000 players
  • Famous Game One of your games has over 10,000 players
  • Coach One of your tutorials has over 1,000 readers
  • RTFM Read the fabulous manual
  • Great Comment One of your comments gets 3 upvotes
  • Email Verified

Progress

18/44
How to earn trophies