I saw a couple of interesting old threads about this function, which never appears to have been finished. I've been working on my copy of AzzyAI and I have this function in a working state where the homunculus can traverse an entire map using the Castling skill to teleport the owner around.
Sample:
Edit 6/20/19: Swapped out original video for a better one.
Setup
I reviewed Dr. Azzy's pinned post, and he explicitly states that unmodified copies of his AI can be freely distributed. So I am not going to repackage a full modified version of his AI. But I will provide instructions for how to modify your copy in the same way I've modified mine.
1. I have modified three files that live in the USER_AI folder inside the AI folder inside the Ragnarok Online folder. So start by finding that folder on your machine: [something]\Ragnarok Online\AI\USER_AI.
2. Copy the USER_AI folder and save it somewhere else. I want you to have a backup in case something doesn't work. If you decide to revert to your previous configuration, just overwrite the files with the ones in this copy.
3. The files that I've modified are:
AI_main.lua
const_.lua
H_Extra.lua
Get the files at this link: https://drive.google...z7yHFeTYk6vTmnW
Update 6/20/19 - Uploaded new versions of the files - If the Homunculus strays from its route, it will clumsily work its way back using semi-random steps (an attempt to avoid getting stuck on a dead square). Two more routes included too: Stapos and Kobolds maps.
4. Copy those files into the Ragnarok Online\AI\USER_AI folder on your computer. Overwrite the ones that are already there. (You did make that copy of your USER_AI folder, right?)
5. Open H_Extra.lua with a text editor. There are routes for several maps included in this file. All are commented out except one.
Commented lines start with '--', example:
--MyRoute={{1,1},{2,2},{3,3}}
Always leave all the route descriptions commented out (the lines with map name and monster names).
To select the map you'll be playing on, comment out every route EXCEPT your route. Uncomment your route by deleting '--'. Continuing the example, here's the same line after uncommenting it:
MyRoute={{1,1},{2,2},{3,3}}
That's it for setup.
Configuration
Here are the required settings within the AzzyAI Configuration Tool to enable CastleRoute.
Homunculus tab, Basic Options:
OldHomunType = Amistr (In case you read this far and don't have an Amistr - Sorry...)
Homunculus tab, Walk/Follow Options:
RelativeRoute = False
UseCastleRoute = True
UseIdleWalk = Route_Circle (technically Route_Linear should work too, but ALL the routes I've included in H_Extra.lua are designed for Route_Circle, and I haven't tested any of my code changes to see if they work with Route_Linear).
Tips
CastleRoute is still not perfect. It's harder than I imagined to keep the Homunculus from getting stuck, but here are some tips:
1. Leveling on aggressive monsters works best because they will come to you. This keeps your Homunculus from wandering too far off its route. CastleRoute will work for non-aggressive mobs too but you may want to be close enough to monitor what's going on as you may have to intervene from time to time (usually you just have to manually move back closer to the route path so Homunculus can get back on track). The Homunculus seems to be better at pathfinding its way TO a target than it is at coming back. They are not good at situations requiring a U-turn to get back to the owner.
2. Setting the Homunculus to React instead of Attack in the Homunculus Tactics tab works well in combination with the first tip. Let aggressive mobs come to you.
3. One more tip that helps if you do decide to level on non-aggressive mobs: On Homunculus tab under Basic Options, set DoNotAttackMoving to True. This will keep your Homunculus from chasing off after a passive mob that finally stops in a spot that is hard to get back from or too far away.
All these tips have the same goal, keeping the Homunculus from wandering off its route and getting stuck.
Optional Settings
Here are the values I'm currently using for some of the stuff in AzzyAI Configuration Tool to help CastleRoute work better. It is not required to use these settings, they are just provided as a starting point:
Homunculus tab, Basic Options
StationaryAggroDist = 10 (This only matters if you are NOT following the tips above. But if the Homunculus has to go attack targets, having a fairly long leash will give it a better chance of encountering enemies.)
Homunculus tab, Walk/Follow Options:FollowStayBack = 5 (One of the conditions to cast Castling is that Homunculus and owner are not too close together, this keeps Homunculus hanging back a bit.)
I set FollowStayBack = 0 now due to an issue where the Homunculus gets stuck if it's on one side of the screen and there's a target in range on the other side of the screen. This problem is pre-existing to my changes, but wouldn't tend to come up that often when hanging out in Orc Dungeon since targets tend to come to you, and frequently get killed by your neighbors when at the edge of your range.
IdleWalkDistance = 11 (My routes tend to keep steps 5 squares apart so I'm allowing lots of room to move around.)
It doesn't matter what IdleWalkDistance is set to when using route_circle or route_linear, that parameter only affects the other route choices.
IdleWalkSP = 20 (When Homunculus gets below this percentage of max SP, it will pause for SP tick. You can even set this to 0 if you have no other skills to save SP for.)
StationaryMoveBounds = 10 (Again just allowing for a nice amount of freedom of movement.)
Closing
I have only tested these modifications with one Homunculus, an Amistr/Sera. It is still just level 109 so I don't know the best way to utilize this with AoE skills and I don't know if it works well with the other Homunculus-S types.
I don't want to have to hold your hand to make these modifications work for you. I've already spent quite a few hours making them work for myself.
It is of course fine to post problems and questions. If I see them and I can answer them, I will, and I'm sure there are more knowledgeable people than me who might answer too.
If there is demand, I would consider generating more routes to include in H_Extra.lua. Perhaps by commission?
Edited by Orthogon, 20 June 2019 - 07:35 PM.