elephunky's Recent Forum Activity

  • dropbox.com/s/ks9hjviwkdu9ftx/SBtext.capx

    The problem arises during events 12 & 14.

    It appears the events are not running at all, and I am wondering if it is because I am using '=' to compare two instance variables that are text?

    (however I tried changing them to numbers and it still didn't run the actions...so maybe there is a different problem.)

    My console repeatedly prints out the actions in event 8 (I assume because it is checking it at every tick?) Is this bad? Maybe this will stop happening once events 12 & 14 run properly?

    Here is what I expect to happen:

    After the player object moves towards the door of their choice (event 10)

    They arrive at the object touched, it checks if the door.doorOption doorText.specificDoor are equal to the scenario.scenarioAnswer, and if it is, it should run the corresponding actions (event 12); if it is wrong, then it will run the corresponding actions (event 14).

    It should do this until numScenarios = 0 (in event 12, I subtract 1 from numScenarios because they got it right; therefore once they have them all right numScenerios should = 0)

    I cannot figure out why the console keeps repeating the actions in event 8, and I cannot figure out why the actions in events 12 & 14 are not running, and am hoping that another pair of eyes can catch something. Thanks!

  • oh good way to think about it! thank you so much.

    I feel like I am getting much closer.

    I used your advice and just used a condition to trigger my actions.

    However, since I set my numScenarios to the width of a given array at the beginning (which will be dynamic), I used 'as long as numScenarios>0..do this' type of thing, and will be subtracting from numScenarios based on when the user makes the correct choice (if incorrect, it stays same). So once they get them all right and numScenarios=0 it will no longer perform the actions.

    Now if I could bug you about my next problem?

    If you want me to post another forum about it I completely understand!

    You have been very helpful in broadening my understanding.

    Here is a new link to my improved game:

    dropbox.com/s/3ttrnuch7efpkta/SBclose.capx

    What is happening now:

    It grabs the scenario from the array correctly & displays it, the pathfinder is working because the person-looking object moves to the correct door.

    But, I can not figure out why events 12 & 13 are not working properly (i.e. the feedbackCorrect/feedbackIncorrect is not showing up etc.)

    There are no errors, and in my console it seems to keep printing the first several actions under the guessProcess... I feel like that is bad? By that I mean should it really be printing those actions over and over again? I doubt it.. but why is it doing that? And why aren't the other actions properly running when they are triggered? (by triggered I mean when the user clicks on the door with the correct/incorrect answer).

    Is it because, within my conditions on events 12 & 13, I am checking if two instance variables - which are text values - are = to one another? I know that in other programming you have to use ".equals" for strings instead of =... but = seems to be the only option here.

    Is what I am doing possible ?

    Thank you again.

  • thanks. still adjusting..

    But... doesn't the condition under the while loop 'break out of the loop'? I thought that is what the condition was for.. to tell it when to stop and move on?

    Because if I want a group of actions to happen a certain # of times, i.e. I want it to run until a variable reaches 0, is there a better way to do that?

    Should I have the group of actions run from a blank event, then have a sub-event after the actions that says 'if ____ , repeat group of actions' 'else ____' ?

    for example, the process I want repeated until global var numScenarios=0 is a group of actions that includes choosing the door, checking if the answer is right, and having something happen if it is correct, and something else happen if it is incorrect. Then I want this to happen all over again with a new scenario.

    My measly mind just cant understand how this would happen over and over again without something like a while loop telling it to keep going UNTIL numScenarios=0....

  • dropbox.com/s/35wc65vrns7txla/SB.capx

    I have temporarily disabled the part of my game file that seems to be causing the problem.

    This is a difficult error for me to solve, because I am not getting any error message when I test my game. Instead, it makes the call to move on to the next screen (main), but the page does not change, and it seems to almost 'freeze up'.

    Note: this does not happen when the while loop is disabled, which is why I have pointed to it as the error origin.

    RUNDOWN:

    (Note: At the beginning of the game <font color=blue>numScenarios</font> is set to the width of the <font color=red>QA array</font> to keep track of how many questions there are.)

    What I expect to happen:

    The while loop begins, it prints the first scenario, the user has a chance to touch/click which door has the correlating, correct answer - they move along a path to the door they touched, once they arrive to the touch coordinates: if they are right (if the <font color=green>door.doorOption</font>/<font color=orange>doorText.specificDoorText</font> = <font color=magenta>scenario.scenarioAnswer</font>), I take the scenario they got right out of the <font color=red>QA array</font> and subtract one from <font color=blue>numScenarios</font>//if they are wrong, points get added to delay time, the scenario stays in the <font color=red>QA array</font>, and <font color=blue>numScenarios</font> stays the same. This process happens until <font color=blue>numScenarios</font> = 0. Then the game is over and it takes you to the summary page.

    However, I am not sure what part of my while loop is causing the page to get hung up.. and hoping that another pair of eyes can catch it, or suggest another way to go about doing things.

    Thank you all very much. <img src="smileys/smiley1.gif" border="0" align="middle" />

  • I feel like a big doof... But I really cannot find how to create a local variable. I have right clicked just about everywhere, within my event I want to add it to, outside of it, in between.. but all I get is the option to add a global variable (plus group, comment, sub event, action, condition.. but no local var :( )

    What am I doing wrong?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • First, I would like to say that what you all are doing is awesome. <img src="smileys/smiley32.gif" border="0" align="middle" />

    Second, I am having a problem finding a solution for a counter I can use in my 'For Each' loop.

    My 'for each' loop used to be a function, and I was using the (loopindex) parameter to count & Function.Param(0) to access the number.

    This was very nice because I could give my object an ID that was tied to the Function.Param(0) and then access an object in an array that had the correlated position based on the Function.Param(0).

    The problem with it being a Function was that it was doing things all at once, without recognizing my sub-events.

    So then I decided to change it to a 'for each' loop, and things are working wonderfully, except I get an infinitely repeated error that says I cannot use the Funtion.Param(0) call because it is not a function... that is totally understandable.

    So, I really want to know if there is some parameter I can use to keep count of how many times my 'for each' loop runs.

    As an alternative, I was thinking, since the 'for each' loop is 'for each (instance of object)', that I could give my object instances IDs and use that to attach to my other object created within the for each loop/use it to access things in the array.

    But if there is a counter similar to Function.Param(0) that can be used in 'for each' loops I would love to know.

    Thank you all so much.

elephunky's avatar

elephunky

Member since 6 Jun, 2013

None one is following elephunky yet!

Trophy Case

  • 11-Year Club
  • Email Verified

Progress

12/44
How to earn trophies