John Cutter's Forum Posts

  • Strange, I just tried to post in this thread but my message didn't appear. Apologies if I accidentally double post.

    Ignaci, I noticed that your example file is using the older version of Construct 2. (I can't even open it.) You may want to update your link. Or I can post an example file if that would be easier. Let me know!

  • Thanks to blackhornet's help I have dramatically simplifed my app (and it's much faster now, too)! But I've got one more bug to fix and I'm completely stumped.

    I'm trying to update my dictionary using a value in my array and it's just not working.

    Here's my code. (I've verified that location 0,3 = "0"):

    Dictionary: Set key Array.at(0,3) to 300[/code:4k9r7w3i] 
    [i]NOTE: I've tried using: str(Array.At(0,3)) but that doesn't help.  [/i]
    
    And yet THIS works:
    [code:4k9r7w3i]Dictionary: Set key str(0) to 300[/code:4k9r7w3i]
    What am I doing wrong?
  • Wow, thank you blackhornet! I really appreciate your help!

    I haven't had a chance to look at your updates, but your response made me remember why I was prompted to write my post.

    It was my assumption that the Sort and Reverse commands for arrays would finish execution before falling through to the next line of my program. But I was running into problems when I Reversed the Y axis, and then immediately Sorted by X. My theory was that the Reverse hadn't finished before I started the Sort. When I put the delays in between (Wait didn't work), everything seemed okay.

    I think I read that some Events need a "tick" to complete. Is that the case here? Would "Wait 0" work?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Not sure if I'm doing this right, but here's a link to my .capx file:

    http://jmcdesign.orgfree.com/Flashcards.capx

    This is my *first* Construct 2 program... so go easy on me.

  • I thought a Flashcard app would be a fairly simple way to learn Construct 2, but I'm sort of struggling at the moment. I spend about half my time "coding" and the other half reading forum posts and looking at tutorials, but despite my research some things are just not clicking yet...

    1. If I create a function to manipulate an array, what is the execution flow? For example, let's say I have a 10 line program. Line 5 is a function call. The function is manipulating an array using "for each". Does the "for each" loop finish WITHIN the function before returning to the main program? Or does it process the loop once, increment the LoopIndex, return to the main program until it hits the Function again, at which point it process the loop, increments the LoopIndex again, etc.

    2. I try to put all my code in Groups. When one Group is finished I deactivate it and activate the next group. But what happens when I sort an array? Can I perform the sort and then immediately de-activate the group? How do I know when an array has finished sorting? Are these events asynchronous like Local Storage?

    3. Is there a way to tell how long other array and dictionary manipulation takes? I wound up writing some code like this to ensure stuff has time to finish:

    [GROUP]

    • initialize counter = 0
    • if counter = 0 reverse array
    • if counter = 15 sort array
    • if counter = 30 update array
    • if counter = 40 deactivate group
    • counter = counter + 1

    Is that necessary? Is there a better way to do it?

    Here's what I'm trying to do with my Flashcard App. If anyone has suggestions please let me know!

    DICTIONARY

    id: score

    ARRAY

    score, french phrase, english phrase, id

    I use AJAX to load data.json into my array. Then I use Local Storage to create my Dictionary object. After that I reverse the y axis of my array so the "id" is in the first column. Then I can sort the array by id. This makes it easy to update the array using the values in the dictionary object. (Everyone using the app needs to have their own "score" for each word.)

    After every card I basically do the opposite of the above to save back to Local Storage.

    It's mostly working but I'm getting weird values in weird places and none of it makes any sense. Perhaps I'm trying to sort an array before it has finished reversing, for example. Not sure.

  • That did the trick! Thank you SOOO much. It's sort of obvious now, but I sure wasn't getting it on my own. (It's late here so maybe I'm just tired...)

  • I've been running into lots of strange bugs today, and I'm quick to blame C2, but in the end ALL of them have been stupid errors on my part.

    That said, I'm completely stumped by my current problem and I could really use some help. I'm sure I'm just doing something wrong but I have no idea what it might be and I've been working on the problem for HOURS.

    My array has the dimensions 468,3,1 and I'm simply trying to change the first value in the last "column".

    Set value at (card_count,last_column) to my_rnd[/code:362kg8fk]
    
    To make sure I wasn't having an issue with my variables I simplified the code above to:
    
    [code:362kg8fk]Set value at (1,0) to 300[/code:362kg8fk]
    
    I ran my app and watched the array in the debugger. The first value changed to "300", as expected. Then I tried (1,1).  The second value changed.  (1,2) caused the third value to change. But (1,3) has ZERO effect.
    
    In desperation I tried setting the value to str(300), but that didn't work either.
    
    What on earth am I doing wrong?
  • I just downloaded Chrome and checked it out. Looks exactly the same: my app is in the upper left quarter of the screen, and some of my "off-screen" sprites are visible below.

    Probably an issue with iPad Pro's higher resolution?

  • I was *just* getting ready to report the same problem. It's sort of an unfortunate bug because I'm making concept and feature prototypes for the people in my company -- and most of us just got iPad Pro's as company gifts. So while I'd like to think, "Oh, what are the odds that someone looking at my app will be on an iPad Pro?" Probably pretty good.

  • Hey, everybody. Nice to meet you.

    My name is John Cutter. I'm 56 years old and I've been creating games professionally since 1984. I have designed and/or produced over 60 titles, including: "Fairway Solitaire", "Defender of the Crown", "Betrayal at Krondor", "Might and Magic II", and a few more. If you are really curious you can find my design portfolio here: johncutterdesign.com

    I tell people that when it comes to programming I'm a really good designer. So when I want to mockup new game concepts or features at work, or I want to create some simple games at home in my spare time, I turn to tools like "Fusion 2.5", "GameMaker" and now "Construct 2". I've only been using Scirra's product for a few weeks but for the most part I really enjoy it so far!

    I'm sometimes an idiot on the technical stuff so please forgive my stupid questions. But expect a lot of them...

  • I'm a professional game designer who likes to make casual games in his spare time. Although I can code a little bit, it's definitely not a strength, so I turn to visual tools like Fusion, Gamemaker and Construct 2. After reading *glowing* reviews of C2 over the last few years I finally purchased a copy and I'm very impressed with it.

    The community here has been great so far but it seems like most of the posts and tutorials I see are from several years ago. When I looked the other day I saw several hundred people browsing the Fusion forums, and only 30 or so in the Scirra forums. Was there once a larger community of developers out there? (Or has the community always been a bit on the small side?) If it used to be bigger was there a mass exodus at some point, or did people just gradually drift away? If the former, what caused people to leave? And where did most of them go?

    Just curious.

    NOTE: After working on my first Construct 2 app for the past week, here are my initial thoughts:

      1. I love the UI. It feels slick and modern. Simple to use and a lot more straightforward than Clickteam's antiquated UI. 2. The graphics editor doesn't have many features. I use dedicated tools for this, so it's not really an issue, but I was a little surprised. 3. I keep accidentally "unhooking" the Programs/Layers/Bookmarks tabs. Then I struggle to get them set up again. Is there a way to lock them? 4. Using C2 is more... complicated... than I expected. With subevents, functions, and other features, and with the way the Event Editor is laid out, it's a bit more like *actual* coding than Fusion. Maybe I just need to spend more time with it. 5. I am struggling a bit with the Event Editor. It's not always intuitive where and how to create subevents, add variables, etc. When I'm writing C or VBA code I sometimes add a blank line to separate one concept from another, but when I try to do that here I get a dialogue box asking me to choose a condition. Probably just need to spend more time with it. 6. My app needs an array, and I have to save data locally. I found the descriptions and tutorials about this VERY confusing, but it turned out to be fairly simple. (Maybe I'm doing something wrong.) 7. With Fusion I frequently ran into problems that I could NEVER understand. Eventually, I'd just try different approaches until I finally got it to work. So far I haven't had that problem with C2. 8. Love, love, love, the debugger. Being able to see the contents of my array, as I tried to manipulate it, was a lifesaver.

    Need to get back to work on my app. If I think of anything else I'll add it. (Or I'll start a new thread.)

  • Here are a couple of ideas *I* use when deciding what game I want to work on next:

    1. Play a lot of games, including games from lesser-known sites. Often I will find a title that has an interesting mechanic, but it's poorly implemented, or there are other features that I don't like. Use that as a starting point for a new game, where you fix the stuff that's wrong and add your own ideas.

    2. Alternately, you can take that same cool mechanic and change the theme/setting/characters. "Angry Birds" is basically just "Crush the Castle" with birds and pigs! (And a lot more personality, of course.)

    3. The physics engine is very powerful, so come up with a simple mechanic and just "play" with it for awhile. That will often suggest new game concepts. For example, one day I got curious if I could use the left and right cursor keys to affect an object's rotation. After I got that working I realized that it was fun to make the object do "flips" once it bounced into the air. That suggested a slew of different game ideas.

  • UPDATE: I wrote some VBA code in Excel to export my spreadsheet into C2's .json format. I made this a Project File and then used "AJAX.LastData" to "LOAD" the file into my array. Works great!

    NEW QUESTIONS:

    I want to make my web app available to my wife and other people in my French class. Ideally, the app will keep track of which words/phrases they get right and wrong so I can make the latter come up more often. I'll also need to add new words/phrases to the list by updating the .json file on the server.

    What would be the best way to do this? Here's what I am currently considering:

    PHRASES ARRAY:

    [id] = Sequential numbering from 1 to the total number of cards. Doesn't change.

    [french] = A French word/phrase

    [english] = The English equivalent

    [score] = This variable is used to determine how often that flashcard appears (based on whether players got it right or wrong)

    LOCALSTORAGE:

    [id]

    [score]

    Then I'll do something like this?

    1. App starts - load Phrases Array from .json file on server

    2. Load LocalStorage

    3. Copy local [score] to array [score] by using the matching [id]

    Then I'll show the Flashcards with the lowest score. If users get a card right then I'll raise the score. If they get a card wrong I'll lower the score.

    If I store my Phrases Array with the [id] first and the [score] last then I should be able to sort the array on the X axis (sort by [id]). Or, Sort the array on the Y axis and then sort it on the X axis (sort by [score]). Right?

  • Using Clickteam's tools I sometimes get unexpected behavior when I try to put too many actions on the same event line. For example, on a Start of Frame event if you try to read data from an array and then use that data there can be issues. So you have to create another Start of Frame event and put the new actions there. Is this a problem in C2, as well?

    I continue to be impressed by Construct 2's features. I was playing around with the debugger this weekend and it's SUPER useful! Very happy with my purchase.

  • Ack! I already tried that and it didn't work, but this time I re-imported the file and everything is working as intended. Thanks Ramones!