Miscellaneous Forums > Scripting and Reverse Engineering

Can stats with battle addresses exceed 255 if modified by a battle address?

(1/2) > >>

james_c:
Hello,

For a mod I'm working on I'm attempting to do a difficulty rebalance I'm interested in making abilities which modify a characters stats in battle under specific conditions (For instance, Tifa parries attacks randomly and after a parry she gains speed) and I'm wondering if modifications made to stats through AI scripts work beyond the ordinary 255 cap.

I.e, let's say I want to give a character an innate trait where whenever they are hit, their attack increase. Attack is normally capped at 255 outside of battle; but there doesn't seem to be a reason why I couldn't just continue to increment it beyond that point via AI Script. I want to know if this will actually do anything? Str and out of battle Attack seem to be bytes, but the AI variables which hold these values do not seem to be.

Will these stats simply be set to 255 if they are over it for the purpose of damage calculations?

Thanks!

DLPB_:
The cap will be in multiple places and what you're asking will likely be a lot of hassle to implement. The main obstacle is that the main "cap" is the one byte var which only has a range up to 255. Thats a limitation in computing. You cant extend it without making the engine use 2 bytes (range up to 65535) which takes a lot of work and recoding. If you want to make a proper balance, divide all character and enemy stats by say 10 and then design game around that instead.

james_c:
Thanks! I will do exactly that.

picklejar:
Dividing all character and enemy stats by N is an interesting idea, but it would only effectively increase the cap, and it wouldn't actually fix the "game breaks if I go over the cap" issue (it only delays it), and it would introduce other problems related to the resulting loss of granularity (especially in the lower ranges), and you might have to re-balance various formulas in the game.

james_c, it sounds like you're trying to "temporarily" change a "stat" to accomplish "some change in damage, speed, etc.", without violating the 255 stat caps. In order to accomplish something like this successfully, on a "global" scale (i.e. where you don't have to modify tons of scripts in the game), I'd recommend that you first read Terence Fergusson's FF7 Battle Mechanics FAQ:
https://www.gamefaqs.com/ps/197341-final-fantasy-vii/faqs/22395

This explains things like "Primary Stats" vs. "Derived Stats", "Before Damage Effect" and "After Damage Effect", a hundred other factors, and all the math formulas for calculating damage, etc., in general. It will also explain the (very complicated) system that governs speed and timing.

The other thing I'd recommend looking at is to find out how the game does similar things to what you're wanting to do. For example, what happens when a character drinks a Source potion during battle, which normally raises a stat by 1? Does it permanently affect their stat after the battle has ended? How does Berserk accomplish a temporary hit% decrease? How does Haste accomplish a temporary speed increase?

You might find that you'll need to invent new stats and modify existing formulas to accomplish what you want? Not sure, depending on how creative you get.

Good luck!

DLPB_:
Youd also limit max hp and stats. You can limit them lower.

Navigation

[0] Message Index

[#] Next page

Go to full version