WHAT I WISH SOMEONE TOLD ME BEFORE I STARTED

Discussion and feedback on Construct 2

Post » Tue Jul 23, 2013 8:20 pm

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.
ClocksTNW2013-07-25 15:40:13
B
9
S
2
G
2
Posts: 47
Reputation: 1,822

Post » Tue Jul 23, 2013 8:37 pm

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.Tokinsom2013-07-23 20:40:22
Image
B
242
S
29
G
13
Posts: 1,787
Reputation: 18,685

Post » Tue Jul 23, 2013 10:27 pm

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.
B
90
S
18
G
9
Posts: 2,455
Reputation: 15,013

Post » Wed Jul 24, 2013 12:46 am

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
B
9
S
2
G
2
Posts: 47
Reputation: 1,822

Post » Wed Jul 24, 2013 1:08 am

[QUOTE=ClocksTNW] 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[/QUOTE]

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".
B
30
S
10
G
7
Posts: 416
Reputation: 7,239

Post » Wed Jul 24, 2013 1:48 am

@firebelly, you say they have different lookup times... so which is faster?
B
147
S
73
G
20
Posts: 1,785
Reputation: 22,420

Post » Wed Jul 24, 2013 2:30 am

[QUOTE=ClocksTNW] 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.
[/QUOTE]

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.
Game design is all about decomposing the core of your game so it becomes simple instructions.
B
52
S
22
G
18
Posts: 2,122
Reputation: 17,093

Post » Wed Jul 24, 2013 8:06 am

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.
You think you can do these things, but you can't, Nemo!
Just keep reading.
Just keep learning.
B
65
S
16
G
9
Posts: 1,429
Reputation: 12,708

Post » Wed Jul 24, 2013 9:27 am

I dont recall any such problems with arrays either.
B
47
S
16
G
9
Posts: 1,097
Reputation: 11,180

Post » Wed Jul 24, 2013 12:03 pm

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.Ashley2013-07-24 12:04:41
Scirra Founder
B
387
S
230
G
88
Posts: 24,249
Reputation: 192,450

Next

Return to Construct 2 General

Who is online

Users browsing this forum: No registered users and 7 guests