LoginLogin
Might make SBS readonly: thread

RPG Help.

Root / Programming Questions / [.]

Z_E_R_OCreated:
Hello! I am back again... Yay right? Sorry... Anyways into the question. Im really trying to break it down and give you all the information needed to help sorry if I sound stupid.) I've actually asked this question before for the smilebasic on 3DS but now I find myself needing the help again. I'm trying to an RPG system to work where I need 3 empty slots and then Enemy information fills the slots. I know how to do partners and other systems. However I have always been terrible with arrays and it shows once again.

Any RPG system would need plenty of arrays, otherwise you’d end up with lots of variables that become difficult to distinguish. I’ll sort of walk through how I did it in my current project but it might get lengthy. I’ll explain the concept rather than give the code so you can investigate/learn on your own. For my system, I read map data that includes a 4x3 string array of enemy groups. The first index is a group (so up to 4 groups) and the second index contains the monster names in the group (up to 3 monsters). The battle function chooses a group at random and restores/reads labels equal to the monster names in index 2. The data in the label includes sprite number, stats, stat scaling, and behavior. I use a for/next loop to place the sprites in their designated x,y locations (also an array). Say if an enemy group only contains 1 monster, I set monster 1 and 3 on index 2 of the enemy formation array to “Null” which skips restoring the monster label and does not place a sprite. I hope this helps. I would recommend skimming the forums about how to use arrays.

Any RPG system would need plenty of arrays, otherwise you’d end up with lots of variables that become difficult to distinguish. I’ll sort of walk through how I did it in my current project but it might get lengthy. I’ll explain the concept rather than give the code so you can investigate/learn on your own. For my system, I read map data that includes a 4x3 string array of enemy groups. The first index is a group (so up to 4 groups) and the second index contains the monster names in the group (up to 3 monsters). The battle function chooses a group at random and restores/reads labels equal to the monster names in index 2. The data in the label includes sprite number, stats, stat scaling, and behavior. I use a for/next loop to place the sprites in their designated x,y locations (also an array). Say if an enemy group only contains 1 monster, I set monster 1 and 3 on index 2 of the enemy formation array to “Null” which skips restoring the monster label and does not place a sprite. I hope this helps. I would recommend skimming the forums about how to use arrays.
Thank you! I'll try to learn how to undex things.. platformers and open world enemies are so much easier with Data management and For statements. I've always wanted to do this kind of system and the only hang up has been multiple enemies in the system. I'll try to learn. Thanks again.

I'm probably gonna stick to one enemy for this until I get better at arrays XD