How do I create soccer teams with players having instance v

0 favourites
From the Asset Store
Players follower. use it for anything which follows the player
  • 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.

  • 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.

  • Thanks 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.

  • 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.

  • 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.

  • 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

  • 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.

  • Any one of you who are browsing this forum can help me too!

  • 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

    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

  • 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 !

  • Gearworkdragon what is next ?

  • and anyone please help!

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Idk its up to you where you want to take the information. Ask me the questions now since you know how array work and how to retrieve values.

    as far as the soccer game mechanic I really have no clue to how to implement it since im more use to doing rpg turn based.

    But if i had to guess maybe something like a formula for each character such as let take movement so we know that in computer movement is done by pixel being redrawn at a pixel speed and how fast the engine take the data and give you the Frame per sec load. Id would do something like set character movement speed to the new value of its speed from an array and of course do it before the game start sort of like in the match making.

    And because power is saying how far is my kick going to drive the soccerball. this one a little tricky since in soccer there is pass the ball and driving the ball. and id make it like a charge shot. like hold down a key and it bring up a charge and when at the highest kick it in a direction in relation to you player power in the array.

    And in most older games and i mean the 1980 games the game was primary base on simply passing the ball in a direction and the character model and the ball would just be stuck to each other until you attempt to pass the ball and if an enemy player was in the way well he would get the ball.

    But that is just a guess. But remember ask a question to get information about a particular effect to achieve we have alot of information but we do not know which piece to give.

  • well Gearworkdragon the problem is how to show these teams and side selection. May be there will a data in array like in a column which will used for store team data means some players with A team some with B so how do I show team A players in a table with there stats and team B players in different table? Now this is the new question or if you can explain this in a capx file I will be happy to see it in real thanks Gearworkdragon

  • please construct 2 users help me !!!!!!!!

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