playMaker

Author Topic: Character/Squad Selection Setup  (Read 1302 times)

thedeafnick

  • Playmaker Newbie
  • *
  • Posts: 2
Character/Squad Selection Setup
« on: March 11, 2019, 12:58:30 PM »
Hello, this is my first time posting on the forum, so bear with me  :-[

I am currently working on my own turn-based rpg that is similar in playstyle to the older Final Fantasy games or Star Wars Galaxy of Heroes (but single-player). Before each battle I want to allow the player to choose 3 characters from a group of (perhaps) 10 and use those 3 characters in the battle (essentially choosing a squad). Each character will have unique abilities, stats, etc.

My question is: how would I go about making the 3 that are selected be the 3 that are used in the level? I already have prefabs made for each of the 10 choices. The only idea that came to my mind was to have a level for each possible combination and load the level that corresponds to the player's selection, but I'm sure there has to be a better, simpler way of doing this, I just don't know how.

Thank you.

Doh

  • Full Member
  • ***
  • Posts: 124
Re: Character/Squad Selection Setup
« Reply #1 on: March 11, 2019, 03:35:47 PM »
I'd probably have a manager scene that is always loaded, then have an FSM within that scene that holds a global array, in that array I'd store the current selection of characters, then when the actual arena level is loaded I'd have an FSM in the arena level that checks the global character array on start and loads each character into its starting position.
« Last Edit: March 11, 2019, 03:41:21 PM by Doh »

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7615
    • jinxtergames
Re: Character/Squad Selection Setup
« Reply #2 on: March 12, 2019, 05:38:16 AM »
Hi.
If you have like a canvas menu to select the players with buttons.

Then you could use 'ui button array Index' or 'ui button from array Index'
(you can find them on the Ecosystem)

Then have the characters in a certain order. and when a character is selected, save the index.

Then on the game scene have an array with the prefabs (or with strings with their prefab names, if you want to use resources load) in the same order as the buttons.

Then you can use the stored index to get the desired character(s)

thedeafnick

  • Playmaker Newbie
  • *
  • Posts: 2
Re: Character/Squad Selection Setup
« Reply #3 on: March 17, 2019, 03:01:42 PM »
Hey guys, I'm very sorry for the late response, I'm a student with a full-time job, so I don't get to work on my own projects as often as I'd like.

Thank you both for your replies, I went ahead and implemented Doh's idea of using a GameObject array and checking the array upon loading the arena level. I haven't run a full thorough testing of it yet, but it seems to work pretty well so far.

Thank you!