Zelda_PL Blob Jaune
Nombre de messages : 797 Age : 31 Localisation : En train d'éliminé les deadras de Cyrodiil Date d'inscription : 09/05/2006
| Sujet: Menu de téléportation Dim 21 Mai - 3:55 | |
| Installation : Copiez le code, ouvrez l'éditeur de script ( F11 ) et créez en un nouveau au dessus de 'Main'. Nommez le " WTS " et collez ce script : Utilisation : - Pour ajouter un mot-clé dans un évènement ou dans un script: $wtel.add_word("motclé") - Pour ajouter une destination dans un évènement ou un script: $wtel.add_location("name", map_ID, x-pos, y-pos) Name: Le Mot devant être composée de mots-clé Map ID: L'ID de la map de destination X-pos: Position en X sur la map Ciblée Y-pos: Position en Y sur la map Ciblée - Pour Afficher la fenêtre de téléportation : Dans un évènement ou un script : $scene = Scene_WTS.new Utiliser la touche S pour passer des mots clé à la validation. La touche X sert à effacer le dernier mot clé entré. Un Mot est valide, quand il s'affiche en vert. - Mettez dans Scene_Title ou un évènement au début du jeu: $wtel = Word_Teleport_Script.new Code : #============================================================= # <> Word Teleport Script v1.4 # ==> You can delete all the comments except the copyright and creator info. Thanks. # ==> Do not rip, repost or any other way of reproducing without proper credit. Thanks. # ShadowClan Technologies © 2003-2005 - All rights reserved. # Creation Asylum Project © 2005 - This script is exclusively only for this project. #----------------------------------------------------------------------------------------------------------------------- # * How to use # Set up in title screen or somewhere near intro of game: # $wtel = Word_Teleport_Script.new # Then just call up: # $scene = Scene_WTS.new # That would be it. Adding... # Words: $wtel.add_word(word) --> word must be in this format: "word" with quotes. # Location: $wtel.add_location(name, map_id, x, y) --> name format: "name" with quotes. # Thats all. # # * Notes # 1. Don't parallel this: $wtel = Word_Teleport_Script.new # 2. First set the $wtel and then add words and locations. Not reversed. # # I'll try and fix bugs here and there, meanwhile, you can suggest stuff. Thanks in advance. #---------------------------------------------------------------------------------------------------------------------- # * Suggestions? ==> PM or post in the section where this is posted. # * Created by: GoldenShadow (invincible_p0wer_@hotmail.com) # * Credits: JyJ for bug-/beta testing, Nick for additional scripting sources #=============================================================
class Word_Teleport_Script # this is the main thing.
attr_accessor :word # The available words attr_accessor :map_id # Available locations with their map IDs attr_accessor :map_x # The X to teleport to with the location attr_accessor :map_y # The Y to teleport to with the location attr_accessor :active # Active word. Will be reset after each cancel/teleport def initialize @word = [] # Yes, an array @map_id = {} # And yes, an hash @map_x = {} # More hash @map_y = {} # And now im stoned @active = [] # Array. It was required. end
def add_word(word) # This is for adding words as the story progresses unless @word.include?(word) # If it exists already, dont add it @word.push(word) end end
def add_location(name, map_id, map_x, map_y) # Also adding locations. if map_id.is_a?(String) or map_x.is_a?(String) or map_y.is_a?(String)#ID, x, y must be numerics return # if its not, dont add it else @map_id[name] = map_id # add it: [name => id] @map_x[name] = map_x # add X @map_y[name] = map_y # add Y end end end
class Window_Word < Window_Base # The 'status' window
def initialize super(320, 64, 320, 416 - 64) self.contents = Bitmap.new(width - 32, height - 32) self.contents.font.name = $fontface.is_a?(String) ? $fontface : $defaultfonttype self.contents.font.size = $defaultfontsize == nil ? $fontsize : $defaultfontsize refresh end
def refresh self.contents.clear self.contents.draw_text(0, 16, self.width - 40, 32, "Votre destination sera", 1) if $wtel.map_id.include?($wtel.active.join) self.contents.font.color = Color.new(152, 239, 95) # green color else self.contents.font.color = Color.new(255, 96, 96) # red color end self.contents.draw_text(0, 64, self.width - 40, 32, $wtel.active.join, 1) # the temp. var self.contents.font.color = normal_color # normal.. self.contents.draw_text(0, 114, self.width - 40, 32, "(Maximun 4 mots.)", 1) # max... self.contents.draw_text(4, 160, self.width - 40, 32, "Appuyez sur le bouton S") self.contents.draw_text(4, 192, self.width - 40, 32, "pour venir sur cette fenêtre.") end end
class Window_WTSList < Window_Selectable # the word list # all i did was just customize the Window_Item. No big deal def initialize super(0, 64, 320, 416) @column_max = 1 refresh self.index = 0 end
def refresh if self.contents != nil self.contents.dispose self.contents = nil end @item_max = $wtel.word.size if @item_max > 0 self.contents = Bitmap.new(width - 32, row_max * 32) self.contents.font.name = $fontface.is_a?(String) ? $fontface : $defaultfonttype self.contents.font.size = $defaultfontsize == nil ? $fontsize : $defaultfontsize for i in 0...@item_max draw_item(i) # show (draw) each item end end end
def draw_item(index) self.contents.font.color = normal_color x = 4 # aligned of x-axis '4' y = index * 32 rect = Rect.new(x, y, self.width / @column_max - 32, 32) self.contents.fill_rect(rect, Color.new(0, 0, 0, 0)) self.contents.draw_text(x, y, 212, 32, $wtel.word[index], 0) # showing it. end end
class Window_WTSCommand < Window_Selectable # command box
def initialize super(0, 0, 320, 64) self.contents = Bitmap.new(width - 32, height - 32) self.contents.font.name = $fontface.is_a?(String) ? $fontface : $defaultfonttype self.contents.font.size = $defaultfontsize == nil ? $fontsize : $defaultfontsize @commands = ["Go!", "Annuler"] # the commands... @item_max = 2 @column_max = 2 draw_item(0, normal_color) # 'Go' draw_item(1, normal_color) # 'Cancel' self.active = false self.index = 0 end
def draw_item(index, color) # self.contents.font.color = color rect = Rect.new(index * 160 + 4, 0, 128 - 10, 32) self.contents.fill_rect(rect, Color.new(0, 0, 0, 0)) self.contents.draw_text(rect, @commands[index], 1) end
def update_cursor_rect # needed to show actual selection self.cursor_rect.set(index * 160, 0, 128, 32) end end
class Scene_WTS # this is the whole thing!
def main if $wtel.word.include?("(Espace)") $wtel.word.delete("(Espace)") # delete this word $wtel.word.push("(Espace)") # and add it at the end of all the other words else $wtel.word.push("(Espace)") end @help_window = Window_Help.new @help_window.set_text("Faites une combininaison de mot pour une destination.") # a msg @status_window = Window_Word.new @list_window = Window_WTSList.new @command_window = Window_WTSCommand.new @command_window.x = 320 # command box x-axis @command_window.y = 416 # command box -y-axis Graphics.transition # transing it, so it updates loop do Graphics.update Input.update update # updating the stuff, see def update if $scene != self break end end Graphics.freeze # when closing, freeze it all first @help_window.dispose # and dispose all the items @status_window.dispose # @list_window.dispose # @command_window.dispose # end
def update # update all the windows @help_window.update @status_window.update @list_window.update @command_window.update if Input.trigger?(Input::Y) and @list_window.active # switch between windows @list_window.active = false @command_window.active = true elsif Input.trigger?(Input::Y) and @command_window.active # same here @list_window.active = true @command_window.active = false end if @command_window.active update_command end if @list_window.active update_list end end
def update_command if Input.trigger?(Input::C) # when the command box is active and selection is made case @command_window.index when 0 # the 'GO' selection unless !$wtel.map_id.include?($wtel.active.join) # unless destination doesn't exist $game_system.se_play($data_system.decision_se) $game_map.setup($wtel.map_id[$wtel.active.join]) # go to map $game_player.moveto($wtel.map_x[$wtel.active.join], $wtel.map_y[$wtel.active.join]) # exact location $game_player.refresh # refresh stuff $game_map.autoplay $game_map.update $wtel.active = [] # clear array $scene = Scene_Map.new # go to map else $game_system.se_play($data_system.buzzer_se) end when 1 $game_system.se_play($data_system.cancel_se) $wtel.active = [] # clear it $scene = Scene_Map.new # and go to actual map end end end
def update_list if Input.trigger?(Input::C) and $wtel.active.size <= 3 # 4 is the max words $game_system.se_play($data_system.decision_se) if $wtel.word[@list_window.index] == "(Espace)" # if its space $wtel.active.push(" ") # add a space! @status_window.refresh else $wtel.active.push($wtel.word[@list_window.index]) # otherwise, add the word @status_window.refresh end elsif Input.trigger?(Input::B) # cancel and remove final word $game_system.se_play($data_system.cancel_se) $wtel.active.pop @status_window.refresh end end end # FINAL UPDATE: 11 August @ 13:31 GMT (damnit, 244 lines )
Un peut compliquer mes utile ... Screen : | |
|
Jordinateur Blob
Nombre de messages : 260 Localisation : Devant mon ordinateur !(enfin sa dépend, peut-être avec ma copine aussi ^^) Humeur/Caractère : Aller a l'école T_T Date d'inscription : 12/05/2006
| Sujet: Re: Menu de téléportation Dim 21 Mai - 11:46 | |
| a oui, je l'avais déjà vu, mais sa ne sert pas vraiment à grand chose... | |
|
Zelda_PL Blob Jaune
Nombre de messages : 797 Age : 31 Localisation : En train d'éliminé les deadras de Cyrodiil Date d'inscription : 09/05/2006
| Sujet: Re: Menu de téléportation Dim 21 Mai - 14:13 | |
| Non mais il peut y avoir des gens qu'il en aille de besoin... | |
|
Jordinateur Blob
Nombre de messages : 260 Localisation : Devant mon ordinateur !(enfin sa dépend, peut-être avec ma copine aussi ^^) Humeur/Caractère : Aller a l'école T_T Date d'inscription : 12/05/2006
| Sujet: Re: Menu de téléportation Dim 21 Mai - 23:52 | |
| | |
|
Zelda_PL Blob Jaune
Nombre de messages : 797 Age : 31 Localisation : En train d'éliminé les deadras de Cyrodiil Date d'inscription : 09/05/2006
| Sujet: Re: Menu de téléportation Lun 22 Mai - 2:34 | |
| Ta dernière phrase est totalement inutil | |
|
Boblino Modo
Nombre de messages : 1184 Age : 32 Localisation : Aux enfers, assis sur mon Canapé. Humeur/Caractère : Bored Date d'inscription : 08/05/2006
Statut Expérience: (9/25) Pixel Point: 20
| Sujet: Re: Menu de téléportation Lun 22 Mai - 4:52 | |
| comme celle que tu vien de poster mon cher... Attention au Flood rahhhhhhhhh on dirait que tu comprends pas.... | |
|
Jordinateur Blob
Nombre de messages : 260 Localisation : Devant mon ordinateur !(enfin sa dépend, peut-être avec ma copine aussi ^^) Humeur/Caractère : Aller a l'école T_T Date d'inscription : 12/05/2006
| Sujet: Re: Menu de téléportation Lun 22 Mai - 18:07 | |
| Laquelle ? Tu parlais de moi ? | |
|
GTK Painteur GTK
Nombre de messages : 3595 Age : 34 Humeur/Caractère : Fatigué Date d'inscription : 29/04/2006
Statut Expérience: (100/100) Pixel Point: ---
| Sujet: Re: Menu de téléportation Lun 22 Mai - 20:41 | |
| Vos 4 dernières phrases ne servaient à rien bande de martiens à 3 noeils !!!
Hein !? Quoi ! Ce messages aussi ...?
Bon ben, mieux vaut se taire que faire des remarques tout ausi inutile, vous pensez pas ? | |
|
Jordinateur Blob
Nombre de messages : 260 Localisation : Devant mon ordinateur !(enfin sa dépend, peut-être avec ma copine aussi ^^) Humeur/Caractère : Aller a l'école T_T Date d'inscription : 12/05/2006
| |
Zelda_PL Blob Jaune
Nombre de messages : 797 Age : 31 Localisation : En train d'éliminé les deadras de Cyrodiil Date d'inscription : 09/05/2006
| Sujet: Re: Menu de téléportation Lun 22 Mai - 23:28 | |
| Martien, tu as de bonne opinion de nous | |
|
GTK Painteur GTK
Nombre de messages : 3595 Age : 34 Humeur/Caractère : Fatigué Date d'inscription : 29/04/2006
Statut Expérience: (100/100) Pixel Point: ---
| Sujet: Re: Menu de téléportation Mar 23 Mai - 20:14 | |
| Je pense pas que j'ai dit que j'aimais les messages inutiles, j'ai du dire un truc du genre que j'en ai posté pas mal et que j'ai rien contre .
Mais faut pas exagérer non plus . | |
|
Contenu sponsorisé
| Sujet: Re: Menu de téléportation | |
| |
|