Alyon93

Veteran
Veteran
Joined
May 19, 2015
Messages
62
Reaction score
2
First Language
Italian
Primarily Uses
N/A
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  :)
 

Ramiro

Now with an army of Mecha-Ralphs!
Veteran
Joined
Aug 5, 2015
Messages
858
Reaction score
365
First Language
Spanish
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
 

Wavelength

MSD Strong
Global Mod
Joined
Jul 22, 2014
Messages
6,114
Reaction score
5,879
First Language
English
Primarily Uses
RMVXA
There's definitely some weird behavior with VX Ace's default "Self" targeting when used outside of battle.  A while back I made a set of items which apply a State to the item's user (simply to track who used the item) and then run a Common Event where you can choose a stat to boost for that character.  The "Self" scope made the most sense to me, but playtesters (as well as myself) found that targetting was working very strangely for these items.  Quoted from TheHonorableRyu in my playtest log for How Badly Do You Want It?:

Items

I also encountered the same bug you mentioned about the cookie items. The strange targeting behavior also seems to change based on how many party members are in the active party:

  • 2 party members: the item automatically applied to the 2nd party member, without any selection option
  • 3 party members: auto-applied to the 3rd member, without selection option
  • 4 party members: selection auto-highlighted the 4th character, but the selection can't be changed
  • 5 party members: auto-applied to the 5th member, without selection option
  • 6 party members: selection auto-highlighted the 3rd character, but the selection can't be changed (not sure why it would highlight the 3rd character, of all things)
He suggested changing it to a scope of One Ally - which, since these items were only used outside of battle, would be an acceptable change, and doing so completely corrected the targetting.

Anyway, this isn't exactly the same as your problem (where you want to be able to self-target in battle as well as using the item on anyone outside of battle), but thought it might be some interesting background in discovering why the bug is happening in the first place.
 

Alyon93

Veteran
Veteran
Joined
May 19, 2015
Messages
62
Reaction score
2
First Language
Italian
Primarily Uses
N/A
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  :)
 

Latest Threads

Latest Profile Posts

For those with up to 9 elements of magic; how do you structure your database. By element? Or by what is offensive vs supportive spells?
would anyone here be interested in rough concept art for the main protagonist of my game that might get changed later? :kaoswt2:
I guess I have no idea how to properly upload a custom font lmao. The menu fonts are too damn small.

Font_Size.PNG
Dev be like: "I'll make the character goes amnesia so I could explain the world and the lore better and immersive to the players"

Forum statistics

Threads
124,435
Messages
1,163,636
Members
163,250
Latest member
Ramadhinata
Top