Oniromancie: Scripts - Nouvelle langue


Comment ça marche?

Aëdemphia
Par Sylvanor

Fighting Robots Quest
Par Boulon

Forstale
Par Ødd Clock

Geex
Par roys

Inexistence
Par Falco

La Légende d'Ibabou
Par Zaitan

Lije
Par Gaetz

LoveMaster
Par Cuddlefox

Sarcia
Par Kaëlar

Super Mario RPG - Lost Souls
Par Omegabowser

Jeux: Monster World RPG / Jeux: Pif et Hercule / News: Mise à jour de RPG Maker 2003 / Tutos: Création de charset / Jeux: FAYLINAWA /

Chat  (32 connectés)

Bienvenue
visiteur !








Statistiques

Liste des
membres


Contact

96 connectés actuellement

9262712 visiteurs
depuis l'ouverture

885 visiteurs
aujourd'hui

Groupe Facebook

Barre de séparation

Partenaires




TOP
GAMEMAKING


Les 5 plus
visités

Lunae, le baz'arts d'Emz0

Le studio du chat vert

Pixelandgame

Tashiroworld

HeyMakeGames

Au hasard

New RPG Maker

RPG Land

Make & Graph'

Les deux derniers

Lunae, le baz'arts d'Emz0

Le studio du chat vert

Nos autres partenaires

Devenir
partenaire


Barre de séparation

Un site du réseau
War Paradise

Annuaires référenceurs




Nouvelle langue
Script pour RPG Maker XP
Ecrit par Cetais

Script crée par SephirothSpawn, revu et corrigé par Eudliel (merci à lui).

Tout d'abord créer un script "Alternate_Language" au-dessus de "Main":

Citation:


#=================================
# Alternate Language thing by makeamidget & Seph
#=================================
#It's constant setting time..., i made two constants that you will use and it's for the color of the messages
#This one is for when the letter is known
NORMAL_COLOR = Color.new(255, 255, 255, 255)#(White)
#this one is for when the letter is unknown
LANG_COLOR = Color.new(128, 128, 255, 255)#(Blue)
#Make a constant like this:
#[ {'KEY' => 'Letter to be Learned', 'VALUE' => 'What your letter Will be Changed to'}, ...]
#Place Your Language Constants here:
ALBHED = [
{'KEY' => 'A', 'VALUE' => 'Y'}, {'KEY' => 'B', 'VALUE' => 'P'}, {'KEY' => 'C', 'VALUE' => 'L'},
{'KEY' => 'D', 'VALUE' => 'T'}, {'KEY' => 'E', 'VALUE' => 'A'}, {'KEY' => 'F', 'VALUE' => 'V'},
{'KEY' => 'G', 'VALUE' => 'K'}, {'KEY' => 'H', 'VALUE' => 'R'}, {'KEY' => 'I', 'VALUE' => 'E'},
{'KEY' => 'J', 'VALUE' => 'Z'}, {'KEY' => 'K', 'VALUE' => 'G'}, {'KEY' => 'L', 'VALUE' => 'M'},
{'KEY' => 'M', 'VALUE' => 'S'}, {'KEY' => 'N', 'VALUE' => 'H'}, {'KEY' => 'O', 'VALUE' => 'U'},
{'KEY' => 'P', 'VALUE' => 'B'}, {'KEY' => 'Q', 'VALUE' => 'X'}, {'KEY' => 'R', 'VALUE' => 'N'},
{'KEY' => 'S', 'VALUE' => 'C'}, {'KEY' => 'T', 'VALUE' => 'D'}, {'KEY' => 'U', 'VALUE' => 'I'},
{'KEY' => 'V', 'VALUE' => 'J'}, {'KEY' => 'W', 'VALUE' => 'F'}, {'KEY' => 'X', 'VALUE' => 'Q'},
{'KEY' => 'Y', 'VALUE' => 'O'}, {'KEY' => 'Z', 'VALUE' => 'W'}]
SYMBOLS = [
{'KEY' => 'A', 'VALUE' => '`'}, {'KEY' => 'B', 'VALUE' => '~'}, {'KEY' => 'C', 'VALUE' => '!'},
{'KEY' => 'D', 'VALUE' => '@'}, {'KEY' => 'E', 'VALUE' => '#'}, {'KEY' => 'F', 'VALUE' => '$'},
{'KEY' => 'G', 'VALUE' => '%'}, {'KEY' => 'H', 'VALUE' => '^'}, {'KEY' => 'I', 'VALUE' => '&'},
{'KEY' => 'J', 'VALUE' => '*'}, {'KEY' => 'K', 'VALUE' => '('}, {'KEY' => 'L', 'VALUE' => ')'},
{'KEY' => 'M', 'VALUE' => '-'}, {'KEY' => 'N', 'VALUE' => '_'}, {'KEY' => 'O', 'VALUE' => '='},
{'KEY' => 'P', 'VALUE' => '+'}, {'KEY' => 'Q', 'VALUE' => '['}, {'KEY' => 'R', 'VALUE' => '{'},
{'KEY' => 'S', 'VALUE' => ']'}, {'KEY' => 'T', 'VALUE' => '}'}, {'KEY' => 'U', 'VALUE' => '|'},
{'KEY' => 'V', 'VALUE' => ';'}, {'KEY' => 'W', 'VALUE' => ':'}, {'KEY' => 'X', 'VALUE' => '<'},
{'KEY' => 'Y', 'VALUE' => '>'}, {'KEY' => 'Z', 'VALUE' => '?'}]
#Now Begins the Game_Party mod
#Make An attr_accessor Named identical to your Constant in Lower Case
class Game_Party
attr_accessor :albhed
attr_accessor :symbols
alias alt_lang_initialize initialize
def initialize
@albhed = []
@symbols = []
alt_lang_initialize
end
end
#Ends Game Party
#Begins Window_Message
class Window_Message < Window_Selectable
#--------------------------------------------------------------------------
def refresh
self.contents.clear
self.contents.font.color = normal_color
x = y = 0
@cursor_width = 0
if $game_temp.choice_start == 0
x = 8
end
if $game_temp.message_text != nil
text = $game_temp.message_text
begin
last_text = text.clone
text.gsub!(/\\[Vv]\[([0-9]+)\]/) { $game_variables[$1.to_i] }
end until text == last_text
text.gsub!(/\\[Nn]\[([0-9]+)\]/) do
$game_actors[$1.to_i] != nil ? $game_actors[$1.to_i].name : ""
end
text.gsub!(/\\\\/) { "\000" }
text.gsub!(/\\[Cc]\[([0-9]+)\]/) { "\001[#{$1}]" }
text.gsub!(/\\[Gg]/) { "\002" }
#Yo, Midge here, explainin what the hell i did... for your amusement...
#This is the new escape that i made just for this... basically this next line makes it so that you
#can just type \Alt[NAME], or \alt[NAME], it deletes that and replaces it with \a[] the $1 is the
#name of the Language that you're gonna use in this message
text.gsub!(/\\[Aa]lt\[([A-Z]+)\]/) { "\a[#{$1}]" }
#End Mod -Midge-
while ((c = text.slice!(/./m)) != nil)
#Okay, remember how \alt[] was replaced with \a? well this is where that whole thing comes into play
#the while statement above makes it go through the message letter by letter... so that it can get to all
#the other escapes and do them accordingly, such as \c[2] since you might have multiple of those...
if c == "\a"
text.sub!(/\[([A-Z]+)\]/, "")
temp = $1 #remember that $1 is the contents of the \Alt[NAME] which is how it works with multiple languages
lang = eval(temp) #eval() de-stringitizes it, so it's no longer a string, it is recognized as the constant that you set up
letters = eval("$game_party." + temp.downcase)#this is getting the name of the attribute for this specific language
alt = true #just a little temp variable to know that this is an alternate language message
end
if alt
#.include? searches all indexes of the array to see if it includes what is in the (), the ! means not
#so it's saying if whatever the current letter is, uppercase, is not in the array, execute the following
self.contents.font.color = NORMAL_COLOR #sets the color to white
if ! letters.include?(c.upcase)
#now we hit the loop.. it goes through each index of the array and executes the code proceeding
#the declaration of the loop.. each iteration is refered to as stuff...
lang.each do |stuff|
#stuff['KEY'] is the value that you set in the hash of the language it's the actual letter, stuff['VALUE']
#is what you want KEY to change into if the language is not known
#basically for each letter in the message it compares it searches the loop for the letter, uppercase and lowercase
#and if it finds the letter then it replaces it with what you set it to, remember that this is after it checks if
#the player knows it or not, when the letter is found it is replaced, the color is changed and the loop is stopped
if stuff['KEY'] == c
self.contents.font.color = LANG_COLOR
c = stuff['VALUE']
break
elsif stuff['KEY'] == c.upcase
self.contents.font.color = LANG_COLOR
c = stuff['VALUE'].downcase
break
end
end
end
end
#End of Mod -Midge-
if c == "\000"
c = "\\"
end
if c == "\001"
text.sub!(/\[([0-9]+)\]/, "")
color = $1.to_i
if color >= 0 and color <= 7
self.contents.font.color = text_color(color)
end
next
end
if c == "\002"
if @gold_window == nil
@gold_window = Window_Gold.new
@gold_window.x = 560 - @gold_window.width
if $game_temp.in_battle
@gold_window.y = 192
else
@gold_window.y = self.y >= 128 ? 32 : 384
end
@gold_window.opacity = self.opacity
@gold_window.back_opacity = self.back_opacity
end
next
end
if c == "\n"
if y >= $game_temp.choice_start
@cursor_width = [@cursor_width, x].max
end
y += 1
x = 0
if y >= $game_temp.choice_start
x = 8
end
next
end
self.contents.draw_text(4 + x, 32 * y, 40, 32, c)
x += self.contents.text_size(c).width
end
end
if $game_temp.choice_max > 0
@item_max = $game_temp.choice_max
self.active = true
self.index = 0
end
if $game_temp.num_input_variable_id > 0
digits_max = $game_temp.num_input_digits_max
number = $game_variables[$game_temp.num_input_variable_id]
@input_number_window = Window_InputNumber.new(digits_max)
@input_number_window.number = number
@input_number_window.x = self.x + 8
@input_number_window.y = self.y + $game_temp.num_input_start * 32
end
end
end


Pui

Pour ajouter une lettre il faut appeler le script:

Code:
$game_party.(the name of your language).push("letter")


Avant chaque message il faut ajouter [nom de votre langage] et le message doit être en majuscules :

Code:
\Alt[NAME OF YOUR LANGUAGE CONSTANT IN CAPS]



RPG-man - posté le 04/08/2008 à 19:17:59. (812 messages postés)

Rubyste, C#iste, 17 ans, over-booké.

¨Pas compris comment ça marche, soit plus précis... j'ai testé, y'a une erreur, quand je fais "insérer un script"
Il faut changer quelques trucs dans le script si on veut changer le nom du langage...
Mais quand je veux ajouter une lettre là... y'a une erreur!

Blog de l'Usine en Folie| Vous l'attendez tous impatiemment ! | Geex

Suite à de nombreux abus, le post en invités a été désactivé. Veuillez vous inscrire si vous souhaitez participer à la conversation.

Haut de page

Merci de ne pas reproduire le contenu de ce site sans autorisation.
Contacter l'équipe

Plan du site:

Activité: Accueil | News | Forum | Flash-news | Chat | Commentaires | Galerie | Screen de la semaine | Sorties | Articles perso | Livre d'or | Recherche
Jeux: Index jeux séparés | Top Classiques | Top Originaux | Les autres | RPG Maker 95 | RPG Maker 2000 | RPG Maker 2003 | RPG Maker XP | RPG Maker VX | RPG Maker VX Ace | RPG Maker MV | Autres | Jeux complets | Proposer
Rubriques: Le Wiki | Collection Oniro | Tutoriaux | Scripts | Guides | Gaming-Live | Tests | Making-of | Interviews | Articles perso | OST | L'Annuaire | Divers | Palmarès
Hébergés: Aëdemphia | Fighting Robots Quest | Forstale | Geex | Inexistence | La Légende d'Ibabou | Lije | LoveMaster | Sarcia | Super Mario RPG - Lost Souls
Ressources: Jeux | Programmes | Packs de ressources | Midis | Eléments séparés | Sprites
RPG Maker 2000/2003: Chipsets | Charsets | Panoramas | Backdrops | Facesets | Battle anims | Battle charsets | Monstres | Systems | Templates
RPG Maker XP: Tilesets | Autotiles | Characters | Battlers | Window skins | Icônes | Transitions | Fogs | Templates
RPG Maker VX: Tilesets | Charsets | Facesets | Systèmes
RPG Maker MV: Tilesets | Characters | Faces | Systèmes | Title | Battlebacks | Animations | SV/Ennemis