Day.png);">
Apprendre


Vous êtes
nouveau sur
Oniromancie?

Visite guidée
du site


Découvrir
RPG Maker

RM 95
RM 2000/2003
RM XP
RM VX/VX Ace
RM MV/MZ

Apprendre
RPG Maker

Tutoriels
Guides
Making-of

Dans le
Forum

Section Entraide

Sorties: Star Trek: Glorious Wolf - (...) / Sorties: Dread Mac Farlane - episode 3 / News: Plein d'images cools créées par (...) / Sorties: Star Trek: Glorious Wolf - (...) / Jeux: Final Fantasy 2.0 / Chat

Bienvenue
visiteur !




publicité RPG Maker!

Statistiques

Liste des
membres


Contact

Mentions légales

442 connectés actuellement

29189158 visiteurs
depuis l'ouverture

4209 visiteurs
aujourd'hui



Barre de séparation

Partenaires

Indiexpo

Akademiya RPG Maker

Blog Alioune Fall

Fairy Tail Constellations

Level Up!

Hellsoft

RPG Maker Détente

RPG Fusion

Kingdom Ultimate

Tous nos partenaires

Devenir
partenaire



Créer un animal de compagnie

Gérer le niveau, la faim, la propreté et l'amitié d'un compagnon, façon Nintendogs.

Script pour RPG Maker XP
Ecrit par mysterio
Publié par malfrax (lui envoyer un message privé)
Signaler un script cassé

❤ 0

Auteur : mysterio
Logiciel : RPG Maker XP
Nombre de scripts : 4

Fonctionnalités
- Ajoute un animal de compagnie, façon Nintendog.

Une petite explication des scripts :
- Window_Chat permet d'afficher le NIVEAU du chat (facultatif)
- Window_chat 2 est pour la faim
- Window_chat 3 pour la saleté
- Window_chat 4 pour la joie.

Installation
A placer au-dessus de Main.

Utilisation

Configuration dans les scripts :
Dans Window_Chat :
self.contents.draw_text(0,0,500,32,"Pussy Cat" ) : Le nom du chat à la place de Pussy Cat.
self.contents.draw_text(40,30,500,32,"LV" ) : L'abréviation pour niveau
self.contents.draw_text(80,30,500,32,$game_variables[x].to_s) La variable utilisée pour le niveau (remplacer x par l'id de la variable).

Dans Window_Chat 2 :
if $game_switches[x] == true et if $game_switches[x] == false (ligne 18 et 29) : Vous pouvez changer l'interrupteur pour la faim ici. L'interrupteur doit être au même id pour true et false.
bitmap = RPG::Cache.icon("Viande") (lignes 21 et 32) : icône de la nourriture.
Window_Chat 2 (lignes 18 et 29) : interrupteur utilisé.
bitmap = RPG::Cache.icon("Viande") : icône utilisée pour la nourriture.
self.contents.draw_text(0,0,500,32,"Bol" ) (lignes 24 et 35) : terme utilisé pour le récipient.
self.contents.draw_text(40,30,500,32,"Plein" ) : terme utilisé lorsque le récipient est plein.
self.contents.draw_text(40,30,500,32,"Vide" ) : terme utilisé lorsque le récipient est vide.

Les autres fonctionnent sur le même principe que Window_Chat 2, c'est-à dire que vous pouvez modifier les termes et les icônes. Vous devez juste faire en sorte que vos interrupteurs soient différents dans vos trois scripts.

L'événement chat :
Faites un évenement avec une apparence de chat, avec déclenchement par la touche action.

Portion de code : Tout sélectionner

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
Jouer un effet sonore (SE) : "O67-Animal02" tempo 100, volume 80.
@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
Message : Que voulez-vous faire ?
Choix : [Nourrir],[Laver],[Caresser],[Rien]
si [Nourrir] :
Condition : interrupteur [0008] = on
Msg : Ton chat n'a pas faim.
Sauter vers l'étiquette : chat.
sinon
Condition : Argent =/> 3
Msg : 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
Msg : 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
Msg : 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



Voilà !

Maintenant, que je vous explique l'histoire du niveau.
Par exemple, faites un évenement commun en processus parallèle déclenché par le switch du début de votre jeu.

Portion de code : Tout sélectionner

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


Ensuite pour le faire courir, c'est vous qui voyez ! Je vais pas tout vous faire, hein ! :cheesygrin:

Evénement pour mettre à jour les interrupteurs :
Faites un event sur un lit, activé par la touche action

Portion de code : Tout sélectionner

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
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
<>



Les scripts
Window_Chat :

Portion de code : Tout sélectionner

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#================================
#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



Window_Chat2 :

Portion de code : Tout sélectionner

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#================================
#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



Window_Chat3 :

Portion de code : Tout sélectionner

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#================================
#Window_Chat 3 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



Et Window_Chat4 :

Portion de code : Tout sélectionner

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#================================
#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



Voilà !
J'éspère avoir pu être utile !


Mis à jour le 9 novembre 2020.






julienRPG - posté le 19/08/2008 à 23:35:30 (29 messages postés)

❤ 0

maker du dimanche

pas besoin de script pour sa tu peut faire la meme chose tout en event


lerodeurdejadis - posté le 06/07/2009 à 13:32:00 (10 messages postés)

❤ 0

Chez moi sa marche super sauf ke je vois pas comment les interrupteur se désactive si kkn a une idée^^
Et le chat ne se télépote pas avec moi c'est normale?

rectification, je peut pas non plus sauvegardé help plz!

Le Troisième Monde RPG en dévellopement créé uniquement avec la version basique de RPG Maker! Contacter moi pour + d'info!


antonela100 - posté le 11/09/2010 à 01:43:30 (6 messages postés)

❤ 0

Chez moi ça marche pas...:doute3


Aye - posté le 11/12/2013 à 18:34:15 (13 messages postés)

❤ 0

Empereur Tarenfoudre

Autant faire en Event :hum

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 - Mentions légales

Plan du site

Communauté: Accueil | Forum | Chat | Commentaires | News | Flash-news | Screen de la semaine | Sorties | Tests | Gaming-Live | Interviews | Galerie | OST | Blogs | Recherche
Apprendre: Visite guidée | RPG Maker 95 | RPG Maker 2003 | RPG Maker XP | RPG Maker VX | RPG Maker MV | Tutoriels | Guides | Making-of
Télécharger: Programmes | Scripts/Plugins | Ressources graphiques / sonores | Packs de ressources | Midis | Eléments séparés | Sprites
Jeux: Au hasard | Notre sélection | Sélection des membres | Tous les jeux | Jeux complets | Le cimetière | RPG Maker 95 | RPG Maker 2000 | RPG Maker 2003 | RPG Maker XP | RPG Maker VX | RPG Maker VX Ace | RPG Maker MV | Autres | Proposer
Ressources RPG Maker 2000/2003: Chipsets | Charsets | Panoramas | Backdrops | Facesets | Battle anims | Battle charsets | Monstres | Systems | Templates
Ressources RPG Maker XP: Tilesets | Autotiles | Characters | Battlers | Window skins | Icônes | Transitions | Fogs | Templates
Ressources RPG Maker VX: Tilesets | Charsets | Facesets | Systèmes
Ressources RPG Maker MV: Tilesets | Characters | Faces | Systèmes | Title | Battlebacks | Animations | SV/Ennemis
Archives: Palmarès | L'Annuaire | Livre d'or | Le Wiki | Divers