*Final Fantasy victory tune*
Today is a day of great triumph!
Originally, the Flying Agent and the Swimming Agent worked the exact same way - which makes sense because they're essentially the same agent, made by the same person.
(I believe she currently goes by RisenAngel; her old username had the initials G_M but I don't want to use it because it would effectively be misgendering her. Y'all know who I mean. I want to give credit but also be respectful. Hence this clunky note. Anyway. Moving on.)
When a female DuoDragon (and many other swimming breeds, probably also other flyers) gets pregnant, a chemical reaction in her genome causes her to get sleepy. She will eventually fall asleep. When that happens, the flying/swimming agent is supposed to cause her to slowly sink to the ground. When she lands, she will lay the egg. This keeps the flying/swimming from interfering with reproduction.
However, in 2017, I started having problems with the Flying Agent after having to reinstall Docking Station. No amount of troubleshooting or tweaking fixed it. The swimming agent remained fine, but Norns using the flying agent were having a lot of trouble getting or eating flying objects, which meant they couldn't eat critter or eat bug while flying. They'd just chase endlessly, but never catch the critter or bug. This is, obviously, a huge problem. I never worked out why this happened with the flying agent and not the swimming agent, nor did anything I tried fix the problem.
I compared the scripts for the swimming agent v3 and the flying agent v2. Turns out they're identical except for two things: whether they work in water or air, and the "accg" property. The swimming agent had accg 0, but the flying agent had accg 0.3. Why this should be a problem I don't know, but I changed it to accg 0 in the flying agent.
Success! The Dragons could eat while flying again.
But also, failure! Because now, when they fall asleep in air, they don't sink to the ground. They just hover in the air, sleeping.
(Weirdly, in 2023 I tried tinkering with this again and put accg back to 0.3; the result was that the Norns could no longer eat in flight, but they also couldn't rest either! They would think 'rest' but could not act on it until their feet touched the ground when they flew low enough. At which point they'd suddenly collapse into the sleeping pose and fall asleep. This suggests they'd been "resting" the entire time but not successfully in some way. I have no idea why this happened, as it was *not* a problem back in 2017, only the eating thing.)
I experimented with several different accg values other than 0.3 and 0, but none of them worked, so I put it back to accg 0 and told myself I'd just have to accept that they weren't going to be sinking to the ground when they fall asleep in the air anymore.
Inexplicably, they still do the sleepy pregnant sinking in water, which means including at least one significant water room in a world can help them continue to reproduce enough to keep things going. They do land on their own sometimes, at which point they'd lay the egg on land, but way less often than they would have otherwise.
But I wasn't quite satisfied with that. I knew pregnant dragons were floating around pregnant for very long periods, possibly for hours at a time. So I got into the habit of using ject flying_agent_v2.cos 7 periodically just to drop everyone to the ground and force any pregnant females to lay their eggs. Sometimes I'd see a burst of many "egg laid" notifications, which convinced me that my 'egg check ject' routine was definitely needed.
Then today I had a sudden thought. "Can ject be used in agent scripts? Can I just write an agent to do the egg check for me?"
Turns out, you can. So I did.
grounder.cos is so named because, every ten minutes or so, it causes all flying (not swimming) Norns to drop to the ground. It's an uncomfortable bump if they were flying high, but don't worry, they'll be okay. They can resume flight immediately after landing if they so choose, and they don't seem to remember the experience, or at least they don't learn anything in particular from it. When this happens, any pregnant female flyer will lay her egg. Then she'll take off again and keep on living her life. It's not as elegant as the sleepy sinking (which the swimming agent thankfully still does correctly), but it works.
I am so stinkin' pleased with myself right now. I created my second agent! Granted, it's extremely similar to the first one. It's essentially the same framework, except I took out all the CA/smell stuff and put in the ject command instead. But still, I did it and it works and I'm happy about that.
Of course, the agent is only useful if you use RisenAngel's Flying Agent v2, and probably only if you use it in the form of a .cos file rather than an injectible agent (at least I think so; I only have it as a .cos so I can't test that). It's an extremely niche solution for an extremely niche problem.
But still. I did it! It works! Eeeeeeee!