Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
1
Question by Nekrell · Feb 24, 2021 at 12:49 AM · charactersave datacharacterscreationcharacter customization

How to implement a party creation system?

I would like to implement in my game a party creation system like those seen in old rpg games like Wizardry 8 or Might and Magic 6/7/10. I'm not talking about skin customization, i will just give some sprite and voice choice for that. I want to make a party creation in which the player can set the stats, starting skills, race and class of 2 or more characters and instantiate those characters in one single body with multiple health bars.

i've learned how to make a character creation screen and how to save the character ready to get in the game, but i cannot find indications on how to manage multiple characters the same way for one single player body.

Is someone aware of a method? or maybe a link to a tutorial. Thanks in advance!

Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

2 Replies

· Add your reply
  • Sort: 
avatar image
2

Answer by pauldarius98 · Feb 24, 2021 at 08:02 PM

You could use inheritance. For example, you could start from this:

 public abstract class CharacterClass
 {
     public abstract ISkill startingSkill { get; }
     public abstract Race race { get; }
     public abstract float MaxHealth { get;  }
 }
 
 public class Wizzard : CharacterClass
 {
 
     public override float MaxHealth => 50;
 
     public override ISkill startingSkill => FireBall;
 
     public override Race race => SomeRace;
 }
 
 public class Archer : CharacterClass
 {
 
     public override float MaxHealth => 50;
 
     public override ISkill startingSkill => ArrowsRain;
 
     public override Race race => SomeOtherRace;
 }

You define a base abstract class with the fields that you want to have and then you create derrived classes which represent the actual character types. Then, in the body you have an CharacterClass which can be changed to any derived simply trough refference (like below)

 public class Body
 {
     public CharacterClass currentClass;
 
     public void ChangeClass(CharacterClass newClass)
     {
         currentClass = newClass;
     }
 }
 
 public class Test
 {
     Body body = new Body();
     body.ChangeClass(new Wizzard()); //Now you have a wizzard
     body.ChangeClass(new Archer()); //Now you have an archer
 }

This is just a small example to give you an idea of how you could implement. I suggest you to take a look at Inheritance, Composition, Interfaces (very usefull for Skills for example) and Abstract classes

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image
0

Answer by Nekrell · Feb 24, 2021 at 11:09 PM

Thank you very much! it will help a lot! But i'm going to keep the question open to more answers to come, in case someone can suggest some more ideas about managing a party of characters during and after the creation.

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

157 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Caracter customization 1 Answer

How can I change character? 0 Answers

Unity networking create & join with custom character?, 0 Answers

Character Creation Screen 2 Answers

Should I have a root bone? 0 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges