La guilde des makers de KalHidia
Vous souhaitez réagir à ce message ? Créez un compte en quelques clics ou connectez-vous pour continuer.
La guilde des makers de KalHidia

Site pour tous les programmeurs, musiciens, dessinnateur qui voudraient se perfectionner dans ces arts!
 
AccueilAccueil  RechercherRechercher  Dernières imagesDernières images  S'enregistrerS'enregistrer  Connexion  
Le Deal du moment : -39%
Ecran PC incurvé gaming – MSI Optix ...
Voir le deal
169.99 €

 

 Un animal de compagnie!

Aller en bas 
AuteurMessage
Drogo-Hardbottle
Admin
Drogo-Hardbottle


Nombre de messages : 113
Date d'inscription : 09/08/2006


Catégorie Principale: Programmeur
Grade de la catégorie principale: Divinité
Niveau de la catégorie principale:
Un animal de compagnie! Left_bar_bleue200/200Un animal de compagnie! Empty_bar_bleue  (200/200)

Un animal de compagnie! Empty
MessageSujet: Un animal de compagnie!   Un animal de compagnie! EmptyMar 22 Aoû - 7:14

Qui est l' auteur de ce script? ???
A quoi sert ce script? Permet de créer un animal de compagnie.
Marche t'il? ??%
Comment installer ce script? Copiez ces scripts, ouvrez l'éditeur de scripts RmXp ( en appuyant sur la touche "F11" ) et créez les nouveaux scripts au dessus de 'Main'.
Nommez ces scripts comme vous le voudrez du moment
qu' ils sont compréhensibles et collez les codes.

Code 1

Code:
#================================
#Window_Chat par mysterio
#pour faire un animal de companie.
#================================

class Window_Chat < Window_Base
#==================================#
#==================================#
def initialize
super(0, 0, 160, 96)
self.contents = Bitmap.new(width - 32, height - 32)
self.contents.font.name = $fontface
self.contents.font.size = $fontsize
refresh
end
#================================
def refresh
self.contents.clear
self.contents.font.color = system_color
bitmap = RPG::Cache.icon("Chat")
src_rect = Rect.new(0, 0, bitmap.width, bitmap.height)
self.contents.blt(5, y+32, bitmap, src_rect)
self.contents.draw_text(0,0,500,32,"Pussy Cat" )
self.contents.draw_text(40,30,500,32,"LV" )
self.contents.font.color = normal_color
self.contents.draw_text(80,30,500,32,$game_variables[36].to_s)
end
end

Code 2

Code:
#================================
#Window_Chat2 par mysterio
#pour faire un animal de companie.
#================================

class Window_Chat2 < Window_Base
#==================================#
#==================================#
def initialize
super(0, 0, 160, 96)
self.contents = Bitmap.new(width - 32, height - 32)
self.contents.font.name = $fontface
self.contents.font.size = $fontsize
refresh
end
#================================
def refresh
if $game_switches[8] == true
self.contents.clear
self.contents.font.color = system_color
bitmap = RPG::Cache.icon("Viande")
src_rect = Rect.new(0, 0, bitmap.width, bitmap.height)
self.contents.blt(5, y+32, bitmap, src_rect)
self.contents.draw_text(0,0,500,32,"Bol" )
self.contents.font.color = normal_color
self.contents.draw_text(40,30,500,32,"Plein" )
end
else
if $game_switches[8] == false
self.contents.clear
self.contents.font.color = system_color
bitmap = RPG::Cache.icon("Viande")
src_rect = Rect.new(0, 0, bitmap.width, bitmap.height)
self.contents.blt(5, y+32, bitmap, src_rect)
self.contents.draw_text(0,0,500,32,"Bol" )
self.contents.font.color = normal_color
self.contents.draw_text(40,30,500,32,"Vide" )
end
end
end

Code 3

Code:
#================================
#Window_Chat3 par mysterio
#pour faire un animal de companie.
#================================

class Window_Chat3 < Window_Base
#==================================#
#==================================#
def initialize
super(0, 0, 160, 96)
self.contents = Bitmap.new(width - 32, height - 32)
self.contents.font.name = $fontface
self.contents.font.size = $fontsize
refresh
end
#================================
def refresh
if $game_switches[9] == true
self.contents.clear
self.contents.font.color = system_color
bitmap = RPG::Cache.icon("Savon")
src_rect = Rect.new(0, 0, bitmap.width, bitmap.height)
self.contents.blt(5, y+32, bitmap, src_rect)
self.contents.draw_text(0,0,500,32,"Propreté" )
self.contents.font.color = normal_color
self.contents.draw_text(40,30,500,32,"Propre" )
end
else
if $game_switches[9] == false
self.contents.clear
self.contents.font.color = system_color
bitmap = RPG::Cache.icon("Savon")
src_rect = Rect.new(0, 0, bitmap.width, bitmap.height)
self.contents.blt(5, y+32, bitmap, src_rect)
self.contents.draw_text(0,0,500,32,"Propreté" )
self.contents.font.color = normal_color
self.contents.draw_text(40,30,500,32,"Sale" )
end
end
end

Code 4

Code:
#================================
#Window_Chat4 par mysterio
#pour faire un animal de companie.
#================================

class Window_Chat4 < Window_Base
#==================================#
#==================================#
def initialize
super(0, 0, 160, 96)
self.contents = Bitmap.new(width - 32, height - 32)
self.contents.font.name = $fontface
self.contents.font.size = $fontsize
refresh
end
#================================
def refresh
if $game_switches[10] == true
self.contents.clear
self.contents.font.color = system_color
bitmap = RPG::Cache.icon("Cadeau 2")
src_rect = Rect.new(0, 0, bitmap.width, bitmap.height)
self.contents.blt(5, y+32, bitmap, src_rect)
self.contents.draw_text(0,0,500,32,"Joie" )
self.contents.font.color = normal_color
self.contents.draw_text(40,30,500,32,"Heureux" )
end
else
if $game_switches[10] == false
self.contents.clear
self.contents.font.color = system_color
bitmap = RPG::Cache.icon("Cadeau 2")
src_rect = Rect.new(0, 0, bitmap.width, bitmap.height)
self.contents.blt(5, y+32, bitmap, src_rect)
self.contents.draw_text(0,0,500,32,"Joie" )
self.contents.font.color = normal_color
self.contents.draw_text(40,30,500,32,"Triste" )
end
end
end
Revenir en haut Aller en bas
https://lgdmm.forumactif.com
Drogo-Hardbottle
Admin
Drogo-Hardbottle


Nombre de messages : 113
Date d'inscription : 09/08/2006


Catégorie Principale: Programmeur
Grade de la catégorie principale: Divinité
Niveau de la catégorie principale:
Un animal de compagnie! Left_bar_bleue200/200Un animal de compagnie! Empty_bar_bleue  (200/200)

Un animal de compagnie! Empty
MessageSujet: Explication   Un animal de compagnie! EmptyMar 22 Aoû - 7:16

Explication des scripts:

Une petite explication des scripts.

Window_Chat permet d'afficher le NIVEAU du chat (facultatif).

Window_Chat2 est pour la faim.


Window_Chat3 pour la propreté du chat.


Window_Chat 4 pour la joie du matou.

Window_Chat Ligne 23 = Le nom du chat. Changez-le selon vos envies.
Window_Chat Ligne 26 = La variable utilisée pour le niveau. Changez-le selon vos besoins.

Window_Chat2 Ligne 21 et 32 = Iicone de la nourriture. Changez-la selon vos envies aussi.
Window_Chat2 Ligne 18 et 29 = switch utilisé.Changez selon vos besoins.

Les 2 autres scripts sont pareils. Changez selon vos besoins et envies.

*
Etape 2 : Evénement.

Faites un événement avec une apparence de chat :

Par la touche action

Jouer un effet sonore (SE) : "O67-Animal02" tempo 100, volume 80.
scrîpt :: @miaou = Window_Chat.new
@miaou.x = 0
@miaou.y = 0
@miaou2 = Window_Chat2.new
@miaou2.x = 161
@miaou2.y = 0
@miaou3 = Window_Chat3.new
@miaou3.x = 322
@miaou3.y = 0
@miaou4 = Window_Chat4.new
@miaou4.x = 483
@miaou4.y = 0
mettre une étiquette : chat
msg : Que voulez vous faire ?
Choix : [Nourrir],[laver],[caresser],[rien]

si [Nourrir] faire :
Condition : interrupteur [0008] = on
msg : Ton chat n'a pas faim.
sauter vers l'étiquette : chat.
sinon
Condition : Argent =/> 3
Tu as nourri ton chat pour 3 PO.
Monnaie -3
Variable [0037 : Exp du chat] + 1
Interrupteur [0008] = on
scrîpt :
@miaou.dispose
@miaou2.dispose
@miaou3.dispose
@miaou4.dispose
scrîpt :: @miaou = Window_Chat.new
@miaou.x = 0
@miaou.y = 0
@miaou2 = Window_Chat2.new
@miaou2.x = 161
@miaou2.y = 0
@miaou3 = Window_Chat3.new
@miaou3.x = 322
@miaou3.y = 0
@miaou4 = Window_Chat4.new
@miaou4.x = 483
@miaou4.y = 0
sauter vers l'étiquette : chat
sinon
msg : Nourrir ton chat coûte 3 PO !
sauter vers l'étiquette : chat
end
end

Si [Laver] faire :
Condition : interrupteur [0009] = on
msg : Ton chat est propre.
sauter vers l'étiquette : chat.
sinon
Condition : Argent =/> 2
Tu as nourri ton chat pour 2 PO.
Monnaie -2
Variable [0037 : Exp du chat] + 1
Interrupteur [0009] = on
scrîpt :
@miaou.dispose
@miaou2.dispose
@miaou3.dispose
@miaou4.dispose
scrîpt :: @miaou = Window_Chat.new
@miaou.x = 0
@miaou.y = 0
@miaou2 = Window_Chat2.new
@miaou2.x = 161
@miaou2.y = 0
@miaou3 = Window_Chat3.new
@miaou3.x = 322
@miaou3.y = 0
@miaou4 = Window_Chat4.new
@miaou4.x = 483
@miaou4.y = 0
sauter vers l'étiquette : chat
sinon
msg : Laver ton chat coûte 2 PO !
sauter vers l'étiquette : chat
end
end

Si [Carresser] faire :
Condition : interrupteur [0010] = on
msg : Ton chat est déja très heureux.
sauter vers l'étiquette : chat.
sinon
Tu grattouille le ventre de ton petit animal.Il adore ça !
Variable [0037 : Exp du chat] + 1
Interrupteur [0010] = on
scrîpt :
@miaou.dispose
@miaou2.dispose
@miaou3.dispose
@miaou4.dispose
scrîpt :: @miaou = Window_Chat.new
@miaou.x = 0
@miaou.y = 0
@miaou2 = Window_Chat2.new
@miaou2.x = 161
@miaou2.y = 0
@miaou3 = Window_Chat3.new
@miaou3.x = 322
@miaou3.y = 0
@miaou4 = Window_Chat4.new
@miaou4.x = 483
@miaou4.y = 0
sauter vers l'étiquette : chat
end

Si [Rien] faire :
scrîpt :
@miaou.dispose
@miaou2.dispose
@miaou3.dispose
@miaou4.dispose
end

Voila.

Maintenant, je vous explique l'histoire du niveau.
Par exemple, faites un événement commun en processuss parallèle, déclenché par la variable du début de votre jeu.

Condition : variable [0037 : Exp de chat] = 6
msg : (Héros1) peut désormais courir !
Switch [nuberofswitch] = on
fin


Mais bon ensuite pour le faire courir, c'est vous qui voyez .
Etape 3 : Update.


Faites un événement sur un lit, actionné par la touche action.

msg : Dormir ?
choix : [oui] , [non]
Si [oui] faire :
Téléporter équipe, (sur le lit),Bas, Pas de fondu.
Déplacer/modifier event : Héros
Modifier l'apparence : (Apparence de votre héros qui dort, dans "Down")
attendre 10 frames
Modifier le ton de l'écran, R:255,V:255,B:255,S:0, 20 frames.
attendre 20 frames
Switches [0008],[0009],[0010] = off
modifier le ton de l'écran ,R:0,V:0,B:0,S:0, 20frames
attendre 20 frames
Délacer/modifier event : Héros
Modifier apparence : (apparence normale du héros)
Téléporter équipe, (a coté du lit),Droite, Pas de fondu.
Msg : Tu as bien dormi !
<>
Si [Non] faire :
<>
fin
<>

Voila !
J'éspère avoir pu être utile !
Voici un petit screen :
Un animal de compagnie! Chat5jy
Revenir en haut Aller en bas
https://lgdmm.forumactif.com
 
Un animal de compagnie!
Revenir en haut 
Page 1 sur 1
 Sujets similaires
-
» Animal crossing

Permission de ce forum:Vous ne pouvez pas répondre aux sujets dans ce forum
La guilde des makers de KalHidia :: Ressources :: Ressources graphique 640x480 ( RmXp ) :: Scripts en ruby :: Scripts en ruby(divers)-
Sauter vers: