Jump to content
Rpg²S Forum

*Ciclo Giorno e Notte


friday666
 Share

Recommended Posts

  • Replies 75
  • Created
  • Last Reply

Top Posters In This Topic

Se ti serve un Giorno/Notte senza timer, affidati agli eventi: Trovi un tutorial nel Campus o nella guida di Losco individuo per fare un giorno notte. Esce anche un pò meglio perchè puoi settare Alba, tramonto, ecc.

Ok grazie, ad eventi lo so fare perchè l'avevo già messo in un vecchio progetto nel 2k. :biggrin:

Link to comment
Share on other sites

Descrizione

Si capisce dal titolo...ciclo giorno e notte

 

Autore

GAM...con mie modifiche al solito

 

Istruzioni per l'uso

Al posto di Sprite_Timer metti questo script:

 

 

#====================================================================

# ** Sprite_Clock
#-------------------------------------------------------------------
# This sprite is used to display the clock. It observes the

$game_system
# class and automatically changes sprite conditions.
# Compiled by GAM modificato da Friday
#==================================================

class Sprite_Timer < Sprite
	
	
	#-----------------------------------------------------------------
	# * Object Initialization
	#-----------------------------------------------------------------
	def initialize
		super
		self.bitmap = Bitmap.new(88, 48)
		self.bitmap.font.name = \"Arial\" #Replace with whatever font you
		
		want
		self.bitmap.font.size = 32
		self.x = 640 - self.bitmap.width
		self.y = 0
		self.z = 500
		update
	end
	#-----------------------------------------------------------------
	# * Dispose
	#-----------------------------------------------------------------
	def dispose
		if self.bitmap != nil
			self.bitmap.dispose
		end
		super
	end
	#-----------------------------------------------------------------
	# * Frame Update
	#-----------------------------------------------------------------
	def update
		super
		self.visible = true
		if Graphics.frame_count / Graphics.frame_rate != @total_sec
			@total_sec = Graphics.frame_count / Graphics.frame_rate #
			
			mod this line to change speed of clock
			$min = @total_sec / 60 % 24
			@sec = @total_sec % 60
			
			
			if $min == 00
				$night = 1
				$game_variables[3]+=1
			end
			
			
			if $min == 12
				$night = 2
			end
			
			#----------------------------------------------------------------
			# Inside/Outside
			# Day / Night
			# mod these for different tones, faster/slower tones,
			# or more tones
			#----------------------------------------------------------------
			if $game_switches[1] #==true
				$game_screen.start_tone_change(Tone.new(0,0,0), 5)
			else
				if $min < 5
					$game_screen.start_tone_change(Tone.new(-170,-170,68), 20)
				elsif $min >= 5 and $min < 7
					$game_screen.start_tone_change(Tone.new(-51,-102,-102), 20)
				elsif $min >= 7 and $min < 9
					$game_screen.start_tone_change(Tone.new(0,-51,-68), 20)
				elsif $min >= 9 and $min < 18
					$game_screen.start_tone_change(Tone.new(0,0,0), 20)
				elsif $min >= 18 and $min < 21
					$game_screen.start_tone_change(Tone.new(-34,-68,-119), 20)
				elsif $min >= 21
					$game_screen.start_tone_change(Tone.new(-170,-170,68), 20)
					
					
				end
			end
			
			#----------------------------------------------------------------
			# Am / Pm
			# 
			#---------------------------------------------------------------- 
			
			
			if $night == 2
				ampm = \" PM\"
				mins = $min - 12
				$day = 0
			else
				ampm = \" AM\"
				mins = $min
				
				
			end
			
			#----------------------------------------------------------------
			# Makes the clock more clock looking
			#
			#---------------------------------------------------------------- 
			
			if $min == 0 or $min == 12
				mins = 12
			end
			if $min == 10
				clock = sprintf(\"d:d\", mins, @sec)
			elsif $min == 11
				clock = sprintf(\"d:d\", mins, @sec)
			elsif $min == 12
				clock = sprintf(\"d:d\", mins, @sec)
			else
				clock = sprintf(\"d:d\", mins, @sec)
			end
			clock += ampm
			
			
			$clock = clock
			# Clear window contents
			self.bitmap.clear
			if $clock != nil
				text = clock
				# Draw clock
				self.bitmap.font.color.set(255, 255, 255)
				self.bitmap.draw_text(self.bitmap.rect, text, 1)
				@timer = clock
			end
		end
	end
	
end

 

 

 

 

Poi sostituite Window_PlayTime con questo, dovrebbe sostituire il menù \"Play time\" con il menù \"World Clock\".

 

 

class Window_PlayTime < Window_Base
	#-----------------------------------------------------------------
	# * Object Initialization
	#-----------------------------------------------------------------
	def initialize
		super(0, 0, 160, 96)
		self.contents = Bitmap.new(width - 32, height - 32)
		refresh
	end
	#-----------------------------------------------------------------
	# * Refresh
	#-----------------------------------------------------------------
	def refresh
		self.contents.clear
		self.contents.font.color = system_color
		self.contents.draw_text(4, 0, 120, 32, \"World Clock\")
		@total_sec = Graphics.frame_count / Graphics.frame_rate
		$min = @total_sec / 60 % 24
		@sec = @total_sec % 60
		
		if $min == 00
			$night = 1
			$day =+ 1
		end
		
		if $min == 12
			$night = 2
		end
		
		
		if $night == 2
			ampm = \" PM\"
			mins = $min - 12
		else
			ampm = \" AM\"
			mins = $min
		end
		
		if $min == 0 or $min == 12
			mins = 12
		end
		
		
		
		if $min == 10
			clock = sprintf(\"d:d\", mins, @sec)
		elsif $min == 11
			clock = sprintf(\"d:d\", mins, @sec)
		elsif $min == 12
			clock = sprintf(\"d:d\", mins, @sec)
		else
			clock = sprintf(\"d:d\", mins, @sec)
		end
		clock += ampm
		self.contents.font.color = normal_color
		self.contents.draw_text(4, 32, 120, 32, clock, 2)
		$clock = clock
	end
	
	#-----------------------------------------------------------------
	# * Frame Update
	#-----------------------------------------------------------------
	
	def update
		super
		if Graphics.frame_count / Graphics.frame_rate != @total_sec
			refresh
		end
	end
end

 

 

Link to comment
Share on other sites

Link to comment
Share on other sites

  • 3 weeks later...

come posso iniziare il gioco di giorno?

cioè quali impostazioni devo cambiare per far diventare giorno??(xkè il gioco inizia quando c'è buio!!!:rovatfl:)

"Chi ha paura muore ogni giorno, chi ha coraggio muore una volta soltanto.."
Battler Bs Minkoff/CTB Qui (In continuo aggiornamento)


Giochi in sviluppo: Gioco Horror (titolo?)

Trama:||||||||||

Grafica:||||||||||
Mapping:||||||||||
Script:||||||||||

Programmazione ad Eventi:||||||||||
Database:||||||||||
Demo:||||||||||
Completamento:|||||||||| 32%

Link to comment
Share on other sites

  • 4 weeks later...
Per far iniziare il gioco di giorno basta mettere lo switch attivo, invece per togliere il timer basta emttere False al posto di true nella riga 42 : self.visible = true---->>>self.visible = false
Link to comment
Share on other sites

io metto la switch 1 on in proces parallel e mi da le 12:00AM(solo ke mi da di giorno.

Ora se io voglio farlo passare alla notte che devo fare ma sopratutto come faccio a far si che le ore passino avanti

ESEMPIO:

15:00 io vado a dormire e si fanno le 17:00.

 

Si puo fare con lo script?

 

P.S:Questa è molto complicata a rispondere.

Link to comment
Share on other sites

  • 1 month later...
  • 3 months later...
a me dà errore sulla window play time, mi dice: syntaxerror sulla linea 18 :( ma che devo fare???
Link to comment
Share on other sites

  • 2 weeks later...
  • 2 weeks later...
  • 1 month later...

Scusate ma ho provato in tutti i modi ...ma mi dice sempre Error a Window_PlayTime riga 18 (SyntaxError)

 

 

cosa devo fare??

Oltre a quell'errore , ce ne sono diversi , tutti di sintassi . Prova cosi :

 

Da inserire al posto di " Sprite_Timer " :

#====================================================================

# ** Sprite_Clock
#-------------------------------------------------------------------
# This sprite is used to display the clock. It observes the

$game_system
# class and automatically changes sprite conditions.
# Compiled by GAM modificato da Friday
#==================================================

class Sprite_Timer < Sprite
	
	
	#-----------------------------------------------------------------
	# * Object Initialization
	#-----------------------------------------------------------------
	def initialize
		super
		self.bitmap = Bitmap.new(88, 48)
		self.bitmap.font.name = "Arial" #Replace with whatever font you
		
		self.bitmap.font.size = 32
		self.x = 640 - self.bitmap.width
		self.y = 0
		self.z = 500
		update
	end
	#-----------------------------------------------------------------
	# * Dispose
	#-----------------------------------------------------------------
	def dispose
		if self.bitmap != nil
			self.bitmap.dispose
		end
		super
	end
	#-----------------------------------------------------------------
	# * Frame Update
	#-----------------------------------------------------------------
	def update
		super
		self.visible = true
		if Graphics.frame_count / Graphics.frame_rate != @total_sec
			@total_sec = Graphics.frame_count / Graphics.frame_rate
			$min = @total_sec / 60 % 24
			@sec = @total_sec % 60
			
			
			if $min == 00
				$night = 1
				$game_variables[3]+=1
			end
			
			
			if $min == 12
				$night = 2
			end
			
			#----------------------------------------------------------------
			# Inside/Outside
			# Day / Night
			# mod these for different tones, faster/slower tones,
			# or more tones
			#----------------------------------------------------------------
			if $game_switches[1] #==true
				$game_screen.start_tone_change(Tone.new(0,0,0), 5)
			else
				if $min < 5
					$game_screen.start_tone_change(Tone.new(-170,-170,68), 20)
				elsif $min >= 5 and $min < 7
					$game_screen.start_tone_change(Tone.new(-51,-102,-102), 20)
				elsif $min >= 7 and $min < 9
					$game_screen.start_tone_change(Tone.new(0,-51,-68), 20)
				elsif $min >= 9 and $min < 18
					$game_screen.start_tone_change(Tone.new(0,0,0), 20)
				elsif $min >= 18 and $min < 21
					$game_screen.start_tone_change(Tone.new(-34,-68,-119), 20)
				elsif $min >= 21
					$game_screen.start_tone_change(Tone.new(-170,-170,68), 20)
					
					
				end
			end
			
			#----------------------------------------------------------------
			# Am / Pm
			# 
			#---------------------------------------------------------------- 
			
			
			if $night == 2
				ampm = " PM"
				mins = $min - 12
				$day = 0
			else
				ampm = "AM"
				mins = $min
				
				
			end
			
			#----------------------------------------------------------------
			# Makes the clock more clock looking
			#
			#---------------------------------------------------------------- 
			
			if $min == 0 or $min == 12
				mins = 12
			end
			if $min == 10
				clock = sprintf("d:d", mins, @sec)
			elsif $min == 11
				clock = sprintf("d:d", mins, @sec)
			elsif $min == 12
				clock = sprintf("d:d", mins, @sec)
			else
				clock = sprintf("d:d", mins, @sec)
			end
			clock += ampm
			
			
			$clock = clock
			# Clear window contents
			self.bitmap.clear
			if $clock != nil
				text = clock
				# Draw clock
				self.bitmap.font.color.set(255, 255, 255)
				self.bitmap.draw_text(self.bitmap.rect, text, 1)
				@timer = clock
			end
		end
	end
	
end

 

 

 

 

Da inserire al posto di "Window_PlayTime" :

 

class Window_PlayTime < Window_Base
	#-----------------------------------------------------------------
	# * Object Initialization
	#-----------------------------------------------------------------
	def initialize
		super(0, 0, 160, 96)
		self.contents = Bitmap.new(width - 32, height - 32)
		refresh
	end
	#-----------------------------------------------------------------
	# * Refresh
	#-----------------------------------------------------------------
	def refresh
		self.contents.clear
		self.contents.font.color = system_color
		self.contents.draw_text(4, 0, 120, 32, "World Clock")
		@total_sec = Graphics.frame_count / Graphics.frame_rate
		$min = @total_sec / 60 % 24
		@sec = @total_sec % 60
		
		if $min == 00
			$night = 1
			$day =+ 1
		end
		
		if $min == 12
			$night = 2
		end
		
		
		if $night == 2
			ampm = " PM"
			mins = $min - 12
		else
			ampm = " AM"
			mins = $min
		end
		
		if $min == 0 or $min == 12
			mins = 12
		end
		
		
		
		if $min == 10
			clock = sprintf("d:d", mins, @sec)
		elsif $min == 11
			clock = sprintf("d:d", mins, @sec)
		elsif $min == 12
			clock = sprintf("d:d", mins, @sec)
		else
			clock = sprintf("d:d", mins, @sec)
		end
		clock += ampm
		self.contents.font.color = normal_color
		self.contents.draw_text(4, 32, 120, 32, clock, 2)
		$clock = clock
	end
	
	#-----------------------------------------------------------------
	# * Frame Update
	#-----------------------------------------------------------------
	
	def update
		super
		if Graphics.frame_count / Graphics.frame_rate != @total_sec
			refresh
		end
	end
end
Edited by Guardian of Irael

Screen Contest

 

 

 

http://img825.imageshack.us/img825/4307/sccontest3oct.gif X 2

 

Progetti

 

Gioco in sviluppo: Decay.

Team: http://img230.imageshack.us/img230/3668/decasoft1.png

( MasterSion,Mercury,SimonRPG )

Direct Link:Decay-project

 

 

Tool : RpgMaker VX

http://img189.imageshack.us/img189/6131/bannnova.jpg

 

Titolo : Nova Planet

Status : Lento

In cerca di un qualsiasi tipo di aiuto per dividere il lavoro

 

in gemellaggio con :

http://img21.imageshack.us/img21/5763/banner10p.png

Link to comment
Share on other sites

  • 2 months later...
mettendo a On la switch 1

Per qualsiasi motivo non aprite questo spoiler.

 

 

Ho detto di non aprirlo !

 

 

Se lo apri ancora esplode il mondo.

 

 

Aaaaaa è un vizio.

 

 

Contento? Il mondo è esploso, sono tutti morti

per colpa della tua curiosità .

 

 

Vuoi che ti venga anche il morbillo, la varicella e l'AIDS???

 

 

O bravo ora sei un malato terminale e nessuno

ti puo curare, sono tutti morti !

 

 

Se clicchi ancora una volta il PC esplode.

 

 

E dai smettila !!

 

Uff!! Hai cliccato tante volte che ho dovuto sostituirlo con un codebox.

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

http://s8.postimg.org/yntv9nxld/Banner.png

http://img204.imageshack.us/img204/8039/sccontest3octpl3.gif

Link to comment
Share on other sites

  • 2 months later...

cerca queste riga nel codice

$game_screen.start_tone_change

cambiando i 3 valori all'interno delle parentis cambi il colore in ordine sono Red-Green-Blue

http://img256.imageshack.us/img256/7639/ihateyou.gif

Un uomo senza religione è come un pesce senza bicicletta.

http://img18.imageshack.us/img18/3668/decasoft1.png

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

Link to comment
Share on other sites

grazie mille!^^

Ho provato ma non cambia nulla. Questa e' la sezione dello script:

 

if $game_switches[1] #==true

$game_screen.start_tone_change(Tone.new(0,0,0), 5)

else

if $min < 5

$game_screen.start_tone_change(Tone.new(-170,-170,68), 20)

elsif $min >= 5 and $min < 7

$game_screen.start_tone_change(Tone.new(-51,-102,-102), 20)

elsif $min >= 7 and $min < 9

$game_screen.start_tone_change(Tone.new(0,-51,-68), 20)

elsif $min >= 9 and $min < 18

$game_screen.start_tone_change(Tone.new(0,0,0), 20)

elsif $min >= 18 and $min < 21

$game_screen.start_tone_change(Tone.new(-34,-68,-119), 20)

elsif $min >= 21

$game_screen.start_tone_change(Tone.new(-170,-170,68), 20)

 

 

La prima volta ho provato sulla prima parentesi con gli zeri ma non e' cambiato nulla, idem per entrambe,sia quella iniziale che quella sopra 18-21...o.o

Edited by The_Grey
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...