Night.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: "Dread Mac Farlane", (...) / Tutos: Checklist de la composition (...) / Sorties: Dread Mac Farlane - episode 8 / Sorties: Dread Mac Farlane - episode 7 / Jeux: Ce qui vit Dessous / Chat

Bienvenue
visiteur !




publicité RPG Maker!

Statistiques

Liste des
membres


Contact

Mentions légales

547 connectés actuellement

29445730 visiteurs
depuis l'ouverture

11613 visiteurs
aujourd'hui



Barre de séparation

Partenaires

Indiexpo

Akademiya RPG Maker

Blog Alioune Fall

Fairy Tail Constellations

Offgame

Kingdom Ultimate

RPG Maker VX

Tous nos partenaires

Devenir
partenaire



Messages postés par cortez
Nombre de messages référencés sur Oniromancie (non supprimés): 469

Aller à la page: 1 2 3 4 5 6 7 8 9 10 11 12

Posté dans Forum - [Scripts] Petites questions connes sur les SCRIPTS!!

cortez - posté le 13/12/2021 à 17:40:26. (523 messages postés)

Je comprend mieux pourquoi j'y arrivait pas..
C'est la valeur HIT rate que je doit modifier et dans la version RPGmakerXP de Steam, les champs de valeur sont tous mélangés (d'ailleurs après ta 1ere intervention j'ai eu des doutes sur la valeur Hit Rate)

image

Bref c'est résolu.
Merci les gars.

Posté dans Forum - [Scripts] Petites questions connes sur les SCRIPTS!!

cortez - posté le 12/12/2021 à 21:23:27. (523 messages postés)

Bonsoir,

Merci Roi, pour les explications. (plein de calculs en perspective, moi qui suis pas doué avec les chiffres..)

Donc pour résumer, je doit d'abord calculer
atk_hit = agi ou dex (selon le choix paramétré en BDD sur le skill)
eva = (8 x self.agi)/(atk_hit) + self.eva

Puis reprendre la formule "inversée"
skill.eva_f = 100 * ((100 - hit) / eva)


Donc pour Aluxes lv1 vs Ghost et le skill "Fire" on trouve :

Ghost
AGI 41
EVA 0

Aluxes (lv1)
DEX 59

Skill "Fire"
skill_eva-F = ?

Le système de combat utlilise une valeur DAMAGE_ALGORITHM_TYPE=0 donc atk_hit = user.dex

eva = 8 x 41/59 + 0
eva = 5.56

skill.eva_f = 100 * (100 - 30) / 5.56
skill.eva_f = 1258

Ya sans doute un souci dans les formules ? (la valeur max possible de skill_eva-F est de 100)

Posté dans Forum - [Scripts] Petites questions connes sur les SCRIPTS!!

cortez - posté le 09/12/2021 à 18:24:50. (523 messages postés)

Bonjour,

J'ai une question lié aux formules de combat.

Logiciel : Rm XP (oui je suis un vieux de la vieille, que voulez vous)
Type : formules de combat

Je sais que la formule de "précision/évasion" d'un skill est la suivante :

Portion de code : Tout sélectionner

1
2
3
4
5
6
7
8
9
10
  def set_skill_hit_value(user, skill, effective)
    atk_hit = DAMAGE_ALGORITHM_TYPE > 1 ? user.agi : user.dex
    eva = 8 * self.agi / atk_hit + self.eva
    hit = self.damage < 0 ? 100 : 100 - eva * skill.eva_f / 100
    hit = self.cant_evade? ? 100 : hit
    hit_result = (rand(100) < hit)
    @evaded = true unless hit_result
    effective |= hit < 100
    return effective
  end



J'ai également compris que la valeur skill.eva est celle située dans l'onglet Skills dans le champ EVA ou EVA-F dans les parametres du skill en question.

Je sais également qu'une valeur EVA à 0 fait en sorte que le skill n'échoue jamais (sort de soin par exemple) et qu'une valeur de 100 fait en sorte que seul une cible avec 100 d'esquive peut esquiver le skill. (sans doute 5% du temps comme le calcul des critiques ?)

Voici là ou je bloque, je souhaiterais savoir comment faire pour donner une valeur EVA dans le skill afin que celui-ci touche 30% du temps.

Si possible expliquer la syntaxe rgss1 afin que j'y vois plus clair.

Merci par avance.

Posté dans Forum - Muma|Rope [COLLAB] Venez tester !

cortez - posté le 20/10/2021 à 17:22:19. (523 messages postés)

Les pièces dans les jeux vidéo ne sont pas juste de simples collectables, c'est un outil au même titre que la lumière ou les angles de caméra pour guider le joueur. Donc libre a vous de ne pas apprécier leur existence mais bien utilisé dans le jeu Muma Rope ça peu-être chouette.

C'est pas trop la rubrique pour partager des vidéos mais elle colle parfaitement au débat qui anime ce topic.



PS pour Modo : N'hésitez pas a éditer ce message si il ne convient pas.

Posté dans Forum - Muma|Rope [COLLAB] Venez tester !

cortez - posté le 19/10/2021 à 18:23:05. (523 messages postés)

J'ai voté C.

Je pensais que l'argent collectable pourrais servir a débloquer une galerie d'images sur le développement du jeu. Ou si c'est trop chiant pas fesable un costume alternatif pour le personnage (un simple recolor de la jupe pourrait faire l'affaire.)

N'hésitez pas a me foudroyer si mes idées ne plaisent pas. :D

Posté dans Forum - [photoshop] Le character de Seiryu

cortez - posté le 04/09/2021 à 23:24:04. (523 messages postés)

Bonsoir,

Sinon vite fait sur le net j'ai trouvé cela. (c'est le sprite officiel du jeu Senran no Samurai Kingdom (titre japonais)

image

Au pire si tu te sens de créer un charset par toi même, essaye de prendre comme base le corps de ce genres de créatures. (Léviator est une créature très proche physiquement de ce que tu souhaite obtenir)
image

Posté dans Forum - Screenshots de vos jeux !

cortez - posté le 22/06/2021 à 18:50:41. (523 messages postés)

Duos de screenshot d'un système pour l'exploration des donjons.

Le sacro-saint donjon dans un volcan/zone de lave. J'adore rendre l'exploration aussi agréable et ingénieuse que dans un bon vieux zelda/Golden Sun. Cependant les personnages n'ont pas de pouvoirs a utiliser via un menu ou une touche, mais au moyen d'un objet qui active tous les mécanismes correspondants.

Ici les joueurs ne peuvent pas marcher sur le sol couleur lave (beaucoup trop chaud) Heureusement qu'ils peuvent utiliser un orbe gelé. Qui refroidit le sol (insérer référence a bomberman) pour se créer un passage. Évidement les joueurs sont libre de viser une case en particulier dans une zone prédéfinie.
image
PS: Map en work-in-progess pour valider l'architecture du donjon, je prendrais le temps d'améliorer le rendu après.


Petit aperçu du système sur la map :

Spoiler (cliquez pour afficher)



Posté dans Tutoriels - Système de quête complet en évènement

cortez - posté le 14/06/2021 à 17:30:08. (523 messages postés)

Avec les titres en couleurs ça en jette un max.
Merci pour les smiley (je les avais pas vu lors de la prévisualisation.)

Je vais laisser quelques jours avant de rajouter les "mini tuto" en éditant le message principal.
J'ai longtemps hésité a publier une démo en plus des consignes sur le forum, cependant je suis partisan de l'apprentissage par le "faire soi même". Si une démo existe, nombreux serons ceux qui l'utiliserons sans décortiquer le tuto. Sans démo, le tuto ne sera pas accessible pour tous, mais c'est un peu le but.
Attention pas d'élitisme, juste que l'on progresse chacun a son rythme et lorsque le niveau de chacun augmente, de nouvelles techniques et méthodes peuvent être acquise. C'est sans doute une façon old-school de voir les choses, mais j'y tiens.
Pensez un peu au phases de leveling de vos personnages de rpg favoris, le making c'est pareil.

Posté dans Forum - Discussion Générale de making

cortez - posté le 30/05/2021 à 16:10:54. (523 messages postés)

Merci pour les suggestions.

Je ne voulais pas être restrictif envers un système générique (basiquement le tour par tour est presque partout) mais plus contre les systèmes basique qui découle de chaque archétype.
Donc je ne souhaitais pas avoir de recommendations type FFVII.

Pareil pour le A-RPG (si c'est pas au tour par tour c'est donc en temps réel). Le système de jeu de FFXV n'est pas ce que je recherche.

Afin que je trouve l'inspiration des système qui cumule 2 genre sont parfait.
Avec les recherche de mon coté j'ai trouvé un bon jeu de plateforme qui mélange plateforme et puzzle game: Henry hatsworth l'incroyable expédition

J'ai regardé vos lien et suggestions c'est super j'ai plein d'idées. (coup de coeur pour Radiant Historia et les deux lien de Mack.)

Posté dans Forum - Discussion Générale de making

cortez - posté le 28/05/2021 à 19:08:03. (523 messages postés)

Bonjour, j'ai pas trouvé sur le fofo une discussion similaire alors de demande votre avis ici.

Avez vous en tête un système de combat qui sorte des classique RPG (tour par tour ou arpg) provenant d'un jeu que vous connaissez ou avez déjà vu.

Je souhaite élargir mes connaissances de systèmes exotiques afin d'en conceptualiser un par moi même.

Posté dans Forum - Discussion Générale de making

cortez - posté le 21/03/2021 à 21:55:02. (523 messages postés)

Bonjour à vous.

En parlant de RPG sans prétentions et d'auto flagellation.

Je bosse en ce moment sur un projet Vx Ace avec pour contrainte de n'utiliser que les ressources de base et les scripts/fonctionnalité de base du logiciel. Rien d'extérieur ne doit-être utilisé. En manipulant des appels script je suis parvenu a crée un système d'ennemis qui s'adaptent automatiquement au lvl des joueurs.

Donc en gros si je veux une ressource qui n'existe pas (genre un porte étendard) je m'oblige a utiliser des combinaisons possibles entre character et tileset, et seulement en dernier recours je crée une ressource custom (toujours a partir des RTP).

Voici un petit aperçu :

Une cloison qui s'ouvre dans un mur (charset custom obligatoire)
image

Les portes étendards sont constitué d'un drapeau, d'un tabouret de bar renversé et d'une corde (sur la couche évènement.)
image

Message de débug pour controler le lv des ennemis.
image

Posté dans Forum - [A déterminé] Demande graphique objet portal 2...

cortez - posté le 02/02/2016 à 18:20:16. (523 messages postés)

Invocation réussie... Je vois que l'on parle de mon jeu.
Tout d'abord merci de m'accorder autant de crédit (même si je sais pas trop
pourquoi.)

Ayant fait mes propres ressources, je ne peut que te conseiller de tout faire toi
même. Ensuite pour ce qui est de l'offre de recrutement, je vais refuser.
Je ne travaille pas en temps que graphiste. Le peu de chose que je crée sont
pour moi. (vu le temps que ça me prend...)

Après si tu souhaites avoir des conseils sur le scénario ou des mécanismes
pourquoi pas. Mais je ne connait pas média fusion...

Avant de retourner dans la 9e dimension je te remercie d'avoir pris contact
avec moi. Et merci verehn d'être autant à l'écoute des demandes des makeurs
débutants.

A bientôt.

Posté dans Forum - [RmVxAce] Afficher et contrôler des images pendant les combats.

cortez - posté le 16/07/2015 à 20:55:02. (523 messages postés)

Je suis entièrement d'accord avec toi. ^^

H.S :
A bientôt pour quelques new's sur le projet Fantasy online. Qui reprend sur VxAce !

Posté dans Forum - [RmVxAce] Afficher et contrôler des images pendant les combats.

cortez - posté le 16/07/2015 à 11:10:17. (523 messages postés)

Domaine concerné: Script
Logiciel utilisé: RmVxAce
Bonjour,
Je recherche de l'aide afin d'obtenir un script qui ajoute le viewport des images dans la scene_battle.
Afin de pouvoir utiliser les commandes d’événement pour afficher et modifier des images.


Mon but afficher une roue des éléments durant les combats, j'ai déjà crée le système en évent, seul l'affichage de
cette roue ne marche pas dans les combats. Ajouter un viewport me semble logique puisqu'il semble ne pas être
disponible en dehors de la scene_map. Cependant tout moyen qui me permet d'afficher des images via commande
d'évent pendant un combat me convient.

Merci.


Dsl du dérangement j'ai fini par y arriver tout seul. (les images peuvent être affichée nativement)

Posté dans Screen de la semaine - Polaris 03 - Premières énigmes

cortez - posté le 08/07/2015 à 17:14:25. (523 messages postés)

J'ai rien contre Nemau mais j’accroche pas au style de perspective utilisé dans Polaris.
J'ai l'impression que le joueur est couché au sol. Et les caisses sont trop bizarres.
(Dans LoZ minish Cap les personnages sont vu de plus haut et les bloc aussi.)

Posté dans Forum - [Scripts] Petites questions connes sur les SCRIPTS!!

cortez - posté le 25/06/2015 à 23:15:11. (523 messages postés)

@brikou
Normalement un :
@spriteset.dispose
que tu place après la ligne 41 devrait résoudre les problèmes. Ou 31 si la manipulation ne change rien.
Je connait bien XP mais VXace modifie tout avec ses def Start et def Terminate.

Posté dans Forum - [VX] RPG Tactique basé sur l'univers de Naruto

cortez - posté le 23/06/2015 à 23:11:16. (523 messages postés)

Question c'est normal que tous tes screens soit passés au filtre "lumière crue".
(la luminosité est aux max)
C'est pareil pour la vidéo. Il faut que tu saches que c'est gênant pour les yeux.

Hormis ce détail, les décors sont sympas (la salle d'examen est trop grande/vide)
Le moteur de T-rpg fonctionne bien. Je l'ai déjà utilisé avec 8 ennemis et l'IA
fonctionne correctement (même si certaines de ses décisions prennent plus de temps)

On te l'a déjà dit, mais pense à modifier l'interface des menus de combat pour qu'ils
s'intègrent dans l'univers de ton jeu.

Posté dans Forum - Alex d'Or 2015

cortez - posté le 18/06/2015 à 21:24:37. (523 messages postés)

Question pour les gens qui savent quels jeux peuvent être présentés aux Alex d'Or.

Je ne pourrais pas finir mon projet Fantasy Online à temps. Cependant je souhaite
participer. Pensez vous que je peux présenter Portal XP ? La règle des 45 minutes
semble m'en empêcher.

Posté dans Screen de la semaine - Polaris 03 - Au fond du trou

cortez - posté le 10/06/2015 à 21:01:39. (523 messages postés)

Ok vous avez raisons Nemau ne fait pas parti du staff. Cependant pour avoir une
"joulie" étiquette, il faut être dans les petit papier du staff. Bref ça sent le piston.
(sous le bureau le piston ?).

En tout cas je félicite les participants encore une fois, je n'ai plus le temps de
participer avec mon nouvel emploi du temps de ouf. (Il est possible que je ne
puisse pas non plus participer aux Alex d'or... -_- )

Posté dans Screen de la semaine - Polaris 03 - Au fond du trou

cortez - posté le 10/06/2015 à 12:11:25. (523 messages postés)

Un bon niveau général. ça fait plaisir à voir.

-Mode complot-
encore un staff qui gagne. ->[]

Posté dans Forum - [Solde Steam] RPGmaker XP à 4,59€ jusqu'au 29 Mai

cortez - posté le 27/05/2015 à 16:49:32. (523 messages postés)

Je me rend compte que tous les rpgmaker sur steam sont en solde jusqu'au 29 Mai.

Petite liste :
VX Ace : 12€
XP : 4,59€
2003 : 9,99€

Donc plus d'excuse pour ne pas "maker" cette année. (légalement à petit prix)

Posté dans Forum - [Solde Steam] RPGmaker XP à 4,59€ jusqu'au 29 Mai

cortez - posté le 27/05/2015 à 16:04:30. (523 messages postés)

Un petit coucou pour vous signaler la remise sur steam de RPG maker XP. Profitez en vite l'offre n'est valable que jusqu'au 29 mai (vendredi de cette semaine donc).

Un lien tout de même pour trouver la page du shop steam :
http://store.steampowered.com/app/235900

à bientôt, moi je file me mettre dans la légalité/ l'acheter.

Posté dans Forum - [Résolu] [RPG MAKER VX ACE] Si la touche n'est PAS appuyée

cortez - posté le 18/05/2015 à 17:48:07. (523 messages postés)

@Mack :
Je ne savais pas que cette commande de script était utilisable sans script en plus.
c'est super utile !

Posté dans Forum - [Résolu] [RPG MAKER VX ACE] Si la touche n'est PAS appuyée

cortez - posté le 18/05/2015 à 09:26:21. (523 messages postés)

Un peu de script sinon ? C'est plus complexe que les autres systèmes mais ça
fonctionne sans soucis :

Essaye une commande de script dans la condition (dernier onglet "si script")

Si script : Input.trigger?(:X ) # :X peut être remplacé par une autre touche dans le script ligne 138 à 157
Tu lance ton animation de tir et le reste de l'évent pour tirer.
fin

Et c'est tout, rien de plus à ajouter. Si le joueur tapote la touche ça tire à chaque fois mais si il laisse enfoncé ça fait rien.


Et le script à utiliser :

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
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
$imported ||= {}
$imported[:zf_keyboard_manager] = "1.1.0"
#+----------------------------------------------------------------------------+
#|   1 - Basic Info
#-============================================================================-
#|  Script:  Keyboard Manager
#|  Version: 1.1.0
#|  Updated: April 9th 2015
#|  Author:  Zalerinian (~ZF)
#------------------------------------------------------------------------------
#|   2 - Section Overview
#-============================================================================-
#|    1 - Basic Info
#|    2 - Section Overview
#|    3 - Script Summary
#|    4 - Version History
#|    5 - Script Support
#|    6 - Attribution
#|    7 - Method List
#|    8 - Usage
#|    9 - Known Issues
#|   10 - Configuration
#------------------------------------------------------------------------------
#|   3 - Script Summary
#-============================================================================-
#| This script allows the developer to set the controls for the game, without
#| needing to worry about the player's control setup.
#------------------------------------------------------------------------------
#|   4 - Version History
#-============================================================================-
#|  v1.1.0 - April 9th, 2015
#|   - Fixed an issue that prevented the player from moving with the set
#|     keybinding.
#|
#|  v1.0.1 - March 11th, 2014
#|   - Fixed a bug when using conditional branches in events
#|
#|  v1.0.0 - March 9th 2014
#|   - Initial Release
#------------------------------------------------------------------------------
#|   5 - Script Support
#-============================================================================-
#|  For support, bug reports, or feedback, please email scripts@razelon.tk,
#|  or send me (Zalerinian) a private message (PM) on the RPG maker forums.
#------------------------------------------------------------------------------
#|   6 - Attribution (Credit)
#-============================================================================-
#|  I do not require credit to be given. You may use this script in a
#|  commercial or non-commercial game, so long as you do not claim that
#|  you wrote it. You may port this script to another engine, and are free
#|  to require credit for it. Do not claim that the original script was
#|  yours. The script also must remain free for both commercial and
#|  non-commercial use.
#------------------------------------------------------------------------------
#|   7 - Method List
#|    + = New Method
#|    * = Aliased Method
#|    ! = Overwritten Method
#-============================================================================-
#| Input
#|  + any_key?
#|  + released?(key)
#|  * press?(key)
#|  * trigger?(key)
#|  ! repeat?(key)
#|  ! dir4
#|  ! dir8
#------------------------------------------------------------------------------
#|   8 - Usage
#-============================================================================-
#| This script is plug-n-play, with configuration explained below.
#------------------------------------------------------------------------------
#|   9 - Known Issues
#-============================================================================-
#| Bound keys will not function with gamepads, only those that do not get
#| rebound will function with gamepads, however RMs gamepad system is designed
#| to work with a controller setup that is not similar to those found on the
#| Xbox or Playstation.
#|
#| Rebinding keys is not currently possible in-game. A future update will
#| provide this feature.
#------------------------------------------------------------------------------
#|  10 - Configuration
#-============================================================================-
module Zale
  module Keyboard_Manager
    # Editable Area below!
    # Don't touch this
    Keys = {
  #   backspace    tab         enter         any shift     any control     any alt     caps lock    escape      spacebar
      _back: 0x08, _tab: 0x09, _enter: 0x0D, _shift: 0x10, _control: 0x11, _alt: 0x12, _capl: 0x14, _esc: 0x1B, _space: 0x20,
  #   page up      page down    end         home         left arrow   up arrow   right arrow   down arrow   print screen key
      _pgup: 0x21, _pgdn: 0x22, _end: 0x23, _home: 0x24, _left: 0x25, _up: 0x26, _right: 0x27, _down: 0x28, _print_screen: 0x2C,
  #   insert         delete         help         0         1         2         3         4         5         6         7
      _insert: 0x2D, _delete: 0x2E, _help: 0x2F, _0: 0x30, _1: 0x31, _2: 0x32, _3: 0x33, _4: 0x34, _5: 0x35, _6: 0x36, _7: 0x37,
  #   8          9         A         B         C         D         E         F         G         H         I         J
      _8: 0x38, _9: 0x39, _a: 0x41, _b: 0x42, _c: 0x43, _d: 0x44, _e: 0x45, _f: 0x46, _g: 0x47, _h: 0x48, _i: 0x49, _j: 0x4A,
  #   K         L         M         N         O         P         Q         R         S         T         U         V
      _k: 0x4B, _l: 0x4C, _m: 0x4D, _n: 0x4E, _o: 0x4F, _p: 0x50, _q: 0x51, _r: 0x52, _s: 0x53, _t: 0x54, _u: 0x55, _v: 0x56, 
  #   W         X         Y         Z         left win     right win    numpad 0    numpad 1      numpad 2     numpad 3
      _w: 0x57, _x: 0x58, _y: 0x59, _z: 0x5A, _lwin: 0x5B, _rwin: 0x5C, _num0: 0x60, _num1: 0x61, _num2: 0x62, _num3: 0x63,
  #   numpad 4     numpad 5     numpad 6     numpad 7     numpad 8     numpad 9     numpad *      numpad +    numpad -
      _num4: 0x64, _num5: 0x65, _num6: 0x66, _num7: 0x67, _num8: 0x68, _num9: 0x69, _multi: 0x6A, _add: 0x6B, _sub: 0x6D, 
  #   numpad .    numpad /    FN 1       FN 2       FN 3       FN 4       FN 5       FN 6       FN 7       FN 8
      _dec: 0x6E, _div: 0x6F, _f1: 0x70, _f2: 0x71, _f3: 0x72, _f4: 0x73, _f5: 0x74, _f6: 0x75, _f7: 0x76, _f8: 0x77,
  #   FN 9       FN 10       FN 11       FN 12       FN 13       FN 14       FN 15       FN 16       FN 17       FN 18
      _f9: 0x78, _f10: 0x79, _f11: 0x7A, _f12: 0x7B, _f13: 0x7C, _f14: 0x7D, _f15: 0x7E, _f16: 0x7F, _f17: 0x80, _f18: 0x81,
  #   FN 19       FN 20       FN 21       FN 22       FN 23       FN 24       left shift     right shift    left ctrl
      _f19: 0x82, _f20: 0x83, _f21: 0x84, _f22: 0x85, _f23: 0x86, _f24: 0x87, _lshift: 0xA0, _rshift: 0xA1, _lcontrol: 0xA2, 
  #   right xtrl       left alt     right alt    :             =              ,             -             .
      _rcontrol: 0xA3, _lalt: 0xA4, _ralt: 0xA5, _colon: 0xBA, _equals: 0xBB, _comma: 0xBC, _minus: 0xBD, _period: 0xBE,
  #   /             ` (~)         [              \                 ]              ' (")
      _slash: 0xBF, _tilde: 0xC0, _lbrace: 0xDB, _backslash: 0xDC, _rbrace: 0xDD, _quote: 0xDE
    }
    
    # Edit here: 
    # Each key binding is stored in the format:
    # internal_button: array of keyboard keys to check.
    
    # Using this, you can create your own key bindings for
    # special functions. These names are used internally to
    # check for input. Each key on the keyboard is stored
    # in the Keys hash above. Ex:
    
    # JUMP: [Keys[:_space] ]
    
    # Now if whenever we use Input.trigger?(:JUMP), Input.press?(:JUMP),
    # or similar, it will check to see if the spacebar has been
    # pressed down, or just released if you use Input.released?(:JUMP).
    
    # The default RM controls are setup by default. If 
    # wish to allow the player to change some controls,
    # comment out (place a # before), or remove each
    # control you wish to leave up to the player. Currently,
    # this is the only way to change controls during the
    # game. A later update will change this.
    Key_Bindings = {
      A:     [Keys[:_shift] ],
      B:     [Keys[:_esc] ],
      C:     [Keys[:_enter], Keys[:_space], Keys[:_z] ],
      X:     [Keys[:_a] ],
      Y:     [Keys[:_s] ],
      Z:     [Keys[:_d] ],
      L:     [Keys[:_q] ], 
      R:     [Keys[:_w] ],
      UP:    [Keys[:_up], Keys[:_num8] ],
      DOWN:  [Keys[:_down], Keys[:_num2] ],
      RIGHT: [Keys[:_right], Keys[:_num6] ],
      LEFT:  [Keys[:_left], Keys[:_num4] ],
      SHIFT: [Keys[:_shift] ],
      CTRL:  [Keys[:_control] ],
      ALT:   [Keys[:_alt] ],
      F5:    [Keys[:_f5] ],
      F6:    [Keys[:_f6] ],
      F7:    [Keys[:_f7] ],
      F8:    [Keys[:_f8] ],
      F9:    [Keys[:_f9] ]
    }
  end
end
 
module Input
  @released = Hash.new{}
  @triggers = Hash.new{}
  @pressed  = Hash.new{}
  @timer    = Hash.new{}
  @table = {
    2 => :DOWN,
    4 => :LEFT,
    6 => :RIGHT,
    8 => :UP,
    11 => :A,
    12 => :B,
    13 => :C,
    14 => :X,
    15 => :Y,
    16 => :Z,
    17 => :L,
    18 => :R,
  }
  
  KEY   = Win32API.new("user32.dll", "GetKeyState",      ["i"], "i")
  AKEY  = Win32API.new("user32.dll", "GetAsyncKeyState", ["i"], "i")
  
  class << self
    include Zale::Keyboard_Manager
    #--------------------------------------------------------------------------
    # Input: Update                                             ALIASED METHOD
    #  * Update will update the status of each key for input check.
    #--------------------------------------------------------------------------
    alias zale_keyman_input_update_CIO223cjcivoa update
    def update
      zale_keyman_input_update_CIO223cjcivoa
      Keys.each_value{ |key|
        @pressed[key]  == nil ? @pressed[key]  = false : nil
        @triggers[key] == nil ? @triggers[key] = false : nil
        @released[key] == nil ? @released[key] = false : nil
        @timer[key]    == nil ? @timer[key]    = 30    : nil
        (@pressed[key] == false && AKEY.call(key) != 0) ? @triggers[key] = true : @triggers[key] = false
        (AKEY.call(key) != 0) ? @pressed[key] = true : @pressed[key] = false
        (@pressed[key] == true && AKEY.call(key) == 0) ? @released[key] = true : @released[key] = false
      }
    end
    
    #--------------------------------------------------------------------------
    # Input: Press?                                             ALIASED METHOD
    #  * Press will check if the given key is pressed down on the keyboard.
    #  * This method does not take into account any delays, if the key is
    #  * down, this will return true.
    #--------------------------------------------------------------------------
    alias zale_keyman_input_press_DIOjd2iovjs press?
    def press?(key)
      if @table[key]
        key = @table[key]
      end
      if Key_Bindings[key]
        Key_Bindings[key].any?{|k| @pressed[k] }
      elsif !@pressed[Keys[key]].nil?
        @pressed[Keys[key]]
      else
        zale_keyman_input_press_DIOjd2iovjs(key)
      end
    end
 
    #--------------------------------------------------------------------------
    # Input: Trigger?                                           ALIASED METHOD
    #  * Trigger checks if the key was just immediately pressed. This returns
    #  * true only for the first frame the key is pressed down. To check for
    #  * the key being down at any time, use press?, described above.
    #--------------------------------------------------------------------------
    alias zale_keyman_input_trigger_389fHUKWquihc trigger?
    def trigger?(key)
      if @table[key]
        key = @table[key]
      end
      if Key_Bindings[key]
        Key_Bindings[key].any?{|k| @triggers[k] }
      elsif !@triggers[Keys[key]].nil?
        @triggers[Keys[key]]
      else
        zale_keyman_input_trigger_389fHUKWquihc(key)
      end
    end
    
    #--------------------------------------------------------------------------
    # Input: Repeat?                                        OVERWRITTEN METHOD
    #  * Repeat will check if a key is pressed down, similar to press?, 
    #  * however, repeat? will take into account a delay. After initially
    #  * pressing the button, the delay will 30 frames (one half of second).
    #  * After, the delay will be 5 frames (one 12th of a second)
    #--------------------------------------------------------------------------
    def repeat?(key)
      if @table[key]
        key = @table[key]
      end
      if !press?(key) || @timer[key].nil?
        @timer[key] = 30
      end
      if trigger?(key)
        return true
      else
        if @timer[key] <= 0
          @timer[key] = 5
          true
        else
          @timer[key] -= 1
          false
        end
      end
    end
 
    #--------------------------------------------------------------------------
    # Input: Toggle?                                                NEW METHOD
    #  * Toggle checks the specified key to see if it is 'on or off'. This is
    #  * useless for most keys, however capslock can by checked with this.
    #--------------------------------------------------------------------------
    def toggle?(key)
      if @table[key]
        key = @table[key]
      end
      key = Keys[key]
      key ? nil : (return false)
      if KEY.call(key) == 1
        return true
      else
        return false
      end
    end
 
    #--------------------------------------------------------------------------
    # Input: Released?                                              NEW METHOD
    #  * Similar to trigger?, release will check if a key has jut been
    #  * released. Again, this only returns true for the first frame
    #--------------------------------------------------------------------------
    def released?(key)
      if @table[key]
        key = @table[key]
      end
      if Key_Bindings[key]
        Key_Bindings[key].all?{ |bind| @released[bind] }
      else
        @released[key]
      end
    end
 
    #--------------------------------------------------------------------------
    # Input: Any_key?                                               NEW METHOD
    #  * Any_key? will check to see if any key on the entire keyboard has been
    #  * pressed down. If any single key is down, this returns true, otherwise
    #  * false.
    #--------------------------------------------------------------------------
    def any_key?
      @pressed.any?{|i| i[1] == true}
    end
    
    #--------------------------------------------------------------------------
    # Input: dir4?                                           OVERWRITTEN METHOD
    #  * dir4 returns an integer based on the keys being pressed. This only
    #  * checks for 4 directions, up, down, left, or right. If no keys are
    #  * pressed, the method returns 0.
    #--------------------------------------------------------------------------
    def dir4
      l = Key_Bindings[:LEFT].any?  {|bind| @pressed[bind]}
      r = Key_Bindings[:RIGHT].any? {|bind| @pressed[bind]}
      u = Key_Bindings[:UP].any?    {|bind| @pressed[bind]}
      d = Key_Bindings[:DOWN].any?  {|bind| @pressed[bind]}
      
      if u && !d
        8
      elsif d && !u
        2
      elsif l && !r
        4
      elsif r && !l
        6
      else
        0
      end
    end
    
    #--------------------------------------------------------------------------
    # Input: dir8?                                           OVERWRITTEN METHOD
    #  * Similar to dir4, this method will return an integer based on 8
    #  * directions, meaning it works with diagonal movement. Again, if no keys
    #  * are being pressed, the method returns 0.
    #--------------------------------------------------------------------------
    def dir8
      l = Key_Bindings[:LEFT].any?  {|bind| @pressed[bind]}
      r = Key_Bindings[:RIGHT].any? {|bind| @pressed[bind]}
      u = Key_Bindings[:UP].any?    {|bind| @pressed[bind]}
      d = Key_Bindings[:DOWN].any?  {|bind| @pressed[bind]}
      
      if l && u && !r && !d
        7
      elsif u && r && !l && !d
        9
      elsif l && d && !r && !u
        1
      elsif d && r && !l && !u
        3
      elsif u && !d
        8
      elsif d && !u
        2
      elsif l && !r
        4
      elsif r && !l 
        6
      else
        0
      end
    end
  end
end



Posté dans Forum - [RPG Maker VX Ace] Pour des altérations qui restent malgré la mort.

cortez - posté le 05/05/2015 à 23:11:06. (523 messages postés)

Les statuts dans VXAce ont une priorité. La mort possède la priorité la plus haute
elle écrase les autres statuts lorsque la cible meurt.
Essaye de voir si ton problème vient de là (il est dangereux d'immuniser un personnage au statut mort.)

Posté dans Forum - [RPG MAKER VX ACE] Nénuphar pour marcher sur l'eau

cortez - posté le 30/04/2015 à 18:28:43. (523 messages postés)

Pourquoi ne pas utiliser des évents en dessous du héro. (au moins 4)
1/ Tu mets ton eau en traversable.
2/ Dans les tags terrain (1 à 64) tu peints l'eau avec le n°2 (ou un autre)

Dans un évent parallèle :
Etiquette 1
3/ Tu vérifie l'ID de la case ou se trouve le joueur, et aussi ses coordonnées X et Y. (variable H_X et H_Y)

Si c'est une case ID 2 c'est de l'eau. Sinon "Allez à l'étiquette 1"
4/ Tu téléporte un event nénuphar1 aux coordonnée du héro.
Etiquette 2
5/ Tu enregistres les Variables H_X et H_Y dans une variable OldX et OldY. Et tu
enregistre à nouveau la position du héro en X et Y et l'ID de la case. (H_X et H_Y)

6/ Toujours dans l'évent parallèle tu vérifie si les coordonnés de H_X ou H_Y sont
différentes de OldX ou OldY. Sinon "Aller à l'étiquette 2"

Si les valeurs sont différentes, le héro c'est déplacé. Donc on vérifie si l'ID de la nouvelle case est 2 (donc si c'est de l'eau ou pas.)
Si le héro à bougé et que la case est ID 2 :
7/ Téléporte l'évent nénuphar2 sur les coordonnées du héro.
Etiquette 3
...

Ensuite tu fait pareil avec pour les 2 autres nénuphars. (recopie les étapes 5,6,7
mais en changeant l'évent téléporté. Pense aussi a ajouter les étiquettes en
changeant le chiffre.)

Pour les évent nénuphars :
Traversables et apparence de nénuphar en dessous du héro.
Type de déplacement : Personnalisé Fréquence Max Vitesse Max
Attendre 1 frame
Tourner de 90° vers la gauche.
Attendre 1 frame
Tourner de 90° vers la gauche.
Attendre 1 frame
Tourner de 90° vers la gauche.
Attendre 1 frame
Opacité 0
Condition de déclenchement "au contact du héro"

Page 1
Opacité 255 (cet évenement)
Regarde vers le bas.

Utilise ce character !$Nenuphar
image

Note :
Il est possible que les évent en dessous du héro crée des bug de superposition, dans ce cas il te faut un
script pour gérer la priorité d'affichage des characters.

Posté dans Forum - [VX ACE] Problème concernant le script

cortez - posté le 24/04/2015 à 15:08:15. (523 messages postés)

Content que tu ais réussi. ^^

Posté dans Forum - [VX ACE] Problème concernant le script

cortez - posté le 23/04/2015 à 17:36:18. (523 messages postés)

Pour la longueur des jauges je sais pas trop mais pour les aligner il faut modifier
dx (inspire toi du dy que j'ai fait.)

Au final tu devrais avoir
dy -=20
dx-= XX (- pour déplacer vers la gauche et + pour aller vers la droite.

Edit : Pour la longueur des jauges au pire des cas tu peux essayer de remplacer
le mot width par une valeur en pixel (au pif 92)

Portion de code : Tout sélectionner

1
draw_gauge(dx, dy, width, actor.hp_rate, hp_gauge_color1, hp_gauge_color2)


devient

Portion de code : Tout sélectionner

1
draw_gauge(dx, dy, 92, actor.hp_rate, hp_gauge_color1, hp_gauge_color2)



Posté dans Forum - [VX ACE] Problème concernant le script

cortez - posté le 23/04/2015 à 15:25:51. (523 messages postés)

Je n'arrive pas à récupérer le script. Je vais donc t'aider à le modifier par toi même.

Premièrement tu dois trouver le morceau de script qui affiche les HP. Il commence
par :

Portion de code : Tout sélectionner

1
2
3
4
5
  #--------------------------------------------------------------------------
  # overwrite method: draw_actor_hp
  #--------------------------------------------------------------------------
  def draw_actor_hp(actor, dx, dy, width = XXX)
  ...



Regarde les XXX et note ce chiffe, il nous servira à modifier la longueur de la barre
des Mp et Tp. En dessous de "def draw_actor_hp"

Ajoute une nouvelle ligne.

Portion de code : Tout sélectionner

1
dy-= 20 #20 ou plus selon le rendu in game.



Ensuite tu modifies remplace le morceau que tu as posté par celui-ci : :avert2 Modifie les XXX !

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
  #--------------------------------------------------------------------------
  # overwrite method: draw_actor_mp
  #--------------------------------------------------------------------------
  def draw_actor_mp(actor, dx, dy, width = XXX) # Remplace XXX par le chiffre trouvé dans le script des Hp
  dy -= 20 # Remplace 20 par le chiffre que tu as mis pour les HP
    draw_gauge(dx, dy, width, actor.mp_rate, mp_gauge_color1, mp_gauge_color2)
    change_color(system_color)
    cy = (Font.default_size - contents.font.size) / 2 + 1
    draw_text(dx+2, dy+cy, 30, line_height, Vocab::mp_a)
    draw_current_and_max_values(dx, dy+cy, width, actor.mp, actor.mmp,
      mp_color(actor), normal_color)
    end
    
  #--------------------------------------------------------------------------
  # overwrite method: draw_actor_tp
  #--------------------------------------------------------------------------
  def draw_actor_tp(actor, dx, dy, width = XXX) # Remplace XXX par le chiffre trouvé dans le script des Hp
    draw_gauge(dx, dy, width, actor.tp_rate, tp_gauge_color1, tp_gauge_color2)
    change_color(system_color)
    cy = (Font.default_size - contents.font.size) / 2 + 1
    draw_text(dx+2, dy+cy, 30, line_height, Vocab::tp_a)
    change_color(tp_color(actor))
    draw_text(dx + width - 42, dy+cy, 42, line_height, actor.tp.to_i, 2)
  end



Petite explication sur la manipulation :
dx et dy sont des variables qui donnent la position en x et y de l'affichage de la jauge et du reste.
J'ai utilisé l'opération += et -= en fait c'est un raccourci pour une formule plus longue.
"a+= 2" équivaut à "a = a+2" Pareil avec les autres signes d'opération ( - + / * )

Posté dans Forum - [VX ACE] Problème concernant le script

cortez - posté le 22/04/2015 à 20:46:59. (523 messages postés)

Essaye ça :

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
 #--------------------------------------------------------------------------
  # overwrite method: draw_actor_mp
  #--------------------------------------------------------------------------
  def draw_actor_mp(actor, dx, dy, width = 124)
    draw_gauge(dx, dy, width, actor.mp_rate, mp_gauge_color1, mp_gauge_color2)
    change_color(system_color)
    cy = (Font.default_size - contents.font.size) / 2 + 1
    draw_text(dx+2, dy+cy, 30, line_height, Vocab::mp_a)
    draw_current_and_max_values(dx, dy+cy, width, actor.mp, actor.mmp,
      mp_color(actor), normal_color)
    end
    
  #--------------------------------------------------------------------------
  # overwrite method: draw_actor_tp
  #--------------------------------------------------------------------------
  def draw_actor_tp(actor, dx, dy, width = 124)
    dy+= 15 #Changer le chiffre pour modifier la position en y de la jauge.
    draw_gauge(dx, dy, width, actor.tp_rate, tp_gauge_color1, tp_gauge_color2)
    change_color(system_color)
    cy = (Font.default_size - contents.font.size) / 2 + 1
    draw_text(dx+2, dy+cy, 30, line_height, Vocab::tp_a)
    change_color(tp_color(actor))
    draw_text(dx + width - 42, dy+cy, 42, line_height, actor.tp.to_i, 2)
  end



Posté dans Forum - [VXAce] compatibilité entre 2 scripts. [Résolu]

cortez - posté le 22/04/2015 à 10:47:27. (523 messages postés)

J'ai encore un bug d'affichage pour des évent avec un $ (1 seul par planche) mais
pour les event en planche de 8 aucun souci ! Donc je te propose cette version,
elle fonctionne pour tes perso et les character uniquement en planche.

Nouveau script Extra frames :

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
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
#==============================================================================
#    Extra Movement Frames
#    Version: 1.0.1
#    Author: modern algebra (rmrk.net)
#    Date: 26 September 2012
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
#  Description:
#    
#    This script allows you to import character sprites with more than 3 frames 
#  for movement animation. In other words, it allows you to animate sprites a 
#  little more smoothly. One use for it is it allows RMXP format characters to 
#  be imported directly into a VXA game without editing (although you will need 
#  to rename the file).
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
#  Instructions:
#    
#    Paste this script into its own slot in the Script Editor, above Main but
#   below Materials. If you are using my Composite Graphics script, then this
#   script must be placed in a slot below Composite Graphics.
#
#    To create a sprite with extra movement frames, all you need to do is 
#   rename the character graphic to something of the form:
#
#      Regular_Name%(x)
#        where:
#          x is the number of frames in each character sprite
#  
#  EXAMPLES:
#
#    $001-Fighter01%(4)
#      This graphic is a single character with four frames of animation. [XP]
#    022-Actors12%(6)
#      This graphic would be interpreted as a character sheet of 8 characters,
#      each having six frames of animation.
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#    Additionally, this script also allows you to specify the "idle" frame (the
#   frame where the sprite is not moving), and also the pattern if wish to so
#   specify. In essence, all you need to do is add those integers after the
#   number of frames:
#
#      Regular_Name%(x y1 y2 y3 ... yx)
#        where:
#          x is the number of frames in each character sprite
#          y1 is the idle frame (the frame shown when sprite is not moving)
#          y2 ... yx are the pattern.
#
#   Keep in mind that the first frame in a sprite is index 0, the second frame
#   is index 1, etc.
#
#    Where y1 is excluded, it is assumed to be 0. Where y2 ... yx are excluded,
#   the pattern is assumed to simply cycle through the frames one by one until
#   it repeats.
#
#  EXAMPLES:
#
#    $003-Fighter03%(4 2)
#      This graphic is a single character with four frames of animation. The 
#      idle frame is 2 (the third one over). The pattern when moving would be
#      2 3 0 1, 2 3 0 1, etc.
#    032-People05%(4 0 1 0 3 2 1)
#      This graphic would be interpreted as a character sheet of 8 characters,
#      each having four frames of animation. The idle frame is 0 (the first
#      in the sheet), and the pattern is 0 1 0 3 2 1, 0 1 0 3 2 1, etc.
#==============================================================================
 
$imported = {} unless $imported
$imported[:MA_ExtraMovementFrames] = true
 
#==============================================================================
# *** MA_ExtraMovementFrames
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
#  This module holds a method for calculating width and height of an emf
# character frame
#==============================================================================
 
module MA_ExtraMovementFrames
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Check if Character has extra movement frames
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  def ma_char_is_emf_sprite?(character_name)
    character_name && !character_name[/\%[\(\[].+?[\)\]]/].nil?
  end
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Derive Frames Array
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  def maemf_get_frames(character_name)
    character_name = "" unless character_name
    frames = !character_name[/\%[\(\[](.+?)[\)\]]/] ? [] : 
      $1.scan(/\d+/).collect { |s| s.to_i }
    frames[0] = 3 unless frames[0] # If empty, then set to default 3
    frames.push(1, 2, 1, 0) if frames[0] == 3 && frames.size < 2
    frames[1] = 0 unless frames[1] # Set idle frame
    if frames.size < 3
      # Create pattern 
      (frames[0] - 1).times {|i| frames.push((frames[1] + i + 1) % frames[0]) } 
    end
    return frames
  end
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Calculate Frame Size
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  def maemf_calc_frame_size(character_name, bitmap, frames = [])
    character_name = "" unless character_name
    frames = maemf_get_frames(character_name) if frames.empty?
    $cw = bitmap.width / (frames[0] ? frames[0] : 3)
    $ch = bitmap.height / 4
    sign = character_name[/^[\!\$]./]
    if !sign || !sign.include?('$')
      $cw /= 4
      $ch /= 2
    end
    return $cw, $ch
  end
end
 
# Compatibility with Composite Graphics
if $imported[:MA_CompositeGraphics]
  #============================================================================
  # *** Cache
  #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  #  Summary of Changes:
  #    aliased method - macgve_make_unique_name
  #============================================================================
  class << Cache
    #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    # * Make Unique Name
    #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    alias macgemf_uniqname_3tc8 macgve_make_unique_name
    def macgve_make_unique_name(cg_array = [], *args)
      result = macgemf_uniqname_3tc8(cg_array, *args) # Call Original Method
      # Add %(x) code to name if the first graphic in the array contains it.
      result += $1 if cg_array[0] && cg_array[0].filename[/(\%[\(\[].+?[\)\]])/]
      result
    end
  end
end
 
#==============================================================================
# ** Game_CharacterBase
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
#  Summary of Changes:
#    aliased method - straighten; update_anime_pattern; initialize;
#      set_graphic; character_name=
#    new methods - maemf_init_char_frames
#==============================================================================
 
class Game_CharacterBase
  include MA_ExtraMovementFrames
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Straighten
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  alias maemf_straghtn_5sb3 straighten
  def straighten(*args, &block)
    maemf_straghtn_5sb3(*args, &block) # Run original method
    @pattern = @original_pattern if @walk_anime || @step_anime
  end
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Update Anime Pattern
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  alias maemf_updanim_ptrn_2yv5 update_anime_pattern
  def update_anime_pattern(*args)
    if @ma_char_is_emf_sprite # If an emf sprite
      if !@step_anime && @stop_count > 0 # Reset to stationary
        @maemf_frame_index = 0
        @pattern = @original_pattern
      else
        # Next Pattern
        @maemf_frame_index = (@maemf_frame_index + 1) % @maemf_character_pattern.size
        @pattern = @maemf_character_pattern[@maemf_frame_index]
      end
    else
      maemf_updanim_ptrn_2yv5(*args) # Call original method
    end
  end
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Initialize Character Frames
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  def maemf_init_char_frames
    @maemf_frame_index = 0 # Initialize Index
    # Save this value for faster reference
    @ma_char_is_emf_sprite = ma_char_is_emf_sprite?(character_name)
    if @ma_char_is_emf_sprite
      # Get pattern
      @maemf_character_pattern = maemf_get_frames(character_name)
      @maemf_character_pattern.shift # Remove frame number
      @original_pattern = @maemf_character_pattern[0]
    else
      @maemf_character_pattern = []
    end
  end
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Initialize Character Frames Proc
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  def self.maemf_init_char_frames_proc
    Proc.new { |method_name|
      alias_method(:"maemf_#{method_name}_2ev9", method_name) # Alias
      define_method(method_name) do |*args| # Define method
        send(:"maemf_#{method_name}_2ev9", *args) # Call original method
        maemf_init_char_frames
      end
    }
  end
  proc = maemf_init_char_frames_proc
  [:initialize, :set_graphic].each { |name| proc.call(name) }
end
 
#==============================================================================
# ** Game_Player/Follower/Vehicle/Event
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
#  This aliases methods in these classes that change @character_name in order
# to call maemf_init_char_frames
#==============================================================================
 
class Game_Player
  # Refresh
  maemf_init_char_frames_proc.call(:refresh)
end
 
class Game_Follower
  # Refresh
  maemf_init_char_frames_proc.call(:refresh)
end
 
class Game_Vehicle
  # Load System Settings
  maemf_init_char_frames_proc.call(:load_system_settings)
end
 
class Game_Event  
  proc = maemf_init_char_frames_proc
  # Clear Page Settings & Setup Page Settings
  [:clear_page_settings, :setup_page_settings].each { |name| proc.call(name) }
end
 
#==============================================================================
# ** Sprite_Character
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
#  Summary of Changes:
#    aliased methods - set_character_bitmap; update_src_rect
#    new methods - ma_set_emf_character_bitmap; ma_update_emf_src_rect
#==============================================================================
 
class Sprite_Character
  include MA_ExtraMovementFrames
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Set Character Bitmap
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  alias maemf_setcharbmp_4rm6 set_character_bitmap
  def set_character_bitmap(*args)
    @emf_char = ma_char_is_emf_sprite?(@character_name)
    @emf_char ? ma_set_emf_character_bitmap : maemf_setcharbmp_4rm6(*args)
  end
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Update Transfer Origin Rectangle
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  alias maemf_updtsrcrect_2kq5 update_src_rect
  def update_src_rect(*args)
    @emf_char ? ma_update_emf_src_rect : maemf_updtsrcrect_2kq5(*args)
  end
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Set Character Bitmap
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  def ma_set_emf_character_bitmap
    self.bitmap = Cache.character(@character_name)
    @emf_char_frames = maemf_get_frames(@character_name)
    $emf_char_frames = @emf_char_frames
    @cw, @ch = maemf_calc_frame_size(@character_name, bitmap, @emf_char_frames)
    self.ox = @cw / 2
    self.oy = @ch
  end
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Update Transfer Origin Rectangle
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  def ma_update_emf_src_rect
    if @tile_id == 0
      index = @character.character_index
      pattern = @character.pattern < @emf_char_frames[0] ? @character.pattern : @emf_char_frames[1]
      sx = (index % 4 * @emf_char_frames[0] + pattern) * @cw
      sy = (index / 4 * 4 + (@character.direction - 2) / 2) * @ch
      self.src_rect.set(sx, sy, @cw, @ch)
    end
  end
end
 
#==============================================================================
# ** Window_Base
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
#  Summary of Changes: 
#    aliased method - draw_character
#    new method - ma_draw_emf_character
#==============================================================================
 
class Window_Base
  include MA_ExtraMovementFrames
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Draw Character Graphic
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  alias maemf_drawcharct_3kq6 draw_character
  def draw_character(character_name, *args)
    character_name[/\%[\(\[].+?[\)\]]/] ? ma_draw_emf_character(character_name, *args) :
      maemf_drawcharct_3kq6(character_name, *args)
  end
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Draw Extra Movement Frames Character Graphic
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  def ma_draw_emf_character(character_name, character_index, x, y)
    return unless character_name
    if !ma_char_is_emf_sprite?(character_name)
      # Draw regular if there is no frame specification in the name
      maemf_drawcharct_3kq6(character_name, *args)
    else
      bitmap = Cache.character(character_name)
      frames = maemf_get_frames(character_name)
      cw, ch = maemf_calc_frame_size(character_name, bitmap, frames)
      n = character_index
      src_rect = Rect.new((n%4*frames[0]+frames[1])*cw, (n/4*4)*ch, cw, ch)
      contents.blt(x - cw / 2, y - ch, bitmap, src_rect)
    end
  end
end



Nouveau script Reflet :

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
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
#------------------------------------------------------------------------------#
#  Galv's Character Effects
#------------------------------------------------------------------------------#
#  For: RPGMAKER VX ACE
#  Version 2.0
#------------------------------------------------------------------------------#
#  2013-12-07 - Version 2.0 - Added comments to more easily add event effects
#                           - Fixed shadow facing bug
#  2013-02-24 - Version 1.9 - added z level option for reflection and shadows
#  2013-02-23 - Version 1.8 - added multiple light sources for shadows
#  2013-02-22 - Version 1.7 - bug fixes
#  2013-02-22 - Version 1.6 - added icon effect
#  2013-02-22 - Version 1.5 - fixed mirror bug on large maps
#  2013-02-22 - Version 1.4 - added effects to vehicles
#  2013-02-21 - Version 1.3 - fixed jump reflection and other minor tweaks
#  2013-02-21 - Version 1.2 - bug with less than 4 actors (oops)
#  2013-02-21 - Version 1.1 - updated flicker effect
#  2013-02-21 - Version 1.0 - release
#------------------------------------------------------------------------------#
#  This script was made to provide some additional effects for characters such
#  as events, followers and the player on the map.
#  Currently it includes:
#
#  Shadows
#  Shadows that appear under player and events in a directions depending on
#  a light source that you choose.
#
#  Parallax Reflect
#  Reflections that appear on the parallax layer for events and actors to be
#  used for things like reflections in the water or glass floor etc. To get
#  effects like the demo, you need to edit the charset graphic to make the water
#  partially transparent.
#
#  Parallax Mirrors
#  Much like reflect but are instead actors and event are reflected in a mirror
#  on a wall designated by a region. Both mirror and reflect effects can be
#  changed so actors and events can use different charsets for their reflections
#
#------------------------------------------------------------------------------#
 
 
#------------------------------------------------------------------------------#
#  NEW - First event command as a COMMENT
#------------------------------------------------------------------------------#
#  You can add a comment as the first event command on an event page to set if
#  that event has an icon, shadow or reflection active. The tags to use are
#  below, all must be on the same line in the comment.
#
# <icon:id,x,y>      # set the event to display an icon (x,y position offset)
# <shadow>           # set the event to display a shadow
# <reflect>          # set the event to display reflections
#
#------------------------------------------------------------------------------#
#  EXAMPLE:
# <icon:1,0,0><shadow><reflect>    # to show reflect, shadow and icon 1 on event
#------------------------------------------------------------------------------#
 
 
#------------------------------------------------------------------------------#
#  SCRIPT CALLS:
#------------------------------------------------------------------------------#
#
#  char_effects(x,x,x,status)
#
#------------------------------------------------------------------------------#
#  # each effect can be true or false to enable/disable them during the game.
#  # you can change multiples of effects at once, x being the effect number
#  # 0 = reflect    1 = shadows    2 = mirror    3 = icons
#------------------------------------------------------------------------------#
#  EXAMPLES:
#  char_effects(0,true)              # turn reflections on
#  char_effects(0,2,true)            # turn reflections and mirror on
#  char_effects(1,3,false)           # turn shadows and icons off
#------------------------------------------------------------------------------#
#
#  reflect_sprite(actor_id,filename,pos)    # Change actor's reflect charset
#
#  reflect_esprite(event_id,filename,pos)   # Change event's reflect charset
#
#  reflect_vsprite(vehicle_id,filename,pos) # Change vehicle's reflect charset
#
#------------------------------------------------------------------------------#
#  EXAMPLES:
#  reflect_sprite(1,"Actor2",2)      # change actor 1's charset to use sprite
#                                    # in position 2 of "Actor2" charset.
#  reflect_esprite(3,"Actor4",5)     # event 3 will use sprite in position 5 of
#                                    # "Actor4" charset.
#  reflect_vsprite(1,"Vehicle",5)    # Ship will use sprite in position 5 of
#                                    # "Vehicle" charset.
#------------------------------------------------------------------------------#
 
#------------------------------------------------------------------------------#
#  SCRIPT CALLS to turn effects ON or OFF for chosen EVENTS
#------------------------------------------------------------------------------#
#
#  reflect(x,x,x,status)   # status can be true or false to turn on or off
#                          # use this to specify for mirror and reflect.
#  shadow(x,x,x,status)    # where x is the event ids you want to change
#                          # to change all events use :all
#  icon(x,x,x,icon_id)     # set which icon id to appear above character. Make
#                          # it 0 for no icon.
#
#------------------------------------------------------------------------------#
#  EXAMPLES:
#  reflect(14,17,3,1,true) # Turn events 14, 17, 3 and 1 reflections ON
#  shadow(1,false)         # Turn event 1 shadow OFF
#  reflect(:all,true)      # Turn all event reflections ON
#  icon(1,2,3,4,38)        # Events 1,2,3 and 4 will have icon 38 appear
#
#  NOTE: All events will default to NO shadows and NO reflections when entering
#        a map. This is a design decision to try to keep lag to a minimum. You
#        should use these effects sparingly and only activate them on events
#        that require them.
#------------------------------------------------------------------------------#
 
#------------------------------------------------------------------------------#
#  SCRIPT CALLS to turn effects ON or OFF for ACTORS and VEHICLES
#------------------------------------------------------------------------------#
#
#  actor_reflect(actor_id,status)  # reflections and shadows are ON by default 
#  actor_shadow(actor_id,status)   # for actors and vehicles. Turning them off 
#  actor_icon(actor_id,icon_id)    # or on will permanently change them.
#
#  v_reflect(x,x,x,status)    # use these v_ calls for changing vehicle effects
#  v_shadow(x,x,x,status)     # on and off for vehicles.
#  v_icon(x,x,x,icon_id)
#
#------------------------------------------------------------------------------#
 
#------------------------------------------------------------------------------#
#  SCRIPT CALLS for shadow options
#------------------------------------------------------------------------------#
#
#  shadow_source(x,y,id)       # set the x,y location for the light. id is the 
#                              # light source number you wish to change (for
#                              # more than one). These are reset on map change.
#  shadow_source(event_id,id)  # use an event's x,y location for the light.
#                              # This will need to be in parallel process if you
#                              # want it to be a moving light.
#
#  shadow_options(intensity,fade,flicker)    # descriptions below
#
#    # intensity = opacity when standing next to the light source (255 is black)
#    # fade = amount shadow becomes more transparent the further away you are.
#    # flicker = true or false. Shadows will flicker as if being cast by fire.
#
#------------------------------------------------------------------------------#
#  EXAMPLE:
#  shadow_options(80,10,false)    # This is the default setting.
#------------------------------------------------------------------------------#
 
#------------------------------------------------------------------------------#
#  SCRIPT CALLS for reflect options
#------------------------------------------------------------------------------#
#
#  reflect_options(wave_pwr) 
#
#    # wave_pwr = how strong the wave movement is. 0 is off
#
#------------------------------------------------------------------------------#
#  EXAMPLE:
#  reflect_options(1) # Turn wave power to 1
#------------------------------------------------------------------------------#
 
 
#------------------------------------------------------------------------------#
#  NOTETAG for ACTORS
#------------------------------------------------------------------------------#
#
#  <no_reflect>    # Actor will not have a reflection (for vampires of course!)
#
#  <reflect_sprite: FileName,pos>  # Actor will use this charset for reflections
#                                  # and use the character in position 'pos'
#
#------------------------------------------------------------------------------#
#  EXAMPLES:
#  <reflect_sprite: Actor2,0>    # The first character from Actor2 charset
#  <reflect_sprite: Actor3,7>    # The last character from Actor2 charset
#------------------------------------------------------------------------------#
 
 
($imported ||= {})["Galv_Character_Effects"] = true
module Galv_CEffects
 
#------------------------------------------------------------------------------#  
#  SETUP OPTIONS
#------------------------------------------------------------------------------#
 
  MIRROR_REGION = 4     # Region ID used to determine mirror walls. Paint the
                        # region on the wall you want to make reflective (and
                        # then use tiles/mapping that make the parallax visible)
 
  ICON_OFFSET = -60     # Y offset for icons that are displayed above characters
   
  REFLECT_Z = -10       # Z level of reflections
  SHADOW_Z = 0          # Z level of shadows
 
#------------------------------------------------------------------------------#  
#  END SETUP OPTIONS
#------------------------------------------------------------------------------#
end
 
 
 
 
class Game_Map
  def do_icons(refresh = true)
    @events.values.each { |e|
      next if !e.list
      if e.list[0].code == 108 && e.list[0].parameters[0] =~ /<icon:(.*),(.*),(.*)>/
        e.icon = $1.to_i
        e.icon_offset = [$2.to_i,$3.to_i]
      else
        e.icon = 0
        e.icon_offset = [0,0]
      end
    }
    SceneManager.scene.spriteset.refresh_effects if refresh
  end
  
  
  def do_shadows(refresh = true)
    @events.values.each { |e|
      next if !e.list
      if e.list[0].code == 108 && e.list[0].parameters[0] =~ /<shadow>/
        e.shadow = true
      else
        e.shadow = false
      end
    }
    SceneManager.scene.spriteset.refresh_effects if refresh
  end
  
  def do_reflects(refresh = true)
    @events.values.each { |e|
      next if !e.list
      if e.list[0].code == 108 && e.list[0].parameters[0] =~ /<reflect>/
        e.reflect = true
      else
        e.reflect = false
      end
    }
    SceneManager.scene.spriteset.refresh_effects if refresh
  end
  
  def do_all_chareffects
    do_icons(false)
    do_shadows(false)
    do_reflects(false)
  end
  
end # Game_Map
 
 
 
 
class Game_Interpreter
  
  def remove_icon
    icon(@event_id,0)
  end
 
#-----------------------------------#
#  REFLECTIONS
#-----------------------------------#
 
  # Add/Remove Reflections from selected events
  def reflect(*args,status)
    char_ids = [*args]
    if char_ids == [:all]
      $game_map.events.values.each { |e| e.reflect = status }
    else
      char_ids.each {|c| $game_map.events[c].reflect = status }
    end
    SceneManager.scene.spriteset.refresh_effects
  end
   
  # Change forever actor's reflect status
  def actor_reflect(actor_id,status)
    $game_actors[actor_id].reflect = status
    $game_player.refresh
  end
   
  # Change forever vehicle's reflect status
  def v_reflect(*args,status)
    char_ids = [*args]
    if char_ids == [:all]
      $game_map.vehicles.each { |v| v.reflect = status }
    else
      char_ids.each { |v| $game_map.vehicles[v].reflect = status }
    end
    SceneManager.scene.spriteset.refresh_effects
  end
 
  def reflect_options(*args)
    $game_map.reflect_options = [*args]
    SceneManager.scene.spriteset.refresh_effects
  end
   
  # Actor reflect sprite change
  def reflect_sprite(actor_id,filename,pos)
    $game_actors[actor_id].reflect_sprite = [filename,pos]
    $game_player.refresh
  end
   
  # Event reflect sprite change
  def reflect_esprite(event_id,filename,pos)
    $game_map.events[event_id].reflect_sprite = [filename,pos]
    $game_map.events[event_id].reflect = true
    SceneManager.scene.spriteset.refresh_characters
  end
   
  # Vehicle reflect sprite change
  def reflect_vsprite(v_id,filename,pos)
    $game_map.vehicles[v_id].reflect_sprite = [filename,pos]
    SceneManager.scene.spriteset.refresh_characters
  end
 
#-----------------------------------#
#  SHADOWS
#-----------------------------------#
 
  # Add/Remove Shadows from selected characters
  def shadow(*args,status)
    char_ids = [*args]
    if char_ids == [:all]
      $game_map.events.values.each { |e| e.shadow = status }
    else
      char_ids.each {|c| $game_map.events[c].shadow = status }
    end
    SceneManager.scene.spriteset.refresh_effects
  end
   
  # Change player and follower shadows
  def actor_shadows(status)
    $game_player.shadow = status
    $game_player.followers.each { |f| f.shadow = status }
    SceneManager.scene.spriteset.refresh_effects
  end
   
  # Change vehicle's shadow status
  def v_shadow(*args,status)
    char_ids = [*args]
    if char_ids == [:all]
      $game_map.vehicles.each { |v| v.shadow = status }
    else
      char_ids.each { |v| $game_map.vehicles[v].shadow = status }
    end
    SceneManager.scene.spriteset.refresh_effects
  end
   
  def shadow_options(*args)
    $game_map.shadow_options = [*args]
    SceneManager.scene.spriteset.refresh_effects
  end
 
  def shadow_source(*args,shad_id)
    shadsource = [*args]
 
    if shadsource.count == 1
      $game_map.light_source[shad_id] = [$game_map.events[shadsource[0]].real_x,
        $game_map.events[shadsource[0]].real_y]
    elsif shadsource.count > 1
      $game_map.light_source[shad_id] = shadsource
    else
      $game_map.light_source = []
    end
  end
 
 
#-----------------------------------#
#  ICONS
#-----------------------------------#
 
  # Add/Remove Icons from selected events
  def icon(*args,icon_id)
    char_ids = [*args]
    if char_ids == [:all]
      $game_map.events.values.each { |e|
      if e.icon <= 0
        e.icon = nil
      else
        e.icon = icon_id
      end
    }
    else
      char_ids.each {|c| $game_map.events[c].icon = icon_id }
    end
    SceneManager.scene.spriteset.refresh_effects
  end
   
  # Change forever actor's icon
  def actor_icon(actor_id,icon_id)
    $game_actors[actor_id].icon = icon_id
    $game_player.refresh
  end
   
  # Change forever vehicle's icon
  def v_icon(*args,icon_id)
    char_ids = [*args]
    if char_ids == [:all]
      $game_map.vehicles.each { |v| v.icon = icon_id }
    else
      char_ids.each { |v| $game_map.vehicles[v].icon = icon_id }
    end
    SceneManager.scene.spriteset.refresh_effects
  end
 
#-----------------------------------#
#  GENERAL
#-----------------------------------#
 
  # Turn on/off effects
    # 0 = reflect
    # 1 = shadow
    # 2 = mirror
    # 3 = icon
     
  def char_effects(*args,status)
    [*args].each { |e| $game_map.char_effects[e] = status }
    SceneManager.scene.spriteset.refresh_effects
  end
 
   
end # Game_Interpreter
 
 
#-------------------------------------------------------------------------------
#  Spriteset_Map
#-------------------------------------------------------------------------------
 
class Spriteset_Map
  alias galv_reflect_sm_initialize initialize
  def initialize
    create_effects
    galv_reflect_sm_initialize
    refresh_characters
  end
   
  alias galv_reflect_sm_refresh_characters refresh_characters
  def refresh_characters
    galv_reflect_sm_refresh_characters
    create_effects
  end
   
  def refresh_effects
    dispose_effects
    create_effects
  end
   
  def create_effects
    @shadow_sprites = []
    @reflect_sprites = []
    @mirror_sprites = []
    @icon_sprites = []
     
    # Do reflections
    if $game_map.char_effects[0]
      $game_map.events.values.each { |e|
        @reflect_sprites.push(Sprite_Reflect.new(@viewport1, e)) if e.reflect
      }
      $game_player.followers.each { |f|
        @reflect_sprites.push(Sprite_Reflect.new(@viewport1, f)) if f.reflect
      }
      if $game_player.reflect
        @reflect_sprites.push(Sprite_Reflect.new(@viewport1, $game_player))
      end
      $game_map.vehicles.each { |v|
        @reflect_sprites.push(Sprite_Reflect.new(@viewport1, v)) if v.reflect
      }
    end
     
    # Do mirrors
    if $game_map.char_effects[2]
      $game_map.events.values.each { |e|
        @mirror_sprites.push(Sprite_Mirror.new(@viewport1, e)) if e.reflect
      }
      $game_player.followers.each { |f|
        @mirror_sprites.push(Sprite_Mirror.new(@viewport1, f)) if f.reflect
      }
      if $game_player.reflect
        @mirror_sprites.push(Sprite_Mirror.new(@viewport1, $game_player))
      end
      $game_map.vehicles.each { |v|
        @mirror_sprites.push(Sprite_Mirror.new(@viewport1, v)) if v.reflect
      }
    end
     
    # Do Shadows
    if $game_map.char_effects[1]
      return if $game_map.light_source.empty?
      $game_map.light_source.count.times { |s|
        $game_map.events.values.each { |e|
          @shadow_sprites.push(Sprite_Shadow.new(@viewport1, e, s)) if e.shadow
        }
        $game_player.followers.each { |f|
          @shadow_sprites.push(Sprite_Shadow.new(@viewport1, f, s)) if f.shadow
        }
        if $game_player.shadow
          @shadow_sprites.push(Sprite_Shadow.new(@viewport1, $game_player, s))
        end
        $game_map.vehicles.each { |v|
          @shadow_sprites.push(Sprite_Shadow.new(@viewport1, v, s)) if v.shadow
        }
      }
    end
     
    # Do icons
    if $game_map.char_effects[3]
      $game_map.events.values.each { |e|
        @icon_sprites.push(Sprite_Icon.new(@viewport1, e)) if e.icon
      }
      $game_player.followers.each { |f|
        @icon_sprites.push(Sprite_Icon.new(@viewport1, f)) if f.icon
      }
      if $game_player.icon
        @icon_sprites.push(Sprite_Icon.new(@viewport1, $game_player))
      end
      $game_map.vehicles.each { |v|
        @icon_sprites.push(Sprite_Icon.new(@viewport1, v)) if v.icon
      }
    end
  end
   
  alias galv_reflect_sm_update update
  def update
    galv_reflect_sm_update
    @reflect_sprites.each {|s| s.update} if $game_map.char_effects[0]
    @mirror_sprites.each {|s| s.update} if $game_map.char_effects[2]
    @shadow_sprites.each {|s| s.update} if $game_map.char_effects[1]
    @icon_sprites.each {|s| s.update} if $game_map.char_effects[3]
  end
 
  alias galv_reflect_sm_dispose_characters dispose_characters
  def dispose_characters
    galv_reflect_sm_dispose_characters
    dispose_effects
  end
   
  def dispose_effects
    @reflect_sprites.each {|s| s.dispose}
    @shadow_sprites.each {|s| s.dispose}
    @mirror_sprites.each {|s| s.dispose}
    @icon_sprites.each {|s| s.dispose}
  end
end # Spriteset_Map
 
 
#-------------------------------------------------------------------------------
#  Sprite_Reflect 
#-------------------------------------------------------------------------------
 
class Sprite_Reflect < Sprite_Character
  def initialize(viewport, character = nil)
    super(viewport, character)
  end
 
  def update
    super
  end
   
  def update_balloon; end
  def setup_new_effect; end
   
  def set_character_bitmap
    if @character.reflect_sprite
      self.bitmap = Cache.character(@character.reflect_sprite[0])
    else
      self.bitmap = Cache.character(@character_name)
    end
    self.mirror = true
    self.angle = 180
    self.opacity = 220
    self.z = Galv_CEffects::REFLECT_Z
    self.wave_amp = $game_map.reflect_options[0]
    
    sign = @character_name[/\%[\(\[](.+?)[\)\]]/]
  if sign && sign.include?('%')
    sign = @character_name[/^[\!\$]./]
    if sign && sign.include?('$')
      @cw = $cw
      @ch = bitmap.height / 4
    else
      @cw = $cw
      @ch = bitmap.height / 8
    end
  else
    sign = @character_name[/^[\!\$]./]
    if sign && sign.include?('$')
      @cw = bitmap.width / 3
      @ch = bitmap.height / 4
    else
      @cw = bitmap.width / 12
      @ch = bitmap.height / 8
    end 
  end
    self.ox = @cw / 2
    self.oy = @ch
  end
 
  def update_position
    self.x = @character.screen_x
    jump = @character.jumping? ? @character.jump_height * 2 : 0
    alt = @character.altitude ? @character.altitude * 2 : 0
    self.y = @character.screen_y - 3 + jump + alt
  end
 
  def update_other
    self.blend_type = @character.blend_type
    self.visible = !@character.transparent
  end
   
  def update_src_rect
    if @character.reflect_sprite
      index = @character.reflect_sprite[1]
    else
      index = @character.character_index
    end
    sign = @character_name[/\%[\(\[](.+?)[\)\]]/]
  if sign && sign.include?('%')
    pattern = @character.pattern < @cw ? @character.pattern : 1
  else
    pattern = @character.pattern < 3 ? @character.pattern : 1
  end
    sx = (index % 4 * $emf_char_frames[0] + pattern) * @cw
    #sx = (index % 4 * @cw + pattern) * @cw
    sy = (index / 4 * 4 + (@character.direction - 2) / 2) * @ch
    self.src_rect.set(sx, sy, @cw, @ch)
  end
end # Sprite_Reflect < Sprite_Character
 
 
#-------------------------------------------------------------------------------
#  Sprite_Mirror
#-------------------------------------------------------------------------------
 
class Sprite_Mirror < Sprite_Character
  def initialize(viewport, character = nil)
    @distance = 0
    super(viewport, character)
  end
 
  def update
    super
  end
   
  def update_balloon; end
  def setup_new_effect; end
   
  def set_character_bitmap
    if @character.reflect_sprite
      self.bitmap = Cache.character(@character.reflect_sprite[0])
    else
      self.bitmap = Cache.character(@character_name)
    end
    self.mirror = true
    self.opacity = 255
    self.z = Galv_CEffects::REFLECT_Z
     
    sign = @character_name[/\%[\(\[](.+?)[\)\]]/]
  if sign && sign.include?('%')
    sign = @character_name[/^[\!\$]./]
    if sign && sign.include?('$')
      @cw = $cw
      @ch = bitmap.height / 4
    else
      @cw = $cw
      @ch = bitmap.height / 8
    end
  else
    sign = @character_name[/^[\!\$]./]
    if sign && sign.include?('$')
      @cw = $cw#bitmap.width / 3
      @ch = bitmap.height / 4
    else
      @cw = $cw#bitmap.width / 12
      @ch = bitmap.height / 8
    end 
  end
    self.ox = @cw / 2
    self.oy = @ch
 
  end
 
  def update_src_rect
    if @character.reflect_sprite
      index = @character.reflect_sprite[1]
    else
      index = @character.character_index
    end
    sign = @character_name[/\%[\(\[](.+?)[\)\]]/]
  if sign && sign.include?('%')
    pattern = @character.pattern < @cw ? @character.pattern : 1
  else
    pattern = @character.pattern < 3 ? @character.pattern : 1
  end
    sx = (index % 4 * $emf_char_frames[0] + pattern) * @cw
    #sx = (index % 4 * 3 + pattern) * @cw
    sy = (index / 4 * 4 + (10 - @character.direction - 2) / 2) * @ch
    self.src_rect.set(sx, sy, @cw, @ch)
  end
   
  def get_mirror_y
    20.times {|i|
      if $game_map.region_id(@character.x, @character.y - i) == Galv_CEffects::MIRROR_REGION
        @distance = (i - 1) * 0.05
        @display = @character.y - i - $game_map.display_y + $game_map.height
        self.opacity = 255
        return (@character.y - i + 1 - $game_map.display_y) * 32 - i * 4
      end
    }
    self.opacity = 0
    return @ch
  end
   
  def update_position
    self.x = @character.screen_x
    self.y = get_mirror_y - 6
    self.zoom_x = 1 - @distance
    self.zoom_y = 1 - @distance
  end
 
  def update_other
    self.blend_type = @character.blend_type
    self.visible = !@character.transparent
  end
end # Sprite_Mirror < Sprite_Character
 
 
#-------------------------------------------------------------------------------
#  Sprite_Shadow
#-------------------------------------------------------------------------------
 
class Sprite_Shadow < Sprite_Character
  def initialize(viewport, character = nil, source)
    @flicker = 0
    @famount = 0
    @aamount = 0
    @source = source
    super(viewport, character)
  end
 
  def update
    super
    update_bitmap
    update_src_rect
    update_position
    update_other
    update_facing
  end
  
  def set_character_bitmap
    self.bitmap = Cache.character(@character_name)
    
    self.color = Color.new(0, 0, 0, 255)
    self.z = Galv_CEffects::SHADOW_Z
    self.wave_amp = 1 if $game_map.shadow_options[2]
    self.wave_speed = 1000
     
    sign = @character_name[/\%[\(\[](.+?)[\)\]]/]
  if sign && sign.include?('%')
    sign = @character_name[/^[\!\$]./]
    if sign && sign.include?('$')
      @cw = $cw
      @ch = bitmap.height / 4
    else
      @cw = $cw
      @ch = bitmap.height / 8
    end
  else
    sign = @character_name[/^[\!\$]./]
    if sign && sign.include?('$')
      @cw = bitmap.width / 3
      @ch = bitmap.height / 4
    else
      @cw = bitmap.width / 12
      @ch = bitmap.height / 8
    end 
  end
    self.ox = @cw / 2
    self.oy = @ch
  end
 
  def update_position
    self.x = @character.screen_x
    self.y = @character.screen_y - 10
    get_angle
  end
   
  def get_angle
    x = $game_map.light_source[@source][0] - @character.real_x
    y = $game_map.light_source[@source][1] - @character.real_y
    self.opacity = $game_map.shadow_options[0] - 
      Math::sqrt(x * x + y * y) * $game_map.shadow_options[1]
     
    if x == 0 && y == 0 || self.opacity <= 0
      self.opacity = 0
    else 
      self.angle = Math::atan2(x, y) * 180 / Math::PI + @aamount
    end
  end
  
  def update_facing
    if @character.y < $game_map.light_source[@source][1]
      self.mirror = false
    else
      self.mirror = true
    end
  end
   
  def update_other
    self.blend_type = @character.blend_type
    self.visible = !@character.transparent
  end
end # Sprite_Shadow < Sprite_Character
 
 
#-------------------------------------------------------------------------------
#  Sprite_Icon
#-------------------------------------------------------------------------------
 
class Sprite_Icon < Sprite_Character
  def initialize(viewport, character = nil)
    @icon_sprite ||= Sprite.new
    @icon_sprite.bitmap ||= Cache.system("Iconset")
    @icon = nil
    super(viewport, character)
  end
 
  def dispose
    super
    if @icon_sprite
      @icon_sprite.dispose
      @icon_sprite = nil
    end
  end
   
  def update
    super
    update_icon
  end
   
  def update_icon
    return if !@character.icon
    draw_icon(@character.icon)
  end
   
  def draw_icon(icon_index)
    return if !@icon.nil?
    rect = Rect.new(icon_index % 16 * 24, icon_index / 16 * 24, 24, 24)
    @icon_sprite.src_rect  = rect
    @icon = icon_index
  end
   
  def update_position
    @icon_sprite.x = @character.screen_x - 12
    @icon_sprite.y = @character.screen_y + Galv_CEffects::ICON_OFFSET
  end
 
  def update_other
    self.blend_type = @character.blend_type
    @icon_sprite.visible = !@character.transparent
  end
end # Sprite_Icon < Sprite_Character
 
 
#-------------------------------------------------------------------------------
#  Other Stuff
#-------------------------------------------------------------------------------
 
 
class Game_Character < Game_CharacterBase
  attr_reader    :altitude
  attr_accessor  :reflect
  attr_accessor  :reflect_sprite
  attr_accessor  :shadow
  attr_accessor  :icon
  attr_accessor  :icon_offset
end
 
 
class Game_Event < Game_Character
  alias galv_reflect_ge_initialize initialize
  def initialize(map_id, event)
    @reflect = false
    @shadow = false
    @icon_offset = [0,0]
    galv_reflect_ge_initialize(map_id, event)
  end
end # Game_Event < Game_Character
 
 
class Game_Vehicle < Game_Character
  attr_reader :map_id
   
  alias galv_reflect_gv_initialize initialize
  def initialize(type)
    @reflect = true
    @shadow = true
    @icon_offset = [0,0]
    galv_reflect_gv_initialize(type)
  end
end # Game_Vehicle < Game_Character
 
 
class Game_Follower < Game_Character
  alias galv_reflect_gf_initialize initialize
  def initialize(member_index, preceding_character)
    galv_reflect_gf_initialize(member_index, preceding_character)
    @reflect = true
    @shadow = true
  end
   
  alias galv_reflect_gf_refresh refresh
  def refresh
    galv_reflect_gf_refresh
    return if actor.nil?
    @reflect = actor.reflect
    @reflect_sprite = actor.reflect_sprite
    @icon = actor.icon
    if SceneManager.scene_is?(Scene_Map)
      SceneManager.scene.spriteset.refresh_effects
    end
  end
end # Game_Follower < Game_Character
 
 
class Game_Player < Game_Character
  alias galv_reflect_gp_initialize initialize
  def initialize
    galv_reflect_gp_initialize
    @reflect = true
    @shadow = true
  end
   
  alias galv_reflect_gp_refresh refresh
  def refresh
    galv_reflect_gp_refresh
    @reflect = actor.reflect
    @reflect_sprite = actor.reflect_sprite
    @icon = actor.icon
    if SceneManager.scene_is?(Scene_Map)
      SceneManager.scene.spriteset.refresh_effects
    end
  end
end # Game_Player < Game_Character
 
 
class Scene_Map < Scene_Base
  attr_accessor :spriteset
end # Scene_Map
 
 
class Game_Map
  attr_accessor :char_effects
  attr_accessor :light_source
  attr_accessor :shadow_options
  attr_accessor :reflect_options
   
  alias galv_reflect_game_map_initialize initialize
  def initialize
    @light_source = []
    @shadow_options = [80,10,false]
    @reflect_options = [0]
    @char_effects = [false,false,false,false]
    #[reflect,shadow,mirror,icon]
    galv_reflect_game_map_initialize
  end
  
   
  alias galv_reflect_game_map_setup setup
  def setup(map_id)
    galv_reflect_game_map_setup(map_id)
    reset_char_effects
    do_all_chareffects
    if SceneManager.scene_is?(Scene_Map)
      SceneManager.scene.spriteset.refresh_effects
    end
  end
   
  def reset_char_effects
    @light_source = []
    @events.values.each { |e|
      e.reflect = false
      e.icon = nil }
  end
end # Game_Map
 
 
class Game_Actor < Game_Battler
  attr_accessor :reflect
  attr_accessor :reflect_sprite
  attr_accessor :icon
   
  alias galv_reflect_game_actor_initialize initialize
  def initialize(actor_id)
    galv_reflect_game_actor_initialize(actor_id)
    @reflect = $data_actors[actor_id].reflect
    @reflect_sprite = $data_actors[actor_id].reflect_sprite
    @icon_offset = [0,0]
  end
end # Game_Actor < Game_Battler
 
 
class RPG::Actor
  def reflect_sprite
    if @reflect_sprite.nil?
      if @note =~ /<reflect_sprite:[ ](.*),(.*)>/i
        @reflect_sprite = [$1.to_s,$2.to_i]
      else
        @reflect_sprite = nil
      end
    end
    @reflect_sprite
  end
  def reflect
    if @reflect.nil?
      if @note =~ /<no_reflect>/i
        @reflect = false
      else
        @reflect = true
      end
    end
    @reflect
  end
end # RPG::Actor



Posté dans Forum - [VX Ace] Différence de dégâts impossible à appliquer...

cortez - posté le 21/04/2015 à 17:19:52. (523 messages postés)

C'est possible mais je n'ai pas les compétences suffisante pour le faire.
Tout les niveaux de magie sont contenus dans la variable script :
$affinity_levels

Reste à trouver comment les sortir de là.

Posté dans Forum - [VXAce] compatibilité entre 2 scripts. [Résolu]

cortez - posté le 21/04/2015 à 17:08:09. (523 messages postés)

J'ai résolu le problème !
Dans le script d'extra frames remplace ça : (ligne 102)

Portion de code : Tout sélectionner

1
2
3
4
5
6
7
8
9
10
11
12
13
  def maemf_calc_frame_size(character_name, bitmap, frames = [])
    character_name = "" unless character_name
    frames = maemf_get_frames(character_name) if frames.empty?
    cw = bitmap.width / (frames[0] ? frames[0] : 3)
    ch = bitmap.height / 4
    sign = character_name[/^[\!\$]./]
    if !sign || !sign.include?('$')
      cw /= 4
      ch /= 2
    end
    return cw, ch
  end
end



par ceci :

Portion de code : Tout sélectionner

1
2
3
4
5
6
7
8
9
10
11
12
13
  def maemf_calc_frame_size(character_name, bitmap, frames = [])
    character_name = "" unless character_name
    frames = maemf_get_frames(character_name) if frames.empty?
    $cw = bitmap.width / (frames[0] ? frames[0] : 3)
    $ch = bitmap.height / 4
    sign = character_name[/^[\!\$]./]
    if !sign || !sign.include?('$')
      $cw /= 4
      $ch /= 2
    end
    return $cw, $ch
  end
end



J'ai aussi modifié le script de reflet : (remplace-le en entier)

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
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
#------------------------------------------------------------------------------#
#  Galv's Character Effects
#------------------------------------------------------------------------------#
#  For: RPGMAKER VX ACE
#  Version 2.0
#------------------------------------------------------------------------------#
#  2013-12-07 - Version 2.0 - Added comments to more easily add event effects
#                           - Fixed shadow facing bug
#  2013-02-24 - Version 1.9 - added z level option for reflection and shadows
#  2013-02-23 - Version 1.8 - added multiple light sources for shadows
#  2013-02-22 - Version 1.7 - bug fixes
#  2013-02-22 - Version 1.6 - added icon effect
#  2013-02-22 - Version 1.5 - fixed mirror bug on large maps
#  2013-02-22 - Version 1.4 - added effects to vehicles
#  2013-02-21 - Version 1.3 - fixed jump reflection and other minor tweaks
#  2013-02-21 - Version 1.2 - bug with less than 4 actors (oops)
#  2013-02-21 - Version 1.1 - updated flicker effect
#  2013-02-21 - Version 1.0 - release
#------------------------------------------------------------------------------#
#  This script was made to provide some additional effects for characters such
#  as events, followers and the player on the map.
#  Currently it includes:
#
#  Shadows
#  Shadows that appear under player and events in a directions depending on
#  a light source that you choose.
#
#  Parallax Reflect
#  Reflections that appear on the parallax layer for events and actors to be
#  used for things like reflections in the water or glass floor etc. To get
#  effects like the demo, you need to edit the charset graphic to make the water
#  partially transparent.
#
#  Parallax Mirrors
#  Much like reflect but are instead actors and event are reflected in a mirror
#  on a wall designated by a region. Both mirror and reflect effects can be
#  changed so actors and events can use different charsets for their reflections
#
#------------------------------------------------------------------------------#
 
 
#------------------------------------------------------------------------------#
#  NEW - First event command as a COMMENT
#------------------------------------------------------------------------------#
#  You can add a comment as the first event command on an event page to set if
#  that event has an icon, shadow or reflection active. The tags to use are
#  below, all must be on the same line in the comment.
#
# <icon:id,x,y>      # set the event to display an icon (x,y position offset)
# <shadow>           # set the event to display a shadow
# <reflect>          # set the event to display reflections
#
#------------------------------------------------------------------------------#
#  EXAMPLE:
# <icon:1,0,0><shadow><reflect>    # to show reflect, shadow and icon 1 on event
#------------------------------------------------------------------------------#
 
 
#------------------------------------------------------------------------------#
#  SCRIPT CALLS:
#------------------------------------------------------------------------------#
#
#  char_effects(x,x,x,status)
#
#------------------------------------------------------------------------------#
#  # each effect can be true or false to enable/disable them during the game.
#  # you can change multiples of effects at once, x being the effect number
#  # 0 = reflect    1 = shadows    2 = mirror    3 = icons
#------------------------------------------------------------------------------#
#  EXAMPLES:
#  char_effects(0,true)              # turn reflections on
#  char_effects(0,2,true)            # turn reflections and mirror on
#  char_effects(1,3,false)           # turn shadows and icons off
#------------------------------------------------------------------------------#
#
#  reflect_sprite(actor_id,filename,pos)    # Change actor's reflect charset
#
#  reflect_esprite(event_id,filename,pos)   # Change event's reflect charset
#
#  reflect_vsprite(vehicle_id,filename,pos) # Change vehicle's reflect charset
#
#------------------------------------------------------------------------------#
#  EXAMPLES:
#  reflect_sprite(1,"Actor2",2)      # change actor 1's charset to use sprite
#                                    # in position 2 of "Actor2" charset.
#  reflect_esprite(3,"Actor4",5)     # event 3 will use sprite in position 5 of
#                                    # "Actor4" charset.
#  reflect_vsprite(1,"Vehicle",5)    # Ship will use sprite in position 5 of
#                                    # "Vehicle" charset.
#------------------------------------------------------------------------------#
 
#------------------------------------------------------------------------------#
#  SCRIPT CALLS to turn effects ON or OFF for chosen EVENTS
#------------------------------------------------------------------------------#
#
#  reflect(x,x,x,status)   # status can be true or false to turn on or off
#                          # use this to specify for mirror and reflect.
#  shadow(x,x,x,status)    # where x is the event ids you want to change
#                          # to change all events use :all
#  icon(x,x,x,icon_id)     # set which icon id to appear above character. Make
#                          # it 0 for no icon.
#
#------------------------------------------------------------------------------#
#  EXAMPLES:
#  reflect(14,17,3,1,true) # Turn events 14, 17, 3 and 1 reflections ON
#  shadow(1,false)         # Turn event 1 shadow OFF
#  reflect(:all,true)      # Turn all event reflections ON
#  icon(1,2,3,4,38)        # Events 1,2,3 and 4 will have icon 38 appear
#
#  NOTE: All events will default to NO shadows and NO reflections when entering
#        a map. This is a design decision to try to keep lag to a minimum. You
#        should use these effects sparingly and only activate them on events
#        that require them.
#------------------------------------------------------------------------------#
 
#------------------------------------------------------------------------------#
#  SCRIPT CALLS to turn effects ON or OFF for ACTORS and VEHICLES
#------------------------------------------------------------------------------#
#
#  actor_reflect(actor_id,status)  # reflections and shadows are ON by default 
#  actor_shadow(actor_id,status)   # for actors and vehicles. Turning them off 
#  actor_icon(actor_id,icon_id)    # or on will permanently change them.
#
#  v_reflect(x,x,x,status)    # use these v_ calls for changing vehicle effects
#  v_shadow(x,x,x,status)     # on and off for vehicles.
#  v_icon(x,x,x,icon_id)
#
#------------------------------------------------------------------------------#
 
#------------------------------------------------------------------------------#
#  SCRIPT CALLS for shadow options
#------------------------------------------------------------------------------#
#
#  shadow_source(x,y,id)       # set the x,y location for the light. id is the 
#                              # light source number you wish to change (for
#                              # more than one). These are reset on map change.
#  shadow_source(event_id,id)  # use an event's x,y location for the light.
#                              # This will need to be in parallel process if you
#                              # want it to be a moving light.
#
#  shadow_options(intensity,fade,flicker)    # descriptions below
#
#    # intensity = opacity when standing next to the light source (255 is black)
#    # fade = amount shadow becomes more transparent the further away you are.
#    # flicker = true or false. Shadows will flicker as if being cast by fire.
#
#------------------------------------------------------------------------------#
#  EXAMPLE:
#  shadow_options(80,10,false)    # This is the default setting.
#------------------------------------------------------------------------------#
 
#------------------------------------------------------------------------------#
#  SCRIPT CALLS for reflect options
#------------------------------------------------------------------------------#
#
#  reflect_options(wave_pwr) 
#
#    # wave_pwr = how strong the wave movement is. 0 is off
#
#------------------------------------------------------------------------------#
#  EXAMPLE:
#  reflect_options(1) # Turn wave power to 1
#------------------------------------------------------------------------------#
 
 
#------------------------------------------------------------------------------#
#  NOTETAG for ACTORS
#------------------------------------------------------------------------------#
#
#  <no_reflect>    # Actor will not have a reflection (for vampires of course!)
#
#  <reflect_sprite: FileName,pos>  # Actor will use this charset for reflections
#                                  # and use the character in position 'pos'
#
#------------------------------------------------------------------------------#
#  EXAMPLES:
#  <reflect_sprite: Actor2,0>    # The first character from Actor2 charset
#  <reflect_sprite: Actor3,7>    # The last character from Actor2 charset
#------------------------------------------------------------------------------#
 
 
($imported ||= {})["Galv_Character_Effects"] = true
module Galv_CEffects
 
#------------------------------------------------------------------------------#  
#  SETUP OPTIONS
#------------------------------------------------------------------------------#
 
  MIRROR_REGION = 4     # Region ID used to determine mirror walls. Paint the
                        # region on the wall you want to make reflective (and
                        # then use tiles/mapping that make the parallax visible)
 
  ICON_OFFSET = -60     # Y offset for icons that are displayed above characters
   
  REFLECT_Z = -10       # Z level of reflections
  SHADOW_Z = 0          # Z level of shadows
 
#------------------------------------------------------------------------------#  
#  END SETUP OPTIONS
#------------------------------------------------------------------------------#
end
 
 
 
 
class Game_Map
  def do_icons(refresh = true)
    @events.values.each { |e|
      next if !e.list
      if e.list[0].code == 108 && e.list[0].parameters[0] =~ /<icon:(.*),(.*),(.*)>/
        e.icon = $1.to_i
        e.icon_offset = [$2.to_i,$3.to_i]
      else
        e.icon = 0
        e.icon_offset = [0,0]
      end
    }
    SceneManager.scene.spriteset.refresh_effects if refresh
  end
  
  
  def do_shadows(refresh = true)
    @events.values.each { |e|
      next if !e.list
      if e.list[0].code == 108 && e.list[0].parameters[0] =~ /<shadow>/
        e.shadow = true
      else
        e.shadow = false
      end
    }
    SceneManager.scene.spriteset.refresh_effects if refresh
  end
  
  def do_reflects(refresh = true)
    @events.values.each { |e|
      next if !e.list
      if e.list[0].code == 108 && e.list[0].parameters[0] =~ /<reflect>/
        e.reflect = true
      else
        e.reflect = false
      end
    }
    SceneManager.scene.spriteset.refresh_effects if refresh
  end
  
  def do_all_chareffects
    do_icons(false)
    do_shadows(false)
    do_reflects(false)
  end
  
end # Game_Map
 
 
 
 
class Game_Interpreter
  
  def remove_icon
    icon(@event_id,0)
  end
 
#-----------------------------------#
#  REFLECTIONS
#-----------------------------------#
 
  # Add/Remove Reflections from selected events
  def reflect(*args,status)
    char_ids = [*args]
    if char_ids == [:all]
      $game_map.events.values.each { |e| e.reflect = status }
    else
      char_ids.each {|c| $game_map.events[c].reflect = status }
    end
    SceneManager.scene.spriteset.refresh_effects
  end
   
  # Change forever actor's reflect status
  def actor_reflect(actor_id,status)
    $game_actors[actor_id].reflect = status
    $game_player.refresh
  end
   
  # Change forever vehicle's reflect status
  def v_reflect(*args,status)
    char_ids = [*args]
    if char_ids == [:all]
      $game_map.vehicles.each { |v| v.reflect = status }
    else
      char_ids.each { |v| $game_map.vehicles[v].reflect = status }
    end
    SceneManager.scene.spriteset.refresh_effects
  end
 
  def reflect_options(*args)
    $game_map.reflect_options = [*args]
    SceneManager.scene.spriteset.refresh_effects
  end
   
  # Actor reflect sprite change
  def reflect_sprite(actor_id,filename,pos)
    $game_actors[actor_id].reflect_sprite = [filename,pos]
    $game_player.refresh
  end
   
  # Event reflect sprite change
  def reflect_esprite(event_id,filename,pos)
    $game_map.events[event_id].reflect_sprite = [filename,pos]
    $game_map.events[event_id].reflect = true
    SceneManager.scene.spriteset.refresh_characters
  end
   
  # Vehicle reflect sprite change
  def reflect_vsprite(v_id,filename,pos)
    $game_map.vehicles[v_id].reflect_sprite = [filename,pos]
    SceneManager.scene.spriteset.refresh_characters
  end
 
#-----------------------------------#
#  SHADOWS
#-----------------------------------#
 
  # Add/Remove Shadows from selected characters
  def shadow(*args,status)
    char_ids = [*args]
    if char_ids == [:all]
      $game_map.events.values.each { |e| e.shadow = status }
    else
      char_ids.each {|c| $game_map.events[c].shadow = status }
    end
    SceneManager.scene.spriteset.refresh_effects
  end
   
  # Change player and follower shadows
  def actor_shadows(status)
    $game_player.shadow = status
    $game_player.followers.each { |f| f.shadow = status }
    SceneManager.scene.spriteset.refresh_effects
  end
   
  # Change vehicle's shadow status
  def v_shadow(*args,status)
    char_ids = [*args]
    if char_ids == [:all]
      $game_map.vehicles.each { |v| v.shadow = status }
    else
      char_ids.each { |v| $game_map.vehicles[v].shadow = status }
    end
    SceneManager.scene.spriteset.refresh_effects
  end
   
  def shadow_options(*args)
    $game_map.shadow_options = [*args]
    SceneManager.scene.spriteset.refresh_effects
  end
 
  def shadow_source(*args,shad_id)
    shadsource = [*args]
 
    if shadsource.count == 1
      $game_map.light_source[shad_id] = [$game_map.events[shadsource[0]].real_x,
        $game_map.events[shadsource[0]].real_y]
    elsif shadsource.count > 1
      $game_map.light_source[shad_id] = shadsource
    else
      $game_map.light_source = []
    end
  end
 
 
#-----------------------------------#
#  ICONS
#-----------------------------------#
 
  # Add/Remove Icons from selected events
  def icon(*args,icon_id)
    char_ids = [*args]
    if char_ids == [:all]
      $game_map.events.values.each { |e|
      if e.icon <= 0
        e.icon = nil
      else
        e.icon = icon_id
      end
    }
    else
      char_ids.each {|c| $game_map.events[c].icon = icon_id }
    end
    SceneManager.scene.spriteset.refresh_effects
  end
   
  # Change forever actor's icon
  def actor_icon(actor_id,icon_id)
    $game_actors[actor_id].icon = icon_id
    $game_player.refresh
  end
   
  # Change forever vehicle's icon
  def v_icon(*args,icon_id)
    char_ids = [*args]
    if char_ids == [:all]
      $game_map.vehicles.each { |v| v.icon = icon_id }
    else
      char_ids.each { |v| $game_map.vehicles[v].icon = icon_id }
    end
    SceneManager.scene.spriteset.refresh_effects
  end
 
#-----------------------------------#
#  GENERAL
#-----------------------------------#
 
  # Turn on/off effects
    # 0 = reflect
    # 1 = shadow
    # 2 = mirror
    # 3 = icon
     
  def char_effects(*args,status)
    [*args].each { |e| $game_map.char_effects[e] = status }
    SceneManager.scene.spriteset.refresh_effects
  end
 
   
end # Game_Interpreter
 
 
#-------------------------------------------------------------------------------
#  Spriteset_Map
#-------------------------------------------------------------------------------
 
class Spriteset_Map
  alias galv_reflect_sm_initialize initialize
  def initialize
    create_effects
    galv_reflect_sm_initialize
    refresh_characters
  end
   
  alias galv_reflect_sm_refresh_characters refresh_characters
  def refresh_characters
    galv_reflect_sm_refresh_characters
    create_effects
  end
   
  def refresh_effects
    dispose_effects
    create_effects
  end
   
  def create_effects
    @shadow_sprites = []
    @reflect_sprites = []
    @mirror_sprites = []
    @icon_sprites = []
     
    # Do reflections
    if $game_map.char_effects[0]
      $game_map.events.values.each { |e|
        @reflect_sprites.push(Sprite_Reflect.new(@viewport1, e)) if e.reflect
      }
      $game_player.followers.each { |f|
        @reflect_sprites.push(Sprite_Reflect.new(@viewport1, f)) if f.reflect
      }
      if $game_player.reflect
        @reflect_sprites.push(Sprite_Reflect.new(@viewport1, $game_player))
      end
      $game_map.vehicles.each { |v|
        @reflect_sprites.push(Sprite_Reflect.new(@viewport1, v)) if v.reflect
      }
    end
     
    # Do mirrors
    if $game_map.char_effects[2]
      $game_map.events.values.each { |e|
        @mirror_sprites.push(Sprite_Mirror.new(@viewport1, e)) if e.reflect
      }
      $game_player.followers.each { |f|
        @mirror_sprites.push(Sprite_Mirror.new(@viewport1, f)) if f.reflect
      }
      if $game_player.reflect
        @mirror_sprites.push(Sprite_Mirror.new(@viewport1, $game_player))
      end
      $game_map.vehicles.each { |v|
        @mirror_sprites.push(Sprite_Mirror.new(@viewport1, v)) if v.reflect
      }
    end
     
    # Do Shadows
    if $game_map.char_effects[1]
      return if $game_map.light_source.empty?
      $game_map.light_source.count.times { |s|
        $game_map.events.values.each { |e|
          @shadow_sprites.push(Sprite_Shadow.new(@viewport1, e, s)) if e.shadow
        }
        $game_player.followers.each { |f|
          @shadow_sprites.push(Sprite_Shadow.new(@viewport1, f, s)) if f.shadow
        }
        if $game_player.shadow
          @shadow_sprites.push(Sprite_Shadow.new(@viewport1, $game_player, s))
        end
        $game_map.vehicles.each { |v|
          @shadow_sprites.push(Sprite_Shadow.new(@viewport1, v, s)) if v.shadow
        }
      }
    end
     
    # Do icons
    if $game_map.char_effects[3]
      $game_map.events.values.each { |e|
        @icon_sprites.push(Sprite_Icon.new(@viewport1, e)) if e.icon
      }
      $game_player.followers.each { |f|
        @icon_sprites.push(Sprite_Icon.new(@viewport1, f)) if f.icon
      }
      if $game_player.icon
        @icon_sprites.push(Sprite_Icon.new(@viewport1, $game_player))
      end
      $game_map.vehicles.each { |v|
        @icon_sprites.push(Sprite_Icon.new(@viewport1, v)) if v.icon
      }
    end
  end
   
  alias galv_reflect_sm_update update
  def update
    galv_reflect_sm_update
    @reflect_sprites.each {|s| s.update} if $game_map.char_effects[0]
    @mirror_sprites.each {|s| s.update} if $game_map.char_effects[2]
    @shadow_sprites.each {|s| s.update} if $game_map.char_effects[1]
    @icon_sprites.each {|s| s.update} if $game_map.char_effects[3]
  end
 
  alias galv_reflect_sm_dispose_characters dispose_characters
  def dispose_characters
    galv_reflect_sm_dispose_characters
    dispose_effects
  end
   
  def dispose_effects
    @reflect_sprites.each {|s| s.dispose}
    @shadow_sprites.each {|s| s.dispose}
    @mirror_sprites.each {|s| s.dispose}
    @icon_sprites.each {|s| s.dispose}
  end
end # Spriteset_Map
 
 
#-------------------------------------------------------------------------------
#  Sprite_Reflect 
#-------------------------------------------------------------------------------
 
class Sprite_Reflect < Sprite_Character
  def initialize(viewport, character = nil)
    super(viewport, character)
  end
 
  def update
    super
  end
   
  def update_balloon; end
  def setup_new_effect; end
   
  def set_character_bitmap
    if @character.reflect_sprite
      self.bitmap = Cache.character(@character.reflect_sprite[0])
    else
      self.bitmap = Cache.character(@character_name)
    end
    self.mirror = true
    self.angle = 180
    self.opacity = 220
    self.z = Galv_CEffects::REFLECT_Z
    self.wave_amp = $game_map.reflect_options[0]
    
    sign = @character_name[/\%[\(\[](.+?)[\)\]]/]
  if sign && sign.include?('%')
    sign = @character_name[/^[\!\$]./]
    if sign && sign.include?('$')
      @cw = $cw
      @ch = bitmap.height / 4
    else
      @cw = $cw
      @ch = bitmap.height / 8
    end
  else
    sign = @character_name[/^[\!\$]./]
    if sign && sign.include?('$')
      @cw = bitmap.width / 3
      @ch = bitmap.height / 4
    else
      @cw = bitmap.width / 12
      @ch = bitmap.height / 8
    end 
  end
    self.ox = @cw / 2
    self.oy = @ch
  end
 
  def update_position
    self.x = @character.screen_x
    jump = @character.jumping? ? @character.jump_height * 2 : 0
    alt = @character.altitude ? @character.altitude * 2 : 0
    self.y = @character.screen_y - 3 + jump + alt
  end
 
  def update_other
    self.blend_type = @character.blend_type
    self.visible = !@character.transparent
  end
   
  def update_src_rect
    if @character.reflect_sprite
      index = @character.reflect_sprite[1]
    else
      index = @character.character_index
    end
    sign = @character_name[/\%[\(\[](.+?)[\)\]]/]
  if sign && sign.include?('%')
    pattern = @character.pattern < @cw ? @character.pattern : 1
  else
    pattern = @character.pattern < 3 ? @character.pattern : 1
  end
    sx = (index % 4 * 3 + pattern) * @cw
    sy = (index / 4 * 4 + (@character.direction - 2) / 2) * @ch
    self.src_rect.set(sx, sy, @cw, @ch)
  end
end # Sprite_Reflect < Sprite_Character
 
 
#-------------------------------------------------------------------------------
#  Sprite_Mirror
#-------------------------------------------------------------------------------
 
class Sprite_Mirror < Sprite_Character
  def initialize(viewport, character = nil)
    @distance = 0
    super(viewport, character)
  end
 
  def update
    super
  end
   
  def update_balloon; end
  def setup_new_effect; end
   
  def set_character_bitmap
    if @character.reflect_sprite
      self.bitmap = Cache.character(@character.reflect_sprite[0])
    else
      self.bitmap = Cache.character(@character_name)
    end
    self.mirror = true
    self.opacity = 255
    self.z = Galv_CEffects::REFLECT_Z
     
    sign = @character_name[/\%[\(\[](.+?)[\)\]]/]
  if sign && sign.include?('%')
    sign = @character_name[/^[\!\$]./]
    if sign && sign.include?('$')
      @cw = $cw
      @ch = bitmap.height / 4
    else
      @cw = $cw
      @ch = bitmap.height / 8
    end
  else
    sign = @character_name[/^[\!\$]./]
    if sign && sign.include?('$')
      @cw = bitmap.width / 3
      @ch = bitmap.height / 4
    else
      @cw = bitmap.width / 12
      @ch = bitmap.height / 8
    end 
  end
    self.ox = @cw / 2
    self.oy = @ch
 
  end
 
  def update_src_rect
    if @character.reflect_sprite
      index = @character.reflect_sprite[1]
    else
      index = @character.character_index
    end
    sign = @character_name[/\%[\(\[](.+?)[\)\]]/]
  if sign && sign.include?('%')
    pattern = @character.pattern < @cw ? @character.pattern : 1
  else
    pattern = @character.pattern < 3 ? @character.pattern : 1
  end
    sx = (index % 4 * 3 + pattern) * @cw
    sy = (index / 4 * 4 + (10 - @character.direction - 2) / 2) * @ch
    self.src_rect.set(sx, sy, @cw, @ch)
  end
   
  def get_mirror_y
    20.times {|i|
      if $game_map.region_id(@character.x, @character.y - i) == Galv_CEffects::MIRROR_REGION
        @distance = (i - 1) * 0.05
        @display = @character.y - i - $game_map.display_y + $game_map.height
        self.opacity = 255
        return (@character.y - i + 1 - $game_map.display_y) * 32 - i * 4
      end
    }
    self.opacity = 0
    return @ch
  end
   
  def update_position
    self.x = @character.screen_x
    self.y = get_mirror_y - 6
    self.zoom_x = 1 - @distance
    self.zoom_y = 1 - @distance
  end
 
  def update_other
    self.blend_type = @character.blend_type
    self.visible = !@character.transparent
  end
end # Sprite_Mirror < Sprite_Character
 
 
#-------------------------------------------------------------------------------
#  Sprite_Shadow
#-------------------------------------------------------------------------------
 
class Sprite_Shadow < Sprite_Character
  def initialize(viewport, character = nil, source)
    @flicker = 0
    @famount = 0
    @aamount = 0
    @source = source
    super(viewport, character)
  end
 
  def update
    super
    update_bitmap
    update_src_rect
    update_position
    update_other
    update_facing
  end
  
  def set_character_bitmap
    self.bitmap = Cache.character(@character_name)
    
    self.color = Color.new(0, 0, 0, 255)
    self.z = Galv_CEffects::SHADOW_Z
    self.wave_amp = 1 if $game_map.shadow_options[2]
    self.wave_speed = 1000
     
    sign = @character_name[/\%[\(\[](.+?)[\)\]]/]
  if sign && sign.include?('%')
    sign = @character_name[/^[\!\$]./]
    if sign && sign.include?('$')
      @cw = $cw
      @ch = bitmap.height / 4
    else
      @cw = $cw
      @ch = bitmap.height / 8
    end
  else
    sign = @character_name[/^[\!\$]./]
    if sign && sign.include?('$')
      @cw = bitmap.width / 3
      @ch = bitmap.height / 4
    else
      @cw = bitmap.width / 12
      @ch = bitmap.height / 8
    end 
  end
    self.ox = @cw / 2
    self.oy = @ch
  end
 
  def update_position
    self.x = @character.screen_x
    self.y = @character.screen_y - 10
    get_angle
  end
   
  def get_angle
    x = $game_map.light_source[@source][0] - @character.real_x
    y = $game_map.light_source[@source][1] - @character.real_y
    self.opacity = $game_map.shadow_options[0] - 
      Math::sqrt(x * x + y * y) * $game_map.shadow_options[1]
     
    if x == 0 && y == 0 || self.opacity <= 0
      self.opacity = 0
    else 
      self.angle = Math::atan2(x, y) * 180 / Math::PI + @aamount
    end
  end
  
  def update_facing
    if @character.y < $game_map.light_source[@source][1]
      self.mirror = false
    else
      self.mirror = true
    end
  end
   
  def update_other
    self.blend_type = @character.blend_type
    self.visible = !@character.transparent
  end
end # Sprite_Shadow < Sprite_Character
 
 
#-------------------------------------------------------------------------------
#  Sprite_Icon
#-------------------------------------------------------------------------------
 
class Sprite_Icon < Sprite_Character
  def initialize(viewport, character = nil)
    @icon_sprite ||= Sprite.new
    @icon_sprite.bitmap ||= Cache.system("Iconset")
    @icon = nil
    super(viewport, character)
  end
 
  def dispose
    super
    if @icon_sprite
      @icon_sprite.dispose
      @icon_sprite = nil
    end
  end
   
  def update
    super
    update_icon
  end
   
  def update_icon
    return if !@character.icon
    draw_icon(@character.icon)
  end
   
  def draw_icon(icon_index)
    return if !@icon.nil?
    rect = Rect.new(icon_index % 16 * 24, icon_index / 16 * 24, 24, 24)
    @icon_sprite.src_rect  = rect
    @icon = icon_index
  end
   
  def update_position
    @icon_sprite.x = @character.screen_x - 12
    @icon_sprite.y = @character.screen_y + Galv_CEffects::ICON_OFFSET
  end
 
  def update_other
    self.blend_type = @character.blend_type
    @icon_sprite.visible = !@character.transparent
  end
end # Sprite_Icon < Sprite_Character
 
 
#-------------------------------------------------------------------------------
#  Other Stuff
#-------------------------------------------------------------------------------
 
 
class Game_Character < Game_CharacterBase
  attr_reader    :altitude
  attr_accessor  :reflect
  attr_accessor  :reflect_sprite
  attr_accessor  :shadow
  attr_accessor  :icon
  attr_accessor  :icon_offset
end
 
 
class Game_Event < Game_Character
  alias galv_reflect_ge_initialize initialize
  def initialize(map_id, event)
    @reflect = false
    @shadow = false
    @icon_offset = [0,0]
    galv_reflect_ge_initialize(map_id, event)
  end
end # Game_Event < Game_Character
 
 
class Game_Vehicle < Game_Character
  attr_reader :map_id
   
  alias galv_reflect_gv_initialize initialize
  def initialize(type)
    @reflect = true
    @shadow = true
    @icon_offset = [0,0]
    galv_reflect_gv_initialize(type)
  end
end # Game_Vehicle < Game_Character
 
 
class Game_Follower < Game_Character
  alias galv_reflect_gf_initialize initialize
  def initialize(member_index, preceding_character)
    galv_reflect_gf_initialize(member_index, preceding_character)
    @reflect = true
    @shadow = true
  end
   
  alias galv_reflect_gf_refresh refresh
  def refresh
    galv_reflect_gf_refresh
    return if actor.nil?
    @reflect = actor.reflect
    @reflect_sprite = actor.reflect_sprite
    @icon = actor.icon
    if SceneManager.scene_is?(Scene_Map)
      SceneManager.scene.spriteset.refresh_effects
    end
  end
end # Game_Follower < Game_Character
 
 
class Game_Player < Game_Character
  alias galv_reflect_gp_initialize initialize
  def initialize
    galv_reflect_gp_initialize
    @reflect = true
    @shadow = true
  end
   
  alias galv_reflect_gp_refresh refresh
  def refresh
    galv_reflect_gp_refresh
    @reflect = actor.reflect
    @reflect_sprite = actor.reflect_sprite
    @icon = actor.icon
    if SceneManager.scene_is?(Scene_Map)
      SceneManager.scene.spriteset.refresh_effects
    end
  end
end # Game_Player < Game_Character
 
 
class Scene_Map < Scene_Base
  attr_accessor :spriteset
end # Scene_Map
 
 
class Game_Map
  attr_accessor :char_effects
  attr_accessor :light_source
  attr_accessor :shadow_options
  attr_accessor :reflect_options
   
  alias galv_reflect_game_map_initialize initialize
  def initialize
    @light_source = []
    @shadow_options = [80,10,false]
    @reflect_options = [0]
    @char_effects = [false,false,false,false]
    #[reflect,shadow,mirror,icon]
    galv_reflect_game_map_initialize
  end
  
   
  alias galv_reflect_game_map_setup setup
  def setup(map_id)
    galv_reflect_game_map_setup(map_id)
    reset_char_effects
    do_all_chareffects
    if SceneManager.scene_is?(Scene_Map)
      SceneManager.scene.spriteset.refresh_effects
    end
  end
   
  def reset_char_effects
    @light_source = []
    @events.values.each { |e|
      e.reflect = false
      e.icon = nil }
  end
end # Game_Map
 
 
class Game_Actor < Game_Battler
  attr_accessor :reflect
  attr_accessor :reflect_sprite
  attr_accessor :icon
   
  alias galv_reflect_game_actor_initialize initialize
  def initialize(actor_id)
    galv_reflect_game_actor_initialize(actor_id)
    @reflect = $data_actors[actor_id].reflect
    @reflect_sprite = $data_actors[actor_id].reflect_sprite
    @icon_offset = [0,0]
  end
end # Game_Actor < Game_Battler
 
 
class RPG::Actor
  def reflect_sprite
    if @reflect_sprite.nil?
      if @note =~ /<reflect_sprite:[ ](.*),(.*)>/i
        @reflect_sprite = [$1.to_s,$2.to_i]
      else
        @reflect_sprite = nil
      end
    end
    @reflect_sprite
  end
  def reflect
    if @reflect.nil?
      if @note =~ /<no_reflect>/i
        @reflect = false
      else
        @reflect = true
      end
    end
    @reflect
  end
end # RPG::Actor



Posté dans Forum - [VXAce] compatibilité entre 2 scripts. [Résolu]

cortez - posté le 20/04/2015 à 23:20:18. (523 messages postés)

Reprends un script de reflet neuf et on vas le modifier.
Une fois la modification faite, teste juste l'affichage du
mirroir seul sans les autres effets, Et dis moi ce que tu
obtiens.
Je pense que mon erreur est corrigée, maintenant les
arguments de "frames" sont tous définis.


Cette fois remplace le code : (ligne 629)

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
  def update_balloon; end
  def setup_new_effect; end
   
  def set_character_bitmap
    if @character.reflect_sprite
      self.bitmap = Cache.character(@character.reflect_sprite[0])
    else
      self.bitmap = Cache.character(@character_name)
    end
    self.mirror = true
    self.opacity = 255
    self.z = Galv_CEffects::REFLECT_Z
     
    sign = @character_name[/^[\!\$]./]
    if sign && sign.include?('$')
      @cw = bitmap.width / 3
      @ch = bitmap.height / 4
    else
      @cw = bitmap.width / 12
      @ch = bitmap.height / 8
    end
    self.ox = @cw / 2
    self.oy = @ch
  end



Par celui-ci :

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
 
  def update_balloon; end
  def setup_new_effect; end
 
  def maemf_get_frames(character_name)
    character_name = "" unless character_name
    frames = !character_name[/\%[\(\[](.+?)[\)\]]/] ? [] : 
      $1.scan(/\d+/).collect { |s| s.to_i }
    frames[0] = 3 unless frames[0] # If empty, then set to default 3
    frames.push(1, 2, 1, 0) if frames[0] == 3 && frames.size < 2
    frames[1] = 0 unless frames[1] # Set idle frame
    if frames.size < 3
      # Create pattern 
      (frames[0] - 1).times {|i| frames.push((frames[1] + i + 1) % frames[0]) } 
    end
    return frames
  end
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Calculate Frame Size
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  def maemf_calc_frame_size(character_name, bitmap, frames = [])
    character_name = "" unless character_name
    frames = maemf_get_frames(character_name) if frames.empty?
    @cw = bitmap.width / (frames[0] ? frames[0] : 3)
    @ch = bitmap.height / 4
    sign = character_name[/^[\!\$]./]
    if !sign || !sign.include?('$')
      @cw /= 4
      @ch /= 2
    end
    return @cw, @ch
  end
 
  def set_character_bitmap
    if @character.reflect_sprite
      self.bitmap = Cache.character(@character.reflect_sprite[0])
    else
      self.bitmap = Cache.character(@character_name)
    end
    self.mirror = true
    self.opacity = 255
    self.z = Galv_CEffects::REFLECT_Z
    self.ox = @cw / 2
    self.oy = @ch
  end



Posté dans Forum - [VX Ace] Différence de dégâts impossible à appliquer...

cortez - posté le 20/04/2015 à 21:08:21. (523 messages postés)

Eh bien tu as ta réponse, les différents scripts de combats que tu possède
bloquent l'utilisation de celui des magie.
Plus exactement les formules de dégats magiques des scripts de combats
réécrivent par dessus la modification que celui de Raizen fait. Du coup :
+1 - 1 = 0 il ne fonctionne pas.

Je ne vais pas chercher plus loin pour trouver une solution, car il me faudrait
chercher dans les scripts indiqués chaque formule de dégats et effectuer des
changements à chaque fois. Essaye donc de t'en passer ou de trouver une
version différente qui fonctionne.

Tu peux aussi le faire manuellement.
Dans chaque sort élémentaire, tu crée une formule de dégat dans la zone
de droite. [exemple Boule de feu : v[20] / 10 +1 * a.mat]
Ainsi la magie que j'ai crée dépend du niveau de magie du héro (a.mat) et
d'une variable la n°20.
Si un objet [cristal de feu] ajoute +1 à la variable 20, je gagne donc 1 lvl de
magie de feu et le sort "Boule de feu" gagne 10% de dégats en plus.

Il suffit de copier coller dans chaque magie en changeant la variable selon
l'élément. n°20 pour le feu, 21 pour l'eau ...
Et pour afficher le niveau des magies. On fait 1 Png ou un objet qui affiche
un texte ou des images avec le niveau de chaque magie (selon les variables.)

Posté dans Forum - [VX Ace] Différence de dégâts impossible à appliquer...

cortez - posté le 20/04/2015 à 10:33:57. (523 messages postés)

Pour que l'on comprennent tout sur ton problème, explique nous aussi quel système
de combat tu utilises. Celui par défaut ? As tu ajoutés un script de combat ?

Puisque sur un projet de base, son script fonctionne, le problème vient d'ailleurs.
Tu dis attaque, tu parle d'une attaque d'une arme ou d'une magie ?
Parce que le script précise une option pour les armes mais il faut l'activer.

Posté dans Forum - [VXAce] compatibilité entre 2 scripts. [Résolu]

cortez - posté le 20/04/2015 à 10:23:29. (523 messages postés)

Ok je comprends essaye ça : (remplace le code précédent par celui-ci)

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
 
    #On récupère le nombres frames du personnage
    character_name = "" unless character_name
    frames = !character_name[/\%[\(\[](.+?)[\)\]]/] ? [] : 
      $1.scan(/\d+/).collect { |s| s.to_i }
    frames[0] = 3 unless frames[0] # If empty, then set to default 3
    frames.push(1, 2, 1, 0) if frames[0] == 3 && frames.size < 2
    frames[1] = 0 unless frames[1] # Set idle frame
    if frames.size < 3
      # Create pattern 
      (frames[0] - 1).times {|i| frames.push((frames[1] + i + 1) % frames[0]) } 
    end
    return frames
 
    sign = @character_name[/^[\!\$]./]
    if sign && sign.include?('$')
      if frames == 3 # Uniquement si le charset est de 3 frames.
         @cw = bitmap.width / 3
         @ch = bitmap.height / 4
      else # Pour les charset de plus de 3 frames.
         @cw = bitmap.width / (frames[0] ? frames[0] : 3)
         @ch = bitmap.height / 4
      end
    else
    @cw = bitmap.width / (frames[0] ? frames[0] : 3)
    @ch = bitmap.height / 4
      @cw /= 4
      @ch /= 2
    end
    self.ox = @cw / 2
    self.oy = @ch
 



Le problème venais du fait que tu as placé les chara en planche donc avec la
modification tout devrais marcher.

Posté dans Forum - [VXAce] compatibilité entre 2 scripts. [Résolu]

cortez - posté le 19/04/2015 à 23:48:16. (523 messages postés)

Quel est le nom complet du chara de tes perso. Sont-ils regroupé sur 1 planche de 12 character ?

J'attends ta réponse avant de modifier le script.

Posté dans Forum - [VXAce] compatibilité entre 2 scripts. [Résolu]

cortez - posté le 19/04/2015 à 21:56:19. (523 messages postés)

Si je ne dis pas de bêtise : (je ne peux pas tester car j'ai pas VXace)

A la ligne 642 du script de reflet tu as :

Portion de code : Tout sélectionner

1
2
3
4
5
6
7
8
9
10
    sign = @character_name[/^[\!\$]./]
    if sign && sign.include?('$')
      @cw = bitmap.width / 3
      @ch = bitmap.height / 4
    else
      @cw = bitmap.width / 12
      @ch = bitmap.height / 8
    end
    self.ox = @cw / 2
    self.oy = @ch



Tu le remplace par :

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
    #On récupère le nombres frames du personnage
    character_name = "" unless character_name
    frames = !character_name[/\%[\(\[](.+?)[\)\]]/] ? [] : 
      $1.scan(/\d+/).collect { |s| s.to_i }
    frames[0] = 3 unless frames[0] # If empty, then set to default 3
    frames.push(1, 2, 1, 0) if frames[0] == 3 && frames.size < 2
    frames[1] = 0 unless frames[1] # Set idle frame
    if frames.size < 3
      # Create pattern 
      (frames[0] - 1).times {|i| frames.push((frames[1] + i + 1) % frames[0]) } 
    end
    return frames
 
    sign = @character_name[/^[\!\$]./]
    if sign && sign.include?('$')
      if frames == 3 # Uniquement si le charset est de 3 frames.
         @cw = bitmap.width / 3
         @ch = bitmap.height / 4
      else # Pour les charset de plus de 3 frames.
         @cw = bitmap.width / (frames[0] ? frames[0] : 3)
         @ch = bitmap.height / 4
      end
    else
      @cw = bitmap.width / 12
      @ch = bitmap.height / 8
    end
    self.ox = @cw / 2
    self.oy = @ch



Cette manipulation devrait fonctionner. Si s'est le cas tu peux aussi faire le même remplacement dans la Classe Reflect (ligne 577) et la Classe Shadow (ligne 723)

Le principe est simple, c'est aux endroits que j'ai indiqué que je script reflect & Co
calcule la taille des frames du reflet/ombre/mirroir donc si j’introduis le calcul d'
extra frames dans ces méthodes, on obtient logiquement un bon découpage.

Posté dans Forum - Questions idiotes sur RM [PAS Script]

cortez - posté le 18/04/2015 à 11:32:18. (523 messages postés)

@Azelda :
Prenons l'exemple pour une grenade de feu.
Il est possible dans la configuration de l'objet de choisir "Utilisable uniquement en
combat" Une fois choisi tu crée une animation d'explosion (Ex : feu) tu configures
ensuite l'animation jouée lors de l'utilisation et tu choisi ton animation de feu.

Et c'est tout tu peux tester que tout fonctionne. Pense aussi à regarder les objets
déjà crée dans le logiciel, il me semble qu'un objet (parchemin élémentaire) peut
être utilisé en combat. Tu peux copier coller sa configuration pour aller plus vite.

Ps: Je n'ai pas VX d'installé je te décris tout de mémoire donc excuse moi si c'est
pas exactement les bons mots. Mais l'idée est juste.

Aller à la page: 1 2 3 4 5 6 7 8 9 10 11 12

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