#P5R - Editing Enemy Attacks
62 messages · Page 1 of 1 (latest)
I think I know why this is. Enemy attacks are defined in the actual AI scripts
And unfortunately, I have zero clue how to edit those.
Ive decompiled P4G's AI scripts out of curiosity, but I have zero clue how youd go about properly editing them
Interesting. I'll get round to decompiling the whole CPK at some stage, so maybe one of the 010 formats will work out.
I mainly did it because I was curious as to what would cause the Clear Sky Musha shadows to use Hassou Tobi. Turns out, they use it in retaliation to being debuffed 
Will keep this marked as unresolved for now, if anyone does know how to modify AI files, a comment or documentation would be appreciated here.
If you get as far as decompiling the AI scripts to get a Flow script, it's actually pretty easy to change the used skills around for any existing scripts, and the syntax for using a skill is pretty clear. It just takes the skill ID used elsewhere and sticks that inside of a function to use it if the script meets a certain condition, eg you might see something like "AI_ACT_SKILL( 14 )" which will use Maragion
Where it gets a little more complicated is if the enemy you're trying to modify doesn't have a script assigned to them, with 010 Editor you can check segment 0 of ELSAI to see if they have a script by their enemy ID, if there's a 0 listed there, they work off a default that there isn't much documentation for
you can freely switch around which AI scripts are assigned to which enemies in that table though, and you can naturally have multiple enemies pull from a single script if you wanted
Oh god what have I gotten myself into. Okayyy.
Is it possible to give/make new AI to/for enemies who didnt have any in the first place, like kamoshida's trophy?
Interesting question.
You're probably better off taking an enemy that's used specially in a boss fight and making a new enemy out of them, I don't know about Kamoshida specifically but some of the boss fights like Okumura's do weird hardcoded things in the AI scripts
What kind of weird hardcoded things? Is it to do with how they use their self destruct attack?
There's that and also getting the robots to spawn in the first place iirc
Right, part of it would be in his script and the other part would be in theirs
What about their spawning is controlled by the robots?
I have a lot of stuff written down about stuff id like to do with P5R if I had the proper knowledge
Like a harder/superboss variant of Yaldabaoth
ive heard that a lot of stuff about yaldy is hardcoded too
The spawning would be in his script, the detonating would be in theirs
I kind of assumed that
yeah Yaldy I haven't even looked at much for precisely that reason
Sacrifice Order does nothing on its own, but when used on the robots, it must trigger some kind of AI flag that has priority over all other actions
Also, one thing I wish we could change, though it might not be currently possible. Allow strength-based Magic attacks (Yes, these do work (somewhat)) to crit
Though, as far as I know, the only strength based magic attack in the original P5 was Akechi's Laevateinn
Ive tested it, and it actually consumes Charge, not Concentrate
Not a whole lot is written about hardcoded things at present, pretty much why ELSAI.tbl is good for changing around scripts but trying to mess with the "default AI" in the other segment is more trouble than it's worth
Ive also tried fiddling with the skill tables and setting magic attacks like Agi to be strength based to see if I can get them to crit, but it doesnt work.
Welp. Considering we now have the dream of a PC release, maybe we can dig into the game more deeply
Mostly everyone I've seen going the AI route ends up just writing scripts from scratch for every enemy
pretty much what I'm doing lol
So wait, theres a default AI script that most enemies use?
I know that some enemies, particularly the red Savage Shadows use their own special scripts
Anubis has the scale tipping which determines what element of insta-kill he uses
And Kali has the rage mechanic which allows her to attack once you hit her enough iirc
not so much a default AI script but something built into the ELSAI table that anyone with 0 as their script number tries to pull from
Im guessing its very simple, because I remember there being an unused Metatron Shadow in vanilla P5 that would only use its normal attack if fought
Which was eventually repurposed to be used in one of Royal's Challenge Battles
What about enemies that literally dont do anything? Treasure demons, Im assuming they have their own script because it displays the message that they "groan" and causes them run after two/three turns
But enemies like Kamoshida's Trophy and Cognitive Shiho
they literally do nothing
For something to not have any AI at all they get 9999 as their script ID
ah ok
and yeah Metatron and Beelzebub are sequentially 1 and 2 in the entire unit table, and yeah they also have 0 as their script iD
so that's essentially how it works
I wonder if its possible to replace an enemy's normal attack
As in, if their AI defaults back to having them use a normal attack, it could be replaced by a custom normal attack
Like in Nocturne Hardtype
Metatron in that rom hack has a very powerful normal attack that is guaranteed to inflict Seal
I can think of many things that could be done with such a thing
@cobalt linden one thing itd be my fucking dream to do is the split Physical back into Strike, Slash and Pierce in p5r
Gun pretty much is Pierce. Guns in P3 were considered Pierce Phys
I know that, but id still like to do it
Id consider Pierce to be more like spears or javelins
And theres been plenty of skills like that
Looking at the file for 201 (Shadow Kamoshida), AI_ACT doesn't seem to be anywhere. Are special skills for bosses handled separately?
In fact most of them have a ton of "UNKNOWN_FUNCTION" entries.
(Maybe don't decompile for SMT3 Nocturne you idiot...) Okay