Author Topic: [PC] Enemy editor - IFRIT (0.11C)  (Read 141326 times)

JWP

  • *
  • Posts: 194
    • View Profile
Re: [FF8] Enemy editor - IFRIT (0.11)
« Reply #125 on: 2016-08-23 13:22:04 »
I was planning to add the feature but I haven't got around to it yet.

Girl next door

  • *
  • Posts: 144
    • View Profile
Re: [FF8] Enemy editor - IFRIT (0.11)
« Reply #126 on: 2016-08-23 18:32:57 »
Fine, I will wait. ;)

Girl next door

  • *
  • Posts: 144
    • View Profile
Re: [FF8] Enemy editor - IFRIT (0.11)
« Reply #127 on: 2016-08-29 01:47:37 »
Now that I know how to edit texts, I've searched a way to edit this:



I can't find it in the c0m113 nor in the kernel. Do you know where is it ?

JWP

  • *
  • Posts: 194
    • View Profile
Re: [FF8] Enemy editor - IFRIT (0.11)
« Reply #128 on: 2016-08-29 01:57:11 »
It's definitely in c0m113.dat, also for some reason it's in the file 4 times.
In the English version the data is at 0x5E10:
Code: [Select]
03 34 20 3F 45 4C 4C 4C 3B 3B 3B 2E 3E
03 34 being Rinoa
« Last Edit: 2016-08-29 02:02:22 by JWP »

Girl next door

  • *
  • Posts: 144
    • View Profile
Re: [FF8] Enemy editor - IFRIT (0.11)
« Reply #129 on: 2016-08-29 02:13:04 »
Well, I've tried to change those offsets but that doesn't work (in the french version, we have it only two times). I think that's because this is not the good text. In the french version Rinoa say "Aaaahhh..." when the party heal her but here she say "Aaaaaahh" which refers to the ennemy attack 324. So I think "Aaaaaahh" is simply the attack's name....

JWP

  • *
  • Posts: 194
    • View Profile
Re: [FF8] Enemy editor - IFRIT (0.11)
« Reply #130 on: 2016-08-29 02:48:57 »
If it's an attack name, it'll be in kernel.bin

Girl next door

  • *
  • Posts: 144
    • View Profile
Re: [FF8] Enemy editor - IFRIT (0.11)
« Reply #131 on: 2016-08-29 03:19:17 »
Well no, I don't find it in the kernel, that's weird...

JWP

  • *
  • Posts: 194
    • View Profile
Re: [FF8] Enemy editor - IFRIT (0.11)
« Reply #132 on: 2016-08-29 04:06:06 »
It might be in Adel (c0m112.dat), it looks like there's an "AHHH...!" there too
at 0x1B8E6
Code: [Select]
03 34 20 3F 45 4C 4C 4C 3B 3B 3B 2E 3E
« Last Edit: 2016-08-29 04:09:04 by JWP »

Girl next door

  • *
  • Posts: 144
    • View Profile
Re: [FF8] Enemy editor - IFRIT (0.11)
« Reply #133 on: 2016-08-29 04:24:47 »
Yeeees ! That was it ! Thanks ! ;D

Girl next door

  • *
  • Posts: 144
    • View Profile
Re: [FF8] Enemy editor - IFRIT (0.11)
« Reply #134 on: 2016-09-02 18:17:39 »
Hi, I'm back for another question: is it possible to give the ability Mad Rush to an enemy and how could I do that ?

Callisto

  • *
  • Posts: 303
    • View Profile
Re: [FF8] Enemy editor - IFRIT (0.11)
« Reply #135 on: 2016-09-03 00:15:58 »
I would suggest modifying one of the already existing unused enemy attacks, such as Holy (#379), using Doomtrain and Carbuncle tools.

Girl next door

  • *
  • Posts: 144
    • View Profile
Re: [FF8] Enemy editor - IFRIT (0.11)
« Reply #136 on: 2016-09-04 00:23:39 »
Good idea, it works. Thanks ! ;D

Girl next door

  • *
  • Posts: 144
    • View Profile
Re: [FF8] Enemy editor - IFRIT (0.11)
« Reply #137 on: 2016-09-04 18:39:12 »
 Well I have another problem with an AI. I have changed the AI of Granaldo:

Code: [Select]
if (rand() % 3 == 0) {
    return
}
else {
    if (enemy.alive == 1) {
        target(201)
        choose(3, 4, 5)
    }
    target(201)
    choose(0, 1, 2)
}

I want to make the AI change when Granaldo is alone in battle but the condition "enemy.alive == 1" works only with the party members. So that its AI change only when we have only one character alive. How could I change it ?

Sega Chief

  • *
  • Posts: 4086
  • These guys is sick
    • View Profile
Re: [FF8] Enemy editor - IFRIT (0.11)
« Reply #138 on: 2016-09-04 18:50:16 »
If it's like FF7 AI at all, then the enemy won't treat the other enemies on the field as 'enemies' but as allies instead (and considers the player party actors as enemies). Is there an opcode for allies anywhere? Trauma might have something, it spawns those little drones and probably has an AI check to see if they are dead or not before spawning them. It might also check for the current status of a particular monster's ID, that could be another way of setting up the condition.

Girl next door

  • *
  • Posts: 144
    • View Profile
Re: [FF8] Enemy editor - IFRIT (0.11)
« Reply #139 on: 2016-09-04 19:12:16 »
Well, the problem is that the formula enemy.alive seems to work with allies and ennemies. Here's the Trauma death's AI:

Code: [Select]
if (enemy.alive == 1) {
    if (self.varE0 == 0) {
        self.varE0 = 1
        target(200)
        domoveid(4)
        remove(200)
    }
}
else {
    target(207)
    domoveid(5)
}

When it's alone, it dies but if there is still a drauma, it uses Drain on it.

JWP

  • *
  • Posts: 194
    • View Profile
Re: [FF8] Enemy editor - IFRIT (0.11)
« Reply #140 on: 2016-09-04 20:30:29 »
I'll take a look at the opcode, it might be that I've set a byte wrong.

EDIT: looks like I'm writing 02 06 C8 00 XX XX XX XX instead of 02 06 C9 00 XX XX XX XX. I guess in this case C8 is used for player characters and C9 is used for monsters.
The reason for this issue is that a lot of the conditionals seem have this byte set to C8 when it's not used but it doesn't seem to be the case here - you're also likely to get this issue if you recompile the code.
Partly the reason the AI stuff is still in beta is because a lot of the stuff is still unknown :P.
You'd probably have to change it manually after compiling it for now until I get around to fixing the issue.
« Last Edit: 2016-09-04 20:54:24 by JWP »

Girl next door

  • *
  • Posts: 144
    • View Profile
Re: [FF8] Enemy editor - IFRIT (0.11)
« Reply #141 on: 2016-09-05 01:51:31 »
Thanks, I managed to do it. ;)

Girl next door

  • *
  • Posts: 144
    • View Profile
Re: [FF8] Enemy editor - IFRIT (0.11)
« Reply #142 on: 2016-09-17 15:34:04 »
Hi !

I have a problem with the AI of Tomberry. I want to change the condition of spawn ot Tomberry Sr. Put 1 battle instead of 20 or 50 to make it spawn. Here's the code:

Code: [Select]
save.var51 += 1
die()
if (battle == 236) {
    if (save.var51 >= 20) {
        if (save.var52 == 0) {
            unknown33()
            launch(0)
            return
        }
    }
}
if (battle == 237) {
    if (save.var51 >= 50) {
        if (save.var52 == 0) {
            unknown33()
            launch(0)
            return
        }
    }
}

When I put 1 instead of 20 and 50, it corrupts the file. How I can do that manually ?

JWP

  • *
  • Posts: 194
    • View Profile
Re: [FF8] Enemy editor - IFRIT (0.11)
« Reply #143 on: 2016-09-20 14:14:11 »
0xC3E0 from 0x14 to 0x01
0xC405 from 0x32 to 0x01

I'd be interested to know why the file ended up corrupted though.

Girl next door

  • *
  • Posts: 144
    • View Profile
Re: [FF8] Enemy editor - IFRIT (0.11)
« Reply #144 on: 2016-09-20 18:58:22 »
Thanks !

I don't know why it corrupts the file but what I know is that I have troubles with fonctions which have self.var or save.var. Here's an example with the Fastitocalon fake. Its AI:

Code: [Select]
if (rand() % 3 == 0) {
    return
}
if (self.status == CONFUSION) {
    target(207)
    if (self.varDC == 0) {
        target(200)
        domoveid(2)
        self.varDC = 1
        changeresistance(3, 900)
        changestat(1, 10)
        changestat(3, 10)
    }
    else {
        target(207)
        domoveid(1)
    }
    return
}
if (self.varDC == 0) {
    target(201)
    domoveid(0)
}
else {
    target(201)
    domoveid(1)
}

When I try to change a simple number, I can compile it, save and when I go back to the file, the AI has changed to something bugged:

Code: [Select]
if (rand() % 3 == 0) {
    return
}
if (self.status == CHARGED) {
    target(207)
    if (self.hp == 20) {
        domoveid(2)
        self.varDC = 1
        changeresistance(3, 900)
        changestat(1, 10)
        changestat(3, 10)
    }
    else {
        target(204)
        domoveid(1)
    }
    return
}
if (self.hp == 7) {
    domoveid(0)
}
else {
    target(201)
    domoveid(1)
}

JWP

  • *
  • Posts: 194
    • View Profile
Re: [FF8] Enemy editor - IFRIT (0.11)
« Reply #145 on: 2016-09-21 10:36:27 »
I believe the majority of the corruption is a problem that I fixed on July 25th, you can get the updated version here.
The issue was that variables in if statements weren't being compiled properly and ended up missing 2 bytes.

Girl next door

  • *
  • Posts: 144
    • View Profile
Re: [FF8] Enemy editor - IFRIT (0.11)
« Reply #146 on: 2016-09-21 18:08:24 »
Oh great, I've missed this update. I've tried it and it works fine, thanks.

Girl next door

  • *
  • Posts: 144
    • View Profile
Re: [FF8] Enemy editor - IFRIT (0.11)
« Reply #147 on: 2016-09-21 19:53:24 »
Sorry for the double post.

Now, I want to use save.var for sidequests but I wonder how it works. I tought it use  this list of variables: http://wiki.qhimm.com/view/FF8/Variables but no, that's not the case. So, where I can find the good list and is there some unused ?

JWP

  • *
  • Posts: 194
    • View Profile
Re: [FF8] Enemy editor - IFRIT (0.11)
« Reply #148 on: 2016-09-21 20:21:36 »
Those variables are only for field scripts, the battle ones are listed here:

and the 8 save vars are as follows:
Code: [Select]
0x0CF4 4 bytes Unknown
0x0CF8 4 bytes Battle: Tonberry killed count
0x0CFC 4 bytes Battle: Tonberry Sr killed (yeah, this is a boolean)
0x0D00 4 bytes Unknown
0x0D04 4 bytes Battle: First "Bug" battle (R1 tip)
0x0D08 4 bytes Battle: First "Bomb" battle (Elemental tip)
0x0D0C 4 bytes Battle: First "T-Rex" battle (Mental tip)
0x0D10 4 bytes Battle: First "Irvine" battle (Irvine's limit break tip)

The offsets are probably slightly wrong but they're in the right order.
the first one is save.var50 and the last one is save.var57.

You could probably edit out some of the tutorial code in the AI or use one of the unknown ones if they're not used.
save.var50 is used by the Guard AI - I'm not sure where it's set though, I couldn't find any instances of save.var53.
« Last Edit: 2016-09-21 20:37:45 by JWP »

Girl next door

  • *
  • Posts: 144
    • View Profile
Re: [FF8] Enemy editor - IFRIT (0.11)
« Reply #149 on: 2016-09-22 07:49:01 »
Hum fine, so I can use 6 save vars (I've deleted the AI tutorials), that's not much.... anyway thanks for the help. :)