Advanced Skill Targeting (plus multiple forced actions) (now Yanfly's compatible)

Discussion in 'RGSSx Scripts In Development' started by geri_khan, Sep 10, 2013.

  1. geri_khan

    geri_khan Veteran Veteran

    Messages:
    32
    Likes Received:
    6
    First Language:
    English
    This script is no longer really supported. If you have problems by all means PM me and I'll see if I can help, but I cannot make any promises any more about fixing bugs or adding features. I may someday port it to MV as that is what I'm using now

    Advanced Skill Targeting


    WHAT'S IT FOR?


    AST allows you to...

    Provide rules that let you determine exactly which actors and enemies are targeted by individual skills and items
    Define global rules that apply to every skill and item, that persist across saving and loading games.
    Make battlers hit by these skills take immediate forced actions, and kill them afterwards if you want
    Get random targeting with no repeated enemies


    WHERE CAN I GET IT?

    A demo is available here

    (script in demo is out of date. It's fully functional but the link below has fixes)

    The script used to be in two parts, now it is only one, here
    The Yanfly version is here. Created for a version of yanfly that may well be outdated now, I am not using VX Ace any more and have not had the time to test it.
    Example images required for the yanfly version:
    [​IMG] [​IMG] [​IMG]

    Important next step: create a state that expires at battle end and turn end called forceaction, and insert its number into this section of the script


    AST_FORCED_ACTION_STATE_ID = your number here

    Some scripting experience is valuable, particularly in creating damage formulas.
    Free for non-commercial use.



    HOW IS IT USED?

    There are three components to the script

    Targeting rules in Skill/Item notes

    [​IMG]

    The first thing to notice is that the scope option still has a purpose. It still defines how many enemies you hit (one, a group, or x random), whether you hit dead or alive enemies, and whether you see the Actor or Enemy choice screen when picking an individual target.

    [​IMG]

    Targeting screen for skill in above image, with scope set to One Ally. Monsters have been added to it because they have the zombie status

    [​IMG]

    Same skill and situation, but scope is One Enemy


    By default, every skill you already have will work as it always has. Things only change when you add some AST commands to the notes.
    AST commands are implemented in the order they're given. You'll want to start by including one or more groups of targets to the target list, and then removing targets from it using rule filters.


    ASTstart:reason - required to tell the script to look for commands. Absolutely no processing will take place without this, and the skill targeting will work as it does by default.
    Reason is optional. It allows you to provide a message to give to the player about why they cannot target that character.

    ASTstart:Slimes cannot be targeted with this skill, they don't have necks.[​IMG]

    note the slimes are greyed out in the selection window, but the bat and hornet are not


    ASTreason:reason - let's you redefine the reason, in case you want different reasons for different enemy groups

    ASTinclude:group - Note the colon :, it's required. Includes a group of targets in the targeting list. Without at least one ASTinclude:, the script will return an empty targeting list.

    Code:
    ASTinclude:friend   # includes all of the caster's allies
    ASTinclude:opponent # includes all of the caster's enemies
    ASTinclude:troop    # includes all the enemy troop
    ASTinclude:party    # includes all the player's party
    you can have more than one of them, the most basic example being

    Code:
    ASTinclude:friendASTinclude:opponentwhich will make the skill target EVERYONE.

    ASTremove:rule - removes targets from the target list based on a rule you provide. The rules are similar to the Damage Formulas but must be comparisons, not assignments.

    Code:
    ASTremove:b.hp==b.mhp     # remove anyone at full health
    ASTremove:b.hp<a.hp       # remove anyone who has less health than the caster
    ASTremove:b.state?(10)    # remove anyone with state 10, whatever that may be
    ASTremove:!b.state?(10)   # remove anyone withOUT state 10, whatever that may be
    ASTremove:b.name=="Kevin" # remove Kevin
    Important note... do NOT use "valuea = valueb" unless you are very very clever. It will not have the effect you're looking for. Make sure to use "valuea == valueb" as that compares the values rather than assigning them. Note there are TWO ==


    ASTpreserve - "locks in" all commands above this command. Targets already on the targetlist will not be affected at all by anything that happens after this command. Remember that heal spell from before? (note: zombies are not a standard feature in RPG Maker. I use Neon Black's script though, but you don't need it for this script. This is just an example anyway)


    Code:
    ASTstart
    ASTinclude:friend       # includes caster's friends
    ASTpreserve             # preserves. The caster's friends will not be removed by the removal rule below.
    ASTinclude:opponent     # includes caster's opponents
    ASTremove:!b.state?(26) # removes every enemy who is not a zombie, but does not remove any friends since they were preserved.The result is a targetlist of the caster's friends and his zombified enemies. Heal spells hurt zombies, so this is a nice thing.
    ASTpreserveglobal - like ASTpreserve, but only applies to global rules. Anything above this in a note will not be affected by global rules.

    ASTremovecaster - easy way to remove the caster from the list of characters his action can target.

    ASTrandom:num_of_targets - reduces the target list down to a list of n random targets. Unlike the built in random scopes, none of these targets will be repeated - each target in the battle can only be hit once, but which ones are hit will be random.


    Code:
    ASTstart
    ASTinclude:opponent # includes all opponents
    ASTrandom:3         # picks three random opponents. If there were only two opponents, only two would be returned.

    ASTforceaction:
    skill_id - If the attack hits, the target will be forced to immediately take a forced action. More information below.

    ASTkillafter - If the target takes a forced action, they will immediately be killed afterwards. I made this so I could turn zombies into bombs. So yeah. More information below.

    That's all the ASTcommands. Here's a few more examples, likely of varying usefulness.


    Code:
    ASTstart
    ASTinclude:party
    ASTremove:b.level % 5 != 0  # the popular level 5 death. Set to hit the party since enemies do not have a level stat.
                                # Guess they saw what happens to Exdeath.
    Code:
    ASTstart
    ASTinclude:friend
    ASTinclude:opponent
    ASTremove:b.agi % 3 != 0 # hit everyone with an agility divisible by 3, Calculator style.
    Code:
    ASTstart
    ASTinclude:opponent
    ASTremove:a.name == "Mike" and b.name == "Karen" # Mike does not have the heart to hit his little sister with his most damaging attack.
    Code:
    ASTstart
    ASTinclude:opponent
    ASTrandom:3         # hits three random enemies...
    ASTpreserve
    ASTinclude:friend
    ASTrandom:3         # and also three random allies. Erupting volcano during the fight?
    ... anyway, on to...


    GLOBAL RULES

    Global rules are handled by the $Targeting_Rules global object. They are included in save games. (and will thus break save games without them. Them's the breaks. Comment that out if you hate it and feel like keeping track of what rules should be in effect when the game is loaded)


    I added the commands to the interpreter, so you can call them with the Script option in any map, battle or common event. The commands to add/remove rules are...

    Code:
    add_target_rule(code,expires)   # eg add_target_rule('b.hp==b.mhp','oneturn')
    rem_target_rule(code)           #    rem_target_rule('b.hp==b.mhp')

    code
    works exactly like the formulas in the ASTremove section above. Use single quotes ' since you'll probably be calling this from map, battle or common events and will need to use ' there or mess about with escape characters and nobody likes that. Each rule will make anyone who it applies to untargetable.

    expires lets you set global rules to automatically expire. If you do not include it, the rule will never expire by default.

    Code:
    add_target_rule('b.hp==b.mhp','oneturn')     # rule will expire after one turn
    add_target_rule('b.hp==b.mhp','afterbattle') # rule will expire after one battle
    add_target_rule('b.hp==b.mhp','never')       # rule will never expire by itself
    add_target_rule('b.hp==b.mhp')               # never is assumed
    Uses? Here's one. Let's say you have a FF-style dragoon with a jump command. When they use Jump, state 40 (jump) is applied and it lasts for one turn.

    When your game starts up, make one of your first script calls

    Code:
    add_target_rule('b.state?(40)','never')
    That dragoon will be untargetable by all skills as long as they are in the air. When they land (lose the state) they will automatically become vulnerable again. Of course if you were doing it in a different way you could use

    Code:
    add_target_rule('b.jumping?','never')
    or something.


    Something more complex? The Demon King has an impenetrable forcefield, and cannot be targeted by any attacks.

    Code:
    add_target_rule('b.name=="Demon King"','never')
    (you could check for enemy_id, but these are the global rules and actors don't have that stat. Be careful!)

    The only thing that can break down the forcefield is the Great Macguffin, an item with this in it's Note.

    Code:
    ASTstart
    ASTinclude:troop
    ASTremove:b.name!="Demon King" # the macguffin can only target the Demon King
    ASTpreserveglobal              # and it is protected from any global rules that might stop it from doing so
    and that item has a common event in its effects with this script

    Code:
    rem_target_rule('b.name=="Demon King"')
    Using the Great Macguffin on him will make him vulnerable and cranky.

    NEW: giving reasons

    You can now give reasons for why global actions do not apply. For example,

    Code:
    add_target_rule('b.name=="Demon King"',"never",'The Demon King is protected by a forcefield!')
    [​IMG]


    FORCED ACTIONS

    Using the following AST codes in the skill/item's notes enables forced actions on hit.

    ASTforceaction:skill_id - if the current skill hits, it forces the target to immediately use a skill
    ASTkillafter - if the current skill hits, and the target uses a forced action, they will die immediately afterwards.


    I use this for blowing up enemies.


    Code:
    ASTstart
    ASTinclude:opponent
    ASTforceaction:12
    ASTkillafterSkill
    12 is an AOE fire attack that hits all allies. The original target dies immediately afterwards.


    Some notes about forcing actions...

    Try adding the forced action state to your skill effects if a skill has no other effects. The script applies the state anyway, but this will prevent the "no effect" messages in the battle log.

    Try to avoid having forced actions trigger forced actions without very careful planning. You can have a forced action trigger itself in retaliation, but you'll quickly end up with an infinite loop of skill uses that only ends if something dies, something dodges or something resists the status.

    Confused enemies who you force to hit their their allies will hit you!

    BE CAREFUL - an unfortunate side effect is that if you force an enemy to act through an event, this will still apply. Make sure to remove your confusion states and any forceaction protection from enemies before you try to event them into action!
     
    Last edited: Jul 2, 2017
    #1
  2. geri_khan

    geri_khan Veteran Veteran

    Messages:
    32
    Likes Received:
    6
    First Language:
    English
    Updated the first post with new version. As far as I can tell this is mostly stable and functional, aside from that issue with enemies not dying properly after a forced action. If anyone has any ideas let me know. Anyway, it's almost certainly not the prettiest code but it seems to be working. If I don't get told about any bugs or other bad things I guess I'll post this in the finished scripts section, which seems like the next step.


    Compatibility is likely also an issue, given that I have to alias and redefine a lot of things. It's not tested with anything but the default battle system.
     
    Last edited by a moderator: Sep 15, 2013
    #2
  3. Ossra

    Ossra Formerly Exhydra Veteran

    Messages:
    913
    Likes Received:
    655
    First Language:
    English
    Primarily Uses:
    RMMV
    Aah, interesting! I have been poking around for a script such as this, lately. I'll try the script out in my current project and see if it can handle playing nice with other scripts.


    One thing that I would highly suggest, is that you choose more creative name schemes for your alias methods. Personally, I use the prefix 'ex_', then the class or module I am under, followed by the name of the method being aliased (example : ex_gs_update). Although, recently I have been considering adding on a string of numbers, as well ... such as the date of creation and so on (ex_gs_091413_update).


    You should probably alias the DataManager methods as well as toss on '(*args, &block)' to pass on any variables and suchnot. I envision some exploding script with the number of non-aliased methods that there are, but we shall see.


    EDIT : Yeap, script error with 'visible_line_number' right as I loaded the project.
     
    Last edited by a moderator: Sep 15, 2013
    #3
  4. geri_khan

    geri_khan Veteran Veteran

    Messages:
    32
    Likes Received:
    6
    First Language:
    English
    Hey, thanks for having a look!
     

    Sure, that should be easy enough to do.
     
     

    I literally learned to alias yesterday, but it seemed to me that I could not alias if...

    1) the lines I wanted to add were in the middle of the method
    2) the method was in a module like DataManager. It wouldn't let me.

    Hence all the regrettable overwritten methods. Is that wrong?
     

    Just to check, you're talking about your project and not my demo right? (sweats)
     
    Last edited by a moderator: Sep 15, 2013
    #4
  5. Ossra

    Ossra Formerly Exhydra Veteran

    Messages:
    913
    Likes Received:
    655
    First Language:
    English
    Primarily Uses:
    RMMV
    Overwriting methods completely can drastically decrease the compatibility of your script. Unless you have absolutely no choice, you should find a way to leave as small of a 'code footprint' as possible when tinkering with a method already in the default scripting. Even a tiny, single-line method that returns 'true' could cause a butterfly effect down the line.

    As for the DataManager issue, try the following :

    unless method_defined?:)gk_dm_091412_make_save_contents) class << self alias :gk_dm_091412_make_save_contents :make_save_contents end end def self.make_save_contents(*args, &block) gk_dm_091412_make_save_contents(*args, &block) contents[:targetrules] = $Targeting_Rules contents end 
    Correct, I am using my project. A true trial by fire, I suppose! I am currently tinkering with the error message to get you some useful information.

    Script List :

    • Script(s) - Modern AlgebraHover Alerts
    • Fix Picture to Map
    • Map Transfer Common Event
    • ATS | Message Options
    • ATS | Special Message Codes
    • ATS | Formatting
    • ATS | Face Options
    • ATS | Choice Options
    • Script(s) - Yanfly
      YEA | Debug Extension
      [*]YEA | Stop All Movement
      [*]YEA | Adjust Limits
      [*]YEA | Move Restrict Region
      [*]YEA | Battle Command List
      [*]YEA | Ace Battle Engine
      [*]YEA | Follow-Up Skill
      [*]YEA | Extra Drops
      [*]YEA | Victory Aftermath
    • Script(s) - Tsukihime
      Event Followers
      [*]Troop Battle BGM
    • Script(s) - Killo Zapit
      Party Switch
      [*]Note Field Hash
    • Script(s) - PK8
      New Character Properties
      [*]New Picture Properties
    • Script(s) - Woratana
      Extra Move Speed
    • Script(s) - Shaz
      Remember Event Position
    • Script(s) - Galv
      Camera Control
    • Script(s) - Kread-EX
      Autobackup
    • Script(s) - self.Exhydra
      (Various Scriptlets)
    EDIT : Alright, the error came from the DataManager. Aliasing all of the methods seems to have fixed the issue.

    Code:
    module DataManager    unless method_defined?(:gk_dm_091412_create_game_objects)    class << self  	  alias :gk_dm_091412_create_game_objects :create_game_objects    end  end    def self.create_game_objects(*args, &block)    gk_dm_091412_create_game_objects(*args, &block)        $Targeting_Rules    = Targeting_Rules.new  end    unless method_defined?(:gk_dm_091412_make_save_contents)    class << self  	  alias :gk_dm_091412_make_save_contents :make_save_contents    end  end  def self.make_save_contents(*args, &block)    gk_dm_091412_make_save_contents(*args, &block)    contents[:targetrules]   = $Targeting_Rules    contents  end    unless method_defined?(:gk_dm_091412_extract_save_contents)    class << self  	  alias :gk_dm_091412_extract_save_contents :extract_save_contents    end  end    def self.extract_save_contents(*args, &block)    gk_dm_091412_extract_save_contents(*args, &block)        $Targeting_Rules    = contents[:targetrules]  end  end
     
    Last edited by a moderator: Sep 15, 2013
    #5
  6. geri_khan

    geri_khan Veteran Veteran

    Messages:
    32
    Likes Received:
    6
    First Language:
    English
    Unfortunately this doesn't seem to work. It just makes the save screen buzz when I try to save.

    However it did show me how to alias all the other methods from DataManager and BattleManager, so thank you!

    edit: oh, and you just posted how to do that at the same time. Strange.

    And I'll give the other non-aliased methods a try again. I think I can see a few ways I might be able to wrangle it, depending on how things work.

    ... my poor wee fishscript doesn't stand a chance. Ah well.

    So are things working, for a given value of working?
     
    Last edited by a moderator: Sep 15, 2013
    #6
  7. Ossra

    Ossra Formerly Exhydra Veteran

    Messages:
    913
    Likes Received:
    655
    First Language:
    English
    Primarily Uses:
    RMMV
    Ah, my apologies, I forgot to pass on the 'contents'. The corrected code should be as follows :

    unless method_defined?:)gk_dm_091412_make_save_contents) class << self alias :gk_dm_091412_make_save_contents :make_save_contents end end def self.make_save_contents(*args, &block) contents = gk_dm_091412_make_save_contents(*args, &block) contents[:targetrules] = $Targeting_Rules contents end
    Keep in mind that you do not need the 'class << self' section for aliasing anything but 'self' methods.

    There is always a way! Sometimes you stumble upon another way entirely.

    I have not gotten into battle, quite yet. But, I will give you an update once I get everything squared away.

    Also, something I have found extremely useful in tracking down errant error messages :

    # This snippet will print out the chain of commands leading up to the error in question.# Remember to enable 'Show Console' under the 'Game' menu.# After you track down the error, simply remove the snippet and continue on.begin # Method coderescue puts $!, $@end# Example : def self.save_game_without_rescue(index) begin File.open(make_filename(index), "wb") do |file| $game_system.on_before_save Marshal.dump(make_save_header, file) Marshal.dump(make_save_contents, file) @last_savefile_index = index end return true rescue puts $!, $@ end endEDIT : Another error during battle directly after switching to targeting a mob :

    'YEA - Ace Battle Engine' line 2293: NoMethodErrorundefined method 'name' for 0:FixnumProbably going to be a bumpy ride.EDIT II : Ok, the issue was in the overwritten 'select_enemy_selection' method. I commented that section out, and immediately after that, another error popped up. So, at the moment, I think meandering back through the code, adding aliases and attempting to disturb as little as possible in the code is probably the best idea, right now.

    Hopefully this is not too discouraging. I know how exploding code makes me feel, so don't give up! The battle system is extremely complicated, and once you add two or three scripts everything becomes even more complicated.
     
    Last edited by a moderator: Sep 15, 2013
    #7
  8. geri_khan

    geri_khan Veteran Veteran

    Messages:
    32
    Likes Received:
    6
    First Language:
    English
    And with that in mind, a fresh version of multi_forcedaction


    https://dl.dropboxusercontent.com/u/65029315/multi_forcedaction_v2.txt


    * everything is now aliased


    * fixed bug with queuing up forced actions when triggered by a skill (it didn't, oops)


    * removed 12 TP boost for dodging in item_apply (leftover code from something else)


    Demo updated. I'll get to work on Advanced_Targeting tomorrow. Not all that discouraged, but I'm up wayyyy too late again...
     
    Last edited by a moderator: Sep 15, 2013
    #8
  9. geri_khan

    geri_khan Veteran Veteran

    Messages:
    32
    Likes Received:
    6
    First Language:
    English
    Sorry about double post, but script updated again.

    Advanced_Targeting

    multi_forcedactions

    The Demo

    Every method is now aliased in some way or another. Hopefully a boost to compatibility.

    A whole slew of bugs cleared up.

    More robust handling of the forced actions loop - they cannot be overwritten but the loop will loop until every forced action is resolved. This does mean infinite loops are now possible, so have caution and try to avoid them. I tried adding a limit to how many could execute, but couldn't get a system that worked reliably.
     
    #9
  10. Ossra

    Ossra Formerly Exhydra Veteran

    Messages:
    913
    Likes Received:
    655
    First Language:
    English
    Primarily Uses:
    RMMV
    Error within Yanfly's 'Ace Battle Engine' upon selecting the 'Attack' option :

    undefined method 'name' for #<Dummy_Battler>Line 2289 - 2295
    Code:
      #--------------------------------------------------------------------------  # battler_name  #--------------------------------------------------------------------------  def battler_name(battler)    text = battler.name.clone    return text  end
    I might suggest working alongside or rotating between battle engines, as that would give you immediate feedback on errors.
     
    #10
  11. geri_khan

    geri_khan Veteran Veteran

    Messages:
    32
    Likes Received:
    6
    First Language:
    English
    Right, I should have figured that Dummy_Battler hack would break something, too easy... I've got a fix that involves cloning the battler, but I guess I'll hold off on publishing it until I can get a hold of Yanfly's and try it for myself. Tomorrow though. Tonight I have to sleep, and I've not done any art for my game for about a week...


    EDIT: Question: if I change the system for Yanfly's, what's the best way to handle it? Copy my existing AST script and edit it to make a Yanfly version, or make a new script that aliases both yanfly and the existing AST?


    Done some work, got battles running in Yanfly. But forced actions, enemies in actor choice window, and random selections are buggy still, and it's not always pretty.
     
    Last edited by a moderator: Sep 16, 2013
    #11
  12. geri_khan

    geri_khan Veteran Veteran

    Messages:
    32
    Likes Received:
    6
    First Language:
    English
    Updated the OP with a new version with some new features. Greater compatibility work is still on the cards, but I thought I should square away a few things that were bugging me before proceeding with that. So there's some bugfixes and new features.
     

    [​IMG]

    Invalid choices now appear disabled in the menus, and return a message reporting why the character cannot be targeted if selected - much more intuitive than the old way of having creatures just disappear I think. You can define this message with ASTstart, ASTreason or with a global rule, see the OP. I suspect this will be more compatible too, with less possibility of 0-item menus being created and Window_Battleenemy.enemy returned to its original function, more or less.

    Confusion has been fixed for forced actions - forcing a confused enemy to attack its ally will have it attack YOU instead.

    This does have an unfortunate side effect - forced actions called though events are subject to confusion, while they were immune before. Please be careful to remove confusion (and any forcedaction status protection too) from your target before invoking an event-based forced action.

    Target smoothing and correction has been improved. Previously, if the contents of an AST-defined Unit were changed between target selection and action execution, the actor might attack the wrong opponent because target indexes had shifted. This has been resolved.

    There's probably more I can't recall. Please test and see how it goes. :)  Barring bugs and simple compatibility fixes, this should be the final iteration of the default battle system version.

    Next I will be working on the Yanfly's compatible version.

    EDIT: compatibility's looking good so far!
     
    Last edited by a moderator: Sep 18, 2013
    #12
  13. geri_khan

    geri_khan Veteran Veteran

    Messages:
    32
    Likes Received:
    6
    First Language:
    English
    And that seems to be it done for a yanfly's version. Crossed fingers, touch wood.

    [​IMG]

    note the enemies in the choice window

    [​IMG]

    I could have fixed how the DK is overflowing out of his target box, but I liked it way too much to do that

    Installation instructions are in the file. You will need some additional images. Go ahead and use these temporarily if you want, they're rather bad so you wouldn't want them to be final :p

    [​IMG] [​IMG] [​IMG]

    AST for Yanfly's Battle Engine - Script - Demo

    I've done what I can, but I really need to get on with other things. I've fallen behind on actually making my own game. Barring any bugs or simple compatibility/optimisation fixes, I'm hoping this is the final version.
     
    Last edited by a moderator: Apr 4, 2015
    #13
  14. Centipede

    Centipede No wait, that's the King. Veteran

    Messages:
    69
    Likes Received:
    6
    Location:
    unknown
    First Language:
    Baby talk
    Quick question: can Advanced Skill Targeting be used on weapons e.g. can it be used to stop a sword hitting a wasp that's hovering too high?
     
    #14
  15. geri_khan

    geri_khan Veteran Veteran

    Messages:
    32
    Likes Received:
    6
    First Language:
    English
    Oh wow this is still a thing.

    Hm, I think so. I'm afraid I've not looked at RPGmaker for months, so I can't give you the exact code required, but if you added a global rule like this pseudocode

    add_target_rule('a.has_a_sword_equipped and b.state?(x)',"never",'This enemy is flying out of reach!')where x is the state number of a "flying" state, then you should be unable to hit any enemy who has the flying state when the character has a sword equipped. As a global rule, this only needs to be used once while initialising your game and then it will be permanently stored until you remove it, and then of course you can do clever stuff to remove the flying state in battle and bring it within sword's reach etc. But I'm afraid I don't know offhand how to detect whether a sword is equipped, as I've not touched AST or RPG Maker in months. But since you can set the weapon type of an item in the database, I'd guess it should be possible.

    Sorry I can't be more help. Let me know if you try it out.

    EDIT: Crap, now that I think about it, that rule would prevent any sword users from using ANYTHING on flying enemies, including items and magic. You'd want to add something else to that rule to check if it's a physical attack. Obviously magical and certain hit attacks should be able to be used in the example you gave.

    add_target_rule('a.has_a_sword_equipped and a.attack_is_physical and b.state?(x)',"never",'This enemy is flying out of reach!')Sorry. don't know offhand how to determine if the attack is physical either.

    MORE EDIT: That said, if all you want is the "out of range" thing maybe make sure there's not another script that's more focused and simpler to use. AST really mucks around with targeting and display, and I have no data on how compatible it may be with other scripts you may be using.
     
    Last edited by a moderator: Feb 25, 2014
    #15
  16. dii

    dii Villager Member

    Messages:
    18
    Likes Received:
    4
    First Language:
    Polish
    I have found help on:

    http://forums.rpgmakerweb.com/index.php?/topic/38160-advanced-skill-targeting-yanfly-compatible-script-without-untargetable-enemies-in-the-choice-window/

    Great script but there is one little thing that bothers me in Yanfly compatible ver. I have tried to change some things in script code but my knowledge is not sufficient :) Is it possible to tweak script such that enemies that are untargetable ( that have certain state or sth ) do not appear in selection bar (choice window)  ?

    Example:

    There is 4 enemis, 2 are untargetable ( have untargetable state from Hime script or are untargetable with method used by advanced targeting). Now all 4 are visible in selection bar (in the choice window) , 2 have red "X" over portrait in target box, 2 are normal.

    I wish that this two target boxes with red "X" was not visible in choice window. Game troop should be the size of targetable enemies not whole alive troop. I want to skip in choice window only between enemies that are targetable.

    I was able to merge yanlfy not compatible ver of Advance Targeting and Untargetable State ( Author: Hime ) and as a result I was able to target only enemies without untargetable state ( but on yanlfy not compatible ver, skills that use AT script commands do not work anyway so that was pointless ;) ) I will try to merge Hime script with Advance Targeting yanfly ver but maybe someone has sufficient knowledge and can tweak it without problem ;)
     
    Last edited by a moderator: Mar 25, 2015
    #16
  17. geri_khan

    geri_khan Veteran Veteran

    Messages:
    32
    Likes Received:
    6
    First Language:
    English
    Hi, thanks for taking a look at the script! I hope you're finding it useful.

    To be perfectly frank, it's been well over a year since I last looked at this thing and I don't entirely remember how it works. What you're asking for seems to be possible and I've already partially implemented it, but there's an awful, awful lot of crashes in the window drawing code that happen when the list of targets has ZERO entries and I need to take some time to remember how this works and figure out how to avoid that. But hopefully I can have something for you soon.
     
    #17
  18. geri_khan

    geri_khan Veteran Veteran

    Messages:
    32
    Likes Received:
    6
    First Language:
    English
    OK I believe I have implemented this and crushed all the bugs and issues that might arise. (including a few old ones I apparently didn't notice before)

    A new version of the demo has been uploaded to the same spot as before. If you just want the script, it's here

    There are two new variables to set at the start of the script.

    Code:
    AST_SHOW_UNTARGETABLE = true# if true, when a battler cannot be targeted they will appear in the targeting# window with your "crossout" icon over them. If false, they will not appear.AST_NO_TARGETS = "No available targets"# the string that will be displayed in yanfly's battle help and the Alert popup# if there are no targets at all
     

    You'll want to set that first one to false. It all seems to work in my tests in the Demo, but there's likely still something going wrong somewhere. Please let me know if so. Hope it works for you and you find it useful!
     
    Last edited by a moderator: Mar 25, 2015
    #18
  19. dii

    dii Villager Member

    Messages:
    18
    Likes Received:
    4
    First Language:
    Polish
    Sorry for not answering for such a long time. I have downloaded demo and new version of the script. It works just fine, well for now :) I spotted some interesting compatibility issue with Pets and Summons (Compatibility) v1.5g Script by: V.M of D.T. When someone is summoned on the battlefield they "do not exist" for targeting methods. They do not exist as targets for ally or enemy. They are like other battle party. I assume that is so because game_party.pets is beeing utilized in summon script. Something to implement in the future? :)

    (For now it is interesting result if one wants nontargetable summons and do not want to make global rule ;) )

    Thank you once again for making un/targetable implementations in such a short time :rock-right:  
     
    #19
  20. geri_khan

    geri_khan Veteran Veteran

    Messages:
    32
    Likes Received:
    6
    First Language:
    English
    Making a pets script was actually the entire reason why I made this in the first place. It's just that I completely burnt out after going crazy on this script and never finished the pets part of it.

    It should be possible to do a quick mod that fixes compatibility for that script. I'll look into it.
     
    #20

Share This Page