Make & Graph
Vous souhaitez réagir à ce message ? Créez un compte en quelques clics ou connectez-vous pour continuer.
Le deal à ne pas rater :
Réassort du coffret Pokémon 151 Électhor-ex : où l’acheter ?
Voir le deal

Vous n'êtes pas connecté. Connectez-vous ou enregistrez-vous

Le nom du hero

4 participants

Aller en bas  Message [Page 1 sur 1]

1RPG Maker XP Le nom du hero Ven 31 Oct - 12:10

senin jiraya

avatar
Membre
Membre

Permet au joueur d ecrire le nom du hero.
Auteur:Moghunter
Coller ce script au dessu de main:
Code:
#_______________________________________________________________________________
# MOG_Scene_Name V1.1         
#_______________________________________________________________________________
# By Moghunter   
# http://www.atelier-rgss.com
#_______________________________________________________________________________
# Scene Name com layout e movimento.
# (Crie seu próprio estilo.)
#_______________________________________________________________________________
module MOG
# Tempo de transição.
MSNTT1 = 30
# Definição do tipo de transição.
MSNTT2 = "004-Blind04"
end
$mogscript = {} if $mogscript == nil
$mogscript["MOG_Scene_Name"] = true
###############
# Window_Base #
###############
class Window_Base < Window
def draw_battler(actor,x,y)
battler = RPG::Cache.battler(actor.battler_name, actor.battler_hue)
cw = battler.width
ch = battler.height
src_rect = Rect.new(0, 0, cw, ch)
self.contents.blt(x , y - ch, battler, src_rect)   
end
def draw_actor_level_name(actor, x, y)
self.contents.font.color = normal_color
self.contents.draw_text(x , y, 24, 32, actor.level.to_s, 1)
end
def draw_actor_class_name(actor, x, y)
self.contents.font.color = normal_color
self.contents.draw_text(x, y, 120, 32, actor.class_name,1)
end
def draw_actr_name(actor, x, y)
self.contents.font.color = normal_color
self.contents.draw_text(x, y, 120, 32, actor.name,1)
end
end
######################
# Window_Status_Name #
######################
class Window_Status_Name < Window_Base
def initialize(actor)
super(0, 0, 320, 480)
self.contents = Bitmap.new(width - 32, height - 32)
self.contents.font.name = "Georgia"
@actor = actor
self.opacity = 0
refresh
end
def refresh
self.contents.clear
draw_actor_graphic(@actor, 50, 110)
draw_actor_class_name(@actor, 55, 395)
draw_actor_level_name(@actor, 20, 120)
draw_battler(@actor, 20, 350)
end
end
####################
# Window_NameEdit2 #
####################
class Window_NameEdit2 < Window_Base
attr_reader  :name                 
attr_reader  :index                 
def initialize(actor, max_char)
super(0, 25, 640, 128)
self.contents = Bitmap.new(width - 32, height - 32)
@actor = actor
@name = actor.name
@max_char = max_char
name_array = @name.split(//)[0...@max_char]
@name = ""
for i in 0...name_array.size
@name += name_array[i]
end
@default_name = @name
@index = name_array.size
refresh
update_cursor_rect
end
def restore_default
@name = @default_name
@index = @name.split(//).size
refresh
update_cursor_rect
end
def add(character)
if @index < @max_char and character != ""
@name += character
@index += 1
refresh
update_cursor_rect
end
end
def back
if @index > 0
name_array = @name.split(//)
@name = ""
for i in 0...name_array.size-1
@name += name_array[i]
end
@index -= 1
refresh
update_cursor_rect
end
end
def refresh
self.contents.clear
name_array = @name.split(//)
for i in 0...@max_char
c = name_array[i]
if c == nil
c = "_"
end
x = 320 - @max_char * 14 + i * 28
self.contents.draw_text(x + 32, 64, 28, 32, c, 1)
end
draw_actr_name(@actor, 295, 20)
end
def update_cursor_rect
x = 320 - @max_char * 14 + @index * 28
self.cursor_rect.set(x + 32, 64, 28, 32)
end
def update
super
update_cursor_rect
end
end
#####################
# Window_NameInput2 #
#####################
class Window_NameInput2 < Window_Base
CHARACTER_TABLE =
[
"A","B","C","D","E",
"F","G","H","I","J",
"K","L","M","N","O",
"P","Q","R","S","T",
"U","V","W","X","Y",
"Z",""," "," "," ",
"+","-","*","/","!",
"1","2","3","4","5",
"" ,"" ,"" ,"" ,"" ,
"a","b","c","d","e",
"f","g","h","i","j",
"k","l","m","n","o",
"p","q","r","s","t",
"u","v","w","x","y",
"z"," "," "," "," ",
"#","$","%","&","@",
"6","7","8","9","0",
"" ,"" ,"" ,"" ,"" ,
]
def initialize
super(64, 140, 640, 352)
self.contents = Bitmap.new(width - 32, height - 32)
@index = 0
refresh
update_cursor_rect
end
def character
return CHARACTER_TABLE[@index]
end
def refresh
self.contents.clear
for i in 0...90
x = 140 + i / 5 / 9 * 180 + i % 5 * 32
y = i / 5 % 9 * 32
self.contents.draw_text(x, y, 32, 32, CHARACTER_TABLE[i], 1)
end
self.contents.draw_text(428, 9 * 32, 48, 32, "OK", 1)
end
def update_cursor_rect
if @index >= 90
self.cursor_rect.set(428, 9 * 32, 48, 32)
else
x = 140 + @index / 5 / 9 * 180 + @index % 5 * 32
y = @index / 5 % 9 * 32
self.cursor_rect.set(x, y, 32, 32)
end
end
def update
super
if @index >= 90
if Input.trigger?(Input::DOWN)
$game_system.se_play($data_system.cursor_se)
@index -= 90
end
if Input.repeat?(Input::UP)
$game_system.se_play($data_system.cursor_se)
@index -= 90 - 40
end
else
if Input.repeat?(Input::RIGHT)
if Input.trigger?(Input::RIGHT) or
@index / 45 < 3 or @index % 5 < 4
$game_system.se_play($data_system.cursor_se)
if @index % 5 < 4
@index += 1
else
@index += 45 - 4
end
if @index >= 90
@index -= 90
end
end
end
if Input.repeat?(Input::LEFT)
if Input.trigger?(Input::LEFT) or
@index / 45 > 0 or @index % 5 > 0
$game_system.se_play($data_system.cursor_se)
if @index % 5 > 0
@index -= 1
else
@index -= 45 - 4
end
if @index < 0
@index += 90
end
end
end
if Input.repeat?(Input::DOWN)
$game_system.se_play($data_system.cursor_se)
if @index % 45 < 40
@index += 5
else
@index += 90 - 40
end
end
if Input.repeat?(Input::UP)
if Input.trigger?(Input::UP) or @index % 45 >= 5
$game_system.se_play($data_system.cursor_se)
if @index % 45 >= 5
@index -= 5
else
@index += 90
end
end
end
if Input.repeat?(Input::L) or Input.repeat?(Input::R)
$game_system.se_play($data_system.cursor_se)
if @index < 45
@index += 45
else
@index -= 45
end
end
end
update_cursor_rect
end
end
##############
# Scene_Name #
##############
class Scene_Name
def main
@actor = $game_actors[$game_temp.name_actor_id]
@edit_window = Window_NameEdit2.new(@actor, $game_temp.name_max_char)
@edit_window.opacity = 0
@input_window = Window_NameInput2.new
@input_window.opacity = 0
@name_back = Plane.new
@name_back.bitmap = RPG::Cache.picture("MN_BK")
@name_back.z = 10
@name_back.opacity = 255
@name_lay = Plane.new
@name_lay.bitmap = RPG::Cache.picture("Name_Lay")
@name_lay.z = 15
@name_lay.opacity = 255
@name_status_window = Window_Status_Name.new(@actor)
@name_status_window.x -= 300
@name_status_window.contents_opacity = 0
Graphics.transition(MOG::MSNTT1, "Graphics/Transitions/" + MOG::MSNTT2)
loop do
Graphics.update
Input.update
update
if $scene != self
break
end
end
Graphics.freeze
@edit_window.dispose
@input_window.dispose
@name_back.dispose
@name_lay.dispose
@name_status_window.dispose
end
def update
@name_back.ox += 1
if @name_status_window.x < 0
@name_status_window.x += 15
@name_status_window.contents_opacity += 5
elsif @name_status_window.x >= 0
@name_status_window.x = 0
@name_status_window.contents_opacity = 255
end
@edit_window.update
@input_window.update
if Input.repeat?(Input::B)
if @edit_window.index == 0
return
end
$game_system.se_play($data_system.cancel_se)
@edit_window.back
return
end
if Input.trigger?(Input::C)
if @input_window.character == nil
if @edit_window.name == ""
@edit_window.restore_default
if @edit_window.name == ""
$game_system.se_play($data_system.buzzer_se)
return
end
$game_system.se_play($data_system.decision_se)
return
end
@actor.name = @edit_window.name
$game_system.se_play($data_system.decision_se)
$scene = Scene_Map.new
return
end
if @edit_window.index == $game_temp.name_max_char
$game_system.se_play($data_system.buzzer_se)
return
end
if @input_window.character == ""
$game_system.se_play($data_system.buzzer_se)
return
end
$game_system.se_play($data_system.decision_se)
@edit_window.add(@input_window.character)
return
end
end
end
Avoir dans le dossier picture ces images:

Image 1
Image 2

EDIT :
Yagami : La prochaine fois , corrige les liens vers tes images OK ?
Cette fois , je les ai fait pour toi.

2RPG Maker XP Re: Le nom du hero Ven 31 Oct - 12:29

Venox

avatar
Fondateur
Fondateur

merci pour ce script ^^ tu gagne 5 PA

3RPG Maker XP Re: Le nom du hero Ven 31 Oct - 12:31

senin jiraya

avatar
Membre
Membre

Les Pa sa sert a koi?

4RPG Maker XP Re: Le nom du hero Ven 31 Oct - 13:09

Venox

avatar
Fondateur
Fondateur

Je vais créer un system d'échange, ( PA / ressources scripts tuto ) mais pour l'instant c'est pour identifier les maker !

PS : tu en a 6 senin jiraya ^^

5RPG Maker XP Re: Le nom du hero Ven 31 Oct - 14:21

Zack Fair

Zack Fair
Membre Actif
Membre Actif

Bah , je crois que tu es trop genéreux , GTO
Il poste un script , et tu lui donne 6 PA ?
.......
Faut revoir ce systéme , de PA .

http://www.google.com

6RPG Maker XP Re: Le nom du hero Ven 31 Oct - 14:23

Venox

avatar
Fondateur
Fondateur

non ce n'est pas que pour ce script et maintenant il en à 16 pour tout ce qu'il à fait, et n'oubli pas que c'est sur 1000

7RPG Maker XP Re: Le nom du hero Sam 1 Nov - 19:24

Zack Fair

Zack Fair
Membre Actif
Membre Actif

Comme tu voudera GTO ... aprés tout c'est toi le fondateur du fofo ! :D

http://www.google.com

8RPG Maker XP Re: Le nom du hero Dim 2 Nov - 15:51

Xtreamgodofchaos

avatar
Membre
Membre

Euh ... Senin je ne vois pas tes images ...

9RPG Maker XP Re: Le nom du hero Dim 2 Nov - 16:22

Zack Fair

Zack Fair
Membre Actif
Membre Actif

Mmmmouais..
C'est une faute qu'il a fait.. je vais la corriger attend...

http://www.google.com

10RPG Maker XP Re: Le nom du hero Mar 4 Nov - 0:22

Xtreamgodofchaos

avatar
Membre
Membre

Merci bien :-----:

Contenu sponsorisé



Revenir en haut  Message [Page 1 sur 1]

Sujets similaires

-

Permission de ce forum:
Vous ne pouvez pas répondre aux sujets dans ce forum

 

Ne ratez plus aucun deal !
Abonnez-vous pour recevoir par notification une sélection des meilleurs deals chaque jour.
IgnorerAutoriser