Jesus, Godot's collisions sometimes will refuse to disable! The cow's shield has a static collision that the player can jump on top of without getting hurt. There are many situations where this gets disabled. FOR SOME FUCKING REASON, when the enemy faints, the collision would get disabled but would STILL block the player, EVEN THOUGH IT WAS
DISABLED!! Even with debug showing the collision shapes gave it a white outline, which meant it was disabled, but behaved as if it wasn't!!!
The cherry on top? I tried using the "set_deferred" function, but it didn't work at all. Coming back to what I did before, simply setting the
collision.disabled = true, magically started working as intended. WHAT THE FUCKING FUCK!?
Ugh, Godot really tries my patience sometimes. What's also testing my patience lately is my shit code. For a change, I went ahead and decided to decouple the logic from the animation (the orc and kobold both have lots of logic that relies on specific animations playing, which is a nice feature of godot). As for actual trouble, getting the sex code to work. Right now, the animation is only playing correctly if the cow dies (as a funny side note, said cow will also disappear/die during the sex), that is, she won't faint for the player to fuck as many times as he'd like. If the cow can faint, the wrong animation is being called. As I said, my own shitty code fucking me.
The lesson i'm taking from this is: learn to fucking define states. I change states (such as whether the enemy is idling, walking, hurt, fainted, being fucked) in several different locations, and that makes my guesswork of "why the fuck is this behaving like this" much harder. To make matters worse, I
also have loads of flags that I check outside of the state. I should definitely refactor this piece of shit, but this will be the last enemy I'll add to the game, so there's that.
The lesson is: write down, draw on a paper all the states the entity can be in, which states can lead to which, and which ones have priority over which; only have ONE piece of code/function to change states
Anyway, I'm also planning on leaving the cow as a non-moving enemy, only ever changing facing direction. I can't quite remember if that was my original plan or not, but I think it makes sense, shieldwall to mess the player a bit, or open up some shortcuts.
Expect some edits on this post later today, if I manage to fix my shit.
Edit1: Ok, the sex is working, the problem now seems to be Godot. See, the eyes are not a texture, they're polygons. If the cow gets hit, the eyes close and the polygons are set to "visible = false", so they don't show up. So far, so good. However, when the animation is the sex one, the polygons don't show up, even when they're VERY FUCKING CLEARLY SET AS VISIBLE in the fucking debug.
Seriously, there's ONE function that toggles the iris visibility. It gets properly called, it sets the visibility to true, YET THE FUCKING POLYGONS DON'T SHOW UP. It's not a Z-index problem either, it's like the damn polygons don't even exist. It's shit like this that really makes me want to give up using Godot.
With visibility fucked, I tried using Color modulation, setting the alpha to 0 when hiding and 1 to show. Even then the fucking iris/polygon disappears. This ONLY happens in the sex animation and I have double checked it, there are NO keyframes for any of the eye polygons, or even the eye sprite for that matter. The fucking thing is literally disappearing for no fucking reason on this specific animation only.
The immediate fix is freezing the cow's eyes in the closed frame, but seriously, what the fuck
Turns out the problem was, in fact, the fucking Z-order. The iris were NOT set to be relative to the parent's Z, so when sex starts and the Z index gets shuffled around, they were getting stuck under 6 or so layers. Remember to check if the shit that's disappearing is using relative Z ordering so you don't bash your head against the keybaord for 30 minutes like an idiot.
Edit2:
Cow cheeks coming in hot! I'll probably finish by tomorrow
Edit3:
I just discovered that I don't need textures/sprite nodes to act as masks, I could have used polygons all this time. This means maybe 500kb of saved space and some 2 or 3mb of VRAM saved when running the big sex scenes. Not a big deal, but something that activates my neurons.