The RPG Maker Resource Kit

RMRK RPG Maker Creation => RPG Maker General => General Scripting => Topic started by: Dko on November 29, 2006, 05:02:45 AM

Title: Adding a new character stat(Some questions about)
Post by: Dko on November 29, 2006, 05:02:45 AM
Ive found that to create the CBS that I want that I need to give my characters and monsters one more stat. The thing is my mind is hurting trying to figure out all the little things that would need to be done to do it. One I don't know where the code is to figure out what happens when a character levels up so the stat is changed accordingly. Second I'm trying to figure out what I need to do to properly save this new stat. I know all others are saved to Actors.rxdata but I don't think I should save it there. Also why are things seemingly saved with Marshal.dump instead of save_data?(I know the help files says that this is to be expected but why?)> Thank you for any help in advance. I just have a horrible time figuring out other peoples code.
Title: Re: Adding a new character stat(Some questions about)
Post by: :) on November 29, 2006, 05:07:13 AM
what type of stat? sorta like Strenght or like a skill?
Title: Re: Adding a new character stat(Some questions about)
Post by: Dko on November 29, 2006, 05:13:34 AM
Like Str. When I get done I want to use it as a way to figure out how many commands a person can input per attack. It goes up with a persons level so they get to do more at higher levels. Think the system that Xenogears has when you attack. But thats not really important to my questions I think.
Title: Re: Adding a new character stat(Some questions about)
Post by: Morris Lawry on November 29, 2006, 09:52:55 AM
ohhhh i see, try googling it
Title: Re: Adding a new character stat(Some questions about)
Post by: Dko on November 29, 2006, 04:15:10 PM
ok tried it. Got nothing.
Title: Re: Adding a new character stat(Some questions about)
Post by: :) on November 30, 2006, 01:22:57 AM
maybe you can mess with this tut I found:
For this tut I will use a skill named 'Wood Cutting'

You will need:

2 common events:
Wood Cutting Level
Random Woodcutting Exp Gain

1 Switch:
Wood Cutting Available

An item, named 'Wood Cutting Axe' and don't make it consumable

And 3 Variables:
Wood cutting Level
Wood Cutting Exp
Wood Cutting Exp Gain

At the start of your game or wherever you want the wood cutting skill to begin, activate the switch: Wood Cutting Available

Ok, let's begin.
Make the common event with a parallel process to the switch 'Wood Cutting Available'. Name it Wood Cutting Level and do the following:
<>Conditional Branch: Variable [001: Wood Cutting Exp] >= 0
<>Variable: [002: Wood Cutting Level] = 0
<>
<>Conditional Branch: Variable [001: Wood Cutting Exp] >= 96
<>Variable: [002: Wood Cutting Level] = 1
<>
Else Handler
<>Conditional Branch: Variable [001: Wood Cutting Exp] >= 237
<>Variable: [002: Wood Cutting Level] = 2
<>
Else Handler
<>Conditional Branch: Variable [001: Wood Cutting Exp] >= 493
<>Variable: [002: Wood Cutting Level] = 3
<>
Else Handler
<>.............................................

So you see the pattern, good!
You can make as many levels as you want but remember, the higher the level, the more Exp required to gain the next level and so on! And on the last level you want, do not use an Else Handler.


Ok, make another Common event named Random Wood Cutting Exp Gain and leave the trigger as none.
So, now do the following:

<>Variable: [003: Random Woodcutting Exp Gain] = Random (1..10)
(Note, you can use any amount of random numbers to make the chance of getting the same amount of Exp again and again even less)
<>Conditional Branch: Variable: [003: Random Woodcutting Exp Gain] == 1
<> Variable: [001: Wood Cutting Exp] += 13
<>
Else Handler
<>Conditional Branch: Variable: [003: Random Woodcutting Exp Gain] == 2
<> Variable: [001: Wood Cutting Exp] += 11
<>
Else Handler
<>Conditional Branch: Variable: [003: Random Woodcutting Exp Gain] == 3
<>Variable: [001: Wood Cutting Exp] += 14
Else Handler
<> ..............................

Again, see the pattern? Continue this until you have used all of the possibilities for the random numbers. And on the last one, do not use an Else Handler!
Once you are done, Make sure you make the final command 'End Event Processing' otherwise it won't stop generating numbers and give you an infinite amount of Exp.


Next step, you make a tree and make it an event which only activates when you have the item 'Wood Cutting Axe'. So when you press enter on the tree, make the sprite change into a tree stump and then use the command 'Common Event' and call 'Random Wood Cutting Exp Gain'

Don't forget to make it that once a tree has been chopped down, you can not chop it again, (until you re-enter the map or something, or if you have a day/night system, the tree returns the next day).
Title: Re: Adding a new character stat(Some questions about)
Post by: Dko on November 30, 2006, 02:43:16 AM
Thanks but that doesn't really help me as im adding stats. Not skills.
Title: Re: Adding a new character stat(Some questions about)
Post by: sum41freak on December 01, 2006, 10:27:03 PM
AAAAH! it sounds like runescape. it better not be something based on runescape... lol that game is terrible.
Title: Re: Adding a new character stat(Some questions about)
Post by: nevfx on December 01, 2006, 11:13:37 PM
What stat do you want to add?
Title: Re: Adding a new character stat(Some questions about)
Post by: Dko on December 03, 2006, 06:13:02 AM
I wants to add a stat called Stamina. It will be represented in my battle system as a bunch of little boxes. The character up for attack can do a strong, medium or light hit  which take up 3, 2, or 1 stamina respectively. Stamina will also increase as you level up. I have gotten much further but im stumped now. I need to have write access to the database (specifically @parameters) but I don't know how to do it.
Title: Re: Adding a new character stat(Some questions about)
Post by: Morris Lawry on December 07, 2006, 06:06:34 AM
i wish i hadn't played runescape to level 107 and then find world of warcraft