ABS targeting enemies

Hello

 


First of all, I'm using an ABS (XAS Hero Edition, link is below) and most of my attacks are ranged.

To prevent facing in wrong directions all the time and not being able to shoot in the direction unless you step closer to the enemy I think it would be a good idea to have a targeting feature so that you face the enemy at all times.

Just like in 3D Zeldas, DarkSouls and every second game out there.


 

500px-Z-targeting_(Ocarina_of_Time).png


 

Preferably you can activate/deactivate it by pressing a button or maybe as a skill - because keyboard usage is very limited...

And if possible that you can switch targets by pressing another button, that every event that contains 'Enemy' in the name can be targeted for example.

 

I think that would benefit my game very much.

I haven't found any scripts that are like that, but that's maybe because I don't know what to look for. Enemy focus? Targeting? Auto aim?

Or maybe you have better ideas on how to solve this. Or is there a better ABS out there that is able to do that and has as many features as XAS?

Thanks in advance 🙂

 

btw - that may not belong here but does anyone know how I can modify and use "if"-commands regarding the health of enemies in XAS? eg if enemy health is below 30% do that... 

 

XAS Hero Edition: http://www.atelier-rgss.com/XAS/Manual.htm
Unfortunately for your request, all ABS scripts are among the most complex scripts in existance, and the chance that anyone but the original author can modify them is rather low - it would take a scripter several months to analyse such a script system to the point that he/she can modify it.

As far as I know there are only four ABS existing, and in two cases the authors are no longer active - in the case of XAS I don't know if it's still worked on.

I suggest that you try to contact the author directly.
Okay, months are not needed for an experienced scripter for sure.


I modified Falcao's ABS within... I don't know if it was 1 day or 2, and I am not even close to the more experienced scripters. 😀


Added some stat bonuses to cooldowns, cast times and such ABS specific things. Stats aren't fully utilized in an ABS, so I felt the need to add stat dependency for the "tools" used in the system. That, and somebody asked me to do it. 😀


Which reminds me... Falcao's ABS has an auto-target feature. Haven't tested it yet though.


Seemingly, Falcao's ABS has the same features as XAS, but I haven't played much with any of the systems yet seriously, so there might be some differences.
I may be wrong with that - but do you have to modify the abs to do that? All I'm asking for is that the player automatically looks at certain events (and if possible he can switch so that he looks at another event). Just like events have the "face player" thing. Only that is refreshes all the time and can be used to face events.

I have seen Falcao and I would not mind using that instead of xas if it had that feature or if it was easier for you to make the auto-targeting for that. 

Isn't Falcaos auto-target feature just like the one in xas where the screen pauses and you can choose one target which will be automatically attacked with the selected skill? This is not what I had in mind.
Just turning towards a specific event shouldn't be difficult in this case, there even is a method to turn a character towards another one already:

$game_player.turn_toward_character(character)

(character must be replaced by  $game_map.events[id]  or another source of a character object)

To turn towards an event continuously while not moving and not standing on a ladder, you could use a script like this for instance:

Spoiler
class Game_Player   attr_accessor :focus_target   unless instance_methods(false).include?🙂update_stop)    define_method🙂update_stop) { super() }  end  alias_method🙂update_stop_ILC_faceFocus, :update_stop)  def update_stop    turn_toward_character(focus_target)  if focus_target and not ladder?    update_stop_ILC_faceFocus  endend class Game_Map   alias_method🙂setup_events_ILC_clearFocus, :setup_events)  def setup_events    $game_player.focus_target = nil    setup_events_ILC_clearFocus  endend
Useevent = $game_map.events[id]
$game_player.focus_target = event


to let the player focus a specific event until the map is changed.

Use
$game_player.focus_target = nil

to release the players focus.
That works pretty well already, thanks 🙂 .

But is there a possibility to have that working even while moving? Using fixed directions manually makes me have a short wait time between each move for some reason.

And an easier way to set that up for multiple enemies on multiple maps would be cool. - This is not necessary though. In that case I would use it only for boss fights.

If I'm using this script, I credit you for this script Another Fen, right?
*push*
*push*
Sorry,

Can't test it right now, but this should do:

Spoiler
class Game_Player   attr_accessor :focus_target   alias_method🙂update_ILC_faceFocus, :update)  def update    update_ILC_faceFocus    if focus_target and not ladder? and not move_route_forcing      turn_toward_character(focus_target)    end  endend class Game_Map   alias_method🙂setup_events_ILC_clearFocus, :setup_events)  def setup_events    $game_player.focus_target = nil    setup_events_ILC_clearFocus  endend
As for the easier way to set it up: how would you want that to look/work?
It seems to have a problem with line 10:

Spoiler
uevulu3u.jpg
I don't know if that's possible but it would be a lot easier to set that up for each map if enemies that have a certain name can be targeted (for example "Enemy") and that are on-screen. An option to switch between targets would be great too. A button, or a skill to target another enemy. (I'd prefer a skill though due to limited key options)
Ooops, forgot to change a method name...

Corrected the post above.

As for the target selection, is this the right way?

Spoiler
class Game_Interpreter   def select_focus_target    SceneManager.call(Scene_Focus_Target_Select)    Fiber.yield  endendclass Scene_Focus_Target_Select < Scene_Target_Select   DISPLAY_SKILL_ID = 42   def main    old_temp, $game_temp = $game_temp, $game_temp.clone    $game_temp.xas_target_shoot_id = DISPLAY_SKILL_ID    $game_map.check_events_on_screen    super    if $game_temp.xas_target_shoot_id == 0      $game_player.focus_target = nil    else      set = $game_map.events.values.select { |ev| ev.target and ev.battler? }      $game_player.focus_target = set[@target_index]    end    $game_temp = old_temp  endend
However, the script utilizes the target selection scene of the xas and might be a bit slow. You can invoke it by calling  select_focus_target  in an events script command, for example within a skills common event.You have to provide a skill to display during the target selection. You can determine its ID in line 13 ofthe script.
Spoiler
mx9zf7gn.jpg
(it's German but you say you speak German, so...)

I somehow can't get this to work with a common event, it seems to ignore it.

I tried to use the osmose skill that you had in first, I tried other status skills too and I tried it with my own skills and variations in the memo. Some with [Auto Target] and some without.

The only way it seems to work at the moment is by having a normal "talk to" to an event with the script in it.

What am I doing wrong?

Other than that it works fine and is exactly what I had in mind (even if it's a bit slow, as you said)
push
Sorry for the delay.

To be honest, I only tested the function with a skill selected from the skill menu. I didn't dig very deep into the ABS to tell for sure, but it is possible that the ABS ignores common event calls triggered by tool skills.

The script creates a copy of the target selection scene that is triggered by the [Autotarget] flag. The  DISPLAY_SKILL_ID  does only have a visual effect. Unfortunately I don't have access to the rpgmaker right now, but I'll see what I can do later.
Aaaah, the events for the skills on the first map! I forgot about testing it with a common event in there instead of the skills page in the database.

Well, I have now and it works just fine with it.

I think I'm happy now. At least I don't know anything more I need at this point. Thank you very much for making that 🙂

You'll be mentioned in the credits of course.

Original thread: https://forums.rpgmakerweb.com/threads/abs-targeting-enemies.36270/