John Cutter's Forum Posts

  • 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?

  • 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.)

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • 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...

  • When I try to go to construct.net (or click the orange CONSTRUCT 3 button at the top of the scirra.com page), I immediately see the error below. Anyone else seeing that? (Fortunately, the version of Construct 3 on my desktop still works...)

    Critical error

    This should not of happened. Please contact support.

    System.ArgumentException: An item with the same key has already been added. at System.ThrowHelper.ThrowArgumentException(ExceptionResource resource) at System.Collections.Generic.Dictionary`2.Insert(TKey key, TValue value, Boolean add) at System.Linq.Enumerable.ToDictionary[TSource,TKey,TElement](IEnumerable`1 source, Func`2 keySelector, Func`2 elementSelector, IEqualityComparer`1 comparer) at C3.Code.Caching.CityCaching.<>c__DisplayClass1_0.b__0() in C:\Dropbox\Dropbox (Scirra Ltd)\Tom\C3 Website\C3Alpha2\Code\Caching\Cities.cs:line 21 at C3.Code.Controls.Application.Caching.Manager.Manager.Get[T](String key, Func`1 getFromExternFunction) in C:\Dropbox\Dropbox (Scirra Ltd)\Tom\C3 Website\C3Alpha2\Code\Controls\Application\Caching\Manager\Manager.cs:line 120 at C3.Code.Caching.CityCaching.GetCitiesInCountry(Int16 countryID) in C:\Dropbox\Dropbox (Scirra Ltd)\Tom\C3 Website\C3Alpha2\Code\Caching\Cities.cs:line 26 at C3.Code.Caching.CityCaching.GetCityID(Int16 countryID, String cityName) in C:\Dropbox\Dropbox (Scirra Ltd)\Tom\C3 Website\C3Alpha2\Code\Caching\Cities.cs:line 35 at C3.Code.Helpers.GeoIP.Functions.GetCityID(Nullable`1 countryID, String cityName) in C:\Dropbox\Dropbox (Scirra Ltd)\Tom\C3 Website\C3Alpha2\Code\Helpers\GeoIP\Functions.cs:line 84 at C3.Code.Helpers.GeoIP.Functions.LookupIP(String ipAddress) in C:\Dropbox\Dropbox (Scirra Ltd)\Tom\C3 Website\C3Alpha2\Code\Helpers\GeoIP\Functions.cs:line 36 at C3.Code.Caching.GeoIPLookupCaching.<>c__DisplayClass0_0.b__0() in C:\Dropbox\Dropbox (Scirra Ltd)\Tom\C3 Website\C3Alpha2\Code\Caching\GeoIPLookup.cs:line 27 at C3.Code.Controls.Application.Caching.Manager.Manager.Get[T](String key, Func`1 getFromExternFunction) in C:\Dropbox\Dropbox (Scirra Ltd)\Tom\C3 Website\C3Alpha2\Code\Controls\Application\Caching\Manager\Manager.cs:line 120 at C3.Code.Caching.GeoIPLookupCaching.GetIPDetails(String ipAddress) in C:\Dropbox\Dropbox (Scirra Ltd)\Tom\C3 Website\C3Alpha2\Code\Caching\GeoIPLookup.cs:line 21 at C3.Code.Helpers.SEO.Functions.GetUsersIPRegion() in C:\Dropbox\Dropbox (Scirra Ltd)\Tom\C3 Website\C3Alpha2\Code\Helpers\SEO\Regions.cs:line 87 at C3.Pages.Master_Pages.Global.Page_Init(Object sender, EventArgs e) in C:\Dropbox\Dropbox (Scirra Ltd)\Tom\C3 Website\C3Alpha2\Pages\Master Pages\Global.Master.cs:line 48 at System.Web.UI.Control.OnInit(EventArgs e) at System.Web.UI.Control.InitRecursive(Control namingContainer) at System.Web.UI.Control.InitRecursive(Control namingContainer) at System.Web.UI.Control.InitRecursive(Control namingContainer) at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)

  • Currently pulling my hair out in Bangkok

    Nicely done, I'm currently trying to do something very similar except to find actual objects on the picture already.

    I used the pinch/zoom sample code, but it doesn't work as smoothly as you pan/zoom! Any tips on that?

    Nicely done, now to go back and find that damned egg

    Thanks for playing my game! Yeah, some of the eggs on the last levels are hard/impossible to find. I know better but I seem to make them harder every year. The best hiding spots are the ones where players think, "THERE it is! How did I not see that before?" Some of my eggs make people think, "THAT was an egg???" Not good.

    I was going to experiment with pinch/zoom for mobile but I ran out of time, so I can't comment on that part. If it's not smooth perhaps you could use lerp? If I figure it out I'll let you know.

    HUNT HINTS

    BANGKOK:

    Check the food and anything that could hold food.

    SCENE 9:

    Pay attention to what people are wearing.

    SCENE 10: There are a couple of tough ones on the float.

  • We had an egg hunt for our daughter every year... for 27 years. (Even as an adult she still loved this Easter tradition!) Then, three years ago, my wife and I moved from the Seattle area, where our daughter lives, to Europe, and we thought the tradition had finally come to an end. I was sad, until I had a great idea! I used Construct 2 to make an Easter egg hunt using pictures of our old house where she grew up. Our daughter loved it!

    Last year I made another egg hunt set in Disneyland, her favorite place on earth! And this year I just finished a new hunt using Construct 3! It celebrates the nine months of travel she did before graduating college. If you are interested, here's the link:

    http://www.cuttergames.com/egghunt_2018/

    NOTES:

    1. It's a big download, so give it a few minutes. (About 50 MB.)

    2. There are 10 scenes and 5 eggs hidden in each scene.

    3. I didn't have to time to make it work on phones / tablets, so it's PC/Mac only.

    4. You can zoom with the middle mouse wheel. Then left click and hold to scroll.

    5. I didn't get permission to use the images and audio, so please don't share.

    6. The last few scenes are pretty challenging. (The eggs are not always obvious...)

    7. If you manage to finish it, tap the screen after the congratulatory message for a... very odd... reward! <img src="{SMILIES_PATH}/icon_e_smile.gif" alt=":-)" title="Smile">