AccueilAccueil  PortailPortail  RechercherRechercher  Dernières imagesDernières images  S'enregistrerS'enregistrer  ConnexionConnexion  



Le Deal du moment : -29%
PC portable – MEDION 15,6″ FHD Intel i7 ...
Voir le deal
499.99 €

Partagez
 

 [VX] Système de Radio

Voir le sujet précédent Voir le sujet suivant Aller en bas 
AuteurMessage
sangy30
Va-nu-pieds Lv.4
Va-nu-pieds Lv.4
sangy30


Masculin Age : 32
Inscrit le : 05/06/2011
Messages : 59

[VX] Système de Radio Empty
MessageSujet: [VX] Système de Radio   [VX] Système de Radio Icon_minitimeVen 2 Mar 2012 - 23:48

Nom du script : Radio

Auteur : Jet10985 ou Jet

Ce script permet de créés une radio dans votre jeu.

le script
Spoiler:
Dans ce scripte ce propose a vous trois commende de script

la première : new_station(name) qui vous permet de crée une nouvelle station
(replacé name par le nom choisie)

la seconde : stop_radio qui vous permet d'arrêté la radio

la dernière : $scene = Scene_Radio.new qui permet d'ouvrir le menus de la radio

Spoiler:
Ceux-ci sont les noms des musiques qui passe dans votre radio les chiffres qui se trouve à la fin est le temps que dure la musique

Spoiler:
sur la première et deuxième ligne se trouvent les noms des stations de radio puis les chiffre à la fin des lignes sont les musiques que passent les radios les musiquent sont a métré dans le dossier BGS

Une image ingame
Spoiler:

démos
http://www.sendspace.com/file/aji19z
Revenir en haut Aller en bas
guillaumeducrotoy
Va-nu-pieds Lv.4
Va-nu-pieds Lv.4
guillaumeducrotoy


Masculin Age : 34
Inscrit le : 14/10/2010
Messages : 59

[VX] Système de Radio Empty
MessageSujet: Re: [VX] Système de Radio   [VX] Système de Radio Icon_minitimeMar 7 Aoû 2012 - 12:35

Bonjour, ton script ne marche pas. Quand je veux l'utiliser il me met un message d'erreur:

Line 202 SyntaxError occurred
Voci la ligne en question (en rouge)

@help_window = Window_Help.new
if $game_radio.playing_station.nil?
@help_window.set_text("Current Station: Radio is Off.", 1)
else
@help_window.set_text("Current Station: " $game_radio.playing_station, 1)
end
create_menu_background
create_command_window
end
Revenir en haut Aller en bas
Zangther
Maître des Duels
Maître des Duels
Zangther


Masculin Age : 31
Inscrit le : 29/07/2009
Messages : 7840

[VX] Système de Radio Empty
MessageSujet: Re: [VX] Système de Radio   [VX] Système de Radio Icon_minitimeMar 7 Aoû 2012 - 12:39

Remplace cette ligne par @help_window.set_text("Current Station: #{$game_radio.playing_station}", 1)
Revenir en haut Aller en bas
guillaumeducrotoy
Va-nu-pieds Lv.4
Va-nu-pieds Lv.4
guillaumeducrotoy


Masculin Age : 34
Inscrit le : 14/10/2010
Messages : 59

[VX] Système de Radio Empty
MessageSujet: Re: [VX] Système de Radio   [VX] Système de Radio Icon_minitimeMar 7 Aoû 2012 - 12:59

quand je fais news station il me met ca
[img][VX] Système de Radio Sans_t10[/img]
Revenir en haut Aller en bas
guillaumeducrotoy
Va-nu-pieds Lv.4
Va-nu-pieds Lv.4
guillaumeducrotoy


Masculin Age : 34
Inscrit le : 14/10/2010
Messages : 59

[VX] Système de Radio Empty
MessageSujet: Re: [VX] Système de Radio   [VX] Système de Radio Icon_minitimeMar 7 Aoû 2012 - 13:09

Je n'arrive pas à accéder à ta démo.
Revenir en haut Aller en bas
guillaumeducrotoy
Va-nu-pieds Lv.4
Va-nu-pieds Lv.4
guillaumeducrotoy


Masculin Age : 34
Inscrit le : 14/10/2010
Messages : 59

[VX] Système de Radio Empty
MessageSujet: Re: [VX] Système de Radio   [VX] Système de Radio Icon_minitimeMar 7 Aoû 2012 - 14:24

Je n'arrive pas à accéder à ta démo.

j'ai mis des guillemet et il me met ca

[VX] Système de Radio Sans_t11

la ligne en question
def random_song
station = RADIO_STATIONS[@playing_station]
song = RADIO_SONGS[station[rand(station.size)]]
@song_index = song
return song[0]
Revenir en haut Aller en bas
guillaumeducrotoy
Va-nu-pieds Lv.4
Va-nu-pieds Lv.4
guillaumeducrotoy


Masculin Age : 34
Inscrit le : 14/10/2010
Messages : 59

[VX] Système de Radio Empty
MessageSujet: Re: [VX] Système de Radio   [VX] Système de Radio Icon_minitimeMar 7 Aoû 2012 - 14:41

#===============================================================================
# Radio
# By Jet10985 (Jet)
#===============================================================================
# This script will allow you to have a radio in your game. This means players
# can tune into radio stations and listen to random audio tracks.
# This script has: 3 customization option.
#===============================================================================
# Overwritten Methods:
# None
#-------------------------------------------------------------------------------
# Aliased methods:
# Scene_Title: create_game_objects
# Scene_Base: update
# Game_System: initialize
#===============================================================================
=begin
How to unlock new stations:

to give the player a new station to listen to, use the following code in
an event "Script..." command:

new_station(name)

name = THE EXACT NAME (puncuation like caps, commas and such must be the same)
of a station created in the config below.
--------------------------------------------------------------------------------
How to stop the Radio:

to stop the radio (for like, an event or something), use the following code
in an event "Script..." command:

stop_radio
--------------------------------------------------------------------------------
Calling the radio:

To call up the radio screen, enter this in an event "Script..." command:

$scene = Scene_Radio.new
=end


module JetRadio

RADIO_SONGS = [] # Don't Touch

RADIO_STATIONS = {} # Don't touch

# Below is the config for songs that can be played on certain stations.
# The config follows the following format:
# RADIO_SONGS[next_index] = ["Song name", "song length"]
# next_index is just the next number in the sequence. See Examples.
# "Song name" is the song name (duh!) make sure it s in quotes.
# "song length" is the song length (again, DUH!) it needs to be like this:
# "minutes:seconds" See examples.
RADIO_SONGS[0] = ["02 Piste 2", "5:52"]
RADIO_SONGS[1] = ["SONG 2", "2:46"]
RADIO_SONGS[2] = ["SONG 3", "2:46"]
RADIO_SONGS[3] = ["SONG 4", "2:46"]
RADIO_SONGS[4] = ["SONG 5", "2:46"]
RADIO_SONGS[5] = ["SONG 6", "2:46"]
RADIO_SONGS[6] = ["SONG 7", "2:46"]
RADIO_SONGS[7] = ["SONG 8", "2:46"]
RADIO_SONGS[8] = ["SONG 9", "2:46"]
RADIO_SONGS[9] = ["SONG 10", "2:46"]
RADIO_SONGS[10] = ["SONG 11", "2:46"]

# Below is the config for different radio stations.
# The config follows the following format:
# RADIO_STATIONS["Name of Station"]
RADIO_STATIONS["Radio 1"] = [0, 1, 2, 5]
RADIO_STATIONS["Radio 2"] = [7, 4, 5, 6, 3]

# These are what stations are already unlocked by default.
# These names HAVE TO BE EXACTLY WHAT YOU NAMED THE STATIONS ABOVE!
STATIONS_AUTOMATICALLY_UNLOCKED = ["Radio 1", "Radio 2"]

end

#===============================================================================
# DON'T EDIT FURTHER UNLESS YOU KNOW WHAT TO DO.
#===============================================================================
class Scene_Title

alias jet4682_create_game_objects create_game_objects unless $@
def create_game_objects
jet4682_create_game_objects
$game_radio = Game_Radio.new
end
end

class Scene_Base

alias jet1111_update update unless $@
def update
jet1111_update
$game_radio.update unless $game_radio.nil?
end
end

class Game_System

attr_accessor :unlocked_stations

alias jet6482_initialize initialize unless $@
def initialize
jet6482_initialize
@unlocked_stations = ["Turn off Radio"]
JetRadio::STATIONS_AUTOMATICALLY_UNLOCKED
end
end

class Game_Interpreter

def stop_radio
RPG::BGS.stop if !$game_radio.playing_song.nil?
$game_radio.playing_song = nil
$game_radio.playing_station = nil
end

def new_station(name)
$game_system.unlocked_stations.push(name)
end
end

class Game_Radio

include JetRadio

attr_accessor :playing_station
attr_accessor :playing_song
attr_accessor :song_playing_for
attr_accessor :song_index

def initialize
@playing_station = nil
@playing_song = nil
@song_playing_for = 0
@song_index = []
end

def update
if !@playing_song.nil? && !@playing_station.nil?
update_playing_song
end
end

def playing_song_length
minutes = @song_index[1].split(":")[0].to_i * 60
seconds = @song_index[1].split(":")[1].to_i
return minutes seconds
end

def random_song
station = RADIO_STATIONS[@playing_station]
song = RADIO_SONGS[station[rand(station.size)]]
@song_index = song
return song[0]
end

def update_playing_song
@song_playing_for = 1
if @song_playing_for == playing_song_length * 60
RPG::BGS.stop
@playing_song = RPG::BGS.new(random_song, 80, 100)
@playing_song.play
end
end

def change_station(station)
if station.nil?
RPG::BGS.stop if !@playing_song.nil?
@playing_song = nil
@playing_station = nil
elsif @playing_station != station
RPG::BGS.stop if @playing_song != nil
@playing_station = station
@playing_song = RPG::BGS.new(random_song, 80, 100)
@playing_song.play
end
end

def stop_radio
RPG::BGS.stop if !@playing_song.nil?
@playing_song = nil
@playing_station = nil
end
end

class Scene_Radio < Scene_Base

def initialize
@came_from = $scene.class.to_s
end

def start
super
@help_window = Window_Help.new
if $game_radio.playing_station.nil?
@help_window.set_text("Current Station: Radio is Off.", 1)
else
@help_window.set_text("Current Station: #{$game_radio.playing_station}", 1)
end
create_menu_background
create_command_window
end

def create_command_window
@command_window = Window_Command.new(170, $game_system.unlocked_stations)
@command_window.x = Graphics.width / 2 - @command_window.width / 2
@command_window.y = Graphics.height / 2 - @command_window.height / 2
end

def update_command_window
@command_window.update
if Input.trigger?(Input::B)
Sound.play_cancel
return_scene
elsif Input.trigger?(Input::C)
if @command_window.index == 0
$game_radio.change_station(nil)
@help_window.set_text("Current Station: Radio is Off.",
1)
else
$game_radio.change_station(
@command_window.commands[@command_window.index])
@help_window.set_text("Current Station: #{$game_radio.playing_station}", 1)
end
end
end

def return_scene
eval("$scene = #{@came_from}.new()")
end

def update
super
update_menu_background
update_command_window
end

def terminate
super
dispose_menu_background
@command_window.dispose
@help_window.dispose
end
end

Voici le script tel qu'il estdans mon jeu. Peux tu m'aider?
Revenir en haut Aller en bas
Contenu sponsorisé




[VX] Système de Radio Empty
MessageSujet: Re: [VX] Système de Radio   [VX] Système de Radio Icon_minitime

Revenir en haut Aller en bas
 

[VX] Système de Radio

Voir le sujet précédent Voir le sujet suivant Revenir en haut 
Page 1 sur 1

 Sujets similaires

-
» Un système de forge (système de minage à venir)
» Votre Radio préférée.
» Systéme de vie
» [VX] Système de tente a la FF7
» [VX] Système de Réincarnation

Permission de ce forum:Vous ne pouvez pas répondre aux sujets dans ce forum
RPG Maker VX :: Entraide :: Scripts :: Scripts VX - RGSS2 :: Divers-
Créer un forum | ©phpBB | Forum gratuit d'entraide | Signaler un abus | Forum gratuit