RPG Stat System

Here’s what I’m trying to do, and trying to explain it the best I can.
I want to make a few simple stats such as Strength and Defense.

stat.STR
stat.DEF

I’m trying to figure out how I would be able to use these in a script attached as a weapon, and depending on certain elements be able to increase (or decrease) the players stats.
I’m working on learning how to apply functions, arrays, and/or strings to this I think…

Any ideas?

Formulas I’m working on: (Does not apply to my request ^)
player.Strength - enemy.Defense;
player.Defense - enemy.Strength;
player.Speed => enemy.Speed;
player.Luck (random + towards one of any) + player.STR, player.DEF, player.Speed

I also have
Magic Luck -> chances your magic will hit, outcome based on enemy Magic Evasion

and the opposite.
It applies to magic like Ban… magic that don’t always work.

That’s similar to Death magic in final fantasy.
Most of the stats I have will have opposing stats that they’ll go up against in battle.
The exceptions are Luck and Speed.
Luck will have a chance to randomly increase certain stats during the player’s turn.
Speed opposes itself against the enemies speed, which will determine the turn order of the battle.

If you’re involving a Strength stat, you might want to consider whether or not that implicates “Attack”, or if Attack has yet to be determined and will be a final calculation based on [(Strength+Weapon Power) - Defence = Attack] etc.

Also if I recall correctly, you can save some data to NPCs locally using “save” or something. I can’t remember what it was I was trying with that, but it seemed like a very important function for RPG servers.

I was thinking of using a Hit Rate stat and Evasion stat as well that’ll have to be added to the formula. I don’t want to use the generic formula I’m currently working with, I’m just using something simple until I can actually get something usable. I think I’m headed in the right direction, and thanks for the suggestion! I had taken weapon power into account but actually forgot to apply it to the formula.
I’ll post something soon when I get it working half way. I’d like to be able to apply this to that battle system [USER=“10627”]2ndwolf[/USER] is working with, he’s already got some cool stuff going with it.

I’m getting my study on learning JavaScript properly, so I can apply it to gscript, since it’s very similar and looks based off JS.

Variables don’t work like that in GS1. You’re basically making a bunch of temporary and local (can be read from other NPCs in the level) variables because they aren’t built into the client. Because the version of the game we are using is entirely clientside, everything not stored in the player’s account file is reset when they log out and back in. You are going to have to create client strings to save them onto the account file if you want anything other than the built-in player variables to be saved.

I told him about client. prefixed variables… which stay btw zaz.

Beholder explained something like this to me a long time ago, I started by adding the stats to the account txt file and was playing with this same idea.
I’ve dedicated the past week to mainly learning some JavaScript syntax that I’d been confused about since I began. It’s making me rethink how I’m going to go
about doing rpg stats, as well as with the info you guys have provided.

I’ve still got a ways to go with this though =.= and I see now that there’s alot more to it than what I first thought when writing up a blueprint for it.

When you’ll be working with stats, initiate them in that order so my battle system works without modification.

 setstring client.statsJohn,
     40, //HP MAX
     20, //HP current
    120, //MP MAX
    100, //MP current
     30, //STR
    999, //SPEED
     30, //HIT
     30, //DEX
     40, //INT
     30, //MagL
     30, //MagE
     30, //DEF
     30, //SPIRIT
     30, //BlockR
     30, //Luck
     30; //TECH

It’s probably the only thing I’ll ask you to do.

I’ll take this into consideration while working on the stat system. I’ve been pretty busy this past week with some work that finally came my way, and haven’t had much time or energy to get much done.
This will be a good template to go by, I’m currently puzzled as to if the NPC/enemy should have a base Level stat as the player will have along with this, or if that would even matter.

With that aside, I’ll hopefully have something presentable soon. Working on the Stats GUI window and getting the stats to update and show in the specified coordinates when called on.

Those stats look obnoxious.

While I did laugh, most people can’t handle flat out criticism with no constructive feedback. So let me add that too many stats can be overwhelming and actually detract from gameplay.

Those are the classic JRPG stats.
They all have a use.

[LIST]
[]Speed is for priority in turns.
[
]STR and DEF are for attacks. (Attacker’s STR vs attacked’s DEF)
[]DEX is the critical hit rate.
[
]INT is the magic power, a multiplier of the base magnitude of magic (attacker). SPIRIT is a negative multiplier (defender)
[]MagL and MagE are for magic like instant kills or sleep, MagL affects how often it will hit (attacker). MagE affects how often it will not hit (defender)
[
]BlockR affects how often an attack will hit the defender. (evasion)
[]LUCK and TECH, I leave them to zaz to explain.
[
]HIT zaz could explain, I forgot what it is.
[/LIST] I gave it thought and together they allow greater fine-tuning of fights and more variations for enemies as well as a possibility for progression. The best example I can come up with is instakill which would hit weaker enemies way more often because their MagE is so low compared to the player’s MagL. In fact, those are little stats. Two for melee, two for offensive/defensive magic, two for status magic (that I added; more fun and complexity). Speed is obvious. DEX, BlockR and TECH (limit break) could be removed but they add to the fun. It leaves Luck. I’ve never understood luck.
That leaves us with 6 stats on 14 that can be considered superfluous but, as I explained, they have a use and actually make the game more compelling. Does not detract from gameplay and anyway, it all happens in the background. Too little stats would make the battles boring and would require more coding, enemy-wise.
All the player will have to care about are what they care about in normal JRPGs. STR and DEF… maybe INT and SPIRIT. The rest is information players will or won’t understand and may never care about. Just like a normal JRPG.

Honestly, I keep getting ideas based on those stats. Anyway, wait until you see the status effect list I made or the different attacks player characters will have. That will look obnoxious to you, especially if you don’t like JRPGs. Where variety is key or otherwise all fights would be the same.

TLDR:
Don’t worry, understanding the stats isn’t required.

This is just a guess as I haven’t played many JRPGs, but doesn’t luck just shrink the space of rolling a number, so instead of choosing 1 from 52 numbers (0 luck), as your luck improves, you might choose 1 from 24 numbers instead? This choosing of a specific number would then affect whether or not you get a rare loot or hit a critical strike?

There are really only 3 stats that matter in RPGs: HP, ATK, and DEF. If you have those three, you can create an RPG. Everything else has been innovations in the genre to keep it from being a bland farming simulator.

DEX becomes a flavour of ATK that dictates how frequently your attacks occur, making high dex builds great for bursting down low HP, high DEF monsters (think Metal Slimes from Dragon Quest). Some games make DEX a stat that determines Evasion/Hit Rate. Others substitute it for a STR stat, and give it to “agile” jobs/classes/characters as their “primary” stat.
INT is similar, however, some games will pair it with WIS (Wisdom) to determine other things. Wisdom can be used to determine MP. Some games use it to determine hit rates for magic. Others use it in factoring healing spell power. If WIS isn’t present, INT generally determines all of those.

LUCK, on the other hand is a stat that can be used in many different ways, but is most commonly designated as the “crit” stat. Crits can be handled differently per game. Most games make it so crits will do anywhere between 1.5 and 2.5 times the standard damage amount. Some games make it simply take defense out of the equation. LUCK could be interpreted as a simple frequency of the event. If I have 128 luck out of 255 luck, and critting relies on a random number between 1 and 255 to land on a number between 1 and the current luck stat, it means I crit approximately 50% of the time. In the craziest situations, I’ve seen compounding luck stats that allow you to double or triple crit. LUCK also tends to be the determining factor in afflictions/binds/curses/etc. being successful. Some games completely ignore the stat and rely on the player’s own luck to determine whether an ability will land.

If I had to guess, TECH is probably going to be used for physical “magic” abilities, sometimes referred to as Techniques, Skills, Arts, etc. I’ve only seen it in a few games so it feels weird to see that here.

Magic spells that miss are probably my biggest pet peeve in RPGs so I’m not fond of seeing MagL there if that’s really what it’s for. I’d rather hit rates be applied to spells themselves, so you can count on most abilities working, and status based ones on missing. But hey, not my game, not my rules. I’ve seen plenty of games where even the challenge of magic spells landing a hit being necessary.

HIT probably interacts with BlockR to solve situations where high evasion enemies can be hit by attackers who have a high enough hit stat. This can be used to create a “floor” to prevent underleveled players from being able to exploit their builds to farm higher level monsters than intended.

at this point I’m rambling about my own knowledge, sorry for putting this here but I thought if I shared what I know it would probably help.

Don’t. That was a great read.

and thanks, actually. You helped me figure out the maths for the probabilities and strength of attacks.

Only need two stats. One for player, one for enemy. Highest number wins. Everything else is to make the game more complicated, which isn’t necessarily a bad thing.

like postcount?

The forums are now an RPG! And I’ve already lost.