I have this script made by sandgolem that makes you see icons above events.
But if you call an event parallel process it's starts slowing the player slowly slowly till he walk very slow. Is there a way to solve this i need this script for showing in my game that these events have quests.
And this is the part were it explains what you need to do to show icons on events(This is not part of the script, i posted it for those who wish to try it.):
But if you call an event parallel process it's starts slowing the player slowly slowly till he walk very slow. Is there a way to solve this i need this script for showing in my game that these events have quests.
Code:
#==========================================================================
# ** SG Event Icons
#==========================================================================
# sandgolem
# Version 2
# 21.01.07
#==========================================================================
SG_EventIcon_DefaultOpacity = 60
SG_EventIcon_MaxOpacity = 180
SG_EventIcon_FadeInSpeed = 3
SG_EventIcon_MapMemory = true
# Switch this to false to disable the map's icons from being remembered.
SG_EventIcon_Types = {
1 => 'Exclamationmark',
2 => 'Questionmark' }
# These are shortcuts you can use instead of always putting in a file name.
#==========================================================================
#
# To check for updates or find more scripts, visit:
# http://www.gamebaker.com/rmxp/scripts/
#
# Need help? Support topic:
# http://forums.gamebaker.com/showthread.php?t=701
#
#==========================================================================
if Object.const_defined?('SDK')
SDK.log('SG Event Icons', 'sandgolem', 2, '21.01.07')
if SDK.state('SG Event Icons') != true
@sg_eventicons_disabled = true
end
end
if !@sg_eventicons_disabled
#--------------------------------------------------------------------------
class Game_Temp
attr_accessor :sg_eventicon_sprites
def sg_eventicon_dispose
return if !@sg_eventicon_sprites
@sg_eventicon_sprites.each { |i| i.dispose if i != nil }
@sg_eventicon_sprites = []
end
end
class Game_Map
attr_accessor :sg_eventicons
def sg_geteventicons
return @sg_eventicons if !SG_EventIcon_MapMemory
return @sg_eventicons[@map_id]
end
def sg_geteventicons=(new)
if !SG_EventIcon_MapMemory
@sg_eventicons = (new)
else
@sg_eventicons[@map_id] = (new)
end
end
def sg_cleareventicons
for i in 0...@sg_eventicons[@map_id].size
return if @sg_eventicons[@map_id][i] != nil
end
@sg_eventicons[@map_id] = nil
end
alias sandgolem_eventicons_mapsetup setup
def setup(map_id)
if !@sg_eventicons or @map_id != map_id
if !SG_EventIcon_MapMemory
@sg_eventicons = []
else
@sg_eventicons = {} if !@sg_eventicons
sg_cleareventicons if @sg_eventicons[@map_id]
@sg_eventicons[map_id] = [] if !@sg_eventicons[map_id]
end
$game_temp.sg_eventicon_dispose
$game_temp.sg_eventicon_sprites = []
end
sandgolem_eventicons_mapsetup(map_id)
end
def sg_eventicon_opacity(opac = SG_EventIcon_DefaultOpacity)
return if !$game_temp.sg_eventicon_sprites
$game_temp.sg_eventicon_sprites.each { |i| i.opacity = opac if i != nil }
end
def sg_eventicon_show
# Called by the start of Scene_Map, redraws old icons
if !$game_map.sg_geteventicons
$game_map.sg_geteventicons = []
$game_temp.sg_eventicon_sprites = []
end
return if $game_map.sg_geteventicons == []
for i in 0...$game_map.sg_geteventicons.size
z = $game_map.sg_geteventicons[i]
next if z == nil
sg_eventicon(z[0],z[1],z[2],z[3])
end
sg_eventicon_opacity
end
def sg_eventicon(event,type,xoff,yoff)
$game_temp.sg_eventicon_sprites = [] if !$game_temp.sg_eventicon_sprites
icon = SG_EventIcon.new
$game_temp.sg_eventicon_sprites += [icon]
icon.event = @events[event]
icon.xoff = xoff
icon.yoff = yoff
icon.x = @events[event].screen_x + xoff
icon.y = @events[event].screen_y + yoff
icon.bitmap = RPG::Cache.icon(type)
icon.z = 541
icon.opacity = SG_EventIcon_DefaultOpacity
end
end
class Scene_Map
alias sandgolem_eventicons_transfer transfer_player
def transfer_player
$game_map.sg_eventicon_opacity(0)
sandgolem_eventicons_transfer
$game_map.sg_eventicon_show
end
alias sandgolem_eventicons_mapmain main
def main
$game_map.sg_eventicon_show
sandgolem_eventicons_mapmain
$game_temp.sg_eventicon_dispose
end
alias sandgolem_eventicons_mapupdate update
def update
sandgolem_eventicons_mapupdate
$game_temp.sg_eventicon_sprites.each { |i| i.update if i != nil }
end
end
def sg_eventicon(event,type,xoff = -12,yoff = -74)
type = SG_EventIcon_Types[type] if type.is_a?(Numeric)
$game_map.sg_geteventicons += [[event,type,xoff,yoff]]
$game_map.sg_eventicon(event,type,xoff,yoff)
end
def sg_uneventicon(event)
z = $game_map.sg_geteventicons
for i in 0...z.size
if z[i] != nil && z[i][0] == event
z[i] = nil
$game_temp.sg_eventicon_sprites[i].dispose
$game_temp.sg_eventicon_sprites[i] = nil
end
end
z.delete(nil)
$game_temp.sg_eventicon_sprites.delete(nil)
end
class SG_EventIcon < Sprite
attr_accessor :eventid, :event, :xoff, :yoff, :type
def update
if self.opacity < SG_EventIcon_MaxOpacity
self.opacity += SG_EventIcon_FadeInSpeed
end
self.x = @event.screen_x + @xoff
self.y = @event.screen_y + @yoff
end
end
#--------------------------------------------------------------------------
end
And this is the part were it explains what you need to do to show icons on events(This is not part of the script, i posted it for those who wish to try it.):
#==========================================
# Event icons guide
#==========================================
#sg_eventicon(4,1)
#
#Puts icon #1 above character 4 at the default position
#
#sg_eventicon(27,'003-Weapon03')
#
#Puts icon '003-Weapon03' above character 27
#
#sg_eventicon(11,1,-12,-50)
#
#Puts icon #1 above character 11 at a new x & y coordinate based on his own.
#You'll need to play around with the numbers a little.
#===================================================
# Event icons guide
#==========================================
#sg_eventicon(4,1)
#
#Puts icon #1 above character 4 at the default position
#
#sg_eventicon(27,'003-Weapon03')
#
#Puts icon '003-Weapon03' above character 27
#
#sg_eventicon(11,1,-12,-50)
#
#Puts icon #1 above character 11 at a new x & y coordinate based on his own.
#You'll need to play around with the numbers a little.
#===================================================