View previous topic :: View next topic |
Author |
Message |
Spoon Weaver

Joined: 18 Nov 2008 Posts: 421 Location: @home
|
Posted: Tue Nov 18, 2008 5:59 pm Post subject: Changing the level gain of FF1 style spells? |
|
|
I'd love to be able to let my little rpg characters to use ff1 style spells but I don't really like the amount gained where it's gain at which level. So instead of browsing the source code for hours upon hours I figured I'd ask to see if I could get a clue as to where to find said code, or maybe if I was lucky, someone would do ( or has already done ) the work for me.
thank you for your time. |
|
Back to top |
|
 |
Robot Skeleton King

Joined: 20 Oct 2008 Posts: 72
|
Posted: Wed Nov 19, 2008 8:23 am Post subject: |
|
|
Just an option:
You could make spells items, and then make a script to give you the correct amount if you stay in an inn. _________________ ---
8bitcity.blogspot.com |
|
Back to top |
|
 |
Calehay ...yeah. Class B Minstrel

Joined: 07 Jul 2004 Posts: 549
|
Posted: Wed Nov 19, 2008 3:44 pm Post subject: |
|
|
You can actually control the amount of level MP using plotscripting, so there probably is no reason to dig into the source for what you are trying to do. The commands "get level mp" and "set level mp" will control this. I was going to write an example code, but I'm not quite sure exactly what you want to do with it yet. _________________ Calehay |
|
Back to top |
|
 |
Rya.Reisender Snippy

Joined: 18 Jan 2008 Posts: 821
|
Posted: Wed Nov 19, 2008 11:25 pm Post subject: |
|
|
What are the maximum values for those by the way? 9? 99? 255? _________________ Snippy:
"curt or sharp, esp. in a condescending way" (Oxford American Dictionary)
"fault-finding, snappish, sharp" (Concise Oxford Dictionary, UK)
1. short-tempered, snappish, 2. unduly brief or curt (Merriam-Webster Dictionary) |
|
Back to top |
|
 |
TMC On the Verge of Insanity
Joined: 05 Apr 2003 Posts: 3240 Location: Matakana
|
Posted: Thu Nov 20, 2008 6:05 am Post subject: |
|
|
There is no maximum amount settable with scripting for any stats.
The level mp amounts are recalculated (overwriting scripted changes) in two cases:
-a hero levels up and 'Don't Restore MP on Levelup' isn't set
-you go to an inn
So you'll want an after-battle script which is set on every map and checks 'hero levelled', and a script for every inn.
The particular function is resetlmp in moresubs.bas _________________ "It is so great it is insanely great." |
|
Back to top |
|
 |
Spoon Weaver

Joined: 18 Nov 2008 Posts: 421 Location: @home
|
Posted: Thu Nov 20, 2008 12:12 pm Post subject: |
|
|
Oh! so I only have to write a script that checks character level in INNs and sets the leveled MP. What a perfect idea. Plus since I already planned to have the reseting of MP off on level up, I don't have to write the other one.
Yay, ty.
Also, just for future refrence, are there any hidden stats thats would be too difficult to change with plotscripting, (example: exp needed for each level) |
|
Back to top |
|
 |
TMC On the Verge of Insanity
Joined: 05 Apr 2003 Posts: 3240 Location: Matakana
|
Posted: Fri Nov 21, 2008 12:53 am Post subject: |
|
|
You can sort of change experience required for levelup with a clever and complicated script, by manipulating the amount of experience a hero has after they level up. This is possible because the player only sees the amount left to gain, not what they actually have.
Here's the script I wrote for Rya, for Gerania:
Code: | script, correct xp to level, hero, begin
variable (level, earned xp, levelled)
# REAL number of levels gained
levelled := hero levelled (hero)
level := get hero level (hero)
# xp earned on top of the (first) levelup
earned xp := 0
if (levelled >> 0) then (
level := level -- levelled + 1
earned xp := total experience (hero) -- experience to level (level)
set hero level (hero, level, true)
)
give experience (hero, experience to next level (hero) -- experience formula (level + 1) + earned xp)
if (hero levelled (hero)) then (correct xp to level (hero))
# just in case you want to use the herolevelled command, recursively set correct
# levelled amount (undocumented stat tinkering!)
if (levelled >> 0) then (set hero stat (hero, 12, hero levelled (hero) + 1, 1))
return (earned xp)
end
script, experience formula, level, begin
# this is the experience to reach a level from the last one. (so call with a minimum level of 1)
# formula is lastlevel * 1.1 + 5
variable (i, exp)
exp := 30
for (i, 2, level) do (exp += exp / 10 + 5)
return (exp)
end
|
I'm not even totally sure how it works anymore. It's magic. correct xp to level should be called after adding a hero to the party, or after they level after a battle (but not after every battle!) It supports gaining multiple levels from a battle (but the battle might announce that you gained the wrong number!) Yeah, I should just get around to adding real support to the engine instead.
I can't think of any other problematic hero stats. _________________ "It is so great it is insanely great." |
|
Back to top |
|
 |
Spoon Weaver

Joined: 18 Nov 2008 Posts: 421 Location: @home
|
Posted: Sun Nov 23, 2008 9:16 am Post subject: |
|
|
SWEET thx
hurray magic |
|
Back to top |
|
 |
Moogle1 Scourge of the Seas Halloween 2006 Creativity Winner


Joined: 15 Jul 2004 Posts: 3377 Location: Seattle, WA
|
Posted: Sun Nov 23, 2008 1:38 pm Post subject: |
|
|
The Mad Cacti wrote: | You can sort of change experience required for levelup with a clever and complicated script, by manipulating the amount of experience a hero has after they level up. This is possible because the player only sees the amount left to gain, not what they actually have.
Here's the script I wrote for Rya, for Gerania:
Code: | script, correct xp to level, hero, begin
variable (level, earned xp, levelled)
# REAL number of levels gained
levelled := hero levelled (hero)
level := get hero level (hero)
# xp earned on top of the (first) levelup
earned xp := 0
if (levelled >> 0) then (
level := level -- levelled + 1
earned xp := total experience (hero) -- experience to level (level)
set hero level (hero, level, true)
)
give experience (hero, experience to next level (hero) -- experience formula (level + 1) + earned xp)
if (hero levelled (hero)) then (correct xp to level (hero))
# just in case you want to use the herolevelled command, recursively set correct
# levelled amount (undocumented stat tinkering!)
if (levelled >> 0) then (set hero stat (hero, 12, hero levelled (hero) + 1, 1))
return (earned xp)
end
script, experience formula, level, begin
# this is the experience to reach a level from the last one. (so call with a minimum level of 1)
# formula is lastlevel * 1.1 + 5
variable (i, exp)
exp := 30
for (i, 2, level) do (exp += exp / 10 + 5)
return (exp)
end
|
I'm not even totally sure how it works anymore. It's magic. correct xp to level should be called after adding a hero to the party, or after they level after a battle (but not after every battle!) It supports gaining multiple levels from a battle (but the battle might announce that you gained the wrong number!) Yeah, I should just get around to adding real support to the engine instead.
I can't think of any other problematic hero stats. |
Please wikify this under Example Scripts if you haven't yet. I don't have any current need for these, but I might someday and I know others do. _________________
|
|
Back to top |
|
 |
Rya.Reisender Snippy

Joined: 18 Jan 2008 Posts: 821
|
Posted: Mon Nov 24, 2008 6:34 am Post subject: |
|
|
That's actually the script TMC wrote for me for Gerania, I didn't really want to make it public (mainly because I don't want the players to know how the mechanics work and if there are exploits to it). _________________ Snippy:
"curt or sharp, esp. in a condescending way" (Oxford American Dictionary)
"fault-finding, snappish, sharp" (Concise Oxford Dictionary, UK)
1. short-tempered, snappish, 2. unduly brief or curt (Merriam-Webster Dictionary) |
|
Back to top |
|
 |
Spoon Weaver

Joined: 18 Nov 2008 Posts: 421 Location: @home
|
Posted: Mon Nov 24, 2008 7:35 am Post subject: |
|
|
It doesn't seem like there's any need to worry about exploits. But, I honestly think instead of posting this, maybe we should all work on implementing a way to change xp per level into O.H.R.rpg.C.E. itself.
..or not. I mean w/e  |
|
Back to top |
|
 |
TMC On the Verge of Insanity
Joined: 05 Apr 2003 Posts: 3240 Location: Matakana
|
Posted: Mon Nov 24, 2008 10:01 pm Post subject: |
|
|
OK, I added it: 'Scripts:Custom experience to level formula'.
Rya.Reisender wrote: | That's actually the script TMC wrote for me for Gerania, I didn't really want to make it public (mainly because I don't want the players to know how the mechanics work and if there are exploits to it). |
It's just the level up formula, and not really exploitable, I think that the gain system is where there are potential exploits. _________________ "It is so great it is insanely great." |
|
Back to top |
|
 |
Rya.Reisender Snippy

Joined: 18 Jan 2008 Posts: 821
|
Posted: Tue Nov 25, 2008 2:55 am Post subject: |
|
|
*whispers* Um, but there was that bug that the hero's level always doubled after every battle which we could never solve or reproduce. _________________ Snippy:
"curt or sharp, esp. in a condescending way" (Oxford American Dictionary)
"fault-finding, snappish, sharp" (Concise Oxford Dictionary, UK)
1. short-tempered, snappish, 2. unduly brief or curt (Merriam-Webster Dictionary) |
|
Back to top |
|
 |
TMC On the Verge of Insanity
Joined: 05 Apr 2003 Posts: 3240 Location: Matakana
|
Posted: Tue Nov 25, 2008 6:47 am Post subject: |
|
|
Rya.Reisender wrote: | *whispers* Um, but there was that bug that the hero's level always doubled after every battle which we could never solve or reproduce. |
Uh... are you sure you told me about it? Can't reproduce it? _________________ "It is so great it is insanely great." |
|
Back to top |
|
 |
Spoon Weaver

Joined: 18 Nov 2008 Posts: 421 Location: @home
|
Posted: Tue Nov 25, 2008 11:58 pm Post subject: |
|
|
hmmm, haven't seen such a bug yet but i'll be on the look out.
till then.....
Just wanted to ask about somemore unalterable stats. namely random attack numbers. is there a way to change the amount of randomness?
....besides switching it off. |
|
Back to top |
|
 |
|