Jump to content
Rpg²S Forum

Implementare le Fogs


Belxebu
 Share

Recommended Posts

DeadlyDan MapFog

Descrizione

Ecco uno script che reinserisce le FOGS stranamente scomparse o_O...

 

Autore

DeadlyDan

 

Istruzioni per l'uso

Inserire sotto Main.

 

 

 

 

#==============================================================================
# ■ DeadlyDan_MapFog by DeadlyDan
#------------------------------------------------------------------------------
#  Allows maps to have fogs like in RPG Maker XP
#==============================================================================
# Usage:
=begin
 
 To initialize a fog for a current map you must:
 
 1) Create a map event and set it to only come on when Self Switch A is on.
 2) Rename it to FOG. (Case sensitive, so it has to be FOG)
 3) Set it to a Parallel Process.
 4) Add for example, the following code into a Script Code event command:
 
 $game_map.fog_name = "fog"			   # Filename of fog image located in the Pictures folder
 $game_map.fog_zoom = 300				 # How much to zoom into the fog image
 $game_map.fog_sx = 1						   # The scrolling speed across the x axis
 $game_map.fog_sy = 1						   # The scrolling speed across the y axis
 $game_map.fog_target_opacity = 80	# The opacity of the fog
 $game_map.fog_show							 # Always call this after changing fog variables  
 
 5) Then, add a Control Self Switch after that Script Code, and set it to turn A off.
 
 (Note)
 It is absolutely vital that you put the event name to FOG and set it to a Parallel Proccess and also set it to
 only run when Self-Switch A is on.
 
 Make sure you place this script after all other scripts except for Main.
 
 (Extras)
 You can also use extra commands to change the fog settings, such as the following example:
 
 $game_map.fog_tone = Tone.new ( 100, 0, 0, 0 )
 $game_map.fog_blend_type = 1 # ( 0 = NONE, 1 = ADD, 2 = SUBTRACT )
 
 (Important!)
 When you want to have a map with no fog, do all of the above but instead of seting the fog options and then
 calling $game_map.fog_show, just add a Script Code event command and place in it $game_map.fog_clear.
 
 This will clear the fog settings and the fog will dissapear, every map has to have a fog event in it, else maps
 will keep all other maps fog settings that might be unintentional on the users side.
 
=end

class Game_Temp
 attr_accessor :fog_name
 attr_accessor :fog_opacity
 attr_accessor :fog_target_opacity
 attr_accessor :fog_blend_type
 attr_accessor :fog_zoom
 attr_accessor :fog_sx
 attr_accessor :fog_sy
 attr_accessor :fog_tone
 
 alias original_initialize initialize
 def initialize
original_initialize
@fog_name = ""
@fog_tone = Tone.new ( 0, 0, 0, 0 )
@fog_opacity = 0
@fog_target_opacity = 0
@fog_blend_type = 0
@fog_zoom = 100
@fog_sx = 0
@fog_sy = 0
 end
 
end

class Game_Map
 attr_accessor :fog_name
 attr_accessor :fog_opacity
 attr_accessor :fog_target_opacity
 attr_accessor :fog_blend_type
 attr_accessor :fog_zoom
 attr_accessor :fog_sx
 attr_accessor :fog_sy
 attr_accessor :fog_ox
 attr_accessor :fog_oy
 attr_accessor :fog_tone
 attr_accessor :fog_start_loop
 attr_accessor :fog_eventid
 attr_accessor :fog_visible
 attr_accessor :fog
 
 alias original_initialize initialize
 def initialize
original_initialize
@fog = Plane.new ( @viewport1 )
@fog_ox = 0
@fog_oy = 0
 end
 
 alias original_setup setup
 def setup ( map_id )
original_setup ( map_id )
fog_event
 end

 alias original_update update
 def update
original_update
if ( @fog_visible and @fog )
  fog_update
end
 end  

 def fog_init
  @fog_name = $game_temp.fog_name
  @fog_tone = $game_temp.fog_tone
  @fog_opacity = $game_temp.fog_opacity
  @fog_target_opacity = $game_temp.fog_target_opacity
  @fog_blend_type = $game_temp.fog_blend_type
  @fog_zoom = $game_temp.fog_zoom
  @fog_sx = $game_temp.fog_sx
  @fog_sy = $game_temp.fog_sy
  @fog_tone_target = Tone.new ( 0, 0, 0, 0 )
  @fog_tone_duration = 0
  @fog_opacity_duration = 0
  @fog_opacity_target = 0
  @fog_previous_name = ""
  fog_setup
 end
 
 def fog_setup
fog_hide
if ( ( @fog_previous_name != @fog_name ) and ( @fog_name != "" ) )
  @fog.bitmap = Cache.picture ( @fog_name )
  @fog_name_previous = @fog_name
  @fog_opacity = @fog_target_opacity
  @fog.opacity = @fog_opacity
  @fog.blend_type = @fog_blend_type
  @fog.zoom_x = @fog_zoom / 100
  @fog.zoom_y = @fog_zoom / 100
  @fog.ox = @fog_ox
  @fog.oy = @fog_oy
  @fog.tone = @fog_tone
  @fog.z = 99
  @fog_visible = true
else
   fog_hide
end
 end
 
 def fog_update
@fog_ox -= @fog_sx / 8.0
@fog_oy -= @fog_sy / 8.0

if ( @fog_tone_duration >= 1 )
  d = @fog_tone_duration
  target = @fog_tone_target
  @fog_tone.red = (@fog_tone.red * (d - 1) + target.red) / d
  @fog_tone.green = (@fog_tone.green * (d - 1) + target.green) / d
  @fog_tone.blue = (@fog_tone.blue * (d - 1) + target.blue) / d
  @fog_tone.gray = (@fog_tone.gray * (d - 1) + target.gray) / d
  @fog_tone_duration -= 1
end
if ( @fog_opacity_duration >= 1 )
  d = @fog_opacity_duration
  @fog_opacity = (@fog_opacity * (d - 1) + @fog_opacity_target) / d
  @fog_opacity_duration -= 1
end
@fog.opacity = @fog_opacity
@fog.blend_type = @fog_blend_type
@fog.zoom_x = @fog_zoom / 100
@fog.zoom_y = @fog_zoom / 100
@fog.ox = @fog_ox
@fog.oy = @fog_oy
@fog.tone = @fog_tone
 end
 
 def fog_show
fog_init
 end
 
 def fog_hide
@fog_visible = false
@fog_opacity = 0
$game_temp.fog_opacity = 0
 end
 
 def fog_clear
@fog_visible = false
@fog_opacity = 0
$game_temp.fog_opacity = 0
@fog_target_opacity = 0
$game_temp.fog_target_opacity = 0
fog_show
 end

 def scroll_up ( distance )
if ( loop_vertical? )
  @display_y += @map.height * 256 - distance
  @display_y %= @map.height * 256
  @parallax_y -= distance
  @fog_oy -= distance / 8.0
else
  last_y = @display_y
  @display_y = [@display_y - distance, 0].max
  @parallax_y += @display_y - last_y
  @fog_oy += ( @display_y - last_y ) / 8.0
end
 end
 
 def scroll_down ( distance )
if ( loop_vertical? )
  @display_y += distance
  @display_y %= @map.height * 256
  @parallax_y += distance
  @fog_oy += distance / 8.0
else
  last_y = @display_y
  @display_y = [@display_y + distance, (height - 13) * 256].min
  @parallax_y += @display_y - last_y
  @fog_oy += ( @display_y - last_y ) / 8.0
end
 end

 def scroll_left ( distance )
if ( loop_horizontal? )
  @display_x += @map.width * 256 - distance
  @display_x %= @map.width * 256
  @parallax_x -= distance
  @fog_ox -= distance / 8.0
else
   last_x = @display_x
  @display_x = [@display_x - distance, 0].max
  @parallax_x += @display_x - last_x
  @fog_ox += ( @display_x - last_x ) / 8.0
end
 end
 
 def scroll_right ( distance )
if ( loop_horizontal? )
  @display_x += distance
  @display_x %= @map.width * 256
  @parallax_x += distance
  @fog_ox += distance / 8.0
else
  last_x = @display_x
  @display_x = [@display_x + distance, (width - 17) * 256].min
  @parallax_x += @display_x - last_x
  @fog_ox += ( @display_x - last_x ) / 8.0
end
 end
 
 def setup_events
@fog_eventid = 0
@events = {}
for i in @map.events.keys
  @events[i] = Game_Event.new(@map_id, @map.events[i])
  if ( @events[i].name == "FOG" )
	@fog_eventid = i
  end
end
@common_events = {}
for i in 1...$data_common_events.size
  @common_events[i] = Game_CommonEvent.new(i)
end
 end

 def fog_event
if ( @fog_eventid != 0 )
  key = @events[@fog_eventid].selfswitch
  $game_self_switches[key] = true
end
 end

end

class Scene_Map < Scene_Base
 
 alias original_start start
 def start
original_start
$game_map.fog_show
$game_map.fog_event
 end

 alias original_terminate terminate
 def terminate
original_terminate
$game_map.fog_hide
 end
 
end

class Game_Player < Game_Character
 
 alias original_perform_transfer perform_transfer
 def perform_transfer
original_perform_transfer
$game_map.setup_events
$game_map.fog_event
$game_map.fog_show
 end
 
end

class Game_Event < Game_Character

 def name
return @event.name
 end
 
 def selfswitch
key = [@map_id, @event.id, 'A']
return key
 end
 
end

 

 

 

Istruzioni per l'uso

- inserite la fog che volete nella cartella Graphics/Pictures (il file deve esser PNG)

- nella mappa dove volete far comparire la fog create un evento

- il nome dell'evento deve esser per forza FOG

- settate l'evento in modalità "processo paralello"

- tra i comandi evento fate un call scritp (chiama script) e mettete questo:

 

$game_temp.fog_name = "nome fog"
$game_temp.fog_zoom = 100
$game_temp.fog_sx = 0
$game_temp.fog_sy = 0
$game_temp.fog_target_opacity = 80
$game_map.fog_show

 

 

- tramite questi comandi potete muovere la fog (i comandi sx e xy), cambiare opacità e zoom.

- sempre tra i comandi, dopo il chiama script mettete un CONTROLLO SWITCH LOCALE A su ON.

- FINE (non dovete creare altre pagine!)

 

ulteriori personalizzazioni le trovate dentro lo script.

 

 

EDIT by EIKICHI: ho sistemato lo script e aggiunto le istruzioni

Edited by Eikichi
Link to comment
Share on other sites

  • 3 months later...
Istruzioni please! Come inserisco le fogs?

ThE GrEeN gObLiN oN lInE G.D.O. - Bunny Show - Onor

Beck

I've never dreamed before

I'm gonna knock the door

Into the world of perfect free

(You ain't no lonely!)

You're gonna say I'm lying

I'm gonna get the chance

I thought a chance is far from me

(You ain't no lonely!) ...

Link to comment
Share on other sites

  • 3 weeks later...

odio i cazzo di script postati così..... u.u

 

scusate, vi dò io le istruzioni:

 

- inserite la fog che volete nella cartella Graphics/Pictures (il file deve esser PNG)

- nella mappa dove volete far comparire la fog create un evento

- il nome dell'evento deve esser per forza FOG

- settate l'evento in modalità "processo paralello"

- tra i comandi evento fate un call scritp (chiama script) e mettete questo:

 

$game_temp.fog_name = "nome fog"
$game_temp.fog_zoom = 100
$game_temp.fog_sx = 0
$game_temp.fog_sy = 0
$game_temp.fog_target_opacity = 80
$game_map.fog_show

 

- tramite questi comandi potete muovere la fog (i comandi sx e xy), cambiare opacità e zoom.

- sempre tra i comandi, dopo il chiama script mettete un CONTROLLO SWITCH LOCALE A su ON.

- FINE (non dovete creare altre pagine!)

 

AH! RISCARICATE LO SCRIPT, è AGGIORNATO! (NON TRADOTTO)

Finrod, GDR PBF

2PV e 1PAEquip: - faretra con 20 frecce- arco lungo- pugnale comune- Armatura di cuoio- Torcia- Cappuccio

Mi sa che è ora di vincere qualche premio per rinnovare questa firma! :3Posizioni raggiunte nei contest

http://rpg2s.net/gif/SCContest3Oct.gifhttp://www.rpg2s.net/awards/bestresourCSist3.jpghttp://www.rpg2s.net/awards/mosthelpful2.jpghttp://www.rpg2s.net/awards/mostpresent2.jpg

 

 

 

Link to comment
Share on other sites

  • 3 weeks later...

assai strano...lo uso tranquillamente e non dà errore.

 

puoi esser più specifico riguardo l'errore?

 

screen magari....

 

hai altri script? perchè gli script dell'xp convertiti con il total converter vanno praticamente sempre in conflitto con altri script.

Finrod, GDR PBF

2PV e 1PAEquip: - faretra con 20 frecce- arco lungo- pugnale comune- Armatura di cuoio- Torcia- Cappuccio

Mi sa che è ora di vincere qualche premio per rinnovare questa firma! :3Posizioni raggiunte nei contest

http://rpg2s.net/gif/SCContest3Oct.gifhttp://www.rpg2s.net/awards/bestresourCSist3.jpghttp://www.rpg2s.net/awards/mosthelpful2.jpghttp://www.rpg2s.net/awards/mostpresent2.jpg

 

 

 

Link to comment
Share on other sites

scusate la mia ignoranza,,

 

ma qnt devo farla grande la fog?

 

io ho provato a farla grande come la mappa,,ma me la da sfalsalta,,xk??

Coming Soon

 

 

"...non hai bisogno di cercare, è tutto dentro di te..."

 

 

Contest

http://rpg2s.net/gif/SCContest1Oct.gifhttp://rpg2s.net/gif/SCContest1Oct.gifhttp://rpg2s.net/gif/SCContest1Oct.gifhttp://rpg2s.net/gif/SCContest2Oct.gifhttp://rpg2s.net/gif/SCContest3Oct.gifhttp://rpg2s.net/gif/SCContest3Oct.gifhttp://rpg2s.net/gif/SCContest3Oct.gif

 

http://i46.tinypic.com/2zof6dt.png

Link to comment
Share on other sites

  • 3 weeks later...
  • 2 weeks later...

purtroppo lo fa anche a me!

qualcuno mi aiutiiii! :sisi:

 

 

Partecipante al Rpg2s.net Game Contest 2008/2009

Gioco in Sviluppo:

Fantasy Chronicle

 

Sarica e commenta anche tu!

 

http://img120.imageshack.us/img120/3914/adlucariodd0.pnghttp://img74.imageshack.us/img74/8841/admariomc6.pnghttp://img177.imageshack.us/img177/8113/adzsamuszd3.pnghttp://img359.imageshack.us/img359/9097/adfalcoqq6.png

http://img382.imageshack.us/img382/3572/adlucasom6.pnghttp://img501.imageshack.us/img501/5646/adsnakepp3.png

 

http://team.ffonline.it/imgpersonaggio/cloud_it.jpghttp://team.ffonline.it/imgpersonaggio/cyan_it.jpghttp://team.ffonline.it/imgpersonaggio/steiner_it.jpg

 

Un tizio riguardo Mario Galaxy

 

io l'ho provato, molto divertente e colorato, ma nn c'entra nulla il termine "cpaolavoro" o "miglior gioco" x un gioco del genere, e ha se, nn puo essere paragonato a "veri" giochi del calibro di resident evil,tekken,gran turismo,rachet e clank,assassin's creed ecc.....

 

 

Link to comment
Share on other sites

Non ci si può fare niente, è un bug dello script. -.-

O meglio, si potrebbe fare qualcosa se qualcuno avesse voglia di sistemare lo script. ^^"

 

La soluzione più semplice è impedire il salvataggio nelle mappe in cui si usano le fogs: in questo modo l'errore viene "scansato".

Certo, se si usano le fog in ogni mappa può essere un grosso problema...

Screen Contest (by Sakura & Shuuchan):

http://rpg2s.net/gif/SCContest3Oct.gif http://rpg2s.net/gif/SCContest3Oct.gif http://rpg2s.net/gif/SCContest2Oct.gif

 

http://i67.servimg.com/u/f67/13/37/20/58/th/gc_r2s10.gif

Bacheca Premi

http://www.rpg2s.net/gif/GC_premio3.gif http://www.rpg2s.net/gif/GC_premio3.gif http://www.rpg2s.net/gif/GC_grafica3.gif http://www.rpg2s.net/gif/GC_grafica1.gif http://www.rpg2s.net/gif/GC_programmazione3.gif http://www.rpg2s.net/gif/GC_programmazione1.gif http://www.rpg2s.net/gif/GC_musica2.gif http://www.rpg2s.net/gif/GC_bestoftool1.gif

 

http://www.rpg2s.net/gif/GC_premio3.gif 3° classificato "Premio BS"

 

http://www.rpg2s.net/gif/GC_premio3.gif 3° classificato "Premio innovazione"

 

http://www.rpg2s.net/gif/GC_grafica3.gif 3° classificato "Miglior Grafica in assoluto"

 

http://www.rpg2s.net/gif/GC_grafica1.gif 1° classificato "Miglior Grafica RmVX"

 

http://www.rpg2s.net/gif/GC_programmazione3.gif 3° classificato "Miglior Programmazione in assoluto"

 

http://www.rpg2s.net/gif/GC_programmazione1.gif 1° classificato "Miglior Programmazione RmVX"

 

http://www.rpg2s.net/gif/GC_musica2.gif 2° classificato "Miglior Colonna Sonora"

 

http://www.rpg2s.net/gif/GC_bestoftool1.gif 1° classificato "Miglior Gioco RmVX"

http://i87.servimg.com/u/f87/13/37/20/58/banner10.png

Scarica la demo ver. 0.2:

RTP non incluse (19 MB) - richiede RMVX ver. 1.02 - Download

Versione completa (52 MB) - Download

Link to comment
Share on other sites

ma a questo punto è inutile,poi le fog si vedono nel menu e nella battaglia

 

 

Partecipante al Rpg2s.net Game Contest 2008/2009

Gioco in Sviluppo:

Fantasy Chronicle

 

Sarica e commenta anche tu!

 

http://img120.imageshack.us/img120/3914/adlucariodd0.pnghttp://img74.imageshack.us/img74/8841/admariomc6.pnghttp://img177.imageshack.us/img177/8113/adzsamuszd3.pnghttp://img359.imageshack.us/img359/9097/adfalcoqq6.png

http://img382.imageshack.us/img382/3572/adlucasom6.pnghttp://img501.imageshack.us/img501/5646/adsnakepp3.png

 

http://team.ffonline.it/imgpersonaggio/cloud_it.jpghttp://team.ffonline.it/imgpersonaggio/cyan_it.jpghttp://team.ffonline.it/imgpersonaggio/steiner_it.jpg

 

Un tizio riguardo Mario Galaxy

 

io l'ho provato, molto divertente e colorato, ma nn c'entra nulla il termine "cpaolavoro" o "miglior gioco" x un gioco del genere, e ha se, nn puo essere paragonato a "veri" giochi del calibro di resident evil,tekken,gran turismo,rachet e clank,assassin's creed ecc.....

 

 

Link to comment
Share on other sites

le fog si vedono nelle battaglie e nel menù? o.O

 

a me non lo fà...uhm.....

Finrod, GDR PBF

2PV e 1PAEquip: - faretra con 20 frecce- arco lungo- pugnale comune- Armatura di cuoio- Torcia- Cappuccio

Mi sa che è ora di vincere qualche premio per rinnovare questa firma! :3Posizioni raggiunte nei contest

http://rpg2s.net/gif/SCContest3Oct.gifhttp://www.rpg2s.net/awards/bestresourCSist3.jpghttp://www.rpg2s.net/awards/mosthelpful2.jpghttp://www.rpg2s.net/awards/mostpresent2.jpg

 

 

 

Link to comment
Share on other sites

Ragazzi, potete sostituire le fog con le picture..O almeno io faccio cosi..

Per adesso la mappa più grande che ho fatto è 30 x 35..Per le mappe basi ho usato le picture 544 x 416, con direzione x=0 Y=0 e trasparenza 70-80, dipende da come la volete voi..e per le mappe più grandi una picture 640 x 480 con gli stessi requisiti della prima, e inoltre non ho usato nessun processo parallelo, ti basta mettere nel teletrasporto della mappa principale il mostra picture..

http://www.freankexpo.net/signature/1129.png

2986.png

BIM_Banner3.png

Premi RpgMaker

 


http://www.rpg2s.net/forum/uploads/monthly_01_2017/msg-293-0-48316500-1483794996.jpghttp://www.rpg2s.net/dax_games/r2s_regali2.pngContesthttp://rpg2s.net/gif/SCContest1Oct.gifhttp://rpg2s.net/gif/SCContest3Oct.gifhttp://rpg2s.net/gif/SCContest2Oct.gifhttp://rpg2s.net/gif/SCContest3Oct.gifhttp://rpg2s.net/gif/SCContest3Oct.gifhttp://rpg2s.net/gif/SCContest3Oct.gifhttp://rpg2s.net/gif/SCContest2Oct.gifhttp://rpg2s.net/gif/SCContest3Oct.gifhttp://rpg2s.net/gif/SCContest1Oct.gifhttp://rpg2s.net/gif/SCContest2Oct.gif http://rpg2s.net/gif/SCContest1Oct.gif http://rpg2s.net/gif/SCContest2Oct.gif http://rpg2s.net/gif/SCContest2Oct.gifhttp://rpg2s.net/gif/SCContest1Oct.gifhttp://www.rpg2s.net/awards/bestpixel2.jpghttp://www.rpg2s.net/awards/bestresourCSist2.jpghttp://www.rpg2s.net/awards/mostproductive1.jpghttp://i42.servimg.com/u/f42/13/12/87/37/iconap13.pnghttp://i42.servimg.com/u/f42/13/12/87/37/iconap14.pnghttp://i42.servimg.com/u/f42/13/12/87/37/iconap15.pnghttp://i42.servimg.com/u/f42/13/12/87/37/iconap16.pnghttp://i42.servimg.com/u/f42/13/12/87/37/screen10.pnghttp://www.rpgmkr.net/contest/screen-contest-primo.pnghttp://www.makerando.com/forum/uploads/jawards/iconawards3.png

Link to comment
Share on other sites

si infatto lo avevo pensato anche io

 

 

Partecipante al Rpg2s.net Game Contest 2008/2009

Gioco in Sviluppo:

Fantasy Chronicle

 

Sarica e commenta anche tu!

 

http://img120.imageshack.us/img120/3914/adlucariodd0.pnghttp://img74.imageshack.us/img74/8841/admariomc6.pnghttp://img177.imageshack.us/img177/8113/adzsamuszd3.pnghttp://img359.imageshack.us/img359/9097/adfalcoqq6.png

http://img382.imageshack.us/img382/3572/adlucasom6.pnghttp://img501.imageshack.us/img501/5646/adsnakepp3.png

 

http://team.ffonline.it/imgpersonaggio/cloud_it.jpghttp://team.ffonline.it/imgpersonaggio/cyan_it.jpghttp://team.ffonline.it/imgpersonaggio/steiner_it.jpg

 

Un tizio riguardo Mario Galaxy

 

io l'ho provato, molto divertente e colorato, ma nn c'entra nulla il termine "cpaolavoro" o "miglior gioco" x un gioco del genere, e ha se, nn puo essere paragonato a "veri" giochi del calibro di resident evil,tekken,gran turismo,rachet e clank,assassin's creed ecc.....

 

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...