Author Topic: FF VIII How to MOD?  (Read 2247 times)

Covarr

  • Covarr-Let
  • Administrator
  • No life
  • *
  • Posts: 3919
  • Karma: 115
  • The Great Redarr.
    • View Profile
Re: FF VIII How to MOD?
« Reply #25 on: 2017-10-11 22:43:47 »
I'm gonna go ahead and close this thread so as to discourage people from helping Divatox with his pirated copy of the game, as per the forum rules.

He bought the game! Yay! Unlocked!
« Last Edit: 2017-10-11 23:57:23 by Covarr »

Girl next door

  • Crazy poster
  • *
  • Posts: 112
  • Karma: 1
    • View Profile
Re: FF VIII How to MOD?
« Reply #26 on: 2017-10-12 05:41:14 »
Wow sorry I didn't know I didn't have to help him. ^^ But now that we can, I wrote a memo about targets:

200 self
201 one target
203 last ononent who attacked (used for the counterattacks)
204 all oponents
205 all allies
207 ally
208 multiple hits

Also, for the bugs, remember that it mostly occurs when you have 2 or more enemies in battle that you have change AI. If you isolate enemies, there won't be problems.

Hope my english is clear. ^^

Divatox

  • Fast newbie
  • *
  • Posts: 49
  • Karma: 2
    • View Profile
Re: FF VIII How to MOD?
« Reply #27 on: 2017-10-12 18:19:03 »
That helped a little XD i guess i need to learn what some line means

self.hp ok
self.status ok
target ok
rand() % 3 != 0 ??? dont know
self.varDC = 0 ??? dont know
domoveid (2) ??? dont know

self.status != REFLECT (i know that if something happens he will cast reflect in him self?)

Exist some topic that explain each line? Im always testing on Glacial Eye and i want to make him cast in him self protect, shell, triple etc when the battle starts. To use this on bosses and other enemies.

And why some magics hit only 1 target? Like Glacial Eye cast Ultima and hit only Squall? Not Squall, Quistis and Irvine (all party)

Girl next door

  • Crazy poster
  • *
  • Posts: 112
  • Karma: 1
    • View Profile
Re: FF VIII How to MOD?
« Reply #28 on: 2017-10-13 06:32:45 »
You say target is OK but it's not ! xD If you want Glacial eye casts Ultima on the party, you have to change the target of the attack from 201 to 204.

if rand() % 3 != 0 > means that the enemy has a 33% chance to do the action.

self.varDC = 0 > variable used by the enemy... hard to explain for me in english sorry. ^^

domoveid (2) > the enemy use the action number 2 of the list of its attacks.

if self.status != REFLECT > means that the enemy will do this action if it has not the status REFLECT.

If you don't have any knowing of things like "if" and "else" , that will be hard for you. ^^

Divatox

  • Fast newbie
  • *
  • Posts: 49
  • Karma: 2
    • View Profile
Re: FF VIII How to MOD?
« Reply #29 on: 2017-10-13 17:48:02 »
BUT you already helped me ALOT if that thank you  8) 8)

i tested this:

if (rand() % 3 == 0) { <-------this works because he has 3 abilities with reflect
    target(200)
    domoveid(2)
    return
}
if (self.hp <= 100) {
    target(200)
    domoveid(3) <------this should work? 3 is the reflect magic, when he has 100 HP he will cast on it self?
    return

Abilities:
1-custom = 2 / anin=13
2-magic = 4(blizzard) / anin=11
3-magic = 31(reflect) / anin=11
4-custom = 2 / anin=13
5-custom = 20(vampire) / anin=14
6-custom = 20(vampire) / anin=14

Its possible i will come back to ask something else XD
« Last Edit: 2017-10-13 18:36:20 by Divatox »

Girl next door

  • Crazy poster
  • *
  • Posts: 112
  • Karma: 1
    • View Profile
Re: FF VIII How to MOD?
« Reply #30 on: 2017-10-13 18:30:16 »
if (self.hp <= 100) {

That's not correct. This is a precentage. For example, if you want an enemy do an action when it has les than 50% of its HPs, you have to write:

if (self.hp <= 5) {

5 means 50%.

Tell me exactly what you want to do with the actions IDs and I should give you the code. :)

Divatox

  • Fast newbie
  • *
  • Posts: 49
  • Karma: 2
    • View Profile
Re: FF VIII How to MOD?
« Reply #31 on: 2017-10-13 19:55:22 »
Ok lets go, i want to the enemie do:

start casting triple
cast haste, cure (cura or curaga), shell or protect with 50% HP

to resume, he cast support magics in him self when necessary. (like bosses) Right now the enemie use blizzard and reflect on my party XD

to cast a high level magic in the hole party is:

if (rand() % 3 == 0) {
    target(204)
    domoveid(2) <------- my question is, this move in from the list of abilities right?
    return
« Last Edit: 2017-10-13 19:57:51 by Divatox »

JWP

  • Crazy poster
  • *
  • Posts: 168
  • Karma: 19
    • View Profile
Re: FF VIII How to MOD?
« Reply #32 on: 2017-10-13 22:05:42 »
Well I think I may have found the root of the problem, it looks like if any if statement is > 255 bytes, the offset doesn't get patched correctly.
I'll see if I can find the old code somewhere to patch since the version I'm working on is a bit of a mess atm.

Edit: I've patched the issue and updated the link here

I'm not sure if it will fix the issue that is causing the problem but it does fix a very major issue - it completely screws the logic up but it doesn't show in the code because the decompiler ignores the offset.
To fix any file, you should be able to adjust the textbox to get the compile button and a compile + save should fix it.
« Last Edit: 2017-10-13 22:24:50 by JWP »

Sega Chief

  • No life
  • *
  • Posts: 2539
  • Karma: 151
  • These guys is sick
    • View Profile
Re: FF VIII How to MOD?
« Reply #33 on: 2017-10-13 22:58:27 »
Well I think I may have found the root of the problem, it looks like if any if statement is > 255 bytes, the offset doesn't get patched correctly.
I'll see if I can find the old code somewhere to patch since the version I'm working on is a bit of a mess atm.

Edit: I've patched the issue and updated the link here

I'm not sure if it will fix the issue that is causing the problem but it does fix a very major issue - it completely screws the logic up but it doesn't show in the code because the decompiler ignores the offset.
To fix any file, you should be able to adjust the textbox to get the compile button and a compile + save should fix it.

Nice, an update; cheers for this.

There was another thing that could make the compiler go wonky; in some counter scripts like for the Ifrit enemy there'll be unknown values that can disrupt it when trying to save/compile scripts:

Code: [Select]
self.varDC += 1
if (unknown(0x0A, 03) == 254) {
    if (unknown(0x0A, 04) == 65) {
        if (self.varDF == 0) {
            self.varDF = 1
            target(200)
            domoveid(3)
            return
        }
    }
}

If I change anything in this script, for instance if I change the attack ID or anything else, then it'll run into this error when compiling: 'Syntax error on line 2: no viable alternative at input 'if(unknown'.

JWP

  • Crazy poster
  • *
  • Posts: 168
  • Karma: 19
    • View Profile
Re: FF VIII How to MOD?
« Reply #34 on: 2017-10-13 23:38:50 »
Fixed and updated the link, let me know if you still get any issues.

Girl next door

  • Crazy poster
  • *
  • Posts: 112
  • Karma: 1
    • View Profile
Re: FF VIII How to MOD?
« Reply #35 on: 2017-10-14 16:39:20 »
Great job JWP ! I will test it tonight, hope that works !

Ok lets go, i want to the enemie do:

start casting triple
cast haste, cure (cura or curaga), shell or protect with 50% HP

to resume, he cast support magics in him self when necessary. (like bosses) Right now the enemie use blizzard and reflect on my party XD

to cast a high level magic in the hole party is:

if (rand() % 3 == 0) {
    target(204)
    domoveid(2) <------- my question is, this move in from the list of abilities right?
    return

Yeah that's right.

So I will take your abilities' list and put the others:

1-custom = 2 / anin=13
2-magic = 4(blizzard) / anin=11
3-magic = 31(reflect) / anin=11
4-custom = 2 / anin=13
5-custom = 20(vampire) / anin=14
6-custom = 20(vampire) / anin=14
7-magic = 34(triple) / anim 11
8-magic = 21(cure, you can put cura and curaga for medium and high level) / anim11
9-magic = 35(haste) / anim11
10-magic = 29(protect) / anim 11

Put this in the init AI:

Code: [Select]
        target(200)
        domoveid(5)

Put this in the Turn AI:

Code: [Select]
if (self.hp <= 5) {
    if (self.varDC == 0) {
        self.varDC = 1
        target(200)
        choose(8, 9, 10)
        return
    }
}
else if (rand() % 3 == 0) {
    target(201)
    choose(1, 5, 5)
}
else {
      target(201)
      domoveid(2)
       if (self.status == TRIPLE) {
              target(201)
              domoveid(2)
              target(201)
              domoveid(2)
         }
        return
}

That's a simple possibility, let me know if you want to complicate it.

Divatox

  • Fast newbie
  • *
  • Posts: 49
  • Karma: 2
    • View Profile
Re: FF VIII How to MOD?
« Reply #36 on: 2017-10-14 19:06:49 »
Now he use vampire on it self XD (in the code that you send me =/)

Im trying now just he uses triple, i think its more simple so i did:

1-custom=2 / anim=13
2-magic=4(blizzard) / anim=11
3-magic=34(triple) / anim=11
5-custom=20 (vampire) / anim=14
-----------
INT AI

 target(200)
        domoveid(5)
-----------
TURN AI

if (self.hp <= 5) {
    if (self.varDC == 0) {
        self.varDC = 1
        target(200)
        domoveid(3)
        return
    }
}
else if (rand() % 3 == 0) {
    target(201)
    choose(1, 5, 5)
}
else {
      target(201)
      domoveid(2)
       if (self.status == TRIPLE) {
              target(201)
              domoveid(2)
              target(201)
              domoveid(2)
         }
        return
}
-----
But he still crashes the game doing vampire on it self

JWP

  • Crazy poster
  • *
  • Posts: 168
  • Karma: 19
    • View Profile
Re: FF VIII How to MOD?
« Reply #37 on: 2017-10-14 19:10:10 »
The init code is targeting himself and casting vampire. Also I thought the magic was indexed at 0.
« Last Edit: 2017-10-14 19:13:15 by JWP »

Girl next door

  • Crazy poster
  • *
  • Posts: 112
  • Karma: 1
    • View Profile
Re: FF VIII How to MOD?
« Reply #38 on: 2017-10-14 19:44:42 »
Oops my bad sorry. ^^'

Here's the good one for init:

        target(200)
        domoveid(7)



Also I thought the magic was indexed at 0.

I don't understand what you mean, you can put magic wherever you want in the index.

Edit:

OK JWP, I've tested for Seifer and his gunblade is still invisible. :'(
« Last Edit: 2017-10-14 20:10:03 by Girl next door »

JWP

  • Crazy poster
  • *
  • Posts: 168
  • Karma: 19
    • View Profile
Re: FF VIII How to MOD?
« Reply #39 on: 2017-10-14 20:14:38 »
What I mean is that the magic is numbered 0-15, not 1-16.
In other words, the first magic line is id 0 - getting this incorrect would cause you to reference the wrong magic.

Which dat file?
Did you recompile and insert back into the archive?
What specific changes have you made?
« Last Edit: 2017-10-14 20:19:08 by JWP »

Divatox

  • Fast newbie
  • *
  • Posts: 49
  • Karma: 2
    • View Profile
Re: FF VIII How to MOD?
« Reply #40 on: 2017-10-14 20:27:13 »
It´s true i just tested its not 1-10 it´s 0-9 the command list
now it´s working ^^

Thank so much guys now i will start to make the changes. Last question, in the level to the enemie start always on lvl 100 i just put 100<>100 ?

Girl next door

  • Crazy poster
  • *
  • Posts: 112
  • Karma: 1
    • View Profile
Re: FF VIII How to MOD?
« Reply #41 on: 2017-10-14 21:03:38 »
What I mean is that the magic is numbered 0-15, not 1-16.
In other words, the first magic line is id 0 - getting this incorrect would cause you to reference the wrong magic.

Of course, sorry I didn't understand. ^^

Which dat file?
Did you recompile and insert back into the archive?
What specific changes have you made?

That's the c0m085.dat and here's the 2 AIs I modified:

Turn:

Code: [Select]
self.varDC += 1
if (self.varDC == 4) {
    target(200)
    domoveid(4)
    target(201)
    domoveid(0)
}
else if (self.varDE == 0) {
    if (self.status != PROTECT) {
        self.varDE = 1
        target(200)
        domoveid(5)
        target(200)
        domoveid(8)
    }
    else {
        target(201)
        choose(0, 0, 3)
    }
}
else if (enemy.status == REFLECT) {
    target(201)
    choose(0, 9, 11)
}
else {
    target(201)
    choose(0, 3, 3)
}

And counter:

Code: [Select]
if (self.varDD == 0) {
    if (self.hp < 5) {
        self.varDD = 1
        target(200)
        domoveid(6)
        target(201)
        domoveid(10)
    }
}

First I tried to just recompile the AI and second, I took a fresh file. For the same result. :(

Last question, in the level to the enemie start always on lvl 100 i just put 100<>100 ?

That's not clear sorry.
« Last Edit: 2017-10-14 21:06:17 by Girl next door »

Divatox

  • Fast newbie
  • *
  • Posts: 49
  • Karma: 2
    • View Profile
Re: FF VIII How to MOD?
« Reply #42 on: 2017-10-14 21:47:59 »
Like how do i make a enemie start on level 100? Link in the 2 island, close to heaven and hell

Girl next door

  • Crazy poster
  • *
  • Posts: 112
  • Karma: 1
    • View Profile
Re: FF VIII How to MOD?
« Reply #43 on: 2017-10-14 21:56:31 »
You can't do that with Ifrit, use Cactilio http://forums.qhimm.com/index.php?topic=16275.0

JWP: I've tested another battle and the graphical bug seems to have disappear except for the Seifer's gunblade.

Edit: well tested a battle with 3 different enemies, Fungar, Anacondor and Wendigo and the bug is already here. :(
« Last Edit: 2017-10-14 22:10:48 by Girl next door »

JWP

  • Crazy poster
  • *
  • Posts: 168
  • Karma: 19
    • View Profile
Re: FF VIII How to MOD?
« Reply #44 on: 2017-10-14 23:14:28 »
I'll do some investigating. It'd be a huge help if you could find the smallest change that causes the issue so that I can isolate the problem quicker.

Girl next door

  • Crazy poster
  • *
  • Posts: 112
  • Karma: 1
    • View Profile
Re: FF VIII How to MOD?
« Reply #45 on: 2017-10-14 23:21:00 »
I've already done some investigating to find where is the problem but I understand nothing. Sometimes a small change is efficient and sometimes a big change and it works without problem. Another weird thing: sometimes 2 enemies can work together on a battle scene but if you change the scene, it doesn't work... really weird.

Divatox

  • Fast newbie
  • *
  • Posts: 49
  • Karma: 2
    • View Profile
Re: FF VIII How to MOD?
« Reply #46 on: 2017-10-15 04:26:05 »
I begun to edit/mod some bosses to rise the dificulty and i notice something:



What happens if i change those 3 parts?
party level
char level
level increment
------
And why some abilities are 264,265,266 all null? Can i change them without a problem? add magics or repeat a definided attack
« Last Edit: 2017-10-15 04:35:52 by Divatox »

JWP

  • Crazy poster
  • *
  • Posts: 168
  • Karma: 19
    • View Profile
Re: FF VIII How to MOD?
« Reply #47 on: 2017-10-15 11:32:47 »
Hmm...
After recompiling c0m085.dat without any changes to the code, I get some changes to the file.
The offsets all change but this should be fine as it's related to a different number of 00's at the end of the code (the first one hit causes a return, so the count doesn't matter)
However there is a concerning difference:
Code: [Select]
if (self.hp < 5)
changes from:
02 00 00 01 05 00 0E 00
to:
02 00 C8 01 05 00 0E 00

I'll have to do some more investigating to see the impact of this change.
In addition to this, I'll code a test to recompile all the AI and check they come out the same to remove any other issues like this.

Sega Chief

  • No life
  • *
  • Posts: 2539
  • Karma: 151
  • These guys is sick
    • View Profile
Re: FF VIII How to MOD?
« Reply #48 on: 2017-10-15 12:23:19 »
I begun to edit/mod some bosses to rise the dificulty and i notice something:
What happens if i change those 3 parts?
party level
char level
level increment
------
And why some abilities are 264,265,266 all null? Can i change them without a problem? add magics or repeat a definided attack

Those 3 parts are just for EXP calculation and don't affect anything in the enemy file; they're for the user's reference.

Average Party Level sets how much EXP will be gained with the team.

Finishing Char Level sets how much extra EXP will be won from the killing blow.

And Level Increment sets how many levels will be shown (for making the table more streamlined).

You can change enemy abilities, but make sure to have them retain a relevant animation. Magic should use their magic-casting animation, etc.

Girl next door

  • Crazy poster
  • *
  • Posts: 112
  • Karma: 1
    • View Profile
Re: FF VIII How to MOD?
« Reply #49 on: 2017-10-15 13:25:40 »
Hmm...
After recompiling c0m085.dat without any changes to the code, I get some changes to the file.
The offsets all change but this should be fine as it's related to a different number of 00's at the end of the code (the first one hit causes a return, so the count doesn't matter)
However there is a concerning difference:
Code: [Select]
if (self.hp < 5)
changes from:
02 00 00 01 05 00 0E 00
to:
02 00 C8 01 05 00 0E 00

I'll have to do some more investigating to see the impact of this change.
In addition to this, I'll code a test to recompile all the AI and check they come out the same to remove any other issues like this.

Anyway, it's better now with the update. I've done a battle that was impossible before, with Seifer, Fujin and Raijin. I have changed the 3 AIs and it works ! But with the gunblade disabled or I have a big graphical bug. There must be several things you have to modify but you'll make it ! :)


And why some abilities are 264,265,266 all null? Can i change them without a problem? add magics or repeat a definided attack

These are special actions like a dialog, don't change them. You can also use Doomtrain to see more details. http://forums.qhimm.com/index.php?topic=17090.0
« Last Edit: 2017-10-15 13:29:29 by Girl next door »