kroftek's Forum Posts

  • Am i missing something, or is the array editor not available in the beta?

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

  • 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

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

  • I'm currently doing it like that (I suppose Self.CurValue + whatever is the same), but I need a way to tell the game that it doesn't reset the scores everytime I press Simulate match, I want it to keep them and then just add on anything onto it...

    I don't know, if you want, I can provide you with a capx (it's not too complex) so you can have a better look into it and possibly figure out the solution...

  • Push or insert? I don't see how can that work...

    If I didn't make myself clear, here's the most basic rundown possible:

    Team A is playing against Team B.

    In the array, Team A's points stat is set at X 9, Y 0, while Team B's is at X 9, Y 1.

    I've made a system where it is known who plays against who, and when a match is simulated, it applies, for instance, 3 points to the tem that won.

    But, I want those 3 points to stay in the table, and when I simulate the match again, I want (in case that team wins again) those points to be ADDED to those 3 already, so it of course totals 6, and so on, and on, and on...

    Get it? Points are just added to the tally every time I simulate a match...

  • OK, I might be on a trail to something. I have an array filled with 4 teams and their stats. Whenever a certain team is picked, it sets the global variable to either ''globalhome'' or ''globalaway'' which is then easy to apply the post-match data (for instance, wins are written to (x, ''globalhome''), etc. BUT, I would like to know - how can I ADD the data to the array, instead of setting it? For instance, I've simulated a match, and it sets the data to their respective cells in the array. But, when I simulate it again, it erases the old data and writes down new data (I suppose it's because of the Set at XY action)...

    I want that any data that gets written to it is actually added to it. Is there any way?

  • Anyone? :/

  • > First of all, if you have the time and you're by any chance a football/soccer fan, I would like that you give this game a try:

    >

    > (since I don't have 300 rep points, I cannot post an URL, so please google Soccer Cards PC, on manwithnomouth.com - latest version 1.42)

    >

    > It's a pretty fun game, mostly involving luck but sometimes even skill.

    >

    > Now my question is - can it be made with C2?

    > At first sight, the game doesn't look that complex, the graphics are primitive and would be easily made with C2, but my main concern is generating the match outcome, and generating the schedule of the matches.

    >

    > Let's say that I have 4 teams to pick from, and I pick 2 that will play against each other. I've made 2 so far, and it works (both teams have inst. variables for matches played, wins, goals scored, points etc. which are at the end transferred to their respective cells in the array). But what if I want, let's say Team 2 vs. Team 4? How will I tell C2 that these teams are playing, and apply the post-match data to their variables? I'm thinking of a solution all day long, and just can't put my mind to anything. I was thinking of 2 slots, like ''opponent 1'' and ''opponent 2'', and then pick teams that will fill those slots, but how will the variables be handled still baffles me. I don't need any complex brainstorming, just a push in the right direction from someone who is more skilled with this tool.

    >

    > (Also, if you have already tested the game a bit, please take a look at some of the aspects of the game, most notably the Schedule, and possibly give me a slight hint or opinion how things should/could be made).

    >

    > Thanks in forward!

    >

    From what I read, it seems you are already in the right path

    Your idea on 2 slots will work, handle the instance variables like you've done before, you should be ok!

    Look at Array.IndexOf expression, you'll be using this quite a lot to update post-match data. I can relate this to my CCG project, the combo of Array.At(Array.IndexOf("variablesXXX"),variablesYYY) is pretty darn useful in cases like this.

    Jeez, my brain is still useless I don't get it, and I don't know if the right path is the appropriate expression currently...

    OK, I'll try to explain this as best as I can.

    So far I've made 2 teams, both of them have instance variables for the matches played, wins, draws, goals scored etc. and are registered in the array, each team updates its stats when the match is simulated because it's set to run every tick. It's just Team 1 vs Team 2, and 2 global variables which represent the score. Based on that variable, the stats are applied to the teams in question.

    So now (you've guessed it), I would like to take a step forward, and introduce a selection list of let's say 4 teams. Then I'd pick Team 2 and Team 3. But I just can't figure out clearly how will the game know who's playing, and to whom should it apply the post-match data at the end. What is the most less-painful way to code this? I mentioned the opponent 1 and 2 slots, but how would I apply the chosen teams (teams 2 and 3 in this case) to these slots, and how should I handle the score variables, so that at the end of the match, the data is applied to the teams that played?

    I must mention that I'm very new at arrays, I just recently started working with them, so don't be too harsh on me I really like this game, and would like not just to remake it, but to improve it in many ways possible, but this is one of the major problems for me that needs to be solved.

  • First of all, if you have the time and you're by any chance a football/soccer fan, I would like that you give this game a try:

    (since I don't have 300 rep points, I cannot post an URL, so please google Soccer Cards PC, on manwithnomouth.com - latest version 1.42)

    It's a pretty fun game, mostly involving luck but sometimes even skill.

    Now my question is - can it be made with C2?

    At first sight, the game doesn't look that complex, the graphics are primitive and would be easily made with C2, but my main concern is generating the match outcome, and generating the schedule of the matches.

    Let's say that I have 4 teams to pick from, and I pick 2 that will play against each other. I've made 2 so far, and it works (both teams have inst. variables for matches played, wins, goals scored, points etc. which are at the end transferred to their respective cells in the array). But what if I want, let's say Team 2 vs. Team 4? How will I tell C2 that these teams are playing, and apply the post-match data to their variables? I'm thinking of a solution all day long, and just can't put my mind to anything. I was thinking of 2 slots, like ''opponent 1'' and ''opponent 2'', and then pick teams that will fill those slots, but how will the variables be handled still baffles me. I don't need any complex brainstorming, just a push in the right direction from someone who is more skilled with this tool.

    (Also, if you have already tested the game a bit, please take a look at some of the aspects of the game, most notably the Schedule, and possibly give me a slight hint or opinion how things should/could be made).

    Thanks in forward!

  • I can't say I understand everything 100% :/

    I've never worked with ratio...also, my values are not meant to be that round...my XP bar is 292 in width, and the MAXXP values are 100, 250, 500, etc. so a different amount is added between levels

    maybe a small capx would help? you've said that it could be done in one event...hope I'm not bothering you

  • OK, really simple: you have the XP amount, and the MAXXP amount, the bar follows the progress, when XP > MAXXP, player levels up, and the bar is reset. But somehow it doesn't work for me...the XP bar tutorial on Scirra's site doesn't cover the situation when you level up, it just has the same amount of XP and MAXXP, it doesn't add up anything in the process. In my example, normally the XP amount stays, for example at 100, and the MAXXP amount then changes to 200, that means that the bar is stuck halfway of the goal. So I tried this: adding a new variable, which gathers the XP in the same way and is set 0 when player levels up, and then works its way up to MAXXP, etc etc...but the bar does not work properly, as it reaches MAXXP it's usually stuck somewhere in the middle...meaning I'm most probably doing something wrong....I've also tried experimenting with the bar sprite width, but nothing good has come out of it...so what I need is the proper behavior of the XP bar, that it grows gradually and follows the XP and MAXXP amounts correctly. Thanks in forward!

  • If i accidentally encounter some inconsistencies, issues or bugs with the second option I'm using, I will definitely take a look at these and try to incorporate one of them. So thanks for clearing things up a bit

  • I might have forgot to point out the somewhat obvious fact, which is that at some point in the game, the MAXHP value will be increased (otherwise I wouldn't even include the MAXHP value meaning the maximum would always be 100, I was just taking that value as an example).

    So I guess the first option is out of the question. The second however is logical and works great for now.

    I didn't really get the third one, I tried it, but it didn't work, it just went way over MAXHP...

    Well as usual, it would be great if the number of events used is small enough to be effective. I'm grouping all these events separately so yeah, it should be pretty easy to spot it's position in the event sheet anytime

  • OK, the situation is as follows:

    1. There is a character with 2 stats, or in this case instance variables, pHP (player's health) and pMAXHP (player's maximum health), logically the player's health can not be larger than his maximum health at any given time.

    2. There is also a health potion, which restores 20 health to the character, if his HP amount is less than MAXHP.

    3. At some point the character's HP will be in a range of 81-100, leaving the question how to derive the needed number, for instance, the HP is 86, meaning that the potion sholud restore 14 HP. I was testing a few equasions, but none has seemed to work properly. So this is my way of saying 'yeah, I suck at math' and hoping that someone will end my misery.

    Thanks in forward!

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • anyone?