Author Topic: [FFVIII-PCSteam] Problems with Ifrit program  (Read 573 times)

Hazedge

  • Crazy poster
  • *
  • Posts: 108
  • Karma: 1
    • View Profile
[FFVIII-PCSteam] Problems with Ifrit program
« on: 2019-07-30 08:52:26 »

As the imagem shows, I'm trying to edit Iguion AI.
I'm trying to remove his Auto-Reflect even with Carbuncle, but everytime I try to remove anything in Counter tab it gives me this error.
The Counter tab had this code:
Spoiler: show
Code: [Select]
if (gfStolen != 204) {
    autostatus(23, 0)
}
battle.var60 += 1


In Turn tab there was this (gfStolen != 204) too but I could remove it without the error, and now if I try to put it back it gives me the same error.
Is it not possible to remove? Or I need to do something else to make it work?
This is what I did in Turn tab:
Spoiler: show
Code: [Select]
if (self.hp >= 8) {
if (rand() % 2 == 0) {
if (enemy.alive == 2) {
        target(204)
        domoveid(2)
return
}
}
else {
target(201)
domoveid(0)
return
}
}
if (self.hp > 4) {
if (rand() % 2 == 0) {
if (enemy.alive == 2) {
        target(204)
        domoveid(2)
return
}
}
else if (rand() % 2 == 0){
target(201)
domoveid(0)
target(201)
domoveid(0)
return
}
else {
target(201)
domoveid(0)
return
}
}
if (self.hp <= 4) {
self.varDC += 1
if (self.varDC >= 3) {
target(204)
domoveid(1)
return
}
if (rand() % 2 == 0) {
if (enemy.alive == 2) {
        target(204)
        domoveid(2)
return
}
}
else if (rand() % 2 == 0){
target(201)
domoveid(0)
target(201)
domoveid(0)
return
}
else {
target(201)
domoveid(0)
return
}
}
« Last Edit: 2019-07-30 09:26:32 by Hazedge »

Girl next door

  • Crazy poster
  • *
  • Posts: 144
  • Karma: 5
    • View Profile
Re: [FFVIII-PCSteam] Problems with Ifrit program
« Reply #1 on: 2019-07-31 01:04:00 »
You can't let the tab empty. You just have tu let the formula "battle.var60 += 1" alone.

Hazedge

  • Crazy poster
  • *
  • Posts: 108
  • Karma: 1
    • View Profile
Re: [FFVIII-PCSteam] Problems with Ifrit program
« Reply #2 on: 2019-07-31 03:25:30 »
You can't let the tab empty. You just have tu let the formula "battle.var60 += 1" alone.
Unfortunately that didn't work as well... It keep saying an error related to that gfstolen code.
In situations like that, veteran modders don't edit anything to avoid getting these errors or theres something else we can do?

Girl next door

  • Crazy poster
  • *
  • Posts: 144
  • Karma: 5
    • View Profile
Re: [FFVIII-PCSteam] Problems with Ifrit program
« Reply #3 on: 2019-07-31 17:40:29 »
I just did it to verify and it works. What did you do exactly ?

Leythalknight

  • Fast newbie
  • *
  • Posts: 20
  • Karma: 2
    • View Profile
Re: [FFVIII-PCSteam] Problems with Ifrit program
« Reply #4 on: 2019-07-31 20:46:21 »
Try replacing the script in the Counter tab with "return" (no quotes) and see if it compiles. If so, you can then add battle.var60 += 1 back to the Counter script afterward if you want.

Hazedge

  • Crazy poster
  • *
  • Posts: 108
  • Karma: 1
    • View Profile
Re: [FFVIII-PCSteam] Problems with Ifrit program
« Reply #5 on: 2019-08-01 14:35:17 »
What the hell???
I tried again to delete the gfstolen code and it worked  :o
What witchcraft is this?

EDIT:
Even removing the code, Iguion still start the fight with REFLECT on.
These are the codes I'm using this time:

Init tab
Spoiler: show
Code: [Select]
battle.var60 = 3
if (battle.var61 == 0) {
    if (save.var57 == 0) {
        battle.var61 = 1
        save.var57 = 1
        movesay(1)
        movesay(2)
        movesay(3)
        movesay(4)
        unknown1C(4)
    }
    else {
        battle.var61 = 1
        say(0)
    }
}


Turn tab:
Spoiler: show
Code: [Select]
if (self.status == SILENCE) {
self.varDC += 1
self.varDD += 1
}
if (self.status != SILENCE) {
target(200)
domoveid(2)
}
if (self.varDD >= 3) {
target(200)
domoveid(4)
}
if (self.status == PROTECT) {
changestat(1, 3)
}
if (self.status != PROTECT) {
changestat(1, 0)
}
if (self.hp >= 7) {
target(201)
domoveid(0)
return
}
if (self.hp >= 4) {
if (rand() % 1 == 0) {
if (enemy.alive == 2) {
target(204)
domoveid(1)
return
}
else {
target(201)
domoveid(0)
return
}
target(201)
domoveid(0)
return
}
}
if (self.hp < 4) {
self.varDC += 1
if (self.varDC >= 10) {
self.varDC = 0
target(201)
domoveid(3)
return
}
if (rand() % 1 == 0) {
if (enemy.alive == 2) {
target(204)
domoveid(1)
return
}
else {
target(201)
domoveid(0)
target(201)
domoveid(0)
return
}
target(201)
domoveid(0)
return
}
}


Counter tab:
Spoiler: show
Code: [Select]
battle.var60 += 1


The idea is:
Iguion will cast PROTECT every turn and if he does his defenses will dramatically increases, so you have to cast Silence on him to avoid it.
Every turn hes silenced, he'll charge 1 var to remove the debuff on the count of 3 and charges 1 var to use Magma Breath (which is pretty strong this time, using as an Ultimate Attack).
Are those codes correct? Am I doing something wrong? Do I use some Unnamed Enemy Attack on Doomtrain to remove Reflect on himself? Or theres a code that I can use to remove REFLECT status?
« Last Edit: 2019-08-01 17:00:57 by Hazedge »

Girl next door

  • Crazy poster
  • *
  • Posts: 144
  • Karma: 5
    • View Profile
Re: [FFVIII-PCSteam] Problems with Ifrit program
« Reply #6 on: 2019-08-01 17:40:49 »
The problem here is probably the fact that he has reflect status due to the fact he has Carbuncle. And you can't do anything for that (maybe change something in the exe but I don't know). To avoid this problem he should use a protect stone instead of Protect.

There are some problems in your AI but I don't have the time now, I will explain later.

Hazedge

  • Crazy poster
  • *
  • Posts: 108
  • Karma: 1
    • View Profile
Re: [FFVIII-PCSteam] Problems with Ifrit program
« Reply #7 on: 2019-08-01 23:21:24 »
The problem here is probably the fact that he has reflect status due to the fact he has Carbuncle. And you can't do anything for that (maybe change something in the exe but I don't know). To avoid this problem he should use a protect stone instead of Protect.

There are some problems in your AI but I don't have the time now, I will explain later.
I thought the gfstolen code was the one that was putting REFLECT on if Carbuncle was still on his stock.
If he uses Protect Stone it wont be reflected then? I'm going to try it out.
I couldn't test this code because I was leaving to work, so it probably had some problems to fix  :-D

EDIT:
Yeah I saw some problems with the Turn tab, fixed some lines already...
Spoiler: show
Code: [Select]
if (self.status == SILENCE) {
    self.varDC += 1
    self.varDD += 1
}
if (self.status != SILENCE) {
    if (self.status != PROTECT) {
target(200)
domoveid(2)
}
}
if (self.varDD >= 3) {
    self.varDD = 0
    target(200)
    domoveid(4)
}
if (self.status == PROTECT) {
    changestat(1, 20)
    self.varDE += 1
}
if (self.varDE >= 3) {
    self.varDE = 0
    target(200)
    domoveid(5)
}
if (self.status != PROTECT) {
    changestat(1, 0)
}
if (self.hp >= 7) {
    target(201)
    domoveid(0)
    return
}
if (self.hp >= 4) {
    if (rand() % 1 == 0) {
        if (enemy.alive == 2) {
            target(204)
            domoveid(1)
            return
        }
        else {
            target(201)
            domoveid(0)
            return
        }
        target(201)
        domoveid(0)
        return
    }
}
if (self.hp < 4) {
    self.varDC += 1
    if (self.varDC >= 10) {
        self.varDC = 0
        target(201)
        domoveid(3)
        return
    }
    if (rand() % 1 == 0) {
        if (enemy.alive == 2) {
            target(204)
            domoveid(1)
            return
        }
        else {
            target(201)
            domoveid(0)
            target(201)
            domoveid(0)
            return
        }
        target(201)
        domoveid(0)
        return
    }
}


His abilities order are:
0 - kernel Attack, ability 2, anim 14
1 - kernel Resonance, ability 121, anim 13
2 - kernel Protect Stone, ability 23, anim 11
3 - kernel Magma Breath, ability 120, anim 12
4 - kernel Barrier Change (edited to remove all debuffs), ability 235, anim 11
5 - kernel Unnamed (edited to remove all buffs), ability 232, anim 11
« Last Edit: 2019-08-01 23:53:34 by Hazedge »

Hazedge

  • Crazy poster
  • *
  • Posts: 108
  • Karma: 1
    • View Profile
Re: [FFVIII-PCSteam] Problems with Ifrit program
« Reply #8 on: 2019-08-02 00:32:33 »
I got it!

Init tab
Spoiler: show
Code: [Select]
battle.var60 = 3
if (battle.var61 == 0) {
    if (save.var57 == 0) {
        battle.var61 = 1
        save.var57 = 1
        movesay(1)
        movesay(2)
        movesay(3)
        movesay(4)
        unknown1C(4)
    }
    else {
        battle.var61 = 1
        say(0)
    }
}
autostatus(23, 0)
self.varDC = 0
self.varDD = 0
self.varDE = 0


Turn tab:
Spoiler: show
Code: [Select]
if (self.status == SILENCE) {
    self.varDC += 2
    self.varDD += 1
}
if (self.status != SILENCE) {
    if (self.status != PROTECT) {
        target(200)
        domoveid(2)
    }
}
if (self.varDD >= 3) {
    self.varDD = 0
    target(200)
    domoveid(4)
}
if (self.status == PROTECT) {
    changestat(1, 30)
    self.varDE += 1
}
if (self.varDE >= 3) {
    self.varDE = 0
    target(200)
    domoveid(5)
}
if (self.status != PROTECT) {
    changestat(1, 0)
}
if (self.hp >= 7) {
    target(201)
    domoveid(0)
    return
}
if (self.hp >= 4) {
    if (rand() % 1 == 0) {
        if (enemy.alive == 2) {
            target(204)
            domoveid(1)
            return
        }
        else {
            target(201)
            domoveid(0)
            return
        }
        target(201)
        domoveid(0)
        return
    }
}
if (self.hp < 4) {
    self.varDC += 1
    if (self.varDC >= 10) {
        self.varDC = 0
        target(201)
        domoveid(3)
        return
    }
    if (rand() % 1 == 0) {
        if (enemy.alive == 2) {
            target(204)
            domoveid(1)
            return
        }
        else {
            target(201)
            domoveid(0)
            target(201)
            domoveid(0)
            return
        }
        target(201)
        domoveid(0)
        return
    }
}


Counter tab:
Spoiler: show
Code: [Select]
battle.var60 += 1


Its working flawlessly!!
I can even put then to use Protect instead of Protect Stone!
What you think?
« Last Edit: 2019-08-02 01:00:21 by Hazedge »

Girl next door

  • Crazy poster
  • *
  • Posts: 144
  • Karma: 5
    • View Profile
Re: [FFVIII-PCSteam] Problems with Ifrit program
« Reply #9 on: 2019-08-02 00:54:08 »
Well, I wouldn't have write this like this but if it works, it's nice ! ;)

Hazedge

  • Crazy poster
  • *
  • Posts: 108
  • Karma: 1
    • View Profile
Re: [FFVIII-PCSteam] Problems with Ifrit program
« Reply #10 on: 2019-08-02 01:01:01 »
Well, I wouldn't have write this like this but if it works, it's nice ! ;)
Are there a better way to write it?
I'm kinda amateur to programing, any hint is very much welcome!  :mrgreen:

EDIT:
Strange... Even putting this code
Code: [Select]
if (enemy.alive == 2) the boss still activate the command when there is only 1 on the field.
« Last Edit: 2019-08-02 01:03:24 by Hazedge »

Girl next door

  • Crazy poster
  • *
  • Posts: 144
  • Karma: 5
    • View Profile
Re: [FFVIII-PCSteam] Problems with Ifrit program
« Reply #11 on: 2019-08-02 14:11:56 »
There's a problem with the tool. You'll have to change it manually by hexedit. Search for 02 06 c9 and change it by 02 06 c8.

I'm amateur too and learned by my own (with a little help like you) so I won't teach you a lesson. If it works that's fine ! :)

Hazedge

  • Crazy poster
  • *
  • Posts: 108
  • Karma: 1
    • View Profile
Re: [FFVIII-PCSteam] Problems with Ifrit program
« Reply #12 on: 2019-08-02 14:29:54 »
There's a problem with the tool. You'll have to change it manually by hexedit. Search for 02 06 c9 and change it by 02 06 c8.

I'm amateur too and learned by my own (with a little help like you) so I won't teach you a lesson. If it works that's fine ! :)
I couldnt find 02 06 c9, instead I fould two lines containing 02 06 c8.



I'm pretty bad at hex xD

Girl next door

  • Crazy poster
  • *
  • Posts: 144
  • Karma: 5
    • View Profile
Re: [FFVIII-PCSteam] Problems with Ifrit program
« Reply #13 on: 2019-08-02 17:45:04 »
Wooops that's the contrary my bad. Sorry !

Hazedge

  • Crazy poster
  • *
  • Posts: 108
  • Karma: 1
    • View Profile
Re: [FFVIII-PCSteam] Problems with Ifrit program
« Reply #14 on: 2019-08-03 04:10:34 »
Can someone tell me how to edit the hex file? I can open it with some websites like www.onlinehexeditor.com for example, but viewing the hex is everything I do, I can't edit it and don't know how  :'(

EDIT:
Forget about it, I discovered the reason for it.
This a wrong code. If I use if (enemy.alive == 2) it wont recognize the enemy team, it will recognize the player team. I've made a test myself putting then to cast Blizzard if the code equals 1 and Thunder if the code equals 2 at every turn, so they were casting Thunder everytime... Until Irvine died, where they started casting Blizzard. Which comes the question: isnt it suppose to work as initially said? To count enemy numbers instead of characters? If thats working to count for alive character, which code I can use to count living monsters in the fight?
« Last Edit: 2019-08-03 08:53:03 by Hazedge »

Girl next door

  • Crazy poster
  • *
  • Posts: 144
  • Karma: 5
    • View Profile
Re: [FFVIII-PCSteam] Problems with Ifrit program
« Reply #15 on: 2019-08-03 13:55:09 »
Yeah I should have explain more :

0206c8 > characters alive
0206c9 > enemies alive

There is the same problem with enemy status :

0205c8 > character status
0205c9 > enemy status

For hexedit, I use Transhexlation : https://www.romhacking.net/utilities/219/