09-12-2012, 03:44 AM
As I'm working on a new ABS modeled after the old Near Fantastica system, I want to adopt my OWN way to have enemies recognize other on-map enemies as potential targets. Now, MrMo had it right with his 'Hate Group' array to store targets. But I want to expand upon that:
That's what I'm aiming for at least.
I did have an unexpected snag earlier today though. MY ENEMIES STOPPED MOVING! WHAT THE HECK DID I DO!!!! Amazing what happens when you comment out one little line. You spend hours going through the enemy system scripts, game map scripts, and scene map code only to find the problem with the sprite character code. Musta been when I was testing animations.
- Hate Points: As an array, it holds the IDs of enemies by the enemy database (like 1 for ghost, 2 for basilisk...) and/or '0' for the player (and party members if applicable)
- Preferred Targets: Another array holding enemy ids like above, 0 for the party, and/or negative values that indicate actual heroes in the database. This means that you would set -1 for Aluxes, -2 for Basil, -7 for Gloria and so on.
- Targeting: An array of two values, one being an area range in tiles that should be at least the range of the sight/sound system if not greater, and another that indicates if the enemy goes after: the closest target, the most preferred target first, hero(es) first then enemies, enemies first then hero... and etc
That's what I'm aiming for at least.
I did have an unexpected snag earlier today though. MY ENEMIES STOPPED MOVING! WHAT THE HECK DID I DO!!!! Amazing what happens when you comment out one little line. You spend hours going through the enemy system scripts, game map scripts, and scene map code only to find the problem with the sprite character code. Musta been when I was testing animations.