John Cutter's Recent Forum Activity

  • blackhornet

    I tried isolating the events into a very small file and I'm still seeing the problem.

    My program:

    Here's a picture of my events sheet:

    And here's a picture of my functions sheet:

    When I click the button my first function is called but the code never reaches the second one. (The text changes to "Button Clicked" and not "Function 2".)

    NOTE: If I reverse the order and call "Change Text" first, the text changes to "Function 2".

    Here's a link to my .c3p if you want to play around with it:

    https://nofile.io/f/uhcGvKUwwuR/Race+Test.c3p

  • Thanks for being so helpful, Asmodean!

    What you proposed is basically what I wound up doing. I wasn't sure how to tell when my "For each element" loop was finished so I am simply checking to see if array_all_words Current value = "agria" (Which is the last word in my array.) Is there a better way to do that?

    Ugh. My code is now full of all sorts of crazy kludges that I didn't actually need. I wonder if there is anything Scirra could do to make it more obvious when this "race" situation is happening? It's not intuitive at ALL.

  • I've really been struggling with my code this weekend and I'm not sure why. Even fairly simple things are not working and I'm starting to suspect that I'm encountering timing issues in the event flow. Like some events are taking so long that following events are not being called at all. Has anyone else encountered this?

    For example, when players push a button in my game I call two different functions. The first checks through a giant array to look for valid words. That works great. The second function does a variety of things and it isn't working. To debug it I started disabling events until I was left with a single one that simply changes text in a visible string. Nothing happens, it's like the second function call is being skipped.

    Here's what my code basically looks like:

    [the player clicks on a button][ul]	[li]Function call "score_words" (this works great!)[/li]
    	[li]Function call "final_score" (this doesn't work at all)[/li]
    [/ul]
    Function On "score_words"
    [ul]
    	[li]For each X element (there are 13,000+ values in my array)[/li]
    [/ul]---- array_all_words Current Value = array_player.at(0) --> set score_1 to array_all_words(arr_all_words.CurX,1)
    
    Function On "final_score" ---> txt_debug Set text to "HERE!"
    [/code:2tyz0h2w]
    
    My debug message never gets updated to "HERE!" I've tried adding a Wait(0) between the two function calls but that doesn't seem to help.
    
    Any other suggestions? (Thanks!)
  • Thank you, Asmodean! That worked like a charm!

  • I've been using Construct 2 casually for years and recently upgraded to Construct 3 (so I could work on a Facebook Instant game). I'm not a power user, but I haven't noticed it being limited at all. Though, I guess it may not have as many addons as C2.

    To be honest, I thought the whole "runs in the browser" thing was kind of gimmicky but the work Scirra has done on this is damn impressive. And the other night I was doing some work before bed and right after I climbed under the covers I thought, "Oh, wait. I think I know how to fix that problem I was working on!" I pulled out my iPad, launched Construct 3, fixed the bug, and saved it. Worked like a charm!

    My only real concern about Construct 3 was the yearly fee. I tend to use these kinds of tools for a few months and then not at all for half a year or more. But I got a C2 discount on the first year so I decided to give it a try. So far so good. And the new faster runtime Ashley is working on should be great! (That's a C3 exclusive, I believe.)

  • I have a two dimensional array with over 13,000 words, and a value associated with each one. I am successfully iterating through this array to find a particular word, but I want to then display the VALUE.

    For example, my array looks something like this:

    apple, 10

    orange, 15

    pear, 25

    When I find the word "orange" I want to be able to display the number 15.

    My code looks like this:

    array_all_words -> For each x element
    [ul]
    	[li]array_all_words Current Value = "orange" -> my_text = ????[/code:3mnrcmls][/li]
    [/ul]
    I've tried different variations of: my_text = array_all_words.at(CurValue,1) but nothing is working so far.
    
    Any suggestions?
  • Next week I am conducting a Rapid Prototyping workshop for 15 to 20 game designers in my company. The last probably half of the workshop will be an introduction to Construct 2 / 3.

    There are obviously some excellent tutorials and sample projects out there, but what other tips would you give to an experienced developer who is unfamiliar with Scirra's products? When you were first learning, what eureka moments helped everything click?

    Here are a few tips I am considering:

      1) If you reference an instance in an event, you can interact with just that instance. 2) Groups are a great way to make your event sheets easier to read (because they are collapsible.) 3) To import frames, right click in the Frames window. (This was a bit hard for me to find, initially.) 4) Check your collision polygons! (I once spent hours trying to figure out why clicking on a sprite was so inconsistent.) 5) Right click on everything when getting started, but then learn the keyboard shortcuts! 6) You can change 'every frame' in your animation by shift clicking the mirror, flip, crop, buttons.

    What are some other tips for experienced people who are learning Construct 2/3?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I posted something similar this morning, then ran some tests and deleted the post. But I'm still stumped so I'm posting again.

    I have a fairly simple function that looks something like this:

    ON FUNCTION "check_words" --> set text_1, text_2 and text_3 to ""
    
    [ul]
    	[li]array_all_words contains "apple" --> text_1 = "FOUND APPLE"[/li]
    [/ul]
    [ul]
    	[li]array_all_words contains "orange" --> text_2 = "FOUND ORANGE"[/li]
    [/ul]
    [ul]
    	[li]array_all_words contains "pear" --> text_3 = "FOUND PEAR"[/code:1sucty74][/li]
    [/ul]
    If my function finds all the words then all three "FOUND" messages are displayed. But if a word is NOT found, the function doesn't seem to check the rest of the words. In other words, as soon as it can't find a word then all the messages below are blank, even if those words are IN the array.
    
    I tried to recreate the problem with a smaller array and it worked as intended, so I'm kind of stumped. Any suggestions? My word_array is pretty large (13,000 entries) so maybe it's taking too long to search the whole array and it's an internal timing issue?
    
    UPDATE: I reworked everything and it seems to be performing as intended now. I still think it was a timing problem of some kind. For those interested, my solution was to create three separate functions, one for each word. I also added a flag to tell me if a word had already been checked or not. That cut down on the number of checks that needed to be made.
  • I've spent the last several weeks working on a Facebook Instant word game which has levels that are generated algorithmically. Tonight I was going to seed the random number generator so everyone gets the same puzzle for each level -- this is important because of leaderboards, competition, etc. -- but there doesn't seem to be a way to do it.

    I assumed (yeah, I know the old saying) that this functionality would be built in, but it looks like I need a special plugin... and none have been ported to Construct 3 yet. Wow. I've solved a lot of problems to get where I am, but this is an issue I never even anticipated.

    I guess I could use a tool like Excel to randomly generate tens of thousands of levels (offline) and then save the values in a huge array. Any other suggestions?

  • It's working again! Thanks Tom!!

  • As far as I can tell there are only two people having an issue with this and I just happened to notice that we both live in Germany! Anyone else from Germany having a problem -- or is Construct 3 working for you?

    (I just filed a bug on this using GitHub.)

  • I just tried going to construct.net on my iPad and I’m getting the same error. (I was on my laptop before.)

    I’m not seeing a ton of reports so the problem seems isolated, but I can’t access C3 unless I use the desktop version, which I don’t have on my iPad, unfortunately...

John Cutter's avatar

John Cutter

Member since 11 Dec, 2015

None one is following John Cutter yet!

Connect with John Cutter