Versão 1.6.4R2
Tradução para o Português do Client.
Corrigido Bug visual Equipament (o escudo ficava em baixo das armaduras).
Adicionado Inventário dividido por Abas.
Adicionado Particle Engine.
Adicionado Vampyr Jump (pula eventos no mapa).
Adicionado Mover em 8 direções.
Adicionado ReinoRPG Mini-Mapa.
Adicionado Velocidade de acordo com agilidade (Nunca achei necessário isso mais me pedirão).
Adicionado ChardWindoSkin.
Adicionado Print Screen com logo.
Adicionado MOG - Animated Panorama.
Adicionado MOG - Location - Name - VX.
Versão 1.6.3R3
Bug do teleporte corrigido.
Adicionado resolução 640x480.
1.6.1 R2 Refresh 08/14/2010
Added help topics;
Added hidden classes by putting * on class name;
Added server-sided shops (You can use both server-sided and default RM shop);
Mixed Vampyr scripts with default RM scripts;
Enhanced the sync module, now it syncs automatically;
Finished Character Config Window;
Fixed crash when choose the client folder;
Fixed global events move thought players;
Fixed exp and gold quests rewards shifted;
Fixed exp formula don't increase the points needed to level up;
Fixed server closes shuddenly when <i>Shop.rvdata</i> or <i>Quest.rvdata</i> don't exist;
Fixed Minor bugs;
1.6 RC2 - 08/14/2010
Server.exe window enhanced, now with graphics;
changed some database structures;
Added custom EXP formula;
Added Verus Tempus Proelium;
Added option to allow only one account make login by IP;
Quest system completely remade;
Enhanced the Network Players method;
Remade some communications methods;
Fixed skills do not save bug;
HP and MP inflation added;
Finished global switches and variables method;
Modified Character Selection Screen to show the actors equips on their body;
Removed Config.ini file, now server infos are stored on Windows registry.
Fixed switches and variables does not save bug;
Fixed character delete does not delete other things about the character;
Fixed double chat bug;
Fixed minor bugs;
1.5 RC - 02/28/2010
Database engine was changed to MySql;
Rewritten all the communication protocol between server and client (more speed);
Started the Global Events method;
Added Global Clock (Day and Night System);
Removed points to distribute when create a new character;
Fixed minor bugs;
Using Ruby 1.8.7-p249 on this server files;
1.1.1 - 12/30/2009
Added Day and Night system;
Fixed ABS bug;
Fixed PM bug;
Fixed minor bugs;
Using Ruby 1.8.6-p383 on the server files;
Beta 1.1.0 – 12/23/2009
Added Multi-languages option to server;
Added NetABS RC
Hud Remade, the new one causes much less lag;
Removed PVP (it will be added again later);
Fixed ABS between error;
Fixed undefined for nil class;
Friends Window finished;
Added PM system;
Enhanced Skills Categories;
Some codes rewritten;
Fixed minor bug;
Server window 70% rewritten;
Enhanced admin panel on server side;
Removed ‘Config’ script, now the things are configured on server side;
Added Client Launcher;
Beta 1.0.9 – 10/09/2009
Added Auto-Updater;
Added + options to vocab;
Added system icons;
Added character managment on server window;
Added Neoncube launcher to client;
Added Visual Equipmen based on gender;
Fixed uninitalized constant Config::Shop_Sell_Divide;
Fixed a little bug of create character window (not finished);
Fixed “Select Characters” button;
Fixed minor bugs;
Beta 1.0.8 – 10/02/2009
Fixed register password and email issues;
Fixed Walk when click on text bar of chat window;
Addded some configurations by server side;
Fixed “undefined method ‘>’ for nil:NilClass”;
Fixed shop shop sell items price;
Fixed actor parametters;
Fixed mouse cursor on monsters after kill then;
Chat code enhanced;
Fixed characters names on head don’t appear sometimes;
Added options window;
Fixes minor bugs;
Beta 1.0.7 – 09/26/2009
Started Quest System (Beta Stage yet);
Widgets updated to 2.0;
Actor creations fixed;
Visual equip fixed;
Online players don't appear sometimes fixed;
Sistem Color.png error fixed;
Chat box enhanced (Now with scrollbar);
Moused based abs beta;
Path finding beta;
Fixes minor bugs;
Beta 1.0.6 – 09/23/2009
Fixed check_value error;
Fixed Hud Hotkeys and Character Status;
Fixed chat on all map;
Added option to choose the shop items price (the value that items price is divided);
Fixed two sword styles actor and window equip;
Fixed GM commands (/kick x, /suspend x, /ban x where x = player’s name);
Fixed character creation;
Fixed other minor bugs;
Beta 1.0.5 – 09/19/2009
Added Self Switches Control (Need new database);
Added Texts to Hud HP, MP and EXP;
Added Amount Box to Trade;
Amount box not needed if your item number <= 1;
Fixed Armors sprites above events;
Fixed minor bugs;
Beta 1.0.4 – 09/18/2009
Added faces (must change the Database.sdf to new);
Added Amount window to shop, inventory and warehouse;
Fixed don’t save actor graphics when it changes;
Fixed some bugs of In-game registration;
Added Anti Sql-Injection on php registration;
Fixed Vocab errors;
Added easy setup-class creation;
Added scrollbars for shop, inventory and trade window;
Fixed more minor bugs;
Beta 1.0.3 – 09/17/2009
Fixed Message Window;
Fixed armors on trade window;
Fixed Network players movement;
Added Register In-game;
Fixed php registration page;
Fixed another equipments kinds (Boots, Gloves, Cape and Necklace);
Added guide to change equips sprites and kinds;
Fixed minor bugs;
Beta 1.0.2 – 09/15/2009
Fixed Visual Equipment;
Fixed windows don’t close when walk;
Fixed Guild error;
Fixed close chat box when press X and cast skills and items when type;
Added message balloon;
Added 1st part of PVP (can attack with weapons);
Added Safe Areas to ABS (Areas where player will respawn when dies);
Fixed minor bugs;
Beta 1.0.1 – 09-14/2009
Fixed Message Window don’t appear;
Fixed warehouse withdraw item disappear;
Fixed teleport and player on map don’t disappear;
Fixed Emotions;
Fixed Game Over (Vampyr Net ABS start being build);
Fixed some other minor bugs;
Beta 1.0.0 – 09/13/2009
Server uses now, SQL Compact Edition;
Server can generate a list of Accounts, characters, Guilds, etc in Microsoft Excel;
Creation and exclusion of chars (5 chars per account);
Switches and Variables save in Database;
Guild System (Creation is based on Mu guild system);
Trade system;
Warehouse system;
IP blocker;
Admin can talk with players using the server window;
Visual Equipment with online support;
Block and Suspense system (Block is undefined days, Suspense is one week);
Font color of chat and display name of GM and Admin is different of the others players;
GM and Admin chat commands:
Chat with case insensitive filter;
Widgets (Windows enhancements identical to Windows Vista);
Chat multi-colors (for Guild talk, whisper, friends talk, scream, etc…)
Path Finding
Skills window with separator of kinds of skills;
Chat with filer case insensitive;
Points distributions when level-up;
Max level 999;
Visual Equipment with online support and kinds of 8 equipments;
#===============================================================================# Mouse System# By Jet10985 (Jet)# Some Code by: Woratana, Berka# Uses: Modern Algebra's Path Finding Script# Super Heavy Testing/Debug Help/Requested By: Nathanial (Beleren)#===============================================================================# This script will allow full use of the mouse inside of rmvx for various# purposes.# This script has: 6 customization options.#===============================================================================# Overwritten Methods:# None#-------------------------------------------------------------------------------# Aliased methods:# Scene_Map: update, terminate, update_transfer_player# Input: update, trigger?, press?, repeat?, dir4, dir8# Window_Selectable: update, top_row=# Scene_File: update# Window_NameInput: update# Game_Temp: initialize# Game_Event: initialize, update#===============================================================================#==============================================================================# Path Finding# Version: 2.0# Author: modern algebra (rmrk.net)# Date: April 10, 2008#==============================================================================# Thanks:# Patrick Lester! For his tutorial on A* Pathfinding algorithm (found at: # http://www.gamedev.net/reference/articles/article2003.asp) as well as # another amazingly helpful tutorial on using binary heaps (found at: # http://www.policyalmanac.org/games/binaryHeaps.htm). Without his excellent# tutorials, this script would not exist. So major thanks to him.# Zeriab, for tricking me into believing that this was an actual exercise.# Also, his table printout actually makes Tables useable :P#===============================================================================beginShowing text above event when mouse hovers:If you want a message to appear over an event's head if the mouse is hoveringover the event, put this comment in the event:MOUSE TEXT MESSAGE HEREeverything after TEXT will be the hovering display.--------------------------------------------------------------------------------Change mouse picture above event when mouse hovers:If you want the mouse's picture to temporarily change whne over an event, putthis comment in the eventMOUSE PIC NAME/NUMBERif you put a name, the mouse will become that picture, but if you put a numberthen the mouse will become the icon that is the id number--------------------------------------------------------------------------------Specific mouse click movement routes:If you want the player to land specifically in a square around an event whenthey click to move on the event, put one of these comments in the event:MOUSE MOVE UP/LEFT/RIGHT/DOWNonly put the direction that you want the player to land on.--------------------------------------------------------------------------------Click to activate:If you want an event to automatically start when it is clicked on, placethis in an event comment:MOUSE CLICK--------------------------------------------------------------------------------Don't stop the player when walking over a touch event:By default, this script will stop a mouse-caused movement if the player walksover/under a player touch/event touch event. If you want the event to activate,but for the player to keep walking to their destination, put this comment in theevent:MOUSE NOSTOP--------------------------------------------------------------------------------Ignore Events:To have an event be ignored when the mouse makes it's movement path (as if theevent isn't there), put this comment in the event:MOUSE THROUGH--------------------------------------------------------------------------------Extra Notes:In selectable windows that have more items than what's shown, players caneither put the mouse below the window to scroll down, OR use the mouse'sscroll wheel to scroll up/down.You can activate action button events by standing next to the event and clickingon it with the mouse.=endmodule JetMouse
# If you are using a graphic, this is it.# It must be in the Graphics/System folder.
CURSOR_PICTURE ="cursor-mouse"# If you aren't using a graphic, this icon will be the mouse.# To use the icon, just put a non-existant picture as the above config
ICON_INDEX =3# Do you want the player to be able to move by clicking the mouse?
ALLOW_MOUSE_MOVEMENT =true# Do you want mouse movement to do 8-dir walking?# Requires 8-Dir Walking by Jet.
DO_8DIR_WALKING =false# Turning this switch on will make the mouse invisible and unusuable until# the switch is turned off
TURN_MOUSE_OFF_SWITCH =20# Do you want the mouse to check for mouse wheel scrolling in selectbale# windows? Not using this may reduce some rare cases of lag.
USE_WHEEL_DETECTION =falseend#===============================================================================# DON'T EDIT FURTHER UNLESS YOU KNOW WHAT TO DO.#===============================================================================module Mouse
Get_Message = Win32API.new('user32','GetMessage','plll','l')
GetAsyncKeyState = Win32API.new("user32","GetAsyncKeyState",'i','i')
GetKeyState = Win32API.new("user32","GetKeyState",'i','i')
SetCursorPos = Win32API.new('user32','SetCursorPos','nn','n')
GetCursorPo = Win32API.new('user32','GetCursorPos','p','i')
ScreenToClient = Win32API.new('user32','ScreenToClient','lp','i')
FindWindowA = Win32API.new('user32','FindWindowA','pp','l')
GetClientRect = Win32API.new('user32','GetClientRect','lp','i')
GetWindowRect = Win32API.new('user32','GetWindowRect','lp','i')
contents =File.open('Game.ini','r'){|f| f.read}
q = contents[/Title=(.+)/].nil? ? "cccc" : $1
@handle= FindWindowA.call('RGSS Player', q)
module_function
Point =Struct.new(:x,:y)
Message =Struct.new(:message,:wparam,:lparam,:pt)
Param =Struct.new(:x,:y,:scroll)
Scroll = 0x0000020A
def hiword(dword);return((dword&0xffff0000)>>16)&0x0000ffff;enddef loword(dword);return dword&0x0000ffff;enddef word2signed_short(value)return value if(value&0x8000)==0return-1*((~value&0x7fff)+1)enddef unpack_dword(buffer, offset =0)
ret = buffer[offset +0]&0x000000ff
ret |=(buffer[offset +1]<<(8*1))&0x0000ff00
ret |=(buffer[offset +2]<<(8*2))&0x00ff0000
ret |=(buffer[offset +3]<<(8*3))&0xff000000
return ret
enddef unpack_msg(buffer)
msg = Message.new; msg.pt= Point.new
msg.message=unpack_dword(buffer,4*1)
msg.wparam= unpack_dword(buffer,4*2)
msg.lparam= unpack_dword(buffer,4*3)
msg.pt.x= unpack_dword(buffer,4*5)
msg.pt.y= unpack_dword(buffer,4*6)return msg
enddef wmcallback(msg)returnunless msg.message== Scroll
param = Param.new
param.x= word2signed_short(loword(msg.lparam))
param.y= word2signed_short(hiword(msg.lparam))
param.scroll= word2signed_short(hiword(msg.wparam))return[param.x, param.y, param.scroll]enddef click?(button)returnfalseif$game_switches[JetMouse::TURN_MOUSE_OFF_SWITCH]returntrueif@keys.include?(button)returnfalseenddef press?(button)returnfalseif$game_switches[JetMouse::TURN_MOUSE_OFF_SWITCH]returntrueif@press.include?(button)returnfalseenddef set_pos(x_pos =0, y_pos =0)
width,height = client_size
if(x_pos.between?(0, width)&& y_pos.between?(0, height))
SetCursorPos.call(client_pos[0]+ x_pos,client_pos[1]+ y_pos)endenddef update
returnif$game_switches[JetMouse::TURN_MOUSE_OFF_SWITCH]@pos= Mouse.pos@keys,@press=[],[]@keys.push(1)if GetAsyncKeyState.call(1)&0x01==1@keys.push(2)if GetAsyncKeyState.call(2)&0x01==1@keys.push(3)if GetAsyncKeyState.call(4)&0x01==1@press.push(1)if pressed?(1)@press.push(2)if pressed?(2)@press.push(3)if pressed?(4)enddef pressed?(key)returntrueunless GetKeyState.call(key).between?(0,1)returnfalseenddef global_pos
pos =[0,0].pack('ll')
GetCursorPo.call(pos) !=0 ? (return pos.unpack('ll')):(return[0,0])enddef pos
return0,0if$game_switches[JetMouse::TURN_MOUSE_OFF_SWITCH]
x, y = screen_to_client(*global_pos)
width, height = client_size
begin
x =0if x <=0; y =0if y <=0
x = width if x >= width; y = height if y >= height
return x, y
endenddef screen_to_client(x, y)returnnilunless x && y
pos =[x, y].pack('ll')
ScreenToClient.call(@handle, pos) !=0 ?(return pos.unpack('ll')):(return[0,0])enddef client_size
rect =[0,0,0,0].pack('l4')
GetClientRect.call(@handle, rect)
right,bottom = rect.unpack('l4')[2..3]return right, bottom
enddef client_pos
rect=[0,0,0,0].pack('l4')
GetWindowRect.call(@handle, rect)
left, upper = rect.unpack('l4')[0..1]return left +4, upper +30enddef grid
return[-1,-1]if$game_switches[JetMouse::TURN_MOUSE_OFF_SWITCH]return[-1,-1]if@pos.nil?
return[(@pos[0]/32),(@pos[1]/32)]enddef true_grid
return[grid[0]+$game_map.display_x/ 256, grid[1] + $game_map.display_y /256]enddef area?(x, y, width, height)returnfalseif$game_switches[JetMouse::TURN_MOUSE_OFF_SWITCH]returnfalseif@pos.nil?
return@pos[0].between?(x, width + x)&&@pos[1].between?(y, height + y)enddef scroll
msg="\0"*32;Get_Message.call(msg,0,0,0);r=wmcallback(unpack_msg(msg))return r if !r.nil?
endendclass Sprite_Cursor < Sprite_Base
attr_accessor :current_cursor,:not_defaultinclude JetMouse
def initialize
super@current_cursor=""@not_default=false
Win32API.new('user32','ShowCursor','i','i').call(0)self.z=5004
create_cursor(CURSOR_PICTURE)$game_switches=[]
update
enddef create_cursor(cursor ="")self.bitmap.disposeunlessself.bitmap.nil?
self.bitmap=nilbeginself.bitmap= Cache.system(cursor)@current_cursor= cursor
rescueself.bitmap= Bitmap.new(24,24)
bitmap = Cache.system("Iconset")
rect = Rect.new(ICON_INDEX %16*24, ICON_INDEX /16*24,24,24)self.bitmap.blt(0,0, bitmap, rect)@current_cursor= ICON_INDEX
end@not_default=falseenddef change_cursor(cursor)self.bitmap.disposeunlessself.bitmap.nil?
self.bitmap=nilbeginself.bitmap= Cache.system(cursor)@current_cursor= cursor
@not_default=truerescuebeginself.bitmap= Bitmap.new(24,24)
bitmap = Cache.system("Iconset")
rect = Rect.new(cursor %16*24, cursor /16*24,24,24)self.bitmap.blt(0,0, bitmap, rect)@current_cursor= cursor
@not_default=truerescue
create_cursor(CURSOR_PICTURE)endendenddef update
if$game_switches[TURN_MOUSE_OFF_SWITCH]self.opacity=0unlessself.opacity==0endself.opacity=255unlessself.opacity==255super
x =self.x
y =self.yself.x,self.y= Mouse.posself.x-=8if@not_defaultself.y-=8if@not_defaultenddef dispose
superendend$cursor= Sprite_Cursor.newmodule Input
class<<selfalias jet5888_press? press? unless $@
def press?(arg)if arg ==Input::Creturntrueif Mouse.press?(1)elsif arg ==Input::Breturntrueif Mouse.press?(2)end
jet5888_press?(arg)endalias jet5888_repeat? repeat? unless $@
def repeat?(arg)if arg ==Input::Creturntrueif Mouse.click?(1)elsif arg ==Input::Breturntrueif Mouse.click?(2)end
jet5888_repeat?(arg)endalias jet5888_trigger? trigger? unless $@
def trigger?(arg)if arg ==Input::Creturntrueif Mouse.click?(1)elsif arg ==Input::Breturntrueif Mouse.click?(2)end
jet5888_trigger?(arg)endalias jet8432_update update unless $@
def update(*args,&block)
jet8432_update(*args,&block)if$game_switches[JetMouse::TURN_MOUSE_OFF_SWITCH]&&$cursor.opacity !=0$cursor.opacity=0end$cursor.updateunless$game_switches[JetMouse::TURN_MOUSE_OFF_SWITCH]
Mouse.updateunless$game_switches[JetMouse::TURN_MOUSE_OFF_SWITCH]endalias jet1626_dir4 dir4 unless $@
def dir4(*args,&block)if !$game_temp.nil?
if$game_temp.move_because_of_mouseif !$game_temp.mouse_path.empty? &&$game_player.movable? && !$game_map.interpreter.running? &&$scene.is_a?(Scene_Map)
f =$game_temp.mouse_path.reverse!.pop$game_temp.mouse_path.reverse!
return f.code*2else$game_temp.move_because_of_mouse=falseendendend
jet1626_dir4(*args,&block)endalias jet1626_dir8 dir8 unless $@
def dir8(*args,&block)if !$game_temp.nil?
if$game_temp.move_because_of_mouseif !$game_temp.mouse_path.empty? &&$game_player.movable? && !$game_map.interpreter.running? &&$scene.is_a?(Scene_Map)
f =$game_temp.mouse_path.reverse!.pop$game_temp.mouse_path.reverse!
if[1,2,3,4].include?(f.code)return f.code*2elsecase f.codewhen5return1when6return3when7return7when8return9endendelse$game_temp.move_because_of_mouse=falseendendend
jet1626_dir8(*args,&block)endendendclass Game_Character
def find_mouse_path(trgt_x, trgt_y)
path =$game_map.find_path(self.x,self.y, trgt_x, trgt_y,JetMouse::DO_8DIR_WALKING,0,self)return[]if path.empty? or trgt_x ==self.x&& trgt_y ==self.yreturn path.reverse!
endendclass Game_Map
def removefrom_binaryheap
@open_nodes[1]=@open_nodes[@listsize]@listsize-=1
v =1loopdo
u = v
w =2*u
if w +1<=@listsize
v = w if@total_cost[@open_nodes[u]]>=@total_cost[@open_nodes[w]]
v = w +1if@total_cost[@open_nodes[v]]>=@total_cost[@open_nodes[w +1]]elsif w <=@listsize
v = w if@total_cost[@open_nodes[u]]>=@total_cost[@open_nodes[w]]endif u == v
breakelse
temp =@open_nodes[u]@open_nodes[u]=@open_nodes[v]@open_nodes[v]= temp
endendenddef find_path (src_x, src_y, trgt_x, trgt_y, diagonal, max_iterations, char)$game_temp.making_path=true
path =[]return path if !char.passable? (trgt_x, trgt_y)
max_elements = width*height +2
openx = Table.new(max_elements)
openy = Table.new(max_elements)@open_nodes= Table.new(max_elements)@total_cost= Table.new(max_elements)
heuristic = Table.new(max_elements)
step_cost = Table.new(width, height)
parent_x = Table.new(width, height)
parent_y = Table.new(width, height)
actual_list = Table.new(width, height)
new_openid =1@open_nodes[1]=1
openx[1]= src_x
openy[1]= src_y
dist =[(trgt_x - src_x).abs,(trgt_y - src_y).abs]
heuristic[1]= diagonal ? (dist.max*14)+(dist.min*10) : (dist[0]+ dist[1])*10@total_cost[1]= heuristic[1]
actual_list[src_x, src_y]=1@listsize=1
count =0loopdobreakif actual_list[trgt_x, trgt_y] !=0
count +=1
Graphics.updateif count %500==0return path if count == max_iterations
return path if@listsize==0
node =@open_nodes[1]
parent_xval, parent_yval = openx[node], openy[node]
actual_list[parent_xval, parent_yval]=2
removefrom_binaryheap
for i in0...8breakif i >3&& !diagonal
x, y =case i
when0then[parent_xval, parent_yval -1]when1then[parent_xval, parent_yval +1]when2then[parent_xval -1, parent_yval]when3then[parent_xval +1, parent_yval]when4then[parent_xval -1, parent_yval -1]when5then[parent_xval +1, parent_yval -1]when6then[parent_xval -1, parent_yval +1]when7then[parent_xval +1, parent_yval +1]endnextif actual_list[x,y]==2nextunless char.passable? (x, y)if i >3nextunlesscase i
when4then char.passable? (x +1, y)|| char.passable? (x, y +1)when5then char.passable? (x -1, y)|| char.passable? (x, y +1)when6then char.passable? (x +1, y)|| char.passable? (x, y -1)when7then char.passable? (x -1, y)|| char.passable? (x, y -1)endend
plus_step_cost =((x - parent_xval).abs+(y - parent_yval).abs)>1 ? 14 : 10
temp_step_cost = step_cost[parent_xval, parent_yval]+ plus_step_cost
if actual_list[x,y]==1if temp_step_cost < step_cost[x, y]
parent_x[x, y]= parent_xval
parent_y[x, y]= parent_yval
step_cost[x, y]= temp_step_cost
index =1while index <@listsize
index +=1breakif openx[@open_nodes[index]]== x &&
openy[@open_nodes[index]]== y
end@total_cost[@open_nodes[index]]= temp_step_cost + heuristic[@open_nodes[index]]elsenextendelse
new_openid +=1@listsize+=1@open_nodes[@listsize]= new_openid
step_cost[x, y]= temp_step_cost
d =[(trgt_x - x).abs,(trgt_y - y).abs]
heuristic[new_openid]= diagonal ? (d.max*14)+(d.min*10) : (d[0]+ d[1])*10@total_cost[new_openid]= temp_step_cost + heuristic[new_openid]
parent_x[x, y]= parent_xval
parent_y[x, y]= parent_yval
openx[new_openid]= x
openy[new_openid]= y
index =@listsize
actual_list[x, y]=1endwhile index !=1
temp_node =@open_nodes[index]if@total_cost[temp_node]<=@total_cost[@open_nodes[index /2]]@open_nodes[index]=@open_nodes[index /2]
index /=2@open_nodes[index]= temp_node
elsebreakendendendend
path_x, path_y = trgt_x, trgt_y
while path_x != src_x || path_y != src_y
prnt_x, prnt_y = parent_x[path_x, path_y], parent_y[path_x, path_y]if path_x < prnt_x
code = path_y < prnt_y ? 7 : path_y > prnt_y ? 5 : 2elsif path_x > prnt_x
code = path_y < prnt_y ? 8 : path_y > prnt_y ? 6 : 3else
code = path_y < prnt_y ? 4 : 1end
path.push(RPG::MoveCommand.new(code))
path_x, path_y = prnt_x, prnt_y
end$game_temp.making_path=falsereturn path
endendclass Game_Temp
attr_accessor :move_because_of_mouse
attr_accessor :mouse_controlled_object
attr_accessor :making_path
attr_accessor :mouse_path
attr_accessor :did_mouse_changealias jet6742_initialize initialize unless $@
def initialize(*args,&block)
jet6742_initialize(*args,&block)@move_because_of_mouse=false@making_path=false@mouse_path=[]endendclass Window_Selectable
alias jet6742_update update unless $@
def update(*args,&block)
jet6742_update(*args,&block)
form_rect_array if@rect_array.nil?
update_mouse ifself.active&&self.visible&& !@rect_array.nil?
endalias jet7222_top_row top_row=unless $@
def top_row=(*args,&block)@last_cursor_move=0if@last_cursor_move.nil?
@last_cursor_move-=1returnif@in_rect_loop||@last_cursor_move>0
jet7222_top_row(*args,&block)@last_cursor_move=10enddef form_rect_array
@rect_array=[]
orig_index =@index@in_rect_loop=true(0..@item_max -1).eachdo|i|@index= i
update_cursor
rect =self.cursor_rect
ix =self.x+16+ rect.x
iy =self.y+16+ rect.y@rect_array.push(Rect.new(ix, iy, rect.width, rect.height))end@in_rect_loop=false@index= orig_index
update
enddef update_mouse
ifJetMouse::USE_WHEEL_DETECTION
f = Mouse.scrollif !f.nil?
if f[2]<0if contents.height>self.height&&self.oy- contents.height<-self.height+32self.top_row=self.top_row+1endelseself.top_row=self.top_row-1if contents.height>self.heightendendend
original_index =@index
fake_index =-2for rect in@rect_arrayif Mouse.area?(rect.x-self.ox, rect.y-self.oy, rect.width, rect.height)
fake_index =@rect_array.index(rect)breakendend@index= fake_index ==-2 ? original_index : fake_index
update_cursor
endendclass Window_NameInput
alias wor_winnam_upd_mouse update unless $@
def update(*args,&block)
wor_winnam_upd_mouse(*args,&block)ifself.activeandself.visible(0..TABLE[@mode].size-1).eachdo|i|
irect = item_rect(i)
irx =self.x+16+ irect.x-self.ox
iry =self.y+16+ irect.y-self.oy@index= i if Mouse.area?(irx, iry, irect.width, irect.height)endendendendclass Window_PartyCommand
def update_mouse
(0..@item_max -1).eachdo|i|
irect = item_rect(i)
irx =self.viewport.ox+16+ irect.x-self.ox
iry =288+16+ irect.y-self.oyself.index= i if Mouse.area?(irx, iry, irect.width, irect.height)endendendclass Window_ActorCommand
def update_mouse
(0..@item_max -1).eachdo|i|
irect = item_rect(i)
irx =self.viewport.ox+288+16+ irect.x
iry =288+16+ irect.yself.index= i if Mouse.area?(irx, iry, irect.width, irect.height)endendendclass Window_Message
def update_mouse
(0..@item_max -1).eachdo|i|
irect = item_rect(i)
irx =self.x+16+ irect.x-self.ox
iry =self.y+16+ irect.y-self.oy+($game_message.choice_start* WLH)self.index= i if Mouse.area?(irx, iry, irect.width, irect.height)endendendclass Window_ShopSell
def refresh
super
form_rect_array
endendclass Scene_File
alias wor_scefil_upd_mouse update unless $@
def update(*args,&block)(0..@item_max -1).eachdo|i|
ix =@savefile_windows[i].x
iy =@savefile_windows[i].y
iw =@savefile_windows[i].width
ih =@savefile_windows[i].heightif Mouse.area?(ix, iy, iw, ih)@savefile_windows[@index].selected=false@savefile_windows[i].selected=true@index= i
endend
wor_scefil_upd_mouse(*args,&block)endendclass Window_EventPopUp < Window_Base
def initialize(x, y, width, height, text)super(x, y, width, height)self.opacity=0@text= text
refresh
enddef refresh
self.contents.clearself.contents.draw_text(0,0,self.width,24,@text)endendclass Game_Event
attr_accessor :popup_window,:pagedef check_for_comment(regexp)returnfalseif@list.nil?
for item in@listif item.code==108or item.code==408if !item.parameters[0][regexp].nil?
return $1.nil? ? true : $1
endendendreturnfalseenddef through
returntrueif check_for_comment(/MOUSE THROUGH/i)&&$game_temp.making_pathreturn@throughendalias jet2734_update update unless $@
def update(*args,&block)
jet2734_update(*args,&block)
update_mouse_popup
update_mouse_change
enddef update_mouse_popup
switch =$game_switches[JetMouse::TURN_MOUSE_OFF_SWITCH]if Mouse.true_grid==[self.x,self.y]&& !switch && !@erased
f =self.check_for_comment(/MOUSE TEXT (.+)/i)if f !=false
q = Bitmap.new(1,1)
size = q.text_size(f)
x =self.screen_x-16- size.width/2
y =self.screen_y-52- size.height/2ifself.popup_window !=nilself.popup_window.disposeself.popup_window=nilendself.popup_window= Window_EventPopUp.new(x, y,
size.width+34, size.height+34, f)
q.dispose
q =nilendelseifself.popup_window !=nilself.popup_window.disposeself.popup_window=nilendendenddef update_mouse_change
if Mouse.true_grid==[self.x,self.y]
f =(self.check_for_comment(/MOUSE PIC (.+)/i)rescuefalse)if f !=falseif f.to_i !=0$cursor.change_cursor(f.to_i)unless$cursor.current_cursor== f.to_ielse$cursor.change_cursor(f)unless$cursor.current_cursor== f
end$game_temp.did_mouse_change=trueendendendendclass Scene_Map
alias jet6742_update update unless $@
def update(*args,&block)if !$game_message.visible
update_mouse_left_click
end
jet6742_update(*args,&block)
check_mouse_change
endalias jet7811_terminate terminate unless $@
def terminate(*args,&block)for event in$game_map.events.valuesnextif event.popup_window.nil?
event.popup_window.disposeunless event.popup_window.disposed?
event.popup_window=nilend$cursor.create_cursor(JetMouse::CURSOR_PICTURE)if ![JetMouse::CURSOR_PICTURE,JetMouse::ICON_INDEX].include?($cursor.current_cursor)$cursor.opacity=0
jet7811_terminate(*args,&block)$cursor.opacity=255unless$game_switches[JetMouse::TURN_MOUSE_OFF_SWITCH]endalias jet8887_update_transfer_player update_transfer_player unless $@
def update_transfer_player(*args,&block)if$game_player.transfer?
$cursor.create_cursor(JetMouse::CURSOR_PICTURE)if ![JetMouse::CURSOR_PICTURE,JetMouse::ICON_INDEX].include?($cursor.current_cursor)end
jet8887_update_transfer_player(*args,&block)enddef check_mouse_change
returnif$game_switches[JetMouse::TURN_MOUSE_OFF_SWITCH]if$game_message.visible||$game_player.transfer?
$cursor.create_cursor(JetMouse::CURSOR_PICTURE)if ![JetMouse::CURSOR_PICTURE,JetMouse::ICON_INDEX].include?($cursor.current_cursor)returnend$cursor.create_cursor(JetMouse::CURSOR_PICTURE)if$game_temp.did_mouse_change.nil? && ![JetMouse::CURSOR_PICTURE,JetMouse::ICON_INDEX].include?($cursor.current_cursor)$game_temp.did_mouse_change=nilenddef do_closest_path_check(ev)
se =$game_player
sx = se.x- ev.x
sy = se.y- ev.yif sx !=0or sy !=0if sx.abs>= sy.absif sx >=0if$game_map.passable?(ev.x+1, ev.y)return[ev.x+1, ev.y]unless$game_map.find_path(se.x, se.y,
ev.x+1, ev.y,false,0, se).empty?
endif sy >=0if$game_map.passable?(ev.x, ev.y+1)return[ev.x, ev.y+1]unless$game_map.find_path(se.x, se.y,
ev.x, ev.y+1,false,0, se).empty?
endelseif$game_map.passable?(ev.x, ev.y-1)return[ev.x, ev.y-1]unless$game_map.find_path(se.x, se.y,
ev.x, ev.y-1,false,0, se).empty?
endendif$game_map.passable?(ev.x-1, ev.y)return[ev.x-1, ev.y]unless$game_map.find_path(se.x, se.y,
ev.x-1, ev.y,false,0, se).empty?
endif sy <0if$game_map.passable?(ev.x, ev.y+1)return[ev.x, ev.y+1]unless$game_map.find_path(se.x, se.y,
ev.x, ev.y+1,false,0, se).empty?
endelseif$game_map.passable?(ev.x, ev.y-1)return[ev.x, ev.y-1]unless$game_map.find_path(se.x, se.y,
ev.x, ev.y-1,false,0, se).empty?
endendelsif sx <0if$game_map.passable?(ev.x-1, ev.y)return[ev.x-1, ev.y]unless$game_map.find_path(se.x, se.y,
ev.x-1, ev.y,false,0, se).empty?
endif sy >=0if$game_map.passable?(ev.x, ev.y+1)return[ev.x, ev.y+1]unless$game_map.find_path(se.x, se.y,
ev.x, ev.y+1,false,0, se).empty?
endelseif$game_map.passable?(ev.x, ev.y-1)return[ev.x, ev.y-1]unless$game_map.find_path(se.x, se.y,
ev.x, ev.y-1,false,0, se).empty?
endendif$game_map.passable?(ev.x+1, ev.y)return[ev.x+1, ev.y]unless$game_map.find_path(se.x, se.y,
ev.x+1, ev.y,false,0, se).empty?
endif sy <0if$game_map.passable?(ev.x, ev.y+1)return[ev.x, ev.y+1]unless$game_map.find_path(se.x, se.y,
ev.x, ev.y+1,false,0, se).empty?
endelseif$game_map.passable?(ev.x, ev.y-1)return[ev.x, ev.y-1]unless$game_map.find_path(se.x, se.y,
ev.x, ev.y-1,false,0, se).empty?
endendendelseif sy >0if$game_map.passable?(ev.x, ev.y+1)return[ev.x, ev.y+1]unless$game_map.find_path(se.x, se.y,
ev.x, ev.y+1,false,0, se).empty?
endif sx >=0if$game_map.passable?(ev.x+1, ev.y)return[ev.x+1, ev.y]unless$game_map.find_path(se.x, se.y,
ev.x+1, ev.y,false,0, se).empty?
endelseif$game_map.passable?(ev.x-1, ev.y)return[ev.x-1, ev.y]unless$game_map.find_path(se.x, se.y,
ev.x-1, ev.y,false,0, se).empty?
endendif$game_map.passable?(ev.x, ev.y-1)return[ev.x, ev.y-1]unless$game_map.find_path(se.x, se.y,
ev.x, ev.y-1,false,0, se).empty?
endif sx <0if$game_map.passable?(ev.x+1, ev.y)return[ev.x+1, ev.y]unless$game_map.find_path(se.x, se.y,
ev.x+1, ev.y,false,0, se).empty?
endelseif$game_map.passable?(ev.x-1, ev.y)return[ev.x-1, ev.y]unless$game_map.find_path(se.x, se.y,
ev.x-1, ev.y,false,0, se).empty?
endendelsif sy <0if$game_map.passable?(ev.x, ev.y-1)return[ev.x, ev.y-1]unless$game_map.find_path(se.x, se.y,
ev.x, ev.y-1,false,0, se).empty?
endif sx >=0if$game_map.passable?(ev.x+1, ev.y)return[ev.x+1, ev.y]unless$game_map.find_path(se.x, se.y,
ev.x+1, ev.y,false,0, se).empty?
endelseif$game_map.passable?(ev.x-1, ev.y)return[ev.x-1, ev.y]unless$game_map.find_path(se.x, se.y,
ev.x-1, ev.y,false,0, se).empty?
endendif$game_map.passable?(ev.x, ev.y+1)return[ev.x, ev.y+1]unless$game_map.find_path(se.x, se.y,
ev.x, ev.y+1,false,0, se).empty?
endif sx <0if$game_map.passable?(ev.x+1, ev.y)return[ev.x+1, ev.y]unless$game_map.find_path(se.x, se.y,
ev.x+1, ev.y,false,0, se).empty?
endelseif$game_map.passable?(ev.x-1, ev.y)return[ev.x-1, ev.y]unless$game_map.find_path(se.x, se.y,
ev.x-1, ev.y,false,0, se).empty?
endendendendendreturnfalseenddef update_mouse_left_click
returnif$game_map.interpreter.running? ||$game_player.transfer?
if Mouse.click?(1)
event_activated =falsefor event in$game_map.events_xy(*Mouse.true_grid)if event.check_for_comment(/MOUSE CLICK/i)
event.start
event_activated =trueelsif(event.x-$game_player.x).abs+(event.y-$game_player.y).abs==1if ![3,4].include?(event.trigger)&&(![0,2].include?(event.priority_type)|| event.trigger==0)&& ![0,1].include?(event.page.list.size)if(event.y-$game_player.y).abs>(event.x-$game_player.x).absif event.y-$game_player.y>0$game_player.turn_downelse$game_player.turn_upendelseif event.x-$game_player.x>0$game_player.turn_rightelse$game_player.turn_leftendend
event.start
event_activated =truebreakendendif !event_activated
for i in["UP","DOWN","RIGHT","LEFT"]if event.check_for_comment(/MOUSE MOVE #{i}/i)
event_activated =truecase i
when"UP"
x, y = event.x, event.y-1when"DOWN"
x, y = event.x, event.y+1when"LEFT"
x, y = event.x-1, event.ywhen"RIGHT"
x, y = event.x+1, event.yendbreakendendendif !event_activated
if$game_player.passable?(*Mouse.true_grid)
x, y =*Mouse.true_grid
event_activated =truebreakendendif !event_activated
q = do_closest_path_check(event)if q !=false
x, y = q[0], q[1]
event_activated =truebreakendendendif !event_activated
if$game_player.map_passable?(*Mouse.true_grid)
x, y =*Mouse.true_gridendendif !x.nil?
$game_temp.move_because_of_mouse=true
g =$game_player.find_mouse_path(x, y)$game_temp.mouse_path= g
endendendend
cari974 - posté le 09/08/2013 à 07:02:11. (38 messages postés)
Bien sûr, ce script n'aurait aucun intérêt si je ne vous montré pas un exemple concré de sont utilisation ...
On peut utiliser ce script pour prendre des héros qui ont plus de 4 frames. Mais moi, je m'en sert pour faire des gros pnj ^^
Exemple :
Utiliser ce Sprite pour votre héros, et nommé le par exemple !$%[4]Hero_AXE_01.png-par-Eichimaru
cari974 - posté le 09/08/2013 à 06:49:25. (38 messages postés)
Pour ceux qui souhaite simplement pouvoir se déplacer à la souris, et sans lag, vous pouvez utiliser script Déplacement à la sourirs V1.0 de Berka, aussi.
Il s'agit la aussi d'un simple copier coller du script qui a été classer dans RPG Maker XP, je ne sais pas pourquoi ...
Article original : http://www.rpg-maker.fr/scripts-149-mouvement-par-la-souris.html
Ce script permet de diriger le hero a l'aide de la souris
sur les bases de SephirothSpawn
# clic gauche: definir le point d'arrivée
# clic droit: suivre/ne pas suivre le héros
# touche directionnelles: deplacer la map
a placer au dessus de main, dans l'ordre:
Module Keyboard/Mouse
#===========================================# Mouvement par souris# par berka#===========================================## clic gauche: definir le point d'arrivée# clic droit: suivre/ne pas suivre le héros# touche directionnelles: deplacer la map#===========================================
Vitesse =8#vitesse du scroll de la mapclass Scene_Map
alias scroll_update update
def update
Keyboard.update
Mouse.updateif Keyboard.trigger?(Keyboard::Mouse_Left)$game_player.find_path(Mouse.grid[0], Mouse.grid[1])end
scroll_update
endendclass Game_Player < Game_Character
alias scroll_init initialize
def initialize
scroll_init
@scroll=falseenddef update
last_real_x =@real_x
last_real_y =@real_y
last_moving = moving?
move_by_input
superif Keyboard.trigger?(Keyboard::Mouse_Right)if@scroll==false$game_player.center($game_player.x,$game_player.y)@scroll=trueelse@scroll=falseendend@scroll=falseif Input.dir4 !=0$game_player.update_scroll(last_real_x, last_real_y)if@scroll==true
update_vehicle
update_nonmoving(last_moving)enddef move_by_input
returnunless movable?
returnif$game_map.interpreter.running?
case Input.dir4when2;$game_map.start_scroll(2,1, Vitesse)when4;$game_map.start_scroll(4,1, Vitesse)when6;$game_map.start_scroll(6,1, Vitesse)when8;$game_map.start_scroll(8,1, Vitesse)endendend
Et sinon, pour un maximums d'options, voici le script "Mouse Système", qui permet d'avoir une gestion totale de la souris, avec moins de lag que le script "Déplacement à la souris V2.0" :
http://www.rpg-maker.fr/scripts-417-mouse-systeme.html
cari974 - posté le 09/08/2013 à 06:38:56. (38 messages postés)
Ho, excusez moi, petite erreur avec le script... C'est pas le bon x)
Le script étant trop grand, je l'ai mit sur ce site : http://pastebin.com/VLyeih24
#==============================================================================# ** Ring Menu#-------------------------------------------------------------------------------# by Syvkal# Version 1.0# 06-23-08#==============================================================================#===================================================## ** C O N F I G U R A T I O N S Y S T E M ** ##===================================================## Amount of frames for Startup Animation
STARTUP_FRAMES =20# Amount of frames for Movement Animation
MOVING_FRAMES =15# Radius of the Menu Ring
RING_R =75# Disabled icon to display when disabled
ICON_DISABLE= Cache::picture('Icon_Disable')#===================================================## ** E N D C O N F I G U R A T I O N ** ##===================================================##==============================================================================# ** Scene_Menu#------------------------------------------------------------------------------# Edited to add Ring Menu#==============================================================================class Scene_Menu < Scene_Base
#--------------------------------------------------------------------------# * Alias Listings#--------------------------------------------------------------------------alias initialize_original initialize
alias start_selection_original start_actor_selection
alias end_selection_original end_actor_selection
#--------------------------------------------------------------------------# * Object Initialization#--------------------------------------------------------------------------def initialize(menu_index =0, move =true)@move= move
initialize_original(menu_index)end#--------------------------------------------------------------------------# * Start processing#--------------------------------------------------------------------------def start
super
create_menu_background
create_command_window
@gold_window= Window_Gold.new(0,360)@location_window= Window_location.new(0,0)end#--------------------------------------------------------------------------# * Termination Processing#--------------------------------------------------------------------------def terminate
super
dispose_menu_background
@command_window.dispose@gold_window.dispose@status_window.disposeif@status_window@location_window.disposeend#--------------------------------------------------------------------------# * Frame Update#--------------------------------------------------------------------------def update
super
update_menu_background
@command_window.update@gold_window.update@status_window.updateif@status_window@location_window.updateif@command_window.active
update_command_selection
elsif@status_window.active
update_actor_selection
endend#--------------------------------------------------------------------------# * Create Command Window#--------------------------------------------------------------------------def create_command_window
s1 = Vocab::item ; s2 = Vocab::skill
s3 = Vocab::equip ; s4 = Vocab::status
s5 ="Save Game"; s6 ="Load Game"
s7 = Vocab::game_end
c1 = Cache::picture('Icon_Items'); c2 = Cache::picture('Icon_Skills')
c3 = Cache::picture('Icon_Equip'); c4 = Cache::picture('Icon_Status')
c5 = Cache::picture('Icon_Save'); c6 = Cache::picture('Icon_Load')
c7 = Cache::picture('Icon_End')@command_window= Window_RingMenu.new(232,164,[s1, s2, s3, s4, s5, s6, s7],[c1, c2, c3, c4, c5, c6, c7],@move,@menu_index)if$game_party.members.size==0@command_window.disable_item(0)@command_window.disable_item(1)@command_window.disable_item(2)@command_window.disable_item(3)endif$game_system.save_disabled@command_window.disable_item(4)endend#--------------------------------------------------------------------------# * Create Command Window#--------------------------------------------------------------------------def create_status_window
names =[]
chars =[]for i in0...$game_party.members.size
names[i]=$game_party.members[i].name
chars[i]=$game_party.members[i]end@status_window= Window_RingMenu.new(255,200, names, chars,true,$game_party.last_actor_index,true)end#--------------------------------------------------------------------------# * Update Command Selection#--------------------------------------------------------------------------def update_command_selection
if Input.trigger?(Input::B)
Sound.play_cancel$scene= Scene_Map.newelsif Input.trigger?(Input::C)if$game_party.members.size==0and@command_window.index<4
Sound.play_buzzerreturnelsif$game_system.save_disabledand@command_window.index==4
Sound.play_buzzerreturnend
Sound.play_decisioncase@command_window.indexwhen0# Item$scene= Scene_Item.newwhen1,2,3# Skill, equipment, status
start_actor_selection
when4# Save$scene= Scene_File.new(true,false,false)when5# Load$scene= Scene_File.new(false,false,false)when6# End Game$scene= Scene_End.newendendend#--------------------------------------------------------------------------# * Start Actor Selection#--------------------------------------------------------------------------def start_actor_selection
@command_window.active=false@command_window.visible=false
create_status_window
if$game_party.last_actor_index<@status_window.item_max@status_window.index=$game_party.last_actor_indexelse@status_window.index=0endend#--------------------------------------------------------------------------# * End Actor Selection#--------------------------------------------------------------------------def end_actor_selection
@command_window.active=true@command_window.visible=true@status_window.disposeif@status_window@status_window=nilendend#==============================================================================# ** Scene_File#------------------------------------------------------------------------------# Edited to return to the menu properly when loading#==============================================================================class Scene_File
alias return_scene_original return_scene
def return_scene
if@from_title$scene= Scene_Title.newelsif@from_event$scene= Scene_Map.newelseif@saving$scene= Scene_Menu.new(4)else$scene= Scene_Menu.new(5)endendendend#==============================================================================# ** Scene_End#------------------------------------------------------------------------------# Edited to return to the menu properly due to loading being added#==============================================================================class Scene_End
alias return_scene_original return_scene
def return_scene
$scene= Scene_Menu.new(6)endend#==============================================================================# ** Window_Location#------------------------------------------------------------------------------# This class shows the current map name.#==============================================================================class Window_location < Window_Base
#--------------------------------------------------------------------------# * Object Initialization#--------------------------------------------------------------------------def initialize(x, y)super(x, y,160,(WLH*2)+32)self.contents= Bitmap.new(width -32, height -32)
refresh
end#--------------------------------------------------------------------------# * Refresh#--------------------------------------------------------------------------def refresh
self.contents.clear$maps= load_data("Data/MapInfos.rvdata")@map_id=$game_map.map_id@currmap=$maps[@map_id].nameself.contents.font.color= system_color
self.contents.draw_text(0,-4,128,32,"Location :")self.contents.font.color= normal_color
self.contents.draw_text(0,-4+WLH,128,32,@currmap,1)endend#==============================================================================# ** Window_RingMenu#------------------------------------------------------------------------------# This Window creates a Ring Menu system#==============================================================================class Window_RingMenu < Window_Base
#--------------------------------------------------------------------------# * Public Instance Variables#--------------------------------------------------------------------------
attr_accessor :index
attr_reader :item_max#--------------------------------------------------------------------------# * Refresh Setup#--------------------------------------------------------------------------
START =1
WAIT =2
MOVER =3
MOVEL =4#--------------------------------------------------------------------------# * Object Initialization#--------------------------------------------------------------------------def initialize(center_x, center_y, commands, items, move =true, index =0, character =false)super(0,0,544,416)self.contents= Bitmap.new(width-32, height-32)self.opacity=0@move= move
@char= character
@startup= STARTUP_FRAMES
@commands= commands
@item_max= commands.size@index= index
@items= items
@disabled=[]for i in0...commands.size-1@disabled[i]=falseend@cx= center_x
@cy= center_y
start_setup
refresh
end#--------------------------------------------------------------------------# * Start Setup#--------------------------------------------------------------------------def start_setup
@mode= START
@steps=@startupend#--------------------------------------------------------------------------# * Disable index# index : item number#--------------------------------------------------------------------------def disable_item(index)@disabled[index]=trueend#--------------------------------------------------------------------------# * Determines if is moving#--------------------------------------------------------------------------def animation?
return@mode != WAIT
end#--------------------------------------------------------------------------# * Determine if cursor is moveable#--------------------------------------------------------------------------def cursor_movable?
returnfalseif(not visible ornot active)returnfalseif(@opening or@closing)returnfalseif animation?
returntrueend#--------------------------------------------------------------------------# * Move cursor right#--------------------------------------------------------------------------def cursor_right
@index-=1@index=@items.size-1if@index<0@mode= MOVER
@steps= MOVING_FRAMES
end#--------------------------------------------------------------------------# * Move cursor left#--------------------------------------------------------------------------def cursor_left
@index+=1@index=0if@index>=@items.size@mode= MOVEL
@steps= MOVING_FRAMES
end#--------------------------------------------------------------------------# * Frame Update#--------------------------------------------------------------------------def update
superifself.activeif cursor_movable?
last_index =@indexif Input.repeat?(Input::DOWN)or Input.repeat?(Input::RIGHT)
cursor_right
endif Input.repeat?(Input::UP)or Input.repeat?(Input::LEFT)
cursor_left
endif@index != last_index
Sound.play_cursorendend
refresh
endend#--------------------------------------------------------------------------# * Refresh#--------------------------------------------------------------------------def refresh
self.contents.clearcase@modewhen START
refresh_start
when WAIT
refresh_wait
when MOVER
refresh_move(1)when MOVEL
refresh_move(0)end
rect = Rect.new(18,196,self.contents.width-32,32)self.contents.draw_text(rect,@commands[@index],1)end#--------------------------------------------------------------------------# * Refresh Start Period#--------------------------------------------------------------------------def refresh_start
d1 =2.0*Math::PI /@item_max
d2 =1.0*Math::PI /@startupfor i in0...@item_max
j = i -@indexif@move
r = RING_R -1.0* RING_R *@steps/@startup
d = d1 * j + d2 *@stepselse
r = RING_R
d = d1 * j
end
x =@cx+( r *Math.sin( d )).to_i
y =@cy-( r *Math.cos( d )).to_i
draw_item(x, y, i)end@steps-=1if@steps<1@mode= WAIT
endend#--------------------------------------------------------------------------# * Refresh Wait Period#--------------------------------------------------------------------------def refresh_wait
d =2.0*Math::PI /@item_maxfor i in0...@item_max
j = i -@index
x =@cx+( RING_R *Math.sin( d * j )).to_i
y =@cy-( RING_R *Math.cos( d * j )).to_i
draw_item(x, y, i)endend#--------------------------------------------------------------------------# * Refresh Movement Period#--------------------------------------------------------------------------def refresh_move( mode )
d1 =2.0*Math::PI /@item_max
d2 = d1 / MOVING_FRAMES
d2 *=-1if mode !=0for i in0...@item_max
j = i -@index
d = d1 * j + d2 *@steps
x =@cx+( RING_R *Math.sin( d )).to_i
y =@cy-( RING_R *Math.cos( d )).to_i
draw_item(x, y, i)end@steps-=1if@steps<1@mode= WAIT
endend#--------------------------------------------------------------------------# * Draw Item# x : draw spot x-coordinate# y : draw spot y-coordinate# index : item number#--------------------------------------------------------------------------def draw_item(x, y, index)if@charif@index== index
draw_character(@items[index].character_name,@items[index].character_index, x, y)if@mode== WAIT
draw_actor_hp_ring(@items[index],@cx,@cy-16,50,6,84,270,true)
draw_actor_mp_ring(@items[index],@cx,@cy-16,50,6,84,180,false)
draw_actor_exp_ring(@items[index],@cx,@cy-16,50,6,155,12,false)endelse
draw_character(@items[index].character_name,@items[index].character_index, x, y,false)endelse
rect = Rect.new(0,0,@items[index].width,@items[index].height)if@index== index
self.contents.blt( x, y,@items[index], rect )if@disabled[@index]self.contents.blt( x, y, ICON_DISABLE, rect )endelseself.contents.blt( x, y,@items[index], rect,128)endendendend#==============================================================================# ** Window_Base#------------------------------------------------------------------------------# Edited to allow disabled character icons#==============================================================================class Window_Base < Window
#--------------------------------------------------------------------------# * Draw Character Graphic#--------------------------------------------------------------------------def draw_character(character_name, character_index, x, y, enabled =true)returnif character_name ==nil
bitmap = Cache.character(character_name)
sign = character_name[/^[\!\$]./]if sign !=niland sign.include?('$')
cw = bitmap.width/3
ch = bitmap.height/4else
cw = bitmap.width/12
ch = bitmap.height/8end
n = character_index
src_rect = Rect.new((n%4*3+1)*cw,(n/4*4)*ch, cw, ch)self.contents.blt(x - cw /2, y - ch, bitmap, src_rect, enabled ? 255 : 128)endend
Screen :
Et n'oubliez pas de télécharger les images nécessaires !
Les images proposées dans le sujet sont bonnes. Mais ces images aussi. Choisissez celles que vous préférez :
Images :
cari974 - posté le 08/08/2013 à 09:48:06. (38 messages postés)
Excusez-moi pour ma réponse tardive mais mon PC était en panne.
Alors, voici quelque explication sur ce script.
Pour l’installer, il faut d'abord copier/coller le script puis, créer un nouvel état avec comme note <counterattack>.
Si tu ne veux pas que le héros contre-attaque à chaque tour, tu as qu'à dire à l'état de duré qu'un seul tour par exemple. Ou alors, tu peux aussi ne pas mettre l'état contre-attaque dans chacune de tes compétences. Le héros ne contre-attaquera donc pas systématiquement. Désolé pour ces explications brouillonnes mais c'est galère à expliquer. Comme tu as déjà testé le script, je pense que tu m'as compris x)
Et pour l'histoire de la contre-attaque qui renvoie les dégâts, désoler mais le script tel qu'il a été scripté ne le permet pas. en effet, lors d'une contre-attaque, le héros, ou le monstre qui contre-attaque ne renvoi par les dégâts subis, il inflige les dégâts de sa propre attaque de base. En gros, le script ignore les dégâts qui ont provoqué la contre-attaque, il permet juste de faire une attaque supplément si et seulement si la personne attaquée et sous l’effet contre-attaque, et si et seulement si l'attaque qui vient d'être porté n'est pas une contre-attaque. Il faut se servir de ce script mais faire un tout nouveau script en plus pour faire "l'effet miroir" de Pokémon.
# SHOW THE MAP NAME - REVOLUTION MODE -#------------------------------------------------------------------------------# Author Ramiro (Holy_wyvern, ramiazul)#------------------------------------------------------------------------------# Version 1.0#------------------------------------------------------------------------------# Description:# Allows you to show the name of some maps, whit a nice graphical style#------------------------------------------------------------------------------# Compatibility:# RPG maker VX script.# Shoud work with anyting (99.999 % sure)#------------------------------------------------------------------------------# Instructions:# Insert on materials section## To show the hero's name on a map or a variable# \N[id of actor on database] (1 - 999)# \P[id of variable] (1 - 999)# \PN[id of actor on party position] (0 - 3)# (Yes it's like the massage window...)#------------------------------------------------------------------------------# BUGS:# Not now... Report if you found one#------------------------------------------------------------------------------# Author's notes:# FOR non-Comertial games only. Giving credit it's not necesarry but it's nice :P#===============================================================================#===============================================================================# Configurations#===============================================================================module MAPWINDOW
VIEWING_TIME =110# viewing time of letter
LETTER_ANIM =150# starting animating time
LETTER_END =20# time for hiding the name
INIT_X =10# start X of first letter
INIT_Y =10# start Y of first letter
START_ANGLE =-180# start angle of firs letter
RECT_COLOR = Color.new(255,255,255)# The line's color
RECT_X =0# the X correction of the rect
RECT_Y =-14# the Y correction
FIRST_LETTER = Color.new(255,255,255)# the first letter�s color
LETTER_COLOR = Color.new(255,255,255,200)# other letter�s colors
OPACITY =255# the letter�s opacity
RECT_OPACITY =255# opacity of the rect
FONT_SIZE =25# the size of the font
EX_START_X =0# X start movement
RECT_HEIGHT =1# the height of the rect
NOT_SHOW_MAPS=[1,286,30,31,32,130,304,305,246]# put map id of maps than don't show# it's name eg. [1,2,3]end#===============================================================================# GAME MAP SETUP #===============================================================================class Game_Map
def name
map_infos = load_data("Data/MapInfos.rvdata")
name = map_infos[@map_id].name.clone
name.gsub!(/\\N\[([0-9]+)\]/i){$game_actors[$1.to_i].name}
name.gsub!(/\\PN\[([0-9]+)\]/i){$game_party.members[$1.to_i].name}
name.gsub!(/\\V\[([0-9]+)\]/i){$game_variables[$1.to_i]}return name
endend#===============================================================================# The spritest of letters #===============================================================================class Spriteset_MapName
include MAPWINDOW
def initialize
@letters=[]@index=0@finish_count=@dispose_count=0enddef set_sprites
if !NOT_SHOW_MAPS.include?($game_map.map_id)
dispose_sprites
@letters=[]
name =$game_map.name.scan(/./).clone@l_count=(LETTER_ANIM / name.size)+1@index=0@finish=false@finish_count= VIEWING_TIME
@dispose_count= LETTER_END
for i in0...name.size@letters[i]= Sprite.new@letters[i].bitmap= Bitmap.new(FONT_SIZE,FONT_SIZE)@letters[i].ox=10@letters[i].oy=10@letters[i].bitmap.font.size= FONT_SIZE
@letters[i].bitmap.font.color= i ==0 ? FIRST_LETTER : LETTER_COLOR
@letters[i].bitmap.draw_text(0,0,FONT_SIZE,FONT_SIZE,name[i],1)@letters[i].x= i *(FONT_SIZE /2)+ EX_START_X + INIT_X
@letters[i].y= INIT_Y
@letters[i].z=9999@letters[i].opacity=0@letters[i].angle= START_ANGLE
end@b_count=@letters.size*((LETTER_ANIM /@letters.size)+1)@border= Sprite.new@border.bitmap= Bitmap.new(@letters.size*(FONT_SIZE / 2) + (FONT_SIZE /2), RECT_HEIGHT)@border.bitmap.fill_rect(Rect.new(0,0,@letters.size*(FONT_SIZE / 2) + (FONT_SIZE /2), RECT_HEIGHT),RECT_COLOR)@border.x=-@border.width+ INIT_X -(FONT_SIZE /2)- RECT_X
@border.opacity=0@border.y= INIT_Y +(FONT_SIZE )+ RECT_Y
endenddef update
if !@finish
if@letters[@index]if@l_count>0@letters[@index].x=(@letters[@index].x*(@l_count -1)+@index*(FONT_SIZE / 2) + INIT_X) /@l_count@letters[@index].opacity=(@letters[@index].opacity*(@l_count -1)+ OPACITY)/@l_count@letters[@index].angle=(@letters[@index].angle*(@l_count -1))/@l_count@l_count-=1if@b_count>0@border.x=(@border.x*(@b_count -1)+ INIT_X -(FONT_SIZE / 2) + RECT_X) /@b_count@border.opacity=(@border.opacity*(@b_count -1)+ RECT_OPACITY)/@b_count@b_count-=1endelse@index+=1@l_count=((LETTER_ANIM /@letters.size)+1)endelse@finish=trueendelseif@finish_count>0@finish_count-=1returnendif@dispose_count>0for i in0...@letters.size@letters[i].x=(@letters[i].x*(@dispose_count -1)+ i *(FONT_SIZE / 2) + 24 + INIT_X) /@dispose_count@letters[i].opacity=(@letters[i].opacity*(@dispose_count -1))/@dispose_countend@border.x=(@border.x*(@dispose_count -1)+ INIT_X + RECT_X -(FONT_SIZE / 2) - @border.width ) /@dispose_count@border.opacity=(@border.opacity*(@dispose_count -1))/@dispose_count@dispose_count-=1endendenddef dispose
dispose_sprites
enddef dispose_sprites
for i in@letters
i.disposeendif@border@border.bitmap.disposeif@border.bitmap@border.disposeendendend#===============================================================================# The map #===============================================================================class Scene_Map < Scene_Base
alias smsbstrt start
alias smsbupdbas update_transfer_player
alias smsbupdnorm update
alias smsbterm terminate
def start
@letters= Spriteset_MapName.new
smsbstrt
#~ @letters.set_spritesenddef update
@letters.update
smsbupdnorm
enddef update_transfer_player
teleported =trueif$game_player.transfer?
smsbupdbas
@letters.set_spritesif teleported
enddef terminate
@letters.dispose
smsbterm
endend
cari974 - posté le 20/06/2013 à 09:32:00. (38 messages postés)
Lorsque tu mets un de ces commentaires sur une de tes compétences cela permet de faire un peu comme l’effet "provoquer" dans World Of Warcraft.
Si tu veux que ton tank provoque les ennemis à chaque tours, tu dois en effet mettre ce commentaire dans toutes les compétences de ton tank.
cari974 - posté le 20/06/2013 à 08:35:11. (38 messages postés)
Bon, étant donné que je ne pense pas avoir su bien expliquer l'installation de ce script, et étant donné qu'on ne puisse pas éditer le sujet, je vais vous expliquer comment installer le serveur en quelques étapes.
cari974 - posté le 12/06/2013 à 12:07:57. (38 messages postés)
Oui je sais mais dès que je mets 20 évènements de ce genre, mon jeu lag... et puis c'est long de mettre 20 variables pour les coordonnées x et 20 pour les y.
cari974 - posté le 12/06/2013 à 10:59:48. (38 messages postés)
Domaine concerné: Script
Logiciel utilisé: VX
Bonjours, j'aimerais savoir si il existe un script qui permettrait de faire un "contact avec l'évènement" ou un "contact avec le héros" qui s'active lorsque deux évènements entre en contact.
J'image un script ou il faut mettre par exemple "[contact]" en commentaire et lorsque 1 évènement avec ce commentaire entre en contact avec 1 évènement quelconque (qui est en "contact avec l'évènement" ou en "contact avec le héros"), l'évènement "[contact]" agit comme si c'était un héros et donc active l'évènement quelconque.
Je profite de ce poste pour vous demander un second script pour rpg maker VX.
je suis parvenu à le modifier pour qu'au passage de la sourie, au lieu d'afficher un message, l'évènement active un interrupteur et modifie des variables .
Mais ne serait-il pas possible de faire un script équivalent avec une seule différence (l'objectif n'étant pas d'afficher un message mais de modifier des interrupteurs) :
Que l'on ne doit pas passer la sourie sur l'évènement pour activer le script, on devrait plutôt double cliqué sur l'évènement pour activer le script.