 |
Castle Paradox
|
View previous topic :: View next topic |
Author |
Message |
Fullcircle

Joined: 09 Jan 2010 Posts: 9
|
Posted: Tue Feb 02, 2010 11:59 am Post subject: Allowing the player to set the value of a Global Constant. |
|
|
If you've ever played one of the recent Elder Scrolls games, any Fallout game, or any paper and pencil RPG, then you may remember how at the beginning of the game the player sets their own stats by allocating points from a pool. I would like to implement this in my game, and am a little lost as to how.
These stats are entirely inapplicable to combat, and are used only for stat checks that affect whether or not your character can perform certain actions (if you're strong enough to lift the fallen tree off of your partner, for instance). The normal OHR stats apply to combat. My first thought was to run a script at the beginning of the game making these stats global constants which are checked upon stat checks, but I can't find a command (or combination of commands) which allows players to set the value of the constants. There's no need to write an entire script for me or anything, but it would be nice to be pointed in the right direction. _________________ Currently in the process of getting competent with the OHR. |
|
Back to top |
|
 |
Moogle1 Scourge of the Seas Halloween 2006 Creativity Winner


Joined: 15 Jul 2004 Posts: 3377 Location: Seattle, WA
|
Posted: Tue Feb 02, 2010 3:50 pm Post subject: |
|
|
"Constant" -> does not change. You want variables.
What you're asking is not difficult. You should check out some of the HamsterSpeak tutorials online and come back if you have more specific questions.
Wiki: http://gilgamesh.hamsterrepublic.com/wiki/ohrrpgce/index.php/Plotdict (there is a tutorial on the wiki, but it is down, so I don't have the URL)
Moglery: http://moogle1.castleparadox.com/scripts.php (warning: old)
I recommend the wiki's info, since it is more recent, but if you absolutely can't access it and really need to learn plotscripting soon, you can use the ancient tutorial behind the second link. _________________
|
|
Back to top |
|
 |
TMC On the Verge of Insanity
Joined: 05 Apr 2003 Posts: 3240 Location: Matakana
|
Posted: Tue Feb 02, 2010 8:01 pm Post subject: |
|
|
The quickest, dirtiest solution is to use input string and number from string, like so:
Code: | global variable (1, my stat)
# puts the result in string #0
input string (0)
my stat := number from string (0) |
But there's much more polish you can apply, like not allowing the player to input garbage text (which will result in a value of 0) _________________ "It is so great it is insanely great." |
|
Back to top |
|
 |
Spoon Weaver

Joined: 18 Nov 2008 Posts: 421 Location: @home
|
Posted: Wed Feb 03, 2010 5:45 pm Post subject: Re: Allowing the player to set the value of a Global Constan |
|
|
Fullcircle wrote: | If you've ever played one of the recent Elder Scrolls games, any Fallout game, or any paper and pencil RPG, then you may remember how at the beginning of the game the player sets their own stats by allocating points from a pool. I would like to implement this in my game, and am a little lost as to how.
These stats are entirely inapplicable to combat, and are used only for stat checks that affect whether or not your character can perform certain actions (if you're strong enough to lift the fallen tree off of your partner, for instance). The normal OHR stats apply to combat. My first thought was to run a script at the beginning of the game making these stats global constants which are checked upon stat checks, but I can't find a command (or combination of commands) which allows players to set the value of the constants. There's no need to write an entire script for me or anything, but it would be nice to be pointed in the right direction. |
There's a lot of ways to do this.
The way the games you're describing do it, requires a mouse. This isn't impossible but it would be kind of odd if it was the only part of your game with a mouse.
Another way would be menus, this way would be a lot easier to code but might prove tricky in the display.
A fake menu made of NPC's on a blank map might end up looking and handling the best. This process would be as involved as the mouse one scripting wise, and would also take up map and might cause a lot of bugs if not handled correctly.
Another way to do it that would be fairly simply would be to give the player a certain number of items. When the player uses the items a menu appears giving the player a choice between all the stats in question. The player chooses the stat and then the stat gets raised and the item goes away. The player can repeat this process once for each item you start them with. This way also allows you to reward the player with more points, which would be difficult any other way you did it.
I'm sure there's other ways of doing this. You need to choose one. If you still need help, I'd be glad to lend a hand. |
|
Back to top |
|
 |
|
|
You can post new topics in this forum You can reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|