Soccer Cards type of game (is it feasible?)

Get help using Construct 2

Post » Wed Sep 03, 2014 5:15 pm

It doesn't restart the layout; persist? never heard of it so far; using global variables would be too much, because eventually the number of teams will be increased, and that would make A LOT of global variables...although i don't know about instance variables...every team has stats in those variables which are then updated in the array, or vice versa...but how would I connect them? Also, I've never worked with webstorage, so... looks like I'm more than useless ATM :P

OK, so ANYONE with experience in working with arrays, webstorages, etc., please take a quick look at this capx (~20 events), and try to tell me where I'm wrong and what could/should be fixed (currently the match scores are Set to XY in the array)...

Open it up in debug, left click the team to select it as Home team, and right click for Away, and watch the ''teams'' array and then simulate the match...it's a bit confusing at first, but it goes in this order - team index, team name, matches played, wins, draws, losses, goals for, goals against, goal difference, points, unused slot

As I said, I need some way to store the data to the array when the match is simulated, so that when I click simulate again, it just adds the new data onto the existing one...
You do not have the required permissions to view the files attached to this post.
B
4
S
1
Posts: 16
Reputation: 432

Post » Wed Sep 03, 2014 5:54 pm

Why are you using r170? Use the latest would be my best advice now.

To be honest, there's a lot of learning you have to do here for arrays, the way you did it is not practical at all. Furthermore using array column-wise is a bad practice for a lot of reason, simply because expression like IndexOf can no longer been use because of that (this is important). I'm afraid, you have to restart everything to make the upcoming complexity to be possible... :|

A jumpstart for you, arrange the team row-by-row like picture below:
hmmm.JPG

Let the computer do the array build for you instead of manual labour like you did.
Actually nobody can help you here unless you get yourself familiar with the manual first. Then, tryout some tutorial.

Ps: I think I went to much ahead by mentioning array.at(array.indexof(""),#) combo.
You do not have the required permissions to view the files attached to this post.
B
28
S
8
G
4
Posts: 553
Reputation: 4,924

Post » Wed Sep 03, 2014 8:23 pm

OK, I did it, but can I go anywhere from here? Can I make a way that any values are added and somehow saved in the array, so the next time I add a value, it just adds up onto the existing one?
B
4
S
1
Posts: 16
Reputation: 432

Post » Thu Sep 04, 2014 6:29 am

kroftek wrote:OK, I did it, but can I go anywhere from here? Can I make a way that any values are added and somehow saved in the array, so the next time I add a value, it just adds up onto the existing one?

Yes, by using the "combo" I mentioned before.
Well then again this is very depended how much you understand the array functionality, which I myself did not develop it overnight, it's like a month really. Whatever I might explain here for each array functionality will be useless since the manual already had it explained.

What can I say now is not how to go from there, its more like start to be experimental with all array function. Try not restrict yourself with just one expression, its not practical. Its always better to have specific question rather than a broad one. Cheers :D

Edit: I probably have a soft spot for people working with something similar mine, here goes nothing :D
What kind of event you should be expecting, should be pretty close to this
Adding HP.JPG
You do not have the required permissions to view the files attached to this post.
B
28
S
8
G
4
Posts: 553
Reputation: 4,924

Previous

Return to How do I....?

Who is online

Users browsing this forum: dop2000, max2612 and 20 guests