Users browsing this thread: 1 Guest(s)
Battlescript variables...

#21
Posts: 1,633
Threads: 56
Thanks Received: 13
Thanks Given: 84
Joined: Apr 2014
Reputation: 12
Status
Atma
Yeah, my bro said that, while playing FFV...

Anyway this and that will definitively happen in my hack.


THE GREATEST CHALLENGE OF ALL TIMES AWAITS:
http://www.ff6hacking.com/forums/showthr...p?tid=2593
DO YOU HAVE WHAT IT TAKES TO SLAY A GOD?
------------------------------------------------------------------------
Tenkarider's project #2 is started: FF6 Curse of the Madsiur Joke (CotMJ)
http://www.ff6hacking.com/forums/showthr...p?tid=2755
What happens when Madsiur tweaks your account? This full game hack will show that!
  Find
Quote  

#22
Posts: 1,633
Threads: 56
Thanks Received: 13
Thanks Given: 84
Joined: Apr 2014
Reputation: 12
Status
Atma
I was wondering... can i check battle variable bits (their value stored when you're outside a battle) with the standard event command used for map event bits?

PS. does exist a way to check var's value, instead of his bits? Doing that with bits is almost impossible... i mean, 256 checks??? Laugh


THE GREATEST CHALLENGE OF ALL TIMES AWAITS:
http://www.ff6hacking.com/forums/showthr...p?tid=2593
DO YOU HAVE WHAT IT TAKES TO SLAY A GOD?
------------------------------------------------------------------------
Tenkarider's project #2 is started: FF6 Curse of the Madsiur Joke (CotMJ)
http://www.ff6hacking.com/forums/showthr...p?tid=2755
What happens when Madsiur tweaks your account? This full game hack will show that!
  Find
Quote  

#23
Posts: 676
Threads: 44
Thanks Received: 26
Thanks Given: 21
Joined: Jan 2015
Reputation: 11
Status
Zombie
Event commands:

Code:
BC : 3    : Return from subroutine if event bit A AND $7FFF is clear/set (bit $8000 determines which). That is to say, A is a word value indicating which event
          : bit to check. Formula is $7E:1E80 + (A & $7FFF)/8.

Formula is $7E:1E80 + (A & $7FFF)/8 I would think that has some relevance to the first question. In other words, would it add up with that formula? Or just a simple, fool proof test would be a better suggestion.

Now, I'm no programmer, but wouldn't checking a variable's value just consist of loading it into the proper sized accumulator and comparing it to a static value? Maybe write a small code to compare it to a custom table and...

Hell I'm confusing myself at this point, I'm gonna stop now. That doesn't mean its not correct though. Possibly.


The only true wisdom is knowing you know nothing.
  Find
Quote  

#24
Posts: 179
Threads: 3
Thanks Received: 24
Thanks Given: 4
Joined: Apr 2015
Reputation: 18
Status
None
(02-27-2015, 01:22 PM)Tenkarider Wrote: PS. anyone has any info about var 36? even Lord Envoy used it for Emperor Dragon and Godzilla...

var 36 is a "monster variable" specific to each monster in the battle. In fact, if you try to use any variable number greater than 36, the game engine defaults to affecting the monster variable. This is what you would use if you have several of the same type of monster in a battle and you want each one to be able to keep track of its own variable without affecting any others. Instead of affecting the global battle variables at $1DC9 or $3EB0, the monster variable is stored separately at $3DAC, 2 bytes for each of the 4 characters and 6 monsters.
  Find
Quote  

#25
Posts: 1,633
Threads: 56
Thanks Received: 13
Thanks Given: 84
Joined: Apr 2014
Reputation: 12
Status
Atma
For some coincidence i read that piece of code right yesterday Laugh
It's nice that you can confirm me that even same monsters have their own local var 36... very useful.
Btw you also mentioned that also the 4 characters have their own var 36, or what?
If that's true how it's handled for characters... it's usable for them when they act like enemies, like Kefka in the camp, or it's usable for your party too?


PS. despite you've joined in the last 24 hours, you surely have some good knowledge of FF6, since you know those details about var 36... are you registered in other hacking sites too?


THE GREATEST CHALLENGE OF ALL TIMES AWAITS:
http://www.ff6hacking.com/forums/showthr...p?tid=2593
DO YOU HAVE WHAT IT TAKES TO SLAY A GOD?
------------------------------------------------------------------------
Tenkarider's project #2 is started: FF6 Curse of the Madsiur Joke (CotMJ)
http://www.ff6hacking.com/forums/showthr...p?tid=2755
What happens when Madsiur tweaks your account? This full game hack will show that!
  Find
Quote  

#26
Posts: 179
Threads: 3
Thanks Received: 24
Thanks Given: 4
Joined: Apr 2015
Reputation: 18
Status
None
(04-06-2015, 06:05 PM)Tenkarider Wrote: Btw you also mentioned that also the 4 characters have their own var 36, or what?
If that's true how it's handled for characters... it's usable for them when they act like enemies, like Kefka in the camp, or it's usable for your party too?

That's right, anything with a script gets a monster variable, even if it happens to be a character. Oh, and even though there's 2 bytes stored for each, when I looked at the asm code it looks like you can only access one.

I don't think you could use it for characters in your party unless they're somehow acting using a script.

No, I'm not active on any other sites. I just found this one a couple weeks ago and I wanted to join in. There's a lot of good stuff on here!
  Find
Quote  

#27
Posts: 1,633
Threads: 56
Thanks Received: 13
Thanks Given: 84
Joined: Apr 2014
Reputation: 12
Status
Atma
Understood. welcome here, then! Wink


THE GREATEST CHALLENGE OF ALL TIMES AWAITS:
http://www.ff6hacking.com/forums/showthr...p?tid=2593
DO YOU HAVE WHAT IT TAKES TO SLAY A GOD?
------------------------------------------------------------------------
Tenkarider's project #2 is started: FF6 Curse of the Madsiur Joke (CotMJ)
http://www.ff6hacking.com/forums/showthr...p?tid=2755
What happens when Madsiur tweaks your account? This full game hack will show that!
  Find
Quote  

#28
Posts: 179
Threads: 3
Thanks Received: 24
Thanks Given: 4
Joined: Apr 2015
Reputation: 18
Status
None
Thanks!
  Find
Quote  

#29
Posts: 1,633
Threads: 56
Thanks Received: 13
Thanks Given: 84
Joined: Apr 2014
Reputation: 12
Status
Atma
I need to verify an info... probably it's more trivial that what i might believe, anyway...

Back on the battle var which don't reset their value after battle... the range was from var 04 to var 23(in hex should be var 17)
We know that var 36 is the last battle var you can access and also that the script won't allow you to target variables above var 36(higher values will be considered var 36 too) so we have an idea of the whole var range, at least.
Well, not exatly: no one mentioned a detail... how 'bout battle vars from var 24 to var 35? their value should be resetted, i believe... but then i wonder if i can use them in the same way of battle vars from 0 to 3... surely a plenty of new slots for battles, while 4 vars should be more than enough for any battle, i might have need to have some "distant" and unused var slot for battles...
For example, about detecting escaping attempts, rather than use that slot from var 0, which would mean that i cannot use it anymore for some generic monster AI and would actually be really annoying, it would be much more better use one var like var 24(or 25 to not risk of using the last reset value var for error) to store escape check bit, and eventually some other check i might create meanwhile.
The only thing i fear is the event in which those var are used for something else and actually change value during battle...
In that case escape check would be triggered suddenly and being a problem!
Maybe i'm just paranoid? what do you think about that, should those vars(24-35) be safe for monster AI script, like var 0-3?


THE GREATEST CHALLENGE OF ALL TIMES AWAITS:
http://www.ff6hacking.com/forums/showthr...p?tid=2593
DO YOU HAVE WHAT IT TAKES TO SLAY A GOD?
------------------------------------------------------------------------
Tenkarider's project #2 is started: FF6 Curse of the Madsiur Joke (CotMJ)
http://www.ff6hacking.com/forums/showthr...p?tid=2755
What happens when Madsiur tweaks your account? This full game hack will show that!
  Find
Quote  

#30
Posts: 179
Threads: 3
Thanks Received: 24
Thanks Given: 4
Joined: Apr 2015
Reputation: 18
Status
None
(07-19-2015, 04:30 PM)Tenkarider Wrote: how 'bout battle vars from var 24 to var 35? their value should be resetted, i believe... but then i wonder if i can use them in the same way of battle vars from 0 to 3...

I did a little bit of digging and I think you got it right exactly. Vars 24 to 35 are safe to use as variables that will get reset at the end of every battle. Var 24 is used to keep track of which elements are nullified by the Forcefield spell. Var 25 is used for something, but I'm not sure what. Var 26 keeps track of the number of different types of monsters in the battle. As far as I can tell, vars 27 to 35 are unused. So you could put your escape check in var 27 and it shouldn't affect anything else.

I was thinking it might be useful to expand the number of variables that get saved. Normally they get copied to $1DC9-$1DDC after battle, which is why the game only saves vars 4 to 23. It wouldn't be too difficult to expand that range a little bit if you wanted to save vars 4 to 35. You would just have to shift a few other things around. Let me know if you're interested in making that happen, I'd be glad to help.
  Find
Quote  



Forum Jump:

Users browsing this thread: 1 Guest(s)


Theme by Madsiur2017Custom Graphics by JamesWhite