- Сообщений: 173
- Спасибо получено: 6
Правила раздела:
1 Задавайте конкретные вопросы. Для болтовни есть свободный раздел.
2 По возможности давайте конкретные ответы.
3 Один вопрос=одна тема. Если хотите задать ещё вопрос, то начинайте новую тему.
4 Название темы должно составлять сам вопрос, и быть максимально конкретным. Рекомендуется начинать тему словами "Как", "Что", "Почему". А первый пост повторяет вопрос и даёт расширенные сведения.
5 Рекомендуется указывать версию мейкера (2000, 2003, RMXP, RMVX, ACE, IGM, и.т.д.. Это важно, и всё равно ведь спросят.
6 Темы "Пара вопросов", "Помогите", и подобные им - самый лёгкий путь к бану.
7 Поиск находится вверху справа.
А. Названия подразделов этого раздела уточняются. Советы принимаются.
1 Задавайте конкретные вопросы. Для болтовни есть свободный раздел.
2 По возможности давайте конкретные ответы.
3 Один вопрос=одна тема. Если хотите задать ещё вопрос, то начинайте новую тему.
4 Название темы должно составлять сам вопрос, и быть максимально конкретным. Рекомендуется начинать тему словами "Как", "Что", "Почему". А первый пост повторяет вопрос и даёт расширенные сведения.
5 Рекомендуется указывать версию мейкера (2000, 2003, RMXP, RMVX, ACE, IGM, и.т.д.. Это важно, и всё равно ведь спросят.
6 Темы "Пара вопросов", "Помогите", и подобные им - самый лёгкий путь к бану.
7 Поиск находится вверху справа.
А. Названия подразделов этого раздела уточняются. Советы принимаются.
[VX] Помогите разобратся со скриптами
15 года 2 мес. назад - 15 года 2 мес. назад #39737
от Scorpio
Scorpio создал тему: [VX] Помогите разобратся со скриптами
помогите разобратся со скриптом Visual Equepment
1. Как убрать волосы
2. Как надо прописывать новые вещи?
Ещё нужна помощь со скриптом fog of war
1. Как сделать что-бы на картах не было тумана?
2. Как увеличить радиус открывания ?
И ещё нужна помощь со скриптом аддона мини карты (показ врагов)
Собственно как заставить отоброжать врагов?
1. Как убрать волосы
2. Как надо прописывать новые вещи?
Ещё нужна помощь со скриптом fog of war
ВНИМАНИЕ: Спойлер!
#=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
# Fog of War 22/05/09
#
# ver.0.1 par Berka rgss.2
# www.rpgmakervx-fr.com
#=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
# Add a Fog of War on the Map
#
# Commands:
# Fog.clear_fog(map_id) # clear the bitmap (all black)
# vu_par_hero?(x,y) # chek if [x,y] is viewed by the hero
# $RayonFog = i # modify the hero's view range
#
# Features:
# * Switch hides the fog
# * the fog of each map is saved
# * threading system (faster) for fog's borders
# Do not use for large maps: FPS may be down
#=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
module Berka
module Brouillard
$RayonFog = 3 # View Range: calculs are optimized for 3 or 6
FichFog = "fog.png" # File of fog tileset: only the first pattern is used
# may be placed on: Graphics/System
IDFog = 1 # Switch_Id: if switch == true: hides the fog
ZFog = 300 # fogs 's priorities
Act_GC = true # Garbage Collector managment
# Do not Change !!!!
Tiles={ # fog's tileset indexes
"0"=>2816,"1"=>2824,"12"=>2844,"123"=>2844,"1234"=>2856,"12346"=>2860,
"123467"=>2860,"1234678"=>2862,"12346789"=>2862,"1234679"=>2860,"123468"=>2862,
"1234689"=>2862,"123469"=>2860,"12347"=>2856,"123478"=>2859,"1234789"=>2859,
"123479"=>2857,"12348"=>2859,"123489"=>2859,"12349"=>2857,"1236"=>2854,
"12367"=>2855,"123678"=>2861,"123679"=>2855,"1236789"=>2861,"12368"=>2861,
"123689"=>2861,"12369"=>2854,"1237"=>2845,"12378"=>2849,"123789"=>2849,
"12379"=>2847,"1238"=>2849,"12389"=>2849,"1239"=>2846,"124"=>2856,"1246"=>2860,
"12467"=>2860,"124678"=>2862,"1246789"=>2862,"124679"=>2860,"12468"=>2862,
"124689"=>2862,"12469"=>2860,"1247"=>2856,"12478"=>2859,"124789"=>2859,
"12479"=>2857,"1248"=>2859,"12489"=>2859,"1249"=>2857,"126"=>2854,"1267"=>2855,
"12678"=>2861,"126789"=>2861,"12679"=>2855,"1268"=>2861,"12689"=>2861,"1269"=>2854,
"127"=>2845,"1278"=>2849,"12789"=>2849,"128"=>2849,"1289"=>2849,"129"=>2846,
"13"=>2828,"134"=>2834,"1346"=>2848,"13467"=>2848,"134678"=>2858,"1346789"=>2858,
"134679"=>2848,"13468"=>2858,"134689"=>2858,"13469"=>2848,"1347"=>2834,
"13478"=>2851,"134789"=>2851,"13479"=>2835,"1348"=>2851,"13489"=>2851,
"1349"=>2835,"136"=>2841,"1367"=>2843,"13678"=>2853,"136789"=>2853,"13679"=>2843,
"1368"=>2853,"13689"=>2853,"1369"=>2841,"137"=>2829,"1378"=>2839,"13789"=>2839,
"138"=>2839,"1389"=>2839,"139"=>2830,"14"=>2832,"146"=>2848,"1467"=>2848,
"14678"=>2858,"146789"=>2858,"14679"=>2848,"1468"=>2862,"14689"=>2858,"1469"=>2848,
"147"=>2832,"1478"=>2850,"14789"=>2850,"1479"=>2833,"148"=>2850,"1489"=>2850,
"149"=>2833,"16"=>2841,"167"=>2843,"1678"=>2853,"16789"=>2853,"1679"=>2848,
"168"=>2853,"1689"=>2853,"169"=>2841,"17"=>2825,"178"=>2838,"1789"=>2838,
"179"=>2827,"18"=>2838,"189"=>2838,"19"=>2826,"2"=>2844,"23"=>2844,"234"=>2856,
"2346"=>2860,"23467"=>2860,"234678"=>2862,"2346789"=>2862,"234679"=>2862,
"23468"=>2862,"234689"=>2862,"23469"=>2860,"2347"=>2856,"23478"=>2859,
"234789"=>2859,"23479"=>2857,"2348"=>2859,"23489"=>2859,"2348"=>2859,"236"=>2854,
"2367"=>2855,"23678"=>2861,"236789"=>2861,"23679"=>2855,"2368"=>2861,"23689"=>2861,
"2369"=>2854,"237"=>2845,"2378"=>2849,"23789"=>2849,"2379"=>2847,"238"=>2849,
"2389"=>2849,"239"=>2846,"24"=>2856,"246"=>2860,"2467"=>2860,"24678"=>2862,
"246789"=>2862,"24679"=>2860,"2468"=>2862,"24689"=>2862,"2469"=>2860,"247"=>2856,
"2478"=>2859,"24789"=>2859,"2479"=>2847,"248"=>2859,"2489"=>2859,"249"=>2857,
"26"=>2854,"267"=>2854,"2678"=>2861,"26789"=>2861,"2679"=>2855,"268"=>2861,
"2689"=>2861,"269"=>2854,"27"=>2845,"278"=>2849,"2789"=>2849,"279"=>2847,"28"=>2849,
"289"=>2849,"29"=>2846,"3"=>2820,"34"=>2834,"346"=>2848,"3467"=>2848,"34678"=>2858,
"346789"=>2858,"34679"=>2848,"3468"=>2858,"34689"=>2858,"3469"=>2848,"347"=>2834,
"3478"=>2851,"34789"=>2851,"3479"=>2835,"348"=>2851,"3489"=>2851,"349"=>2835,
"36"=>2840,"367"=>2842,"3678"=>2852,"36789"=>2852,"3679"=>2842,"368"=>2852,
"3689"=>2852,"369"=>2840,"37"=>2821,"378"=>2837,"3789"=>2837,"379"=>2823,
"38"=>2837,"389"=>2837,"39"=>2822,"4"=>2832,"46"=>2848,"467"=>2848,"4678"=>2858,
"46789"=>2858,"4679"=>2848,"468"=>2858,"4689"=>2858,"469"=>2848,"47"=>2832,
"478"=>2850,"4789"=>2850,"479"=>2833,"48"=>2850,"489"=>2850,"49"=>2833,
"6"=>2840,"67"=>2842,"678"=>2852,"6789"=>2852,"679"=>2842,"68"=>2852,
"689"=>2852,"69"=>2840,"7"=>2817,"78"=>2836,"789"=>2836,"79"=>2819,"8"=>2836,
"89"=>2836,"9"=>2818
} # et tu payes ton mal de crâne, pour trouver chaque valeur ^^
end
end
module Fog
def self.clear_fog(id)
$game_temp.br_maps.delete(id)
return if !$scene.is_a?(Scene_Map)
$scene.spriteset.dispose
$scene.spriteset=Spriteset_Map.new
end
end
Win32API.new('kernel32','SetPriorityClass','pi','i').call(
Win32API.new('kernel32','GetCurrentProcess','','i').call,256)
include Berka::Brouillard
class Spriteset_Map
alias :br_create :create_tilemap
alias :br_dispose :dispose_tilemap
alias :br_view :dispose_viewports
alias :br_update :update_tilemap unless $@
alias :br_view_update :update_viewports unless $@
attr_accessor :br_tile,:tilemap
def create_tilemap
br_create
@br_tile=Tilemap.new(@br_view=Viewport.new(0,0,Graphics.width,Graphics.height))
@br_view.z=ZFog
8.times{|i|@br_tile.bitmaps=@tilemap.bitmaps.clone}
@br_tile.bitmaps[1]=Cache.system(FichFog)
@br_tile.map_data=Table.new($game_map.width,$game_map.height,3)
clear_fog
end
def clear_fog
w,h=$game_map.width,$game_map.height
if $game_temp.br_maps.has_key?($game_map.map_id)
for x in 0...w;for y in 0...h
if $game_temp.br_maps[$game_map.map_id][x,y]==0
@br_tile.map_data[x,y,1]=2816
a||=true
else
@br_tile.map_data[x,y,1]=0
a||=false
end
end;end
if a
Thread.new{for x in 0...w;for y in 0...h
chk(x,y)
end;end}
end
else
$game_temp.br_maps[$game_map.map_id]||=Table.new(w,h)
for x in 0...w;for y in 0...h
@br_tile.map_data[x,y,1]=2816
$game_temp.br_maps[$game_map.map_id][x,y]=0
end;end
end
end
def dispose_tilemap
br_dispose
@br_tile.dispose
end
def dispose_viewports
br_view
@br_view.dispose
end
def update_tilemap
br_update
if $game_switches[IDFog]
@br_tile.dispose
return
end
GC.start if !$game_player.moving?&&Act_GC
return if !$game_temp.br_maps.has_key?($game_map.map_id)
br_obscurcis
x,y=$game_map.display_x/8,$game_map.display_y/8
return if x==@br_tile.ox&&y==@br_tile.oy
@br_tile.ox,@br_tile.oy=x,y
@br_tile.update
end
def br_obscurcis
x,y=$game_player.x,$game_player.y
rx,ry=(x-$RayonFog-2..x+$RayonFog+2).to_a,(y-$RayonFog-2..y+$RayonFog+2).to_a
for tx in rx
for ty in ry
r=Math.sqrt(((x-tx)**2+(y-ty)**2))
chk(tx,ty)if r.between?($RayonFog,$RayonFog+2)
next if !tx.between?(rx[0],rx[-1])
if r<=$RayonFog
@br_tile.map_data[tx,ty,1]=0
$game_temp.br_maps[$game_map.map_id][tx,ty]=1
end
end
end
end
def chk(x,y)
return if !$game_temp.br_maps.has_key?($game_map.map_id)||x.nil?||y.nil?||
$game_temp.br_maps[$game_map.map_id][x,y]==1
d=@br_tile.map_data
l=[]
l<<1 if d[x-1,y+1,1]==0
l<<2 if d[x,y+1,1]==0
l<
if d[x+1,y+1,1]==0
l<<4 if d[x-1,y,1]==0
l<<6 if d[x+1,y,1]==0
l<<9 if d[x+1,y-1,1]==0
l<<8 if d[x,y-1,1]==0
l<<7 if d[x-1,y-1,1]==0
l=l.sort.join
return if l.nil?||l==""
@br_tile.map_data[x,y,1]=Tiles[l]
end
def update_viewports
br_view_update
@br_view.update
end
end
class Game_Temp
alias :br_initialize :initialize
attr_accessor :br_maps
def initialize
br_initialize
@br_maps={}
end
end
def vu_par_hero?(x,y)
Math.sqrt((($game_player.x-x)**2+($game_player.y-y)**2))<=$RayonFog
end
class Scene_Map<Scene_Base # correctif: mà j spriteset 1/frame
attr_accessor :spriteset
def update_basic
Graphics.update
Input.update
$game_map.update
end
end
class Scene_File<Scene_Base
alias :br_write_save :write_save_data
alias :br_read_save :read_save_data
def write_save_data(file)
br_write_save(file)
Marshal.dump($game_temp.br_maps,file)
end
def read_save_data(file)
br_read_save(file)
$game_temp.br_maps=Marshal.load(file)
end
end
# Fog of War 22/05/09
#
# ver.0.1 par Berka rgss.2
# www.rpgmakervx-fr.com
#=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
# Add a Fog of War on the Map
#
# Commands:
# Fog.clear_fog(map_id) # clear the bitmap (all black)
# vu_par_hero?(x,y) # chek if [x,y] is viewed by the hero
# $RayonFog = i # modify the hero's view range
#
# Features:
# * Switch hides the fog
# * the fog of each map is saved
# * threading system (faster) for fog's borders
# Do not use for large maps: FPS may be down
#=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
module Berka
module Brouillard
$RayonFog = 3 # View Range: calculs are optimized for 3 or 6
FichFog = "fog.png" # File of fog tileset: only the first pattern is used
# may be placed on: Graphics/System
IDFog = 1 # Switch_Id: if switch == true: hides the fog
ZFog = 300 # fogs 's priorities
Act_GC = true # Garbage Collector managment
# Do not Change !!!!
Tiles={ # fog's tileset indexes
"0"=>2816,"1"=>2824,"12"=>2844,"123"=>2844,"1234"=>2856,"12346"=>2860,
"123467"=>2860,"1234678"=>2862,"12346789"=>2862,"1234679"=>2860,"123468"=>2862,
"1234689"=>2862,"123469"=>2860,"12347"=>2856,"123478"=>2859,"1234789"=>2859,
"123479"=>2857,"12348"=>2859,"123489"=>2859,"12349"=>2857,"1236"=>2854,
"12367"=>2855,"123678"=>2861,"123679"=>2855,"1236789"=>2861,"12368"=>2861,
"123689"=>2861,"12369"=>2854,"1237"=>2845,"12378"=>2849,"123789"=>2849,
"12379"=>2847,"1238"=>2849,"12389"=>2849,"1239"=>2846,"124"=>2856,"1246"=>2860,
"12467"=>2860,"124678"=>2862,"1246789"=>2862,"124679"=>2860,"12468"=>2862,
"124689"=>2862,"12469"=>2860,"1247"=>2856,"12478"=>2859,"124789"=>2859,
"12479"=>2857,"1248"=>2859,"12489"=>2859,"1249"=>2857,"126"=>2854,"1267"=>2855,
"12678"=>2861,"126789"=>2861,"12679"=>2855,"1268"=>2861,"12689"=>2861,"1269"=>2854,
"127"=>2845,"1278"=>2849,"12789"=>2849,"128"=>2849,"1289"=>2849,"129"=>2846,
"13"=>2828,"134"=>2834,"1346"=>2848,"13467"=>2848,"134678"=>2858,"1346789"=>2858,
"134679"=>2848,"13468"=>2858,"134689"=>2858,"13469"=>2848,"1347"=>2834,
"13478"=>2851,"134789"=>2851,"13479"=>2835,"1348"=>2851,"13489"=>2851,
"1349"=>2835,"136"=>2841,"1367"=>2843,"13678"=>2853,"136789"=>2853,"13679"=>2843,
"1368"=>2853,"13689"=>2853,"1369"=>2841,"137"=>2829,"1378"=>2839,"13789"=>2839,
"138"=>2839,"1389"=>2839,"139"=>2830,"14"=>2832,"146"=>2848,"1467"=>2848,
"14678"=>2858,"146789"=>2858,"14679"=>2848,"1468"=>2862,"14689"=>2858,"1469"=>2848,
"147"=>2832,"1478"=>2850,"14789"=>2850,"1479"=>2833,"148"=>2850,"1489"=>2850,
"149"=>2833,"16"=>2841,"167"=>2843,"1678"=>2853,"16789"=>2853,"1679"=>2848,
"168"=>2853,"1689"=>2853,"169"=>2841,"17"=>2825,"178"=>2838,"1789"=>2838,
"179"=>2827,"18"=>2838,"189"=>2838,"19"=>2826,"2"=>2844,"23"=>2844,"234"=>2856,
"2346"=>2860,"23467"=>2860,"234678"=>2862,"2346789"=>2862,"234679"=>2862,
"23468"=>2862,"234689"=>2862,"23469"=>2860,"2347"=>2856,"23478"=>2859,
"234789"=>2859,"23479"=>2857,"2348"=>2859,"23489"=>2859,"2348"=>2859,"236"=>2854,
"2367"=>2855,"23678"=>2861,"236789"=>2861,"23679"=>2855,"2368"=>2861,"23689"=>2861,
"2369"=>2854,"237"=>2845,"2378"=>2849,"23789"=>2849,"2379"=>2847,"238"=>2849,
"2389"=>2849,"239"=>2846,"24"=>2856,"246"=>2860,"2467"=>2860,"24678"=>2862,
"246789"=>2862,"24679"=>2860,"2468"=>2862,"24689"=>2862,"2469"=>2860,"247"=>2856,
"2478"=>2859,"24789"=>2859,"2479"=>2847,"248"=>2859,"2489"=>2859,"249"=>2857,
"26"=>2854,"267"=>2854,"2678"=>2861,"26789"=>2861,"2679"=>2855,"268"=>2861,
"2689"=>2861,"269"=>2854,"27"=>2845,"278"=>2849,"2789"=>2849,"279"=>2847,"28"=>2849,
"289"=>2849,"29"=>2846,"3"=>2820,"34"=>2834,"346"=>2848,"3467"=>2848,"34678"=>2858,
"346789"=>2858,"34679"=>2848,"3468"=>2858,"34689"=>2858,"3469"=>2848,"347"=>2834,
"3478"=>2851,"34789"=>2851,"3479"=>2835,"348"=>2851,"3489"=>2851,"349"=>2835,
"36"=>2840,"367"=>2842,"3678"=>2852,"36789"=>2852,"3679"=>2842,"368"=>2852,
"3689"=>2852,"369"=>2840,"37"=>2821,"378"=>2837,"3789"=>2837,"379"=>2823,
"38"=>2837,"389"=>2837,"39"=>2822,"4"=>2832,"46"=>2848,"467"=>2848,"4678"=>2858,
"46789"=>2858,"4679"=>2848,"468"=>2858,"4689"=>2858,"469"=>2848,"47"=>2832,
"478"=>2850,"4789"=>2850,"479"=>2833,"48"=>2850,"489"=>2850,"49"=>2833,
"6"=>2840,"67"=>2842,"678"=>2852,"6789"=>2852,"679"=>2842,"68"=>2852,
"689"=>2852,"69"=>2840,"7"=>2817,"78"=>2836,"789"=>2836,"79"=>2819,"8"=>2836,
"89"=>2836,"9"=>2818
} # et tu payes ton mal de crâne, pour trouver chaque valeur ^^
end
end
module Fog
def self.clear_fog(id)
$game_temp.br_maps.delete(id)
return if !$scene.is_a?(Scene_Map)
$scene.spriteset.dispose
$scene.spriteset=Spriteset_Map.new
end
end
Win32API.new('kernel32','SetPriorityClass','pi','i').call(
Win32API.new('kernel32','GetCurrentProcess','','i').call,256)
include Berka::Brouillard
class Spriteset_Map
alias :br_create :create_tilemap
alias :br_dispose :dispose_tilemap
alias :br_view :dispose_viewports
alias :br_update :update_tilemap unless $@
alias :br_view_update :update_viewports unless $@
attr_accessor :br_tile,:tilemap
def create_tilemap
br_create
@br_tile=Tilemap.new(@br_view=Viewport.new(0,0,Graphics.width,Graphics.height))
@br_view.z=ZFog
8.times{|i|@br_tile.bitmaps=@tilemap.bitmaps.clone}
@br_tile.bitmaps[1]=Cache.system(FichFog)
@br_tile.map_data=Table.new($game_map.width,$game_map.height,3)
clear_fog
end
def clear_fog
w,h=$game_map.width,$game_map.height
if $game_temp.br_maps.has_key?($game_map.map_id)
for x in 0...w;for y in 0...h
if $game_temp.br_maps[$game_map.map_id][x,y]==0
@br_tile.map_data[x,y,1]=2816
a||=true
else
@br_tile.map_data[x,y,1]=0
a||=false
end
end;end
if a
Thread.new{for x in 0...w;for y in 0...h
chk(x,y)
end;end}
end
else
$game_temp.br_maps[$game_map.map_id]||=Table.new(w,h)
for x in 0...w;for y in 0...h
@br_tile.map_data[x,y,1]=2816
$game_temp.br_maps[$game_map.map_id][x,y]=0
end;end
end
end
def dispose_tilemap
br_dispose
@br_tile.dispose
end
def dispose_viewports
br_view
@br_view.dispose
end
def update_tilemap
br_update
if $game_switches[IDFog]
@br_tile.dispose
return
end
GC.start if !$game_player.moving?&&Act_GC
return if !$game_temp.br_maps.has_key?($game_map.map_id)
br_obscurcis
x,y=$game_map.display_x/8,$game_map.display_y/8
return if x==@br_tile.ox&&y==@br_tile.oy
@br_tile.ox,@br_tile.oy=x,y
@br_tile.update
end
def br_obscurcis
x,y=$game_player.x,$game_player.y
rx,ry=(x-$RayonFog-2..x+$RayonFog+2).to_a,(y-$RayonFog-2..y+$RayonFog+2).to_a
for tx in rx
for ty in ry
r=Math.sqrt(((x-tx)**2+(y-ty)**2))
chk(tx,ty)if r.between?($RayonFog,$RayonFog+2)
next if !tx.between?(rx[0],rx[-1])
if r<=$RayonFog
@br_tile.map_data[tx,ty,1]=0
$game_temp.br_maps[$game_map.map_id][tx,ty]=1
end
end
end
end
def chk(x,y)
return if !$game_temp.br_maps.has_key?($game_map.map_id)||x.nil?||y.nil?||
$game_temp.br_maps[$game_map.map_id][x,y]==1
d=@br_tile.map_data
l=[]
l<<1 if d[x-1,y+1,1]==0
l<<2 if d[x,y+1,1]==0
l<
if d[x+1,y+1,1]==0l<<4 if d[x-1,y,1]==0
l<<6 if d[x+1,y,1]==0
l<<9 if d[x+1,y-1,1]==0
l<<8 if d[x,y-1,1]==0
l<<7 if d[x-1,y-1,1]==0
l=l.sort.join
return if l.nil?||l==""
@br_tile.map_data[x,y,1]=Tiles[l]
end
def update_viewports
br_view_update
@br_view.update
end
end
class Game_Temp
alias :br_initialize :initialize
attr_accessor :br_maps
def initialize
br_initialize
@br_maps={}
end
end
def vu_par_hero?(x,y)
Math.sqrt((($game_player.x-x)**2+($game_player.y-y)**2))<=$RayonFog
end
class Scene_Map<Scene_Base # correctif: mà j spriteset 1/frame
attr_accessor :spriteset
def update_basic
Graphics.update
Input.update
$game_map.update
end
end
class Scene_File<Scene_Base
alias :br_write_save :write_save_data
alias :br_read_save :read_save_data
def write_save_data(file)
br_write_save(file)
Marshal.dump($game_temp.br_maps,file)
end
def read_save_data(file)
br_read_save(file)
$game_temp.br_maps=Marshal.load(file)
end
end
1. Как сделать что-бы на картах не было тумана?
2. Как увеличить радиус открывания ?
И ещё нужна помощь со скриптом аддона мини карты (показ врагов)
ВНИМАНИЕ: Спойлер!
################################################################################
# #
# ~~~~~ Copyright 2009 SojaBird ~~~~~ #
# #
################################################################################
#
# * Game_MiniMap: Gets amount of enemies on the map
#
class Game_MiniMap
attr_reader :enemies
alias hud_initialize initialize
alias draw_hud_object draw_object
def initialize(tilemap)
@enemies = 0
hud_initialize(tilemap)
end
def draw_object
@enemies = 0
draw_hud_object
@object_list.each do |key, events|
color = MiniMap::OBJECT_COLOR[key]
next if events.nil? or color.nil?
events.each do |obj|
if !obj.character_name.empty?
@enemies += 1 if color == MiniMap::OBJECT_COLOR
end
end
end
end
end
#
# * Woratana_MiniMap_Enemy_HUD: Creates the HUD
#
class Woratana_MiniMap_Enemy_HUD < Window_Base
include MiniMap
def initialize
@x = MAP_RECT[0]
@y = MAP_RECT[1] + MAP_RECT[3] - 16
@width = MAP_RECT[2]
@height = WLH + 32
super(@x, @y, @width, @height)
self.visible = $game_system.show_minimap
self.opacity = 0
self.z = MAP_Z + 1
@enemies_total = $scene.spriteset.minimap.enemies
@enemies = $scene.spriteset.minimap.enemies
refresh
end
def color
return knockout_color if @enemies >= (@enemies_total.to_f / 2)
return crisis_color if @enemies > 0
return power_up_color
end
def draw_border
@border = Sprite.new
@border.x = @x - MINIMAP_BORDER_SIZE
@border.y = @y + 16
b_width = @width + (MINIMAP_BORDER_SIZE * 2)
b_height = @height + (MINIMAP_BORDER_SIZE * 2) - 32
@border.bitmap = Bitmap.new(b_width, b_height)
@border.bitmap.fill_rect(@border.bitmap.rect, MINIMAP_BORDER_COLOR)
@border.bitmap.clear_rect(MINIMAP_BORDER_SIZE, MINIMAP_BORDER_SIZE,
@border.bitmap.width - (MINIMAP_BORDER_SIZE * 2),
@border.bitmap.height - (MINIMAP_BORDER_SIZE * 2))
@border.z = MAP_Z
end
def draw_background
@background = Sprite.new
@background.x = @x
@background.y = @y + MINIMAP_BORDER_SIZE + 16
b_width = @width
b_height = @height - 32
@background.bitmap = Bitmap.new(b_width, b_height)
@background.bitmap.fill_rect(@background.bitmap.rect, BACKGROUND_COLOR)
@background.z = MAP_Z
end
def refresh
contents.clear
draw_border if @border.nil?
draw_background if @background.nil?
@enemies = $scene.spriteset.minimap.enemies
self.contents.font.color = color
@string = "#{@enemies}/#{@enemies_total}"
self.contents.draw_text(0, 0, self.width - 32, WLH, @string, 1)
end
def dispose
@border.dispose if !@border.nil?
@background.dispose if !@background.nil?
end
def update
self.visible = $game_system.show_minimap
return if !self.visible
if $scene.is_a?(Scene_Map) and @enemies != $scene.spriteset.minimap.enemies
refresh
end
end
end
#
# * Scene_Map: Attach HUD to map
#
class Scene_Map < Scene_Base
alias start_hud start
alias terminate_hud terminate
alias update_hud update
def start
start_hud
@woratana_minimap_enemy_hud = Woratana_MiniMap_Enemy_HUD.new
end
def terminate
@woratana_minimap_enemy_hud.dispose
terminate_hud
end
def update
update_hud
@woratana_minimap_enemy_hud.update
end
end
# #
# ~~~~~ Copyright 2009 SojaBird ~~~~~ #
# #
################################################################################
#
# * Game_MiniMap: Gets amount of enemies on the map
#
class Game_MiniMap
attr_reader :enemies
alias hud_initialize initialize
alias draw_hud_object draw_object
def initialize(tilemap)
@enemies = 0
hud_initialize(tilemap)
end
def draw_object
@enemies = 0
draw_hud_object
@object_list.each do |key, events|
color = MiniMap::OBJECT_COLOR[key]
next if events.nil? or color.nil?
events.each do |obj|
if !obj.character_name.empty?
@enemies += 1 if color == MiniMap::OBJECT_COLOR
end
end
end
end
end
#
# * Woratana_MiniMap_Enemy_HUD: Creates the HUD
#
class Woratana_MiniMap_Enemy_HUD < Window_Base
include MiniMap
def initialize
@x = MAP_RECT[0]
@y = MAP_RECT[1] + MAP_RECT[3] - 16
@width = MAP_RECT[2]
@height = WLH + 32
super(@x, @y, @width, @height)
self.visible = $game_system.show_minimap
self.opacity = 0
self.z = MAP_Z + 1
@enemies_total = $scene.spriteset.minimap.enemies
@enemies = $scene.spriteset.minimap.enemies
refresh
end
def color
return knockout_color if @enemies >= (@enemies_total.to_f / 2)
return crisis_color if @enemies > 0
return power_up_color
end
def draw_border
@border = Sprite.new
@border.x = @x - MINIMAP_BORDER_SIZE
@border.y = @y + 16
b_width = @width + (MINIMAP_BORDER_SIZE * 2)
b_height = @height + (MINIMAP_BORDER_SIZE * 2) - 32
@border.bitmap = Bitmap.new(b_width, b_height)
@border.bitmap.fill_rect(@border.bitmap.rect, MINIMAP_BORDER_COLOR)
@border.bitmap.clear_rect(MINIMAP_BORDER_SIZE, MINIMAP_BORDER_SIZE,
@border.bitmap.width - (MINIMAP_BORDER_SIZE * 2),
@border.bitmap.height - (MINIMAP_BORDER_SIZE * 2))
@border.z = MAP_Z
end
def draw_background
@background = Sprite.new
@background.x = @x
@background.y = @y + MINIMAP_BORDER_SIZE + 16
b_width = @width
b_height = @height - 32
@background.bitmap = Bitmap.new(b_width, b_height)
@background.bitmap.fill_rect(@background.bitmap.rect, BACKGROUND_COLOR)
@background.z = MAP_Z
end
def refresh
contents.clear
draw_border if @border.nil?
draw_background if @background.nil?
@enemies = $scene.spriteset.minimap.enemies
self.contents.font.color = color
@string = "#{@enemies}/#{@enemies_total}"
self.contents.draw_text(0, 0, self.width - 32, WLH, @string, 1)
end
def dispose
@border.dispose if !@border.nil?
@background.dispose if !@background.nil?
end
def update
self.visible = $game_system.show_minimap
return if !self.visible
if $scene.is_a?(Scene_Map) and @enemies != $scene.spriteset.minimap.enemies
refresh
end
end
end
#
# * Scene_Map: Attach HUD to map
#
class Scene_Map < Scene_Base
alias start_hud start
alias terminate_hud terminate
alias update_hud update
def start
start_hud
@woratana_minimap_enemy_hud = Woratana_MiniMap_Enemy_HUD.new
end
def terminate
@woratana_minimap_enemy_hud.dispose
terminate_hud
end
def update
update_hud
@woratana_minimap_enemy_hud.update
end
end
Собственно как заставить отоброжать врагов?
Последнее редактирование: 15 года 2 мес. назад пользователем Scorpio.
Пожалуйста Войти или Регистрация, чтобы присоединиться к беседе.
Время создания страницы: 0.091 секунд
