~Hakurei Shrine~ > Rika and Nitori's Garage Experiments
New DMF character: Sakuya A
Stuffman:
Hmm, maybe I'll do with it what I did with Josette G's big shot and make Indiscriminate knives do more damage the farther they travel to offset the lower shot density.
And yeah apparently the little targetting bit I made isn't working to make Sakuya pick valid targets, I haven't really screwed around with it much since I usually wind up using unfocused during stages anyway. I'll mess with it some more tomorrow.
Also Sakuya keeps homing in on Yuka's invincible familiars in Phantasm Romance. Fffff.
Naut:
If you do end up figuring it out, could you try to explain what you did in it? I'm really having a hard time with enemy enumeration and would like to better know how it works. Just pouring over scripts isn't doing much, unfortunately.
And yeah, I've tested Sakuya on many spell cards and stages with different types of enemies. REIMU_A's shots will only home in on things with hitboxes (SetCollisionA must be called inside of the enemy script) that aren't invincible, and as soon as the enemy is destroyed they will move onto another target and wont be deleted until they hit something or hit the Auto-Delete boundry (they don't die after a set period of time, or the time is large enough that I just haven't noticed it yet). For your Sakuya's shots, they just aim at the first thing they can and will until it dies, which unfortunately always ends up being familars spawned by bosses... Anyways, I leave it to you until I learn more about this enumeration crap.
EDIT: Does your Josette Y properly enumerate enemies? I know that it ignores anything with a million life, but does it have the same issue with familiars and stuff? Wait, it still homes in even if the enemy is behind you... But does it still home onto unimportant things instead of the main boss?
Stuffman:
Well I at least fixed the far-targetting issue, I got her to at least pick the enemy closest to her in x-coordinate as her target, so that fixes that. But she'll still target those familiars.
And yes, a quick check determines Josette Y has the same problem.
I think I have an idea of how to maybe fix it, at least for bosses. There's some function that checks if there's an active boss, and I can force the homing to go after the boss in that case. I don't think I'll be able to do it with enumeration alone, unless my theory that the enemy at EnumEnemyBegin is always the boss is correct.
To be fair I think it's a mistake on the designer's part to use enemy scripts for familiars that can't be destroyed, they could've used objects instead. Incidentally, I really really wish we could see the default Reimu and Marisa scripts.
Also Sakuya's knives aren't able to turn after firing by design, they can't actively home in like Reimu's can. They get shot at the target and if they miss, they miss.
I might have another update tomorrow if my idea works.
Naut:
I dunno why I included the part about Reimu's shots continuing to home if their target is destroyed, I knew that Sakuya's where just arctan'd normal shots....
Anyways, I'm pretty sure your theory about the first enemy enumerated being the boss isn't correct. Or shouldn't be, at least. It is almost always right, however, and I can almost guarentee that just from a logical standpoint. Here's the thought process:
At first I thought you were correct, it made sense, the boss is always the first thing spawned in a script. So in spell-cards, you're right, it is usually the first enemy it will enumerate. However, enemies will not get deleted until a spellcard ends, so any enemies left over from the stage portion or attack before a spellcard are still enumerated, and will be earlier on the list because they existed before the boss. That's my thinking anyway. It would be best if the function was coded to force bosses to the front (or back, but we know it isn't) of the list, which would be ideal, but who knows really.
I do agree with your wish, there are many things I would like to see in both Reimu and Marisa's scripts. Reimu_A's Godly-coded homing shots, Marisa_B's lasers.... Even the spellcards would be interesting so see.
Also, I'm not so good with drawing verticies and whatnot, so I still use enemy scripts for familiars instead of object scripts. I would prefer to use objects, since using the same global variables would be awesome and object scripts run faster than seperate enemy scripts, but I'm not confident enough in my ability to draw images using verticies. This wouldn't be an issue if we could just see how Reimu targets things... Ergh.
EDIT: Spelling...
Stuffman:
Okay so yeah, I just do a quick check on IsBossExisting, and then I can use GetEnemyX and GetEnemyY for it to automatically give me the boss coordinates.
That should be fine, in theory. I'll try it after D&D tomorrow.
It still wouldn't cover regular enemies with familiars but I don't think there's any way to deal with those, and they're uncommon anyway.