Hi guys,
this one should be rather easy, yet I'm not able to....
I want consumables to have different target while in-battle or outside.
Basically the whole point is that I want to remove the "a guy uses a potion on another guy".
Maybe it seems odd but I don't really like the "an ally" target, at least during a battle.
So I've put target "user" but predictably now outside battle I can use potion only on the leader of the party.
I'm not really sure I would need a script to fix this, but for now I'm out of options.
SO the idea is: Since "user" target is useless if an item is used in menù, why don't make it act like "an ally" ?
Hope you guys will understand the problem and will be able to help me.
Thanks in advance for whoever is going to read and answer.
Cheers 🙂
OMG this really look as a bug...
Let me see with a quick hotfix:
#==============================================================================# Item selection fix - Released as CC-0 (Creative commons 1.0 UNIVERSAL)# It MAY override other scripts so please, put it before any other Materials. # (But after RM scripts)# Credit is not needed.#==============================================================================class Window_MenuActor < Window_MenuStatus #-------------------------------------------------------------------------- # * Set Position of Cursor for Item - override #-------------------------------------------------------------------------- def select_for_item(item) @cursor_fix = item.for_user? #added condition 'if not in battle' only @cursor_fix = false if !$game_party.in_battle && item.is_a?(RPG::Item) @cursor_all = item.for_all? if @cursor_fix select($game_party.menu_actor.index) elsif @cursor_all select(0) else select_last end end endclass Scene_ItemBase < Scene_MenuBase #-------------------------------------------------------------------------- # * Checks if item is used on self - added method #-------------------------------------------------------------------------- def real_item_user(item, target) return user if $game_party.in_battle item.for_user? ? target : user end #-------------------------------------------------------------------------- # * Determine if Item Is Effective - override #-------------------------------------------------------------------------- def item_effects_valid? item_target_actors.any? do |target| target.item_test(real_item_user(item, target), item) end end #-------------------------------------------------------------------------- # * Use Item on Actor - override #-------------------------------------------------------------------------- def use_item_to_actors item_target_actors.each do |target| item.repeats.times { target.item_apply(real_item_user(item, target), item) } end end endWoah! a bug from long ago without anyone knowing... awesome...
Sorry if the script is not "polished", I am rusty because I didn't make any new scripts for a long time xD
Thanks Ramiro it works awesomely now!
About the bug discovery, I don't know what to say. It seemed to me a bug but it was also pretty predictable. I don't know if the other software like RMXP had the same bug or was it a distraction of the developers in this.
Anyway Wavelenght found out this strange behavior and Yeah it'll be very interesting why do this happen.
Thanks for solving the problem guys!
Cheers 🙂