Isto é uma pré-visualização de um tema em Hitskin.com
Instalar o tema • Voltar para a ficha do tema
[NPM4.0] Adicionar novos cursores
+6
Zeref.
Nietore
RD12
Kuraudo
Maverick ~
lovins
10 participantes
Aldeia RPG :: RPG Maker :: Rpg Maker XP :: Netplays :: Scripts para netplays
Página 2 de 2
Página 2 de 2 • 1, 2
Re: [NPM4.0] Adicionar novos cursores
meu script ficou assim:
- Spoiler:
- #===============================================================================
# ** Mouse Script v1 - Thank you to Cybersam who decoded Windows in order to make
# this work. of the credit, all I did was add a few functions.
# Without this script my entire system would not work. Thank you!
# I would not edit this, because it could easily be messed up. (Astro_Mech says)
#-------------------------------------------------------------------------------
# Author Cybersam
# Modified Valentine
# Version 2.0
# Date 11-04-06
# Edit Astro_mech
#===============================================================================
SDK.log("MouseInput", "Astro_mech", "1.0", " 13-04-06")
#-------------------------------------------------------------------------------
# Begin SDK Enabled Check
#-------------------------------------------------------------------------------
if SDK.state('MouseInput') == true
module Mouse
#--------------------------------------------------------------------------
# * Variable Setup
#--------------------------------------------------------------------------
gsm = Win32API.new('user32', 'GetSystemMetrics', 'i', 'i')
@cursor_pos = Win32API.new('user32', 'GetCursorPos', 'p', 'i')
module_function
#--------------------------------------------------------------------------
# * Mouse Global Position
#--------------------------------------------------------------------------
def mouse_global_pos
pos = [0, 0].pack('ll')
if @cursor_pos.call(pos) != 0
return pos.unpack('ll')
else
return nil
end
end
#--------------------------------------------------------------------------
# * Mouse Position
#--------------------------------------------------------------------------
def mouse_pos(catch_anywhere = false)
Input.mouse_update# Rataime's edit
width, height = client_size
x, y = screen_to_client(*mouse_global_pos)
if Input.Anykey == false
if catch_anywhere or (x >= 0 and y >= 0 and $Mouse.x < width and $Mouse.y < height)
return x, y
else
return $Mouse.x, $Mouse.y
end
else
return x, y
return $Mouse.x, $Mouse.y
end
end
#--------------------------------------------------------------------------
# * Delete
#--------------------------------------------------------------------------
def del
if @oldcursor == nil
return
else
@SetClassLong.call(handel ,-12, @oldcursor)
@oldcursor = nil
end
end
end
#--------------------------------------------------------------------------
# * Variable Setup
#--------------------------------------------------------------------------
$scr2cli = Win32API.new('user32', 'ScreenToClient', %w(l p), 'i')
$client_rect = Win32API.new('user32', 'GetClientRect', %w(l p), 'i')
$readini = Win32API.new('kernel32', 'GetPrivateProfileStringA', %w(p p p p l p), 'l')
$findwindow = Win32API.new('user32', 'FindWindowA', %w(p p), 'l')
#--------------------------------------------------------------------------
# * Screen to Client
#--------------------------------------------------------------------------
def screen_to_client(x, y)
return nil unless x and y
pos = [x, y].pack('ll')
if $scr2cli.call(hwnd, pos) != 0
return pos.unpack('ll')
else
return nil
end
end
#--------------------------------------------------------------------------
# * H Windowed
#--------------------------------------------------------------------------
def hwnd
game_name = "\0" * 256
$readini.call('Game','Title','',game_name,255,".\\Game.ini")
game_name.delete!("\0")
return $findwindow.call('RGSS Player',game_name)
end
#--------------------------------------------------------------------------
# * Client Size
#--------------------------------------------------------------------------
def client_size
rect = [0, 0, 0, 0].pack('l4')
$client_rect.call(hwnd, rect)
right, bottom = rect.unpack('l4')[2..3]
return right, bottom
end
end
class Game_Temp
attr_accessor :atualizar_mouse
alias mouse_mmo initialize
def initialize
mouse_mmo
@atualizar_mouse = false
end
end
#-------------------------------------------------------------------------------
# End SDK Enabled Check
#-------------------------------------------------------------------------------
#===============================================================================
# ** Mouse Script v1 - Controlls the Mouse's functions, inlcuding drawing.
# + Event Map Interaction by MrMo, Merged by trebor777
#-------------------------------------------------------------------------------
# Author Astro_mech
# Version 1.3
# Date 15-11-06
# Edit Me™, Mr.Mo and trebor777
#===============================================================================
SDK.log("Mouse", "Astro_mech", "1.3", " 13-04-06")
#-------------------------------------------------------------------------------
# Begin SDK Enabled Check
#-------------------------------------------------------------------------------
if SDK.state('Mouse')
cursor = Win32API.new("user32", "ShowCursor", "i", "i" )
cursor.call(0)
class Game_Mouse
MOUSE_ICON = {}
MOUSE_ICON["Default"] = "Arrow" #The default mouse icon.
#Setting up mouse Icons are easy
MOUSE_ICON["NPC"] = "Arrow-Event2"
MOUSE_ICON["Item"] = "Arrow-Event2"
MOUSE_ICON["Event"] = "Arrow-Event2"
MOUSE_ICON["Enemy"] = "001-Weapon01"
MOUSE_ICON["NETPLAYER"] = "Arrow-Event2"
MOUSE_ICON["Minerar"] = "Picadeira"
#--------------------------------------------------------------------------
# * Attributes
#--------------------------------------------------------------------------
attr_accessor :icon
attr_accessor :x
attr_accessor :y
#--------------------------------------------------------------------------
# * Starts up the class, and creates the cursor icon
#--------------------------------------------------------------------------
def initialize
@x = 0
@y = 0
$icon = RPG::Cache.icon(MOUSE_ICON["Default"])
@icon_name = MOUSE_ICON["Default"]
@sprite = Sprite.new
#@sprite.bitmap = $icon
@sprite.opacity = 0
@sprite.z = 999999999
@draw = false
end
#--------------------------------------------------------------------------
# * Reset
#--------------------------------------------------------------------------
def reset
$icon = RPG::Cache.icon(MOUSE_ICON["Default"])
@icon_name = MOUSE_ICON["Default"]
@sprite.dispose if @sprite.bitmap != nil
@sprite = Sprite.new
@sprite.bitmap = $icon
@draw = false
# Updates the co-ordinates of the icon
@x, @y = Mouse.mouse_pos
@sprite.x = @x
@sprite.y = @y
@sprite.z = 999999999
end
def reset2
$icon = RPG::Cache.icon($mouse_iconfor)
@icon_name = MOUSE_ICON["Default"]
@sprite.dispose if @sprite.bitmap != nil
@sprite = Sprite.new
@sprite.bitmap = $icon
@draw = false
# Updates the co-ordinates of the icon
@old_x = @x # prevent the F2 bug
@old_y = @y # prevent the F2 bug
@x, @y = Mouse.mouse_pos
@x = @old_x if @x==nil # prevent the F2 bug
@y = @old_y if @y==nil # Prevent the F2 Bug
@sprite.x = @x
@sprite.y = @y
@sprite.z = 999999999
end
#--------------------------------------------------------------------------
# * Update
#--------------------------------------------------------------------------
def update
# Updates the co-ordinates of the icon
@old_x = @x # prevent the F2 bug
@old_y = @y # prevent the F2 bug
@x, @y = Mouse.mouse_pos
@x = @old_x if @x==nil # prevent the F2 bug
@y = @old_y if @y==nil # Prevent the F2 Bug
@sprite.x = @x
@sprite.y = @y
if $scene.is_a?(Scene_Map)
#Check if the mouse is clicked
if Input.pressed?(Input::Mouse_Left)
mouse_interactive
end
mouse_netinteractive if Input.pressed?(Input::Mouse_Right)
#$game_player.clear_path if Input.trigger(Input::Mouse_Right) or $game_temp.message_window_showing or $game_netplay.chat_active
#Check for mouse over
check_icon_to_icon
end
if $game_temp.atualizar_mouse == true
$game_temp.atualizar_mouse = false
reset2
end
end
#--------------------------------------------------------------------------
# * Change Icon according to the Icon List
#--------------------------------------------------------------------------
def check_icon_to_icon
object = get_allobject
if object[0]
if object[1].is_a?(Game_Event)
list = comment_include(object[1], "Mouse")
return if list == nil
#Check what the list is
for key in MOUSE_ICON.keys
next if !list.include?(key)
next if @icon_name == MOUSE_ICON[key]
return if $pegando_item == true
return if $pegando_item_loja == true
return if $pegando_item_trade == true
return if $pegando_skill == true
return if $desequipar_arma == true
return if $desequipar_armadura== true
return if $desequipar_escudo == true
return if $desequipar_helmet== true
return if $desequipar_acessorio == true
return if $desequipar_capa == true
return if $desequipar_luva == true
return if $desequipar_bota == true
return if $desequipar_amuleto == true
$icon = RPG::Cache.icon(MOUSE_ICON[key])
@icon_name = MOUSE_ICON[key]
@sprite.bitmap.dispose if @sprite.bitmap != nil or @sprite.bitmap.disposed?
@sprite.bitmap = $icon
end
elsif object[1].is_a?(Game_NetPlayer)
#Check what the list is
if @icon_name != MOUSE_ICON["NETPLAYER"]
$icon = RPG::Cache.icon(MOUSE_ICON["NETPLAYER"])
@icon_name = MOUSE_ICON["NETPLAYER"]
@sprite.bitmap.dispose if @sprite.bitmap != nil or @sprite.bitmap.disposed?
@sprite.bitmap = $icon
end
end
elsif @icon_name != MOUSE_ICON["Default"]
$icon = RPG::Cache.icon(MOUSE_ICON["Default"])
@icon_name = MOUSE_ICON["Default"]
@sprite.bitmap.dispose if @sprite.bitmap != nil or @sprite.bitmap.disposed?
@sprite.bitmap = $icon
end
end
#--------------------------------------------------------------------------
# * Interactive System
#--------------------------------------------------------------------------
def mouse_interactive
#Check if there is something on that pos.
object = get_object
if object[0] and object[1].is_a?(Game_Event)
#Get the correct pos
pos = get_pos(object[1])
#return if there is no pos
return if pos == nil
#Move to pos
return if $pegando_item == true
return if $pegando_item_loja == true
return if $pegando_skill == true
return if $pegando_item_trade == true
return if $desequipar_arma == true
return if $desequipar_armadura== true
return if $desequipar_escudo == true
return if $desequipar_helmet== true
return if $desequipar_acessorio == true
return if $desequipar_capa == true
return if $desequipar_luva == true
return if $desequipar_bota == true
return if $desequipar_amuleto == true
return if $equip_w.in_area? and $equip_w.visible
return if $member_list.in_area? and $member_list.visible
return if $item_w.in_area? and $item_w.visible
return if $painel_adm.in_area? and $painel_adm.visible
return if $teleport.in_area? and $teleport.visible
return if $skill.in_area? and $skill.visible
return if $guild_w.in_area? and $guild_w.visible
return if $guild_created.in_area? and $guild_created.visible
return if $janela_base.in_area?
$game_player.turn_to(object[1]) if !in_direction?($game_player,object[1])
#Activate event if facing event and next to event.
#start event
list = comment_include(object[1], "ABS")
if $game_map.events[object[1].id].opacity == 150
return if $fechando_ativar == true
$game_map.events[object[1].id].opacity = 255
$fechando_ativar = true
else
return if $fechando_ativar == true
$game_map.events[object[1].id].opacity = 150
#if $event_opa != $game_map.events[object[1].id] and $event_opa != nil
#$game_map.events[$event_opa].opacity = 255
#end
$player_opa = nil
$player_leva = nil
$event_opa = object[1].id
$event_leva = object[1]
if $ABS.enemies[$event_leva.id] != nil
else
$event_leva = nil
end
$fechando_ativar = true
end
if list != nil
#Network::Main.socket.send("5|@pvp_target = 'NPC'|<->")
# $game_party.actors[0].pvp_target = [$game_map.events[object[1].id],$ABS.enemies[object[1].id]]
return
end
end
#Check if there is something on that pos.
object = get_netobj
if object[0] and object[1].is_a?(Game_NetPlayer)
#Get the correct pos
pos = get_pos(object[1])
#return if there is no pos
return if pos == nil
#Move to pos
$game_player.turn_to(object[1]) if !in_direction?($game_player,object[1])
#Activate event if facing event and next to event.
return if !in_range?($game_player, object[1], 20)
return if $fechando_ativar == true
if object[1].opacity == 150
return if $fechando_ativar == true
object[1].opacity = 255
$fechando_ativar = true
else
return if $fechando_ativar == true
object[1].opacity = 150
$event_opa = nil
$event_leva = nil
$player_opa = object[1].id
$player_leva = object[1]
$fechando_ativar = true
end
#start event
# Network::Main.socket.send("5|@pvp_target = '#{object[1].name}'|<->")
# $game_party.actors[0].pvp_target = object[1]
return
else
# $game_party.actors[0].pvp_target = nil
end
if object[0] and object[1].is_a?(Game_Event)
list = comment_include(object[1], "Mouse")
return if list == nil
#Get the correct pos
pos = get_pos(object[1])
#return if there is no pos
return if pos == nil
#if list.include?("Start") and !in_range?($game_player, object[1], 1)
#Move to pos
return $game_player.find_path(pos[0], pos[1]) if list.include?("Cursor") and !in_range?($game_player, object[1], 1)
$game_player.turn_to(object[1]) if !in_direction?($game_player,object[1])
#Activate event if facing event and next to event.
return if !in_direction?($game_player,object[1]) or !in_range?($game_player, object[1], 1)
#start event
object[1].start if list.include?("Cursor")
return
end
#If there is nothing than move
return if !$game_map.passable?(tile_x, tile_y, 0, $game_player)
if $item_w.in_area? or $equip_w.in_area? and $item_w.visible == true
elsif $skill.in_area? and $skill.visible == true
elsif $trade_a == true
if $trade_w.in_area? and $trade_w.visible == true or $trade_w_2.in_area? and $trade_w_2.visible == true
else
if $pegando_item == false and $pegando_item_trade == false and $pegando_item_loja == false
$game_player.find_path(tile_x, tile_y) if User_Edit::PATHFIND_ACTIVE
end
end
elsif $loja == true
if $loja_w.in_area? and $loja_w.visible == true
else
if $pegando_item == false and $pegando_item_trade == false and $pegando_item_loja == false
$game_player.find_path(tile_x, tile_y) if User_Edit::PATHFIND_ACTIVE
end
end
elsif $status.in_area? and $status.visible == true
elsif $member_list.in_area? and $member_list.visible == true
elsif $guild_created.in_area? and $guild_created.visible == true
elsif $msg.in_area? and $msg.visible == true
elsif $janela_base.in_area? and $janela_base.visible == true
elsif $chat.in_area? and $chat.visible == true
elsif $painel_adm.in_area? and $painel_adm.visible == true
elsif $pegando_item_trade == true
elsif $pegando_item_loja == true
elsif $fechando_ativar == true
elsif $pegando_skill == true
elsif $pegando_item == true
elsif $arrastando_poxa == true
elsif $desequipar_arma == true
elsif $desequipar_armadura== true
elsif $desequipar_escudo == true
elsif $desequipar_helmet== true
elsif $desequipar_acessorio == true
elsif $desequipar_capa == true
elsif $desequipar_luva == true
elsif $desequipar_bota == true
elsif $desequipar_amuleto == true
elsif $chat_textinho.in_area? and $chat_textinho.visible == true
elsif $teleport.in_area? and $teleport.visible == true
elsif $guild_w.in_area? and $guild_w.visible == true
elsif $quest_list.in_area? and $quest_list.visible == true
elsif $quest_w.in_area? and $quest_w.visible == true
else
$game_player.find_path(tile_x, tile_y) if User_Edit::PATHFIND_ACTIVE
end
end
def mouse_netinteractive
#Check if there is something on that pos.
object = get_netobj
if object[0] and object[1].is_a?(Game_NetPlayer)
#Get the correct pos
pos = get_pos(object[1])
#return if there is no pos
return if pos == nil
#Move to pos
$game_player.turn_to(object[1]) if !in_direction?($game_player,object[1])
#Activate event if facing event and next to event.
return if !in_range?($game_player, object[1], 20)
#start event
$scene.active_netcommand(@x,@y,object[1].netid)
return
end
# $game_player.find_path(tile_x, tile_y)
end
#--------------------------------------------------------------------------
# * Get Pos
#--------------------------------------------------------------------------
def get_pos(object)
return [tile_x-1,tile_y] if $game_map.passable?(tile_x-1, tile_y, 0, object)
return [tile_x,tile_y-1] if $game_map.passable?(tile_x, tile_y-1, 0, object)
return [tile_x+1,tile_y] if $game_map.passable?(tile_x+1, tile_y, 0, object)
return [tile_x,tile_y+1] if $game_map.passable?(tile_x, tile_y+1, 0, object)
return nil
end
#--------------------------------------------------------------------------
# * Get Object
#--------------------------------------------------------------------------
def get_object
for event in $game_map.events.values
return [true,event] if event.x == tile_x and event.y == tile_y
end
return [false,nil]
end
def get_netobj
for player in Network::Main.mapplayers.values
return [true,player] if player.x == tile_x and player.y == tile_y
end
return [false,nil]
end
def get_allobject
for player in Network::Main.mapplayers.values
return [true,player] if player.x == tile_x and player.y == tile_y
end
for event in $game_map.events.values
return [true,event] if event.x == tile_x and event.y == tile_y
end
return [false,nil]
end
#--------------------------------------------------------------------------
# * Get Comments
#--------------------------------------------------------------------------
def comment_include(*args)
list = *args[0].list
trigger = *args[1]
return nil if list == nil
return nil unless list.is_a?(Array)
for item in list
next if item.code != 108
par = item.parameters[0].split(' ')
return item.parameters[0] if par[0] == trigger
end
return nil
end
#--------------------------------------------------------------------------
# * In Range?(Element, Object, Range) - Near Fantastica
#--------------------------------------------------------------------------
def in_range?(element, object, range)
x = (element.x - object.x) * (element.x - object.x)
y = (element.y - object.y) * (element.y - object.y)
r = x + y
return true if r <= (range * range)
return false
end
#--------------------------------------------------------------------------
# * In Direction?(Element, Object) - Near Fantastica
#--------------------------------------------------------------------------
def in_direction?(element, object)
return true if element.direction == 2 and object.y >= element.y and object.x == element.x
return true if element.direction == 4 and object.x <= element.x and object.y == element.y
return true if element.direction == 6 and object.x >= element.x and object.y == element.y
return true if element.direction == 8 and object.y <= element.y and object.x == element.x
return false
end
#--------------------------------------------------------------------------
# * Returns the current x-coordinate of the tile the mouse is over on the map
#--------------------------------------------------------------------------
def tile_x
return ((($game_map.display_x.to_f/4.0).floor + @x.to_f)/32.0).floor
end
#--------------------------------------------------------------------------
# * Returns the current y-coordinate of the tile the mouse is over on the map
#--------------------------------------------------------------------------
def tile_y
return ((($game_map.display_y.to_f/4.0).floor + @y.to_f)/32.0).floor
end
#--------------------------------------------------------------------------
# * Makes the mouse sprite disappear
#--------------------------------------------------------------------------
def invisible
@sprite.opacity = 0
#Win32API.new('user32', 'ShowCursor', 'l', 'l').call(1)
end
#--------------------------------------------------------------------------
# * Makes the mouse sprite visible
#--------------------------------------------------------------------------
def visible
@sprite.opacity = 255
#Win32API.new('user32', 'ShowCursor', 'l', 'l').call(0)
end
#--------------------------------------------------------------------------
# * Disposes the sprite
#--------------------------------------------------------------------------
def dispose
@sprite.dispose
end
end
end
#-------------------------------------------------------------------------------
# End SDK Enabled Check
#-------------------------------------------------------------------------------
_________________
Dia 27/07/2012 as 9:38 pm,foi quando o apocalipse maker aconteceu,Valentine anúncia sua saída![LUTO]
- Spoiler:
Zeref.- Semi-Experiente
- Mensagens : 130
Créditos : 13
Re: [NPM4.0] Adicionar novos cursores
@Frango
Cara não é pra colocar o nome da imagem no comentário, e sim o nome do comentário.
Tipo:
Comentário > Nome da Imagem
Não é assim,é assim:
Comentário > Nome do Comentário
tipo: "MOUSE_ICON["NOME DO COMENTARIO QUE ATIVA"] = "IMAGEM DO CURSOR"
Comentário > NOME DO COMENTARIO QUE ATIVA
Se num der coloca Mouse Cursor antes.
Não sei você entendeu é que me enrolei um pouco
FLWS
Cara não é pra colocar o nome da imagem no comentário, e sim o nome do comentário.
Tipo:
Comentário > Nome da Imagem
Não é assim,é assim:
Comentário > Nome do Comentário
tipo: "MOUSE_ICON["NOME DO COMENTARIO QUE ATIVA"] = "IMAGEM DO CURSOR"
Comentário > NOME DO COMENTARIO QUE ATIVA
Se num der coloca Mouse Cursor antes.
Não sei você entendeu é que me enrolei um pouco
FLWS
_________________
- Músicas Recomendadas:
- = WOOHOO!!!
= Massa!
Slipknot - Spit It Out
Slipknot - Before I Forget
Slipknot - Eyeless
Iron Weasel - Band Van
Iron Weasel - Pull My Finger
Iron Weasel - Weasel Rock You
System Of a Down - B.Y.O.B.
System Of a Down - Chop Suey
System Of a Down - Sugar
System Of a Down - Prison Song
Dry Cell - Slip Away
Mr. D- Semi-Experiente
- Mensagens : 116
Créditos : 4
Re: [NPM4.0] Adicionar novos cursores
eu entendi isso,mas ele não ativa '-'
_________________
Dia 27/07/2012 as 9:38 pm,foi quando o apocalipse maker aconteceu,Valentine anúncia sua saída![LUTO]
- Spoiler:
Zeref.- Semi-Experiente
- Mensagens : 130
Créditos : 13
Re: [NPM4.0] Adicionar novos cursores
também não to conseguindo coloca vish!
_________________
"Não importa o quão forte o cara é, o que importa é encara-lo de frente sem fraquejar"
Laxus ~ Fairy Tail
Laxus- Aldeia Friend
- Mensagens : 1150
Créditos : 78
Re: [NPM4.0] Adicionar novos cursores
É pq ele n disse que o comentario tinha que ser :
Mouse Cursor E aki o Nome do Seu Comentario Tipo Mouse Cursor Minar
Mouse Cursor E aki o Nome do Seu Comentario Tipo Mouse Cursor Minar
_________________
Assinatura removida pela Staff
^ Tenho nova, surprise
Página 2 de 2 • 1, 2
Tópicos semelhantes
» Como adicionar novos servidores no seu Game
» Como posso adicionar novos tipos de armadura?
» [NPM4.9.1] Nova HUD
» [NPM4.0] Servidor por TXT
» que há com o NPM4.0?
» Como posso adicionar novos tipos de armadura?
» [NPM4.9.1] Nova HUD
» [NPM4.0] Servidor por TXT
» que há com o NPM4.0?
Aldeia RPG :: RPG Maker :: Rpg Maker XP :: Netplays :: Scripts para netplays
Página 2 de 2
Permissões neste sub-fórum
Não podes responder a tópicos