Well, I do believe this is possible, it was in rm2k3... but I've struck a blank spot..
All I want to do is: when the player chooses to shear a sheep, give an icon above the player's head WHEREVER the player might be (as I know you can put piccys in, but you have to specify the placement...and that is impossible to be honest) and add a wait period before the icon disappears and they find out whether they were successful or not.
Trouble being, I can't, for the life of me, work out how to event it. Whereas usually this kinda thing is no problem... any help please? Or (perish the thought) will I need a script. Because if I need a script then I'd rather just flash a picture in the middle of the screen while they do the task...
i know you said that instead of a script you would rather use a picture but since i already had a method to find characters sprites position i just used that so any way here this will work on the player and all events/Blizz-ABS Enemies just use $game_player.place_icon(icon,wait) icon is the name if the icon in the icon folder wait is the amount of time in seconds it will take to disappear to use on events/Blizz-ABS Enemies do the same but use $game_map.events[id].place_icon(icon,wait) id being the events id
#============================================================================
# Game_Character
#----------------------------------------------------------------------------
# Adds a mouse_in_area? method to any instance of this class.
#============================================================================
class Game_Character
alias icon_placment_initialize initialize
def initialize
icon_placment_initialize
@sprite = Sprite.new
@sprite.z = 1000
@icon_wait = 0
end
def icon_position
b = get_sprite.inner_bitmap
x = get_sprite.x-(get_sprite.cw/2)
y = get_sprite.y-get_sprite.ch
w,h = (b.width/2)-12,b.height-12
return (x+w),(y-h)
end
def place_icon(icon,wait)
@show = true
@icon_wait = wait*40
bitmap = RPG::Cache.icon(icon)
@sprite.bitmap = bitmap.clone
end
alias icon_placment_update update
def update
icon_placment_update
@icon_wait -= 1 if @icon_wait > 0
if @show
@sprite.x,@sprite.y = icon_position
if @icon_wait == 0
@sprite.bitmap.clear
@show = false
end
end
end
def get_sprite
return if !$scene.is_a?(Scene_Map)
$scene.spriteset.character_sprites.each{|s|return s if s.character == self}
end
end
#============================================================================
# Sprite_Character
#----------------------------------------------------------------------------
# Creats a inner bitmap for use with the mouse_in_area? method.
#============================================================================
class Sprite_Character
attr_reader :ch,:cw,:inner_bitmap
alias mces_initialize initialize
def initialize(viewport,character = nil)
mces_initialize(viewport,character)
end
alias mces_update update
def update
mces_update
@cw,@ch = @sprite.cw, @sprite.ch if $BlizzABS != nil
@inner_bitmap = Bitmap.new(@cw,@ch) if @inner_bitmap == nil
if @pattern != @character.pattern
@pattern = @character.pattern
bitmap = ($BlizzABS != nil ? @sprite.bitmap : self.bitmap)
src_rect = ($BlizzABS != nil ? @sprite.src_rect : self.src_rect)
@inner_bitmap.blt(0, 0, bitmap, src_rect)
end
end
end
#============================================================================
# Adds eternal reading of methods.
#============================================================================
class Sprite_Character_ABSEAL_ed; attr_reader :ch,:cw end if $BlizzABS != nil
class Scene_Map; attr_reader :spriteset end
class Spriteset_Map; attr_reader :character_sprites end
Ah thanks! I wasn't expecting such a quick reply ^^
Hm, I think I will use the script then if it's actually that simple :)
Technically all you need to do is have an event that stores all of the icons needed in it (each one assigned to another variable), set it to through and always on top (to avoid weird conflicts with other events), and when the "sheering" the sheep is to be done, set it to teleport to player x,y+1. This will place it above the players head. Do you want the icon to appear while the player is standing next to the sheep or do you want it while the action is happening? For standing next to the sheep, you'll need to do a few checks which'll decide whether or not you're near the sheep (this will most likely have to be done through a script snippet in a parallel process, or by comparing the player x,y and the event(s) x,y). After these checks are complete the icon would appear. If you don't want that, you just need to throw a few event commands into the sheep to move the icon while sheering.