RPG Sunrise
Vous souhaitez réagir à ce message ? Créez un compte en quelques clics ou connectez-vous pour continuer.



 
AccueilRechercherDernières imagesS'enregistrerConnexion
Le Deal du moment : -15%
-15% Apple MacBook Air 13” 16Go RAM / 256Go SSD ...
Voir le deal
1299 €

 

 [Script] Téléportation comme dans Fable !

Aller en bas 
2 participants
AuteurMessage
17.WeeD
Veilleur
Veilleur
17.WeeD


Masculin Nombre de messages : 197
Age : 31
Localisation : A Gibraltar, dans l'UE, au Camp Central.
Emploi/loisirs : RMXP - Battlefield : 2142 - Football
Projet en Cours : Battlefield : 2412
Date d'inscription : 25/12/2007

[Script] Téléportation comme dans Fable ! Empty
MessageSujet: [Script] Téléportation comme dans Fable !   [Script] Téléportation comme dans Fable ! Icon_minitimeDim 6 Jan - 12:40

TELEPORTATION [Très très] AMELIOREE


Auteur : GoldenShadow

Remarques : Testé et fonctionnel.

Démo : http://www.megaupload.com/?d=CR54EUXE

Fonctions : Permet de ce téléporter à un endroit grâce à une combinaison de mot clé.

Screen :
[Script] Téléportation comme dans Fable ! Screen10

Installation : Copiez le code, ouvrez l'éditeur de script ( F11 ) et créez en un nouveau au dessus de 'Main'. Nommez le " WTS ".

Script :

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

Utilisation :


$wtel.add_word("le mot clé")

- 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és qui ont été ajoutés avant.
Map ID: L'ID de la map de destination (001, 002...)
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
Code:

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 au début du jeu dans un événemet parallèle (pour activer le script) :

Code:
$wtel = Word_Teleport_Script.new
Revenir en haut Aller en bas
http://mercury-17.skyrock.com
KeyLad
Inquisiteur
Inquisiteur
KeyLad


Masculin Nombre de messages : 365
Age : 32
Localisation : France, Isère
Emploi/loisirs : Guitare, skate, ma copine
Projet en Cours : Projet 1
Date d'inscription : 03/10/2007

[Script] Téléportation comme dans Fable ! Empty
MessageSujet: Re: [Script] Téléportation comme dans Fable !   [Script] Téléportation comme dans Fable ! Icon_minitimeDim 6 Jan - 13:41

J'ai tésté, vraiment pas mal ce script, personnellement je l'ai jamais trouvé bounce .
Bravo Very Happy
Revenir en haut Aller en bas
17.WeeD
Veilleur
Veilleur
17.WeeD


Masculin Nombre de messages : 197
Age : 31
Localisation : A Gibraltar, dans l'UE, au Camp Central.
Emploi/loisirs : RMXP - Battlefield : 2142 - Football
Projet en Cours : Battlefield : 2412
Date d'inscription : 25/12/2007

[Script] Téléportation comme dans Fable ! Empty
MessageSujet: Re: [Script] Téléportation comme dans Fable !   [Script] Téléportation comme dans Fable ! Icon_minitimeDim 6 Jan - 13:47

Merci Wink Il est très utile!
Revenir en haut Aller en bas
http://mercury-17.skyrock.com
Contenu sponsorisé





[Script] Téléportation comme dans Fable ! Empty
MessageSujet: Re: [Script] Téléportation comme dans Fable !   [Script] Téléportation comme dans Fable ! Icon_minitime

Revenir en haut Aller en bas
 
[Script] Téléportation comme dans Fable !
Revenir en haut 
Page 1 sur 1
 Sujets similaires
-
» [Script] Musique dans le menu
» [Script] Mini-Map

Permission de ce forum:Vous ne pouvez pas répondre aux sujets dans ce forum
RPG Sunrise :: Alchimisterie :: Scripts :: Scripts Libres-
Sauter vers:  
Ne ratez plus aucun deal !
Abonnez-vous pour recevoir par notification une sélection des meilleurs deals chaque jour.
IgnorerAutoriser