WHAT I WISH SOMEONE TOLD ME BEFORE I STARTED

0 favourites
  • 14 posts
From the Asset Store
Design for game, asset for game, game kit, UI design, completed design for game, mobile game, Winter Wish
  • Hey everyone,

    Well, its been a long two or three weeks of Construct 2 usage, and I'd like to save new users hours and hours of time that I wasted figuring things out that should be made very obvious in the tutorials.

    1. If you're using arrays and its returning 0 and you're positive you set up the array size correctly and you're positive you used the "set value" technique correctly,you have to reset the size in the trigger/action section before you add any new values. Seriously, even if you run your program with an array defaulted at 10, 10, 10 and try to add "8,1,1" it will not work without a resize "10,10,10" before it. I'm not kidding...

    2. BUTTONS DON'T SHOW UP IN MOBILE APPLICATIONS!?!? you have to use your own custom sprites, as far as I can tell. Don't even bother with buttons, they're hardly customizable anyway.

    3. If you're adding a key to a dictionary, that's totally different than adding an instance variable. To my knowledge keys serve no purpose.

    4. CocoonJS errors can be accessed by clicking on the FPS button in the top left corner. YOU SHOULD BE EXPORTING TO COCOONJS EVERYDAY because it likes to crash when loading certain images, and playing guess and check after 2 weeks is a huge pain and often project-crippling experience.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • 1. Haven't used arrays in a while but when I did I did not have this problem. If it's a bug then make a .capx where you can reproduce it and file a bug report.

    2. I guess buttons are a windows thing.

    3. Dictionaries and their keys are extremely useful. I use them solely for game/save data.

    4. Major update with CocoonJS recently, bugs are to be expected.

  • I think you don't understand number 3.

    instance variables are predefined values. Dictionary is used for dynamic values and use for long term storage(Dictionary to WebStorage).

    as an example if you had a game where you hire squad soldiers, but you can name the soldeirs, have a varying number of soldiers, different stats, gear so on. Dictionaries can be very helpful to organize the data. Where as instance variables have very limited use for such dynamic storage.

    4. yes. daily, every build. constant.

  • Well, I suppose I know that keys can do things, I just don't understand why you wouldn't use arrays. Thanks for the responses though. I do actually really like construct 2

  • Well, I suppose I know that keys can do things, I just don't understand why you wouldn't use arrays. Thanks for the responses though. I do actually really like construct 2

    Dictionaries and Arrays have different lookup times too. If you've taken any programming classes at school, they will make you learn Big O notation. It will explain why you would use them in different instances.

    Plus, dictionaries are much easier to use in human terms. If I have 100 settings for my games, it's easier to remember "Player_Name" rather than "043".

  • firebelly, you say they have different lookup times... so which is faster?

  • Hey everyone,

    1. If you're using arrays and its returning 0 and you're positive you set up the array size correctly and you're positive you used the "set value" technique correctly,you have to reset the size in the trigger/action section before you add any new values. Seriously, even if you run your program with an array defaulted at 10, 10, 10 and try to add "8,1,1" it will not work without a resize "10,10,10" before it. I'm not kidding...

    2. BUTTONS DON'T SHOW UP IN MOBILE APPLICATIONS LOL!?!? you have to use your own custom sprites, as far as I can tell. Don't even bother with buttons, they're hardly customizable anyway.

    3. If you're adding a key to a dictionary, that's totally different than adding an instance variable. To my knowledge keys serve no purpose.

    4. CocoonJS errors can be accessed by clicking on the FPS button in the top left corner. YOU SHOULD BE EXPORTING TO COCOONJS EVERYDAY because it likes to crash when loading certain images, and playing guess and check after 2 weeks is a huge pain and often project-crippling experience.

    2/ JQuery isn't supported by cocoonJS, not C2's fault itself, but yeah.. frustrating, that means no form controls.

    3/ Dictionnaries are pretty useful whe nyou need to keep the track of a lot of values, like an inventory.

  • I have fallen in love with dictionaries. Especially now that I can load an external json file into it. I can then save project and edit the external file because editing via c2 is a pain in the *ss - lol.

  • I dont recall any such problems with arrays either.

  • 1) Here's a .capx showing that it does in fact work without needing a resize action: https://dl.dropboxusercontent.com/u/15217362/arrayworks.capx

    I think you might have been confused by the fact the array object defaults to 10x1x1, and since indices are zero-based, the element at 8,1,1 is outside the array. It works fine with 10x10x10 though, as the .capx proves.

    2) Only if you use CocoonJS or the Intel XDK, and it's a documented limitation (e.g. see how to export to CocoonJS). If you use PhoneGap or a mobile browser it all works, but then you have other trade-offs (performance, distribution etc.)

    3) Instance variables are static - you can only use the ones you added in the editor. The Dictionary object keys are dynamic, and can be changed at runtime, making it useful when you don't know in advance how many variables you'll need.

    4) Well, that's to do with CocoonJS, and not Construct 2. Let them know about any issues you come across and hopefully they'll be able to fix them.

  • Also a very useful practice is to ask how something works before complaining about it as you will find that in 90% of cases it's a lack of understanding of the feature as opposed to broken functionality. Just saying, due diligence and a bit of research will yield faster results than complaints. Going back to the subject of this post, if you would have asked, someone indeed would have told you.

  • I use the dictionary object to store all the speech lines I need in my game. I could've used an array, but IMO the dictionary object is much easier to deal with.

    Each key is the name of the object that the player is currently interacting with, followed by the number of lines they should say.

    What I'm trying to say is: be creative.

  • Dictionaries and Arrays have different lookup times too. If you've taken any programming classes at school, they will make you learn Big O notation. It will explain why you would use them in different instances.

    This is not true in JavaScript. JS arrays are a special case of an object and JS objects are (basically) dictionaries, which means JS arrays are also dictionaries. Typed arrays were added to address the performance issues of normal JS arrays.

  • 1) Here's a .capx showing that it does in fact work without needing a resize action: https://dl.dropboxusercontent.com/u/15217362/arrayworks.capx

    I think you might have been confused by the fact the array object defaults to 10x1x1, and since indices are zero-based, the element at 8,1,1 is outside the array. It works fine with 10x10x10 though, as the .capx proves.

    You're right.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)