Okay, I'm working on this project right now where I have a bunch of stats recorded in a struct/array and I want to copy them all instantly to an array that uses the same stats, but I don't know how.
Although my knowledge of the terms is not exactly ideal, I can give a general idea. Basically, I have a struct MyStatsStruct and arrays mychar[30] and battchar[10].
In a battle, the battchar stats act as dummies, allowing the characters to be in a different order and allowing some automation of functions.
So, let's say MyStatsStruct includes the properties hp, hpmax, spdmax, spd, sp, spmax, etc. I first check which characters are first, second, third and fourth in the roster, and then set the stats of each dummy to that of the corresponding character using aditional "id" property.
So, for example, if battchar[1].id = 4, then I set battchar's hp hpmax, and so on to be equal to mychar[4].
Well, I can do this manually so that each of the 40 stats or so is copied from mychar to battchar accordingly, but this is going to be very unweildy very quickly. Both arrays already share the same struct. battchar has properties .hp, .hpmax, .sp, .spmax etc, as does mychar.
What I am looking for is a way to copy all of the stats from one array to another that shares the same properties. I can only see it in dos language, but there it would look like:
battchar[1].* = mychar[4].*;
Is this possible? How can I accomplish this, and am I even going about it in a way that AGS will interpret correctly?
Thanks
Although my knowledge of the terms is not exactly ideal, I can give a general idea. Basically, I have a struct MyStatsStruct and arrays mychar[30] and battchar[10].
In a battle, the battchar stats act as dummies, allowing the characters to be in a different order and allowing some automation of functions.
So, let's say MyStatsStruct includes the properties hp, hpmax, spdmax, spd, sp, spmax, etc. I first check which characters are first, second, third and fourth in the roster, and then set the stats of each dummy to that of the corresponding character using aditional "id" property.
So, for example, if battchar[1].id = 4, then I set battchar's hp hpmax, and so on to be equal to mychar[4].
Well, I can do this manually so that each of the 40 stats or so is copied from mychar to battchar accordingly, but this is going to be very unweildy very quickly. Both arrays already share the same struct. battchar has properties .hp, .hpmax, .sp, .spmax etc, as does mychar.
What I am looking for is a way to copy all of the stats from one array to another that shares the same properties. I can only see it in dos language, but there it would look like:
battchar[1].* = mychar[4].*;
Is this possible? How can I accomplish this, and am I even going about it in a way that AGS will interpret correctly?
Thanks
