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

JWP

  • *
  • Posts: 194
    • View Profile
Re: [FF8] Enemy editor - IFRIT (0.11)
« Reply #100 on: 2016-06-22 21:40:32 »
What happens when you use the standard version of Ifrit?
Bear in mind it stores some stuff in the registry (HKEY_CURRENT_USER\SOFTWARE\Ifrit) that's used in both versions and I've only tested the new version with folder opening.

I'm going to guess that error is a null reference exception of some sort due to it not being able to open the requested file.
Have you moved the file you last had open in Ifrit - or was the last file you had open one the 3 files that the new version doesn't deal with well?
« Last Edit: 2016-06-22 21:47:12 by JWP »

mexico

  • Pirate
  • *
  • Posts: 78
    • View Profile
Re: [FF8] Enemy editor - IFRIT (0.11)
« Reply #101 on: 2016-06-23 07:45:46 »
I have the same thing with the standard version. And I haven't open a file with the tool. It's the first time I'm using it (I've used it before, maybe 1 or 2 years ago but that was an old version very different ). I have this error when I launch the tool. I've tried to paste the battle.fs in ifrit but I have the same thing.

Edit: I've tried it with another PC, which I never used Ifrit before and it works. So it seems that Ifrit "remember" that I used it before. How can I delete this "memory" ?
« Last Edit: 2016-06-23 07:56:36 by mexico »

gjoerulv

  • *
  • Posts: 1225
  • me
    • View Profile
    • My Youtube
Re: [FF8] Enemy editor - IFRIT (0.11)
« Reply #102 on: 2016-06-23 09:20:18 »
ugh... I knew about that issue and thought it was solved.

Open regedit (hold "windows key"+"r", type "regedit" then hit ok). You'll see a folder (on root) named HKEY_CURRENT_USER.

Your goal is to find and delete the "Ifrit" folder. It should be "HKEY_CURRENT_USER\SOFTWARE\Ifrit" or "HKEY_CURRENT_USER\SOFTWARE\Wow6432Node\Ifrit" or something similar.

EDIT: Looking at the code, I see there are some really odd checks (for example: "if (fileStream.Length > Int32.MaxValue) { ... }" haha).
« Last Edit: 2016-06-23 09:43:53 by gjoerulv »

mexico

  • Pirate
  • *
  • Posts: 78
    • View Profile
Re: [FF8] Enemy editor - IFRIT (0.11)
« Reply #103 on: 2016-06-23 15:44:59 »
Thanks ! Found it and delete it ! Then it works ! :D

evilmog6

  • *
  • Posts: 12
    • View Profile
Re: [FF8] Enemy editor - IFRIT (0.11)
« Reply #104 on: 2016-06-25 00:05:45 »
Hello gjoerulv, JWP, and forumites,

The addition of the AI editor beta work to your tool has me wanting to jump in to modding ff8 too so this is my first post. All the tools here are amazing genius work, I think, but this one would round out the portfolio. I want to say keep it up! This is amazing work!

I also am just fiddling with it and wanted to ask a question about it to see if it is something I am just not understanding how to do, or if it is a limitation you are looking into, or if it is a limitation that will exist in the engine even if this tool is fully finished because of how the assumptions they made in their script language for the needs of the original game.

Anyway, I am trying to make a rule in the AI so that a monster will only use an attack on an enemy character when that character doesn't have a particular status, but  also it will continue to use that attack until ALL the characters have that status, and then not use that attack anymore. Here is the code for the Bite Bug I edited, where ability "1" is "Fart" (lol) which causes BERSERK.

Code: [Select]
if (rand() % 3 == 0) {
    return
}
if (self.status == CONFUSION) {
    target(207)
    domoveid(0)
    return
}
if (enemy.status == BERSERK) {
    targetadv(0, 200, 0, 5)
    domoveid(1)
    return
}
if (enemy.status != BERSERK) {
    target(201)
    domoveid(1)
    return
}
target(201)
domoveid(0)
 

The problem is targetadv(0, 200, 0, 5) works until all the characters have the status, and then crashes the game. This seems to be a infinite loop, overflow, or some similar logic error because it cannot find a target without the status to attack, but it seems it is not optional to pass on this attempt with a try/catch of some kind. So, I tried ALL_ENEMIES and the numeric values in a bunch of Hail Mary configurations in the function to see if I could get the test to only run true if all characters have the status, whereas enemy.status seems to be if any at all do, but none of these shots in the dark would compile.

Sorry for a long first post, but I am very excited about this tool, and if the above could be accomplished I would be even more.

« Last Edit: 2016-06-25 00:22:42 by evilmog6 »

JWP

  • *
  • Posts: 194
    • View Profile
Re: [FF8] Enemy editor - IFRIT (0.11)
« Reply #105 on: 2016-06-25 03:22:51 »
If you're trying to target non-berserk enemies, it should be more like:
Code: [Select]
if (rand() % 3 == 0) {
    return
}
if (self.status == CONFUSION) {
    target(207)
    domoveid(0)
    return
}
if (enemy.status != BERSERK) {
    targetadv(0, 200, 3, 5)
    domoveid(1)
    return
}
target(201)
domoveid(0)

but I'm not sure if that still crashes the game or not, I'll need to do a bit more digging into the code but I'm running an event this weekend, so it probably won't be until Monday evening.
« Last Edit: 2016-06-25 04:42:18 by JWP »

evilmog6

  • *
  • Posts: 12
    • View Profile
Re: [FF8] Enemy editor - IFRIT (0.11)
« Reply #106 on: 2016-06-25 12:35:30 »
Thank you so much for the reply and continuing to work on this!

I forgot to mention that I had fiddled with the third argument being 3 in the targetadv function too in some of my shots in the dark previously. I'm not sure how I ended up posting what I posted honestly, that's what I meant to post but was making so many changes to the function I guess I screwed up.

In any case, using "3" in the 3rd argument does work but not inside of the negative lookup for the status, because then once a single character has the status, the condition if(enemy.status != BERSERK) always returns false, so the negative lookup inside never happens. If you put targetadv(0,200,3,5) inside if(enemy.status == BERSERK), it only crashes the game after you get to the point where all the characters have the status.

So, in summary, enemy.status != BERSERK returns true only if NO characters have the status, and enemy.status == BERSERK returns true if even ONE character does, and additionally, targetadv() seems to cause an infinite loop when looking for a character without a status but when there isn't one to find. It would be very cool if there were something like ALL_ENEMIES.status != BERSERK where it returns true only when there is at least one that doesn't have the status to avoid this conflict but still prevent monsters from ever using an ability on a character that already is inflicted with the status, thereby wasting their attack.

I know I'm a noob, I just want to point out I'm not demanding a feature! I have trouble being pithy, but I am just showing something I found out while "testing" out the beta and thought it would be a cool addition. I can work without this feature and live with wasted monster attacks if it isn't doable, and am very grateful for this scripting tool! Thanks again!

JWP

  • *
  • Posts: 194
    • View Profile
Re: [FF8] Enemy editor - IFRIT (0.11)
« Reply #107 on: 2016-06-25 16:24:54 »
Ah yes, I see what you mean now.
I could look at adding this sort of option in the future :).
« Last Edit: 2016-06-25 17:10:35 by JWP »

evilmog6

  • *
  • Posts: 12
    • View Profile
Re: [FF8] Enemy editor - IFRIT (0.11)
« Reply #108 on: 2016-06-25 16:54:54 »
I won't keep bugging you with it since you said you aren't able to do actual tests until at least Monday hehe, sorry to keep it up for just one more post, but sadly that won't work there either. Using that, no one ever gets BERSERK to begin with in a closed system against just this enemy (unless the player intentionally berserks themselves). Move id 0 is just an attack, so the first if statement will always be true, and always just have the bug attack.

If I change it to domoveid(1) in the first if statement, the bugs fart until everyone is berserked, then the game crashes, just like in my original posts' issue. This is because after the first character is BERSERK status, the first if statement is always false, then the targetadv in the second if statement will fire each time until all characters are BERSERK, but unfortunately, it also fires one more time, and on that time, it crashes the game because it can't find a target that isn't status 5.

The fundamental reason this happens seems to be that "enemy.status" is all or nothing, meaning that the positive lookup is true if at least one has it, and the negative lookup is only true if none have it. There isn't a way to specify a specific number of enemies having the status, or all enemies having the status, which I think is what would be required to make sure that single target status attacks could be coded to not ever be "wasted" on a target that already has said status. I just don't think with what "enemy.status" does currently can target things this way, but maybe when you are able to do magic at your actual station with your code set up you can sort it out :)

JWP

  • *
  • Posts: 194
    • View Profile
Re: [FF8] Enemy editor - IFRIT (0.11)
« Reply #109 on: 2016-06-25 18:13:29 »
It is possible to do if you check each character individually - although I haven't implemented this test yet.
There might be another way since there are other options to that specific test that I haven't worked out what they do.

mexico

  • Pirate
  • *
  • Posts: 78
    • View Profile
Re: [FF8] Enemy editor - IFRIT (0.11)
« Reply #110 on: 2016-06-29 20:19:41 »
Looking at the Blobra's abilities, I find something weird:



It has some strange abilities in his list like Everyone's grudge or Shockwave Pulsar. Do I misunderstand something or what ?

JWP

  • *
  • Posts: 194
    • View Profile
Re: [FF8] Enemy editor - IFRIT (0.11)
« Reply #111 on: 2016-06-29 21:34:39 »
I think you're misunderstanding slightly, the drop-down with Magic, Custom and Item in it has an affect on which list the ability number refers to.
Custom attacks 2 and 66 are a physical attack and sticky icky, the rest of the abilities are just standard magic.
So there are several lists that can be confusing.
There's a magic ID list (see here), which governs what attack animation to use, this is used indirectly by all the other lists - you don't use these directly in Ifrit.
There's an enemy attack list (see here), which is all the moves that are marked as "custom" in Ifrit.
There's an item list and a magic list (see here), which are for items and magic respectively.
« Last Edit: 2016-06-29 21:37:20 by JWP »

mexico

  • Pirate
  • *
  • Posts: 78
    • View Profile
Re: [FF8] Enemy editor - IFRIT (0.11)
« Reply #112 on: 2016-06-29 21:48:27 »
Thanks, that's clear now. :D

Edit: well not totally clear in fact. ^^' In the magic list, there is no magic for 38, 39, 46, 36 and 41. So I don't understand what are these magics...

Sorry for all my stupid questions, just try to learn. ^^'
« Last Edit: 2016-06-29 21:56:26 by mexico »

JWP

  • *
  • Posts: 194
    • View Profile
Re: [FF8] Enemy editor - IFRIT (0.11)
« Reply #113 on: 2016-06-29 22:11:51 »
Ifrit numbers are decimal, the list I linked uses hexadecimal.
So:
38 -> 0x26 -> Blind
39 -> 0x27 -> Confuse
46 -> 0x2E -> Berserk
36 -> 0x24 -> Slow
41 -> 0x29 -> Silence
« Last Edit: 2016-06-29 22:18:00 by JWP »

mexico

  • Pirate
  • *
  • Posts: 78
    • View Profile
Re: [FF8] Enemy editor - IFRIT (0.11)
« Reply #114 on: 2016-06-29 22:33:35 »
OK, thanks, sometimes in hex, sometimes in decimal. I've taken a table of hex numbers, that will be easier. ^^

Sega Chief

  • *
  • Posts: 4085
  • These guys is sick
    • View Profile
Re: [FF8] Enemy editor - IFRIT (0.11)
« Reply #115 on: 2016-07-02 20:39:56 »
Quick question about this:

target(201)
choose(0, 1, 253)

So when it chooses one of three random attacks, I'm guessing it's attackid 0, 1, and then I'm not sure what 253 is. Does that mean no attack or does it do something else?

JWP

  • *
  • Posts: 194
    • View Profile
Re: [FF8] Enemy editor - IFRIT (0.11)
« Reply #116 on: 2016-07-02 20:57:44 »
That's a good question, I have no idea, normally they're all attack IDs... what monster is that AI code from?
Could be any number of things... do nothing, do last attack...

EDIT: looked at the ASM for FF8, it tests the see if the value is 0xFD (253) and carries on parsing code without doing any move if it is.
You're right, it's basically no attack.
« Last Edit: 2016-07-02 21:08:19 by JWP »

mexico

  • Pirate
  • *
  • Posts: 78
    • View Profile
Re: [FF8] Enemy editor - IFRIT (0.11)
« Reply #117 on: 2016-07-02 22:36:51 »
So that's why some ennemies don't do anything for a long time maybe... if you replace 253 by 257 for example, does the ennemy perform Gravija or is it more complicate than that ?

JWP

  • *
  • Posts: 194
    • View Profile
Re: [FF8] Enemy editor - IFRIT (0.11)
« Reply #118 on: 2016-07-02 22:47:21 »
253 is the only special case, anything else is treated as a move id.
The move id doesn't refer to an enemy attack id (so your Gravija example wouldn't work), it refers to the list of moves in the ability section in Ifrit, the first set of drop-down menus is move 0.
choose(0, 1, 253) is:
1/3 chance to do move id 0
1/3 chance to do move id 1
1/3 chance to do nothing

Most monsters spend ages doing nothing because they'll have code like:
Code: [Select]
if (rand() % 3 == 0) {
   return
}
at the start, which is 1/3 chance of completely skipping the turn.
« Last Edit: 2016-07-02 22:52:50 by JWP »

mexico

  • Pirate
  • *
  • Posts: 78
    • View Profile
Re: [FF8] Enemy editor - IFRIT (0.11)
« Reply #119 on: 2016-07-02 22:56:52 »
OK, so if you replace 253 by 2, he won't skip his turn, right ? (in the case he has an ability corresponding to 2)

JWP

  • *
  • Posts: 194
    • View Profile
Re: [FF8] Enemy editor - IFRIT (0.11)
« Reply #120 on: 2016-07-02 23:00:12 »
That is correct.
choose(0, 1, 2) is:
1/3 chance to do move id 0
1/3 chance to do move id 1
1/3 chance to do move id 2

mexico

  • Pirate
  • *
  • Posts: 78
    • View Profile
Re: [FF8] Enemy editor - IFRIT (0.11)
« Reply #121 on: 2016-07-02 23:06:21 »
Interesting, thanks. ;)

Sega Chief

  • *
  • Posts: 4085
  • These guys is sick
    • View Profile
Re: [FF8] Enemy editor - IFRIT (0.11)
« Reply #122 on: 2016-07-03 06:26:56 »
That's a good question, I have no idea, normally they're all attack IDs... what monster is that AI code from?
Could be any number of things... do nothing, do last attack...

EDIT: looked at the ASM for FF8, it tests the see if the value is 0xFD (253) and carries on parsing code without doing any move if it is.
You're right, it's basically no attack.

Thanks for looking into that for us, bud.

EQ2Alyza

  • 7th Heaven Crew
  • Global moderator
  • *
  • Posts: 3200
  • Dilly-Dally Shilly-Shally
    • View Profile
    • EQ2Alyza - YouTube Channel
Re: [FF8] Enemy editor - IFRIT (0.11)
« Reply #123 on: 2016-07-06 06:17:11 »
This is a tough thing to do, but mexico is clearly pirating the game, so I ask that we provide no further discussion for his questions until he can provide proof of a legitimate copy bought. Sorry all, but it's forum policy.

Girl next door

  • *
  • Posts: 144
    • View Profile
Re: [FF8] Enemy editor - IFRIT (0.11)
« Reply #124 on: 2016-08-23 13:16:17 »
I'm trying to change the AI with this tool but there is still some unknown things and it's impossible to modify texts during battle. Do you think it will be possible in a future release ?