Creating Character Classes With Set Stats

QuantumShenanigans
13 Feb 2016, 18:38
Greetings,

My idea was to allow the player to choose a primary class with certain set stats and a secondary class that would provide a boast to certain stats. However, I am unsure how to go about doing this, thus I was wondering if someone could inform me of how one could go about doing this or if it is even possible.

Thank you in advance for the help. :)

Cylius_Optimi
13 Feb 2016, 20:34
It sounds like the Object Types system would be about right for you.

If you're using the GUI, you can find it in "Advanced". Any attributes you add to an object type will also be added to any object (including player objects) that you inherit it to. In addition, you can inherit other types to a type, in a sort of type-tree.

If Object Types doesn't cut it, you can use the following to just add or change variables for the current player object:
game.pov.AttributeName = 12345

or, if you want to simply boost stats:
game.pov.AttributeName = game.pov.AttributeName + 12345

Similarly, you can decrease stats with:
game.pov.AttributeName = game.pov.AttributeName - 12345

Anonynn
13 Feb 2016, 22:17
It can be done, but it's an extremely involved process ^_^ quite complicated! There are numerous ways to go about doing it, I may be able to start you on one of them --- if I can remember how to do it correctly. I'll make it an easy step by step for you.

*First, to make things easier for you in the long run. Create a word document/or excel spreadsheet called "Full Data Extended List"
**Second, write down ALL of the stats you'll want to be using. For example,
Strength
Agility
Defense
etc
***Third, write down ALL of the races, and then divide the stats among them exactly as you would like to make them appear in the game. Trust me, this will all save you TONS and TONS of time in the long run. Use this Document/Spreadsheet and add changes to it accordingly as you create your game, in case you want to go back later and add stuff to it.

With that said...we can get started.

I imagine you'll want to allow the player to name their character? If not, you can skip this step.
First
Go to your "Tree of Stuff" and click on "game"
Second, select the "Script" tab.
Next under "Start Script", create a "Get Input Script"
Inside that script put this code.
player.alias = result
ClearScreen
msg ("<br/>Pleased to meet you, {player.alias}.<br/>")
AskQuestion


And that should allow the player to name themselves.

For the Creation Process...you may want to define your stats first.
Strength
Defense
etc.

So to add them to the "Player Pane Window" (so that the player can see it)
You go to your "tree of stuff", select "player" and select the "Attributes" tab.
After that, you'll see three groups of data --- "Status Attributes", "Inherited Types", and "Attributes"
Go to the "Status Attributes" and select "Add"

Now you'll need a "key" and a "value"
Key Value (the value is what the player will see in the player pane while playing the game)
strength Strength: !
defense Defense: !
etc

After adding in all the stats you're going to use for these races, you move on down to the "Attributes".
From here...
Add
Name Value
race unknown (string)
strength 0 (integer)
defense 0 (integer)
etc

*BTW SPELLING IS IMPORTANT AND SO IS CONSISTENCY. IF YOU SPELL SOMETHING WITH A LOWER CASE or WITH UNDERSCORES, you MUST BE CONSISTENT. For example,
strength of arms
Strength of Arms
strength_of_arms
Strength_of_arms
Strengthofarms

^ these are ALL different according to Quest. So if you put something in the status attributes "keys" as a lowercase, then the attributes must match, and so must all objects having to do with what you're creating, otherwise nothing will work.

Anyway....

Now, create a "Object" called fulldata (or whatever you want to call it)
Next, in that "parent" create another "Object" called race
After that, select race --- and find the "Attributes Tab" and then "Attributes.
Add
Name Value
list (find and select "string list")
Add
human
elf
etc.

Next, you may want to add descriptions to the "Set-Up Tab" of race and let the player know what stats they'll be getting when they choose a particular race, or you can add descriptions there, etc.

From there...I forget what to do. I hope this helps get you started though!

Cylius_Optimi
13 Feb 2016, 22:20
Quick correction for you:
Neonayon wrote:
player.alias = result
ClearScreen
msg ("<br/>Pleased to meet you, {player.alias}.<br/>")
AskQuestion

should probably be
get input {
player.alias = result
ClearScreen
msg ("<br/>Pleased to meet you, {player.alias}.<br/>")
AskQuestion
}

QuantumShenanigans
14 Feb 2016, 01:07
Thank you both for your help. :)

I do have a question about the Object Types system though, how would I go about inheriting objects to an object type in game? Like if the player starts out with no class but than chooses their class later in the game.

Also, I figure I should ask this here rather than start a whole new thread, I have went and made a couple of different things invisible, one exit and one object. With both, I made them visible again with the "Make object visible" script but they would only appear in "Places and Objects" panes and not in the exit or object list. I can't really figure out why this is happening and it kind of looks bad given what I was using them for.

Cylius_Optimi
14 Feb 2016, 01:25
QuantumShenanigans wrote:Thank you both for your help. :)

I do have a question about the Object Types system though, how would I go about inheriting objects to an object type in game? Like if the player starts out with no class but than chooses their class later in the game.


That's the question, 'ennit?

QuantumShenanigans wrote:Also, I figure I should ask this here rather than start a whole new thread, I have went and made a couple of different things invisible, one exit and one object. With both, I made them visible again with the "Make object visible" script but they would only appear in "Places and Objects" panes and not in the exit or object list. I can't really figure out why this is happening and it kind of looks bad given what I was using them for.


If you want to make an exit visible or invisible, you should use the Make exit {visible|invisible} script, not the object one.

QuantumShenanigans
14 Feb 2016, 02:51
Cylius_Optimi wrote:That's the question, 'ennit?


I believe I may have messed up my wording my question. :? What I meant to ask is more in how to go about setting up a "type-tree." I can figure out how to make various object types but I'm having trouble figuring out where to go from there, how I might go about allowing the player-object to inherit the type.


Cylius_Optimi wrote:If you want to make an exit visible or invisible, you should use the Make exit {visible|invisible} script, not the object one.


My apologizes, I really should have read back over that question before I posted it. Nevertheless, I was toying with it some more and found that there was nothing wrong, just my inexperience causing confusion.

Cylius_Optimi
14 Feb 2016, 03:13
QuantumShenanigans wrote:

"Cylius_Optimi"

That's the question, 'ennit?



I believe I may have messed up my wording my question. :? What I meant to ask is more in how to go about setting up a "type-tree." I can figure out how to make various object types but I'm having trouble figuring out where to go from there, how I might go about allowing the player-object to inherit the type.



Ah, I thought you were referring to adding a type to an object via script. Basically, object types act like an object; you can simply use the top pane to add inherited types to the object. Any values altered will take precedence over those inherited. For example, a type 'complex' with a string 'test' equal to "These are some words that this string uses."; that inherits a type 'basic' with a string 'test' equal to "Test Message", will never return "Test Message".

QuantumShenanigans wrote:

"Cylius_Optimi"

If you want to make an exit visible or invisible, you should use the Make exit {visible|invisible} script, not the object one.



My apologizes, I really should have read back over that question before I posted it. Nevertheless, I was toying with it some more and found that there was nothing wrong, just my inexperience causing confusion.



Gotcha.

jaynabonne
14 Feb 2016, 09:14
If you want the player to be able to assign a class at run time, you can't use types. There is no way to manipulate types in script. In other words, you can assign a type statically at game authoring time, but you can't dynamically change or assign type while in a game.

The way I have done it is to create an object per class that I want my player to be able to choose from. Then at run time, I have an attribute on the player called something like "race" that will eventually be assigned one of those objects. Then whenever you need to access a class-based trait, you have to go one level of indirection, for example:

hits = player.race.max_hits

That's one way, at least, to do it. The other is to have objects as above with traits, and when the player picks one, copy all the traits from that race/class object to the player.

The Pixie
14 Feb 2016, 14:51
jaynabonne wrote:... The other is to have objects as above with traits, and when the player picks one, copy all the traits from that race/class object to the player.

Or change game.pov (i.e., the player-object) to that race/class object.

jaynabonne
14 Feb 2016, 15:35
True! :)

QuantumShenanigans
14 Feb 2016, 21:34
Okay, that all makes way more sense. Thank you all very much for the help. :)