Visual Novel Maker

Visual Novel Maker

Muntz Jan 18, 2018 @ 4:32am
Player stats: Parameters or Variables?
I'm new to the program (and an inexperienced developer), and I'm still trying to get a grasp on a lot of it. One thing that I'm wondering is: When it comes to player attributes (e.g Strength, INT, whatever), I'm looking at Variables vs Character Parameters and I'm wondering which is better long term.

Does either one have more flexibility when it comes to manipulating or calling or whatever? I don't want to commit to one early and then find out that I should've gone down the other route.
Originally posted by Rebecca Kalista:
Assuming I'm reading the manual right:

(Character) Parameters can't be directly interacted with in conditionals / scene content instructions. Instead, you have to use Get Parameter and Set Parameter to interact with them:

- Get Parameter reads a character's Parameter and stores it in a Variable, which can then be used to perform Conditionals and the likes.
- Set Parameter sets a character's Parameter to the value of an existing Variable.

Character Parameters are particularly useful if they actually relate to characters (or other entities), as they allow you to keep your Global/Persistent Variable fields "clean" (which is pretty good practice if you care about "writing good code"), but using them requires a couple more lines of code in the Scene Content (you can put that in Common Events, and I encourage you to read up about these in the manual - look for Parametric Common Events).

With that being said, if there is only one character with stats, it's "acceptable" to just store these in Global Variables. This will require more careful management of the Global Variable field (and I'd argue it's probably not optimal), but ultimately if you're able to find your way around your code you're probably fine.

----

An library analogy/metaphor to try and help you better "get" what the jargon means:

- VNM-engine is a person sitting at a table and reading through your instructions (Scene Content).
- VNM-engine knows three kinds of Variables. Local Variables are post-its they use to make quick calculations (they are discarded afterwards), Global Variables are sheets of paper they keep at hand's reach to be able to check and edit them at all times, Persistent Variables are words engraved on the library's walls (they're always there, including when VNM-engine leaves the room and returns a couple days later in another save file).
- Character Parameters are data stored in books. When VNM-engine needs to check them, they go retrieve the relevant book, open it, read the data, write it somewhere (in a Variable) to remember it, and occasionally modify the book itself before putting it back on its shelf if the data needs updating.
- VNM-engine prefers to store things they don't need to remember at all times in books (Character Parameters), because this keeps their workspace (Variables) clean. But that's not a necessity, just a preference.
< >
Showing 1-6 of 6 comments
The author of this topic has marked a post as the answer to their question.
Rebecca Kalista Jan 18, 2018 @ 6:24am 
Assuming I'm reading the manual right:

(Character) Parameters can't be directly interacted with in conditionals / scene content instructions. Instead, you have to use Get Parameter and Set Parameter to interact with them:

- Get Parameter reads a character's Parameter and stores it in a Variable, which can then be used to perform Conditionals and the likes.
- Set Parameter sets a character's Parameter to the value of an existing Variable.

Character Parameters are particularly useful if they actually relate to characters (or other entities), as they allow you to keep your Global/Persistent Variable fields "clean" (which is pretty good practice if you care about "writing good code"), but using them requires a couple more lines of code in the Scene Content (you can put that in Common Events, and I encourage you to read up about these in the manual - look for Parametric Common Events).

With that being said, if there is only one character with stats, it's "acceptable" to just store these in Global Variables. This will require more careful management of the Global Variable field (and I'd argue it's probably not optimal), but ultimately if you're able to find your way around your code you're probably fine.

----

An library analogy/metaphor to try and help you better "get" what the jargon means:

- VNM-engine is a person sitting at a table and reading through your instructions (Scene Content).
- VNM-engine knows three kinds of Variables. Local Variables are post-its they use to make quick calculations (they are discarded afterwards), Global Variables are sheets of paper they keep at hand's reach to be able to check and edit them at all times, Persistent Variables are words engraved on the library's walls (they're always there, including when VNM-engine leaves the room and returns a couple days later in another save file).
- Character Parameters are data stored in books. When VNM-engine needs to check them, they go retrieve the relevant book, open it, read the data, write it somewhere (in a Variable) to remember it, and occasionally modify the book itself before putting it back on its shelf if the data needs updating.
- VNM-engine prefers to store things they don't need to remember at all times in books (Character Parameters), because this keeps their workspace (Variables) clean. But that's not a necessity, just a preference.
Last edited by Rebecca Kalista; Jan 18, 2018 @ 6:27am
Archeia  [developer] Jan 18, 2018 @ 11:18am 
Both are fine. Character Parameters however are unique to each one and would save you some global variable space.
Last edited by Archeia; Jan 18, 2018 @ 11:18am
Muntz Jan 19, 2018 @ 4:02am 
Thanks for the responses. Especially Rebecca's. Fantastically in-depth and informative. Acheia, cheers for the confirmation, straight from a dev's mouth! I appreciate both of you!
Cocosoy Jan 19, 2018 @ 7:10pm 
This post has been really helpful. I have a futhur question that kind relate to this.

Let's say I have the following scenes: A, B1, B2, B3, C.

An option will be presented in Scene 1 with 3 branching results in jumping into B1, B2 or B3. But all of them will eventually proceed into scene C. However, different things happen in scene B1/B2/B3 which should cause part of the dialogues to be different in Scene C. How do I achieve that with variables? or should I use paramenters?

To clarify, I don't want scene B1/B2/B3 proceed into C1/C2/C3. I want them all go to scene C, but with different dialogues or options.

Thanks in advance!
Rebecca Kalista Jan 19, 2018 @ 7:42pm 
Originally posted by Cocosoy:
This post has been really helpful. I have a futhur question that kind relate to this.

Let's say I have the following scenes: A, B1, B2, B3, C.

An option will be presented in Scene 1 with 3 branching results in jumping into B1, B2 or B3. But all of them will eventually proceed into scene C. However, different things happen in scene B1/B2/B3 which should cause part of the dialogues to be different in Scene C. How do I achieve that with variables? or should I use paramenters?

To clarify, I don't want scene B1/B2/B3 proceed into C1/C2/C3. I want them all go to scene C, but with different dialogues or options.

Thanks in advance!

For that kind of stuff, you probably want to use Variables (specifically Global Switches) rather than Character Parameters. Have B1, B2 and B3 toggle the relevant switches, and check against them with conditionals in C.

In pseudo-code:

- B1 sets Switch 1, B2 sets Switch 2, B3 sets Switch 3.
- When needed, C checks which Switch is up with a Conditional and jumps to the relevant label. It then jumps to a "common" label when returning to common flow.

Strictly speaking, you can use any Variable kind (for instance: a check against a Luck stat's value), but for what you're describing Switches seem best as they're exclusively ON/OFF.
Last edited by Rebecca Kalista; Jan 19, 2018 @ 7:44pm
Cocosoy Jan 20, 2018 @ 2:26am 
Originally posted by Rebecca Kalista:
Originally posted by Cocosoy:
This post has been really helpful. I have a futhur question that kind relate to this.

Let's say I have the following scenes: A, B1, B2, B3, C.

An option will be presented in Scene 1 with 3 branching results in jumping into B1, B2 or B3. But all of them will eventually proceed into scene C. However, different things happen in scene B1/B2/B3 which should cause part of the dialogues to be different in Scene C. How do I achieve that with variables? or should I use paramenters?

To clarify, I don't want scene B1/B2/B3 proceed into C1/C2/C3. I want them all go to scene C, but with different dialogues or options.

Thanks in advance!

For that kind of stuff, you probably want to use Variables (specifically Global Switches) rather than Character Parameters. Have B1, B2 and B3 toggle the relevant switches, and check against them with conditionals in C.

In pseudo-code:

- B1 sets Switch 1, B2 sets Switch 2, B3 sets Switch 3.
- When needed, C checks which Switch is up with a Conditional and jumps to the relevant label. It then jumps to a "common" label when returning to common flow.

Strictly speaking, you can use any Variable kind (for instance: a check against a Luck stat's value), but for what you're describing Switches seem best as they're exclusively ON/OFF.

Many thanks Rebecca, I will check it out!
< >
Showing 1-6 of 6 comments
Per page: 1530 50

Date Posted: Jan 18, 2018 @ 4:32am
Posts: 6