View previous topic :: View next topic |
Author |
Message |
KainMinter *~*

Joined: 10 Jan 2004 Posts: 155 Location: Austin
|
Posted: Sun Jul 11, 2004 10:21 pm Post subject: Reading current money....? |
|
|
I have been making a custom menu for my game, and I wanted to include the player's "Gil"(Money) at the bottom in the main menu. Problem is, I haven't been able to figure out if there is a plot scripting command or constant that references the current amount of money on hand.
Any one have any advice for me? |
|
Back to top |
|
 |
Iblis Ghost Cat

Joined: 26 May 2003 Posts: 1233 Location: Your brain
|
Posted: Sun Jul 11, 2004 10:56 pm Post subject: |
|
|
I think you could use "pay money" to check how much gold you have. You could use a loop and keep incrementing how much it's checking for and then stop when the command returns false. Or you could start at 32767 decrement the value until it returns true. Once you're done you use "get money" to give yourself back what you just paid
To get around the 32767 limit, you'd have to have multiple loops. If it went all the way to 32767 in the first loop you could start a second loop and keep the result from that in a separate variable, then when it's done you can get the money from both variables.
I dunno how long it would take to calculate it if you had a really huge amount of money, it might be too slow. |
|
Back to top |
|
 |
Guest
|
Posted: Sun Jul 11, 2004 11:06 pm Post subject: |
|
|
thats still better than nothing... thanks man ^^
I'll give that a shot and hope for the best.
I've also just realized there is no way to look up exp or exp to next level... could you tell me if you know any way around that? |
|
Back to top |
|
 |
KainMinter *~*

Joined: 10 Jan 2004 Posts: 155 Location: Austin
|
Posted: Sun Jul 11, 2004 11:17 pm Post subject: |
|
|
Oops. didnt realize I wasnt logged in.. -_- |
|
Back to top |
|
 |
TMC On the Verge of Insanity
Joined: 05 Apr 2003 Posts: 3240 Location: Matakana
|
Posted: Mon Jul 12, 2004 1:06 am Post subject: |
|
|
No, there is no way to return exp.
See, both exp required and money are values that are potentially greater than 32767, so they are stored in a 32 bit integers, which plotscripting can't handle. So such functions are ommited from the language.
And theres no way around it, other then painfully running an instead of battle script for every battle and hard coding in the amount of experience to be gained and subtracting from total required for every hero (emulating 32 bit integer math) after dividing by the number of heros left alive afterwards and whether or not they ran... _________________ "It is so great it is insanely great." |
|
Back to top |
|
 |
Aethereal SHUT UP. Elite Designer


Joined: 04 Jan 2003 Posts: 928 Location: Gone! I pop in on occasion though.
|
Posted: Mon Jul 12, 2004 4:34 am Post subject: |
|
|
Hmm...maybe I should write a checkmoney() function for the plotscripting command library. Y'know what, I'll do that when I get home. _________________
 |
|
Back to top |
|
 |
KainMinter *~*

Joined: 10 Jan 2004 Posts: 155 Location: Austin
|
Posted: Mon Jul 12, 2004 5:33 am Post subject: |
|
|
actually, that does make a lot of sense.I'll atempt to write a money script for my menu also then, that returns the each place up to 100,000s and probably set the gil to max out at either 250,000 or 999,999, depending on lag time when loading up the menu. If its still too slow loading with a 250,000 max, then I'll just have to give up on the idea of having the gil there all together I guess =\
Itd be nice to replace that 0 next to the gil. |
|
Back to top |
|
 |
RPGCreations E Pluribus Unum

Joined: 18 May 2003 Posts: 345
|
Posted: Mon Jul 12, 2004 2:42 pm Post subject: |
|
|
Aethereal wrote: | Hmm...maybe I should write a checkmoney() function for the plotscripting command library. Y'know what, I'll do that when I get home. |
such a command has been available in the Third Party HSI since it's inception.
Quote: | have money(amount,strictness)
Checks to see if the player has the amount of money specified. By default the check is loose, meaning it will return true if the amount of money the player has is equal or greater than the amount checked for. Using strict as your second arguement, however, will only return true if they have the exact amount. |
http://www.hamsterrepublic.com/ohrrpgce/miscfiles.php
Posting from work. _________________
 |
|
Back to top |
|
 |
KainMinter *~*

Joined: 10 Jan 2004 Posts: 155 Location: Austin
|
Posted: Mon Jul 12, 2004 3:58 pm Post subject: |
|
|
ooh, thats neat to know about the 3rd party plot scripting commands.
can you tell me anything about this one? (Found in the same list you pointed out.)
digit(num,digit)
Returns a digit in num
I have a feeling that i can reduce the length of my code drastically if this is what I think it is ^o^ * |
|
Back to top |
|
 |
RPGCreations E Pluribus Unum

Joined: 18 May 2003 Posts: 345
|
Posted: Mon Jul 12, 2004 4:57 pm Post subject: |
|
|
Yep. It'll return the nth digit in a number, so if you do
digit(1456,3)
it will return 5.
posting from work _________________
 |
|
Back to top |
|
 |
TMC On the Verge of Insanity
Joined: 05 Apr 2003 Posts: 3240 Location: Matakana
|
Posted: Tue Jul 13, 2004 1:24 am Post subject: |
|
|
Actually, it starts counting digits from the right of the number, first digit is digit one -
digit(1456,3) will return 4, and
digit(12345,4) is 2.
Also, if you pass it a negative number, it'll return the digit correctly, but negative. _________________ "It is so great it is insanely great." |
|
Back to top |
|
 |
KainMinter *~*

Joined: 10 Jan 2004 Posts: 155 Location: Austin
|
Posted: Tue Jul 13, 2004 11:27 am Post subject: |
|
|
Holy crap thank you ^o^!!!
That is very awsome! Thanks for explaining it. |
|
Back to top |
|
 |
RPGCreations E Pluribus Unum

Joined: 18 May 2003 Posts: 345
|
Posted: Tue Jul 13, 2004 2:16 pm Post subject: |
|
|
Silly me. I was thinking of the number as an array.
Oh, and TMC, please PM me your Third Party HSI update to me on here or CPX, thanks. _________________
 |
|
Back to top |
|
 |
|