Display variable changes [pop-ups] above an event

I apologize if something that does this already exists; I've looked all over to no avail, but I may easily have overlooked a script that does just this.

I've been trying to create a variable-based affinity system for the various party members in my project, and while the system itself works fine, I've been looking for a way to easily inform the player of affinity increases and decreases. What I've being trying to find is a script that displays the increases and decreases of variables in the form of a pop-up above a specified event (in this case, a party member). For example, if an action caused a party member to gain 10 affinity with the player, it would show in the form of a '+10 Affection' pop-up above the relevant party member's head, along with a sound effect.

Here's a small mockup:

Spoiler
hxc2GRP.png
Hey would this work: Event Window by yanfly?
Hey ♫

I wrote this for you. It requires Galv's Event Pop-Ups. By default this script will have popups when you gain items, although this can be disabled using a switch, set up in that scripts config section.

My script will call a popup over a followers head, whenever a variable linked to that actor is changed using an event. It should work retroactively through all of the events you have already built!

Spoiler
module Variable_Actor_Link Links = {}##################START CONFIG#################### Links[11] = 1 #Variable 11 is linked to actor 1 Links[12] = 2 #Variable 12 is linked to actor 2 Links[13] = 3 #Variable 13 is linked to actor 3 Links[14] = 4 #Variable 14 is linked to actor 4 Format = "%s Affection [%s]" #Format of the Popup # First %s is replaced with opperation # Second with the Actors Name Icons = [122,123] #First number is icon index for Addition and Mulitiplication # Second is for Subtraction and Division # Use 0 for no iconend################ END CONFIG###########class Game_Map def get_ptarget(target) if target < 0 index = nil $game_party.members.each_with_index{|m,i| index = i if m.id == (-target) } return nil if index==nil return $game_player if index==0 return $game_player.followers[index-1] elsif target == 0; return $game_player elsif target > 0; return $game_map.events[target] end endendclass Game_Interpreter alias kaimonkey_opp_var operate_variable def operate_variable(variable_id, operation_type, value) kaimonkey_opp_var(variable_id, operation_type, value) return unless SceneManager.scene_is?(Scene_Map) if Variable_Actor_Link::Links.has_key?(variable_id) id = Variable_Actor_Link::Links[variable_id] return unless $game_party.members.any?{|m| m.id == id } if(value<0) case operation_type when 1 # Add operation_type = 2 value *= -1 when 2 # Sub operation_type = 1 value *= -1 end end case operation_type when 0 # Set opp = "" inc = true when 1 # Add opp = "+" inc = true when 2 # Sub opp = "-" inc = false when 3 # Mul opp = "×" inc = true when 4 # Div opp = "÷" inc = false when 5 # Mod opp = "%" inc = false end str = sprintf(Variable_Actor_Link::Format,opp+value.to_s,$game_actors[id].name) popup(-id,str,Variable_Actor_Link::Icons[inc ? 0 : 1],0) end endend 
In the config section of my script, you can set up which variables are linked to which actors, the format of the popup, and which icons, if any, are displayed.

I hope this works well for you

/Kai ♫
Ah, thank you so much!

Just two minor grievances:

  1. Is there a way to alter the font?   Figured out this one, it's linked to Galv's script.
  2. Am I able to place the pop-up onto an event? As it stands, the script places the pop-up onto the affected party member, which is perfect for when the entire party is together and affection is being changed in the field. However, when talking to party members back in a safe 'base' area, I tend to make the party members into separate events so that they can be talked to and interacted with individually when back at your base. (Essentially they are removed from the party and the player is left on his own to talk to the party members at his own leisure) As a result of these party members being separate events and not the actual party members, the affection gains and losses can't be seen when just talking to the 'event' party members.
Grievances aside, the script works great, and is visually exactly what I had in mind - thanks again!
Okay, how about this:
If the actor is IN the party, it appears above their head
If the actor is NOT IN the party, it appears above the event?

EDIT: Hows this:

Spoiler
Code:
module Variable_Actor_Link  Links = {}  Links[11] = 1 #Variable 11 is linked to actor 1  Links[12] = 2 #Variable 12 is linked to actor 2  Links[13] = 3 #Variable 13 is linked to actor 3  Links[14] = 4 #Variable 14 is linked to actor 4    Format = "%s Affection [%s]" #Format of the Popup                               # First %s is replaced with opperation                               # Second with the Actors Name     Icons = [122,123] #First number is icon index for Addition and Mulitiplication                    # Second is for Subtraction and Division                    # Use 0 for no iconendclass Game_Map  def get_ptarget(target)    if target < 0      index = nil      $game_party.members.each_with_index{|m,i|        index = i if m.id == (-target)      }      return nil if index==nil      return $game_player if index==0      return $game_player.followers[index-1]    elsif target == 0; return $game_player    elsif target > 0; return $game_map.events[target]    end  endendclass Game_Interpreter  alias kaimonkey_opp_var operate_variable  def operate_variable(variable_id, operation_type, value)    kaimonkey_opp_var(variable_id, operation_type, value)    return unless SceneManager.scene_is?(Scene_Map)    if Variable_Actor_Link::Links.has_key?(variable_id)      id =  Variable_Actor_Link::Links[variable_id]      if $game_party.members.any?{|m|m.id == id}        char_id = -id      else        return unless event_id        char_id = event_id      end      if(value<0)        case operation_type        when 1  # Add          operation_type = 2          value *= -1        when 2  # Sub          operation_type = 1        value *= -1        end      end      case operation_type      when 0  # Set        opp = ""        inc = true      when 1  # Add        opp = "+"        inc = true      when 2  # Sub        opp = "-"        inc = false      when 3  # Mul        opp = "×"        inc = true      when 4  # Div        opp = "÷"        inc = false      when 5  # Mod        opp = "%"        inc = false      end      str = sprintf(Variable_Actor_Link::Format,opp+value.to_s,$game_actors[id].name)      popup(char_id,str,Variable_Actor_Link::Icons[inc ? 0 : 1],0)    end  endend 
Perfect! Thank you so much! 😀 👍

Original thread: https://forums.rpgmakerweb.com/threads/display-variable-changes-pop-ups-above-an-event.41886/