playMaker

Author Topic: Choosing a Character Class... Suggestions?  (Read 1330 times)

Red

  • Hero Member
  • *****
  • Posts: 563
    • View Profile
Choosing a Character Class... Suggestions?
« on: September 04, 2012, 06:05:59 AM »
So, the game i'm making is coming along well... and in it i have character classes that the player can choose from. since i'm not using UnityPro, i don't have access to asset-bundles so i think i've found a way to work around that (though i'm not sure if asset bundles would be the best way of doing it anyway but still....)

So, character select screen... you choose your class and when you do, it uses a global vector3 variable and stores the number as a float in there. i chose to use these as they persist over different levels as well as the fact that i can also store the health and experience so that those also persist between levels... and any time i need to access them, i just use a "get vector3" action and just choose the appropriate value and work from there. from there, in the level, i have a matrix of all possible character classes in one object (it's huge) and it pares down the list to the appropriate character, weapons and such.

so, example

at start:

Player matrix
-player Geo
--class 1
--class 2
--class 3
-player weapons
--class 1's weapon 1
--class 1's weapon 2
--class 1's weapon 3
--class 2's weapon 1
--class 2's weapon 2
--class 2's weapon 3
--class 3's weapon 1
--class 3's weapon 2
--class 3's weapon 3

(there are more than that but this is for example)

after the game is started it runs through the list and deletes so you have (assuming you've picked class 2)

Player Matrix
-player Geo
--class 2
-player weapons
--class 2's weapon 1
--class 2's weapon 2
--class 2's weapon 3

I was thinking that this might be a bit on the beefy side and i was wondering if there are ways that i could rearrange this so that instead of deleting the non-appropriate items, i'd be spawning them... but this would be a massive retooling of the system i have in place and i would like to know some suggestions before i go ahead and try it (i can easily just create a new player matrix but that's still a week's worth of node-pushing anyway.)

so, what do you think? which would you suggest? all of this happens within the first second of the game and there's a fade-in of the camera which would hide the things that i don't want the player to see... but i still think this is a bit of a hack.
« Last Edit: September 04, 2012, 06:09:22 AM by Red »

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15377
  • Official Playmaker Support
    • View Profile
Re: Choosing a Character Class... Suggestions?
« Reply #1 on: September 04, 2012, 06:40:21 AM »
Hi,

 by class you mean components right? if that the case, I would go for nested gameObjects each responsible for hosting a "class",

PLAYER
 -- CLASS 1
      -- WEAPON 1
      -- WEAPON 2
      -- WEAPON 3
 -- CLASS 2
      -- WEAPON 1
      -- WEAPON 2
etc

this way, you can first have your player totally empty, and simply attach to the player the selected class, and in turns the selected weapons.

Does that sound like doable?

bye,

 Jean

Red

  • Hero Member
  • *****
  • Posts: 563
    • View Profile
Re: Choosing a Character Class... Suggestions?
« Reply #2 on: September 05, 2012, 04:46:13 AM »
it does. i'll see about cobbling something like this together.