How do I create soccer teams with players having instance v

Get help using Construct 2

Post » Sat Sep 10, 2016 8:43 am

I want to make a soccer league game the main game is almost ready but I dont know how to present teams ,players in it too and how players will have many skills like speed ,accuracy, power, stamina etc.
Some people told me do it with arrays or local storage but I dont know how?
And how I transfer a player to other team and dont lost its data too?
But I didnt understand what type of the player member objects where to store them ? How to make them ? What will make a team? Means how game will load the teams having those players at begining? How to select 11 members from 15 members?How a player member will have those multiple skills?
Yes it is very difficult and I dont know so much. Please explain how to do this or if can make or provide a small capx example then it would be great! Thanks. :)
B
17
S
5
Posts: 45
Reputation: 1,240

Post » Sat Sep 10, 2016 4:54 pm

That is a LOT of questions. "Some people told me do it with arrays or local storage but I dont know how?" That's your issue, I would look at array tutorials, there's a nice basic one to learn what arrays are and how they are used. Once that is complete then you'll know how to add data to an array and store it. I believe if someone just sends you a capx you won't know how any of it works will you? So it will be difficult to then expand on it to make a game. This also sounds like a big effort for a first game as it will require lots of database information to be stored. In general though, yes if it's some kind of management game you are going for then you can store a player and each related data in an array and grab it later by finding the position in the array. I guess you would display that information in text boxes. You would probably assign them 'team' data so they can be listed in a team and then if you want to swap them to another team you update this data. I don't think there's any way to provide a 'small capx' for this, it's more progressive, you will start with data and build upon it until you have player selection in a list and then transfers available, because what you are describing above is pretty much an entire game. In terms of presenting the teams, if you mean in a list then that will be a case of searching the array for all data that contains that team name and listing the players. If you mean actually playing some soccer graphically you would have to make that, randomise some movements of dots on screen or something similar.

TLTR: look at some array tutorials and get comfortable with using arrays as your game will rely on it.
B
47
S
17
G
81
Posts: 2,227
Reputation: 48,101

Post » Mon Sep 12, 2016 4:40 am

Thanks @Plinkie you covered a lot ! I will read all array tutorials , I know how to set value in an array so if there are 50 players in the game can I set them all in one array and then load (or retrieve) them from their team name or their position name like Goalkeeper, center midfielder etc?
Yes a capx with some 5 or 6 players with 3 or 4 team example would be great for how I will will present a team.
B
17
S
5
Posts: 45
Reputation: 1,240

Post » Mon Sep 12, 2016 5:52 am

if you want a really easy array builder look up rex plugin for CSV to array. It like a format maker that translate excel csv format and load it into array using Ajax.

Id would start small with it first use like 4 player and their stats and see how the interaction goes and if you have a paid one get ready to learn function or else you will run outta event room.

Ive tried to make an rpg form with just under 100 event and using no function....that just impossble lol and soccer games are like rpg in a lot of ways. So id start learning arrays and function to your advantage.
B
52
S
24
G
6
Posts: 391
Reputation: 7,845

Post » Mon Sep 12, 2016 7:40 am

thanks @gearworkdragon ! csv to array so I have to open excel .
Can you make that 4 or 6 player basic capx please :) . Requesting.
I am learning array again.
B
17
S
5
Posts: 45
Reputation: 1,240

Post » Mon Sep 12, 2016 11:15 pm

well it would be too easy to just give you a capx i tell you what. Write down players attribute that you want and then on a piece of paper write down for the Rows to the attribute you want such as this name, power, defense, speed and next write down the colume setting player 1 2 3

so it should look like this

Name:power:defense,speed
Player 1
player 2
player 3

Now a homework for you what is the value for this array.at(0,0) and array.at(0,3) And next tell me what is the width and height and depth of this array. If you need help with figuring out the array go read up the manual and their expression

The reason why i am asking you these question is because you need to learn the fundamentals of array before I let you head deep in a capx anyway.

keep in mind the first row and column is always x,y coordination of 0
B
52
S
24
G
6
Posts: 391
Reputation: 7,845

Post » Wed Sep 14, 2016 2:58 pm

wow @gearworkdragon you are explaining great I need this great . About the homework as you write above in the array it is Name at(0,0) and Defense at(0,3) . Please continue. Tell me more. Teach me. :)
B
17
S
5
Posts: 45
Reputation: 1,240

Post » Wed Sep 14, 2016 3:03 pm

Any one of you who are browsing this forum can help me too! :)
B
17
S
5
Posts: 45
Reputation: 1,240

Post » Wed Sep 14, 2016 3:35 pm

First one is right but the 2nd one is wrong the very first X,Y coor are 0,0 and then 0,1 the array.at 0,3 is speed. I will tell you why .

arrays x/y is alway arranged like this
0,0 0,1 0,2 0,3
1,0 1,1 1,2 1,3
2,0 2,1 2,2 2,3
3,0 3,1 3,2 3,3
So you can see how theres a total of 16 slot but the max X is at 3 that because all array start at 0,0.

Example visualization
Image

So by this example above has a 4x3 grid of space to a total value of 12 slot

Now go back and check what is each value and their coorindation array.at And do please tell me what is the current width and height and depth size of this array Width. Think of it like a rubric cube. Ill give you a head start this has a depth of 1 and Now tell me why does it has a depth of 1 as well as explain your answer how you got the width and the height of this array. If you need reference in how to figure out the width and height and depth go check up array in the manual page.

After you figure out this little homework ill show you some cool ways to not only reduce event but also a way to quickly find your value in a Callback function. As well as a build to with loops and push back.

Also did you know that since the dawn of math, array has always been here so this isn't new. But in the world of computer and networking we start array at 0,0 while in real world life it be 1,1
B
52
S
24
G
6
Posts: 391
Reputation: 7,845

Post » Wed Sep 14, 2016 5:54 pm

@gearworkdragon Hmm Yes that was my mistake at array.at(0,3). As you said above it is a Rubik's cube then now I can this imagine array like a cube so width is X which is 4 because in computer and networking we start it from 0 and the height is Y so it is 3 (0,1and 2).
So what will be the depth of this cube if we have a 4x3 grid ? So if the depth is 1 then I can say in 3d it is 4x3x1. Now if depth is 1 so I can imagine this 4x3 grid is a single layer of the rubik cube.
That maths and computer information is good !
B
17
S
5
Posts: 45
Reputation: 1,240

Next

Return to How do I....?

Who is online

Users browsing this forum: danalog, dop2000 and 25 guests