❤ 0 Auteur : PK8
Logiciel : RPG Maker VX
Nombre de scripts : 1
Source : https://save-point.org/showthread.php?tid=4130
Instructions :
Ce script permet de démarrer les évènements communs manuellement. Plus besoin de mettre un interrupteur dans les évènements communs automatiques et parallèles que vous souhaitez faire fonctionner pour toute la partie (genre les évènement communs pour la météo).
Conditions d'utilisation
- Vous devez créditer l'auteur (PK8)
- Vous pouvez utiliser ce script dans vos projets commerciaux
Installation
A placer au-dessus de Main.
Utilisation
Allez à la ligne 46 (Autorun, Parallel = [], []) et mettez entre crochets les évènements que vous désirez démarrer en parallèles ou en automatiques.
Dans votre base de donnée, vos pouvez maintenant mettre le facteur "aucun déclenchement" à votre évènement, il s’exécutera quand même (en parallèle ou en automatique => comme indiquer dans le script).
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
| =begin
Switchless Common Events v1.1
by PK8
Created: 5/6/2012
Modified: 5/27/2012
──────────────────────────────────────────────────────────────────────────────
■ Author's Notes
This was a fairly quick script I wrote. It was an idea I had in my head
for a little while.
──────────────────────────────────────────────────────────────────────────────
■ Introduction
Remember how in RPG Maker 2000 and 2003, you didn't need to rely on switches
in order for your common events to run on parallel process and autorun? Well,
it's back. This script lets you set which common events are going to run in
either parallel processing or automatically, without the use of conditional
switches.
──────────────────────────────────────────────────────────────────────────────
■ Features
o Set which common events are going to use autorun or parallel process
triggering without a conditional switch.
──────────────────────────────────────────────────────────────────────────────
■ Methods Aliased
Scene_Title.command_new_game
Game_Interpreter.setup_starting_event
Game_CommonEvent.refresh
──────────────────────────────────────────────────────────────────────────────
■ Changelog
v1 (05/06/2012): Initial Release
v1.1 (05/27/2012): Removed Custom Conditionals feature because it was
unnecessary and could easily be accomplished through
conditional branches. I also reduced a lot of code.
=end
#==============================================================================
# ** Configuration
#==============================================================================
module PK8
class Switchless_CommonEvents
#--------------------------------------------------------------------------
# * Do not modify
#--------------------------------------------------------------------------
Autorun, Parallel = [], []
#--------------------------------------------------------------------------
# * Decide which common events would autorun/process without a switch.
# Autorun/Parallel = [Common Event IDs]
#--------------------------------------------------------------------------
#Autorun = [10, 9]
#Parallel = [8, 7]
end
end
#==============================================================================
# ** Scene_Title
#------------------------------------------------------------------------------
# This class performs title screen processing.
#==============================================================================
class Scene_Title < Scene_Base
#--------------------------------------------------------------------------
# * Alias Listings
#--------------------------------------------------------------------------
unless method_defined?(:pk8_sce_command_new_game)
alias_method(:pk8_sce_command_new_game, :command_new_game)
end
#--------------------------------------------------------------------------
# * Command: New Game
#--------------------------------------------------------------------------
def command_new_game
pk8_sce_command_new_game
PK8::Switchless_CommonEvents::Autorun.each { | id |
ceid = $data_common_events[id]; ceid.trigger, ceid.switch_id = 0, 0 }
PK8::Switchless_CommonEvents::Parallel.each { | id |
ceid = $data_common_events[id]; ceid.trigger, ceid.switch_id = 0, 0 }
end
end
#==============================================================================
# ** Interpreter
#------------------------------------------------------------------------------
# This interpreter runs event commands. This class is used within the
# Game_System class and the Game_Event class.
#==============================================================================
class Game_Interpreter
#--------------------------------------------------------------------------
# * Alias Listings
#--------------------------------------------------------------------------
unless method_defined?(:pk8_sce_setup_starting_event)
alias_method(:pk8_sce_setup_starting_event, :setup_starting_event)
end
#--------------------------------------------------------------------------
# * Starting Event Setup
#--------------------------------------------------------------------------
def setup_starting_event
pk8_sce_setup_starting_event
$data_common_events.compact.each { | ce |
setup(ce.list) if PK8::Switchless_CommonEvents::Autorun.include?(ce.id) }
end
end
#==============================================================================
# ** Game_CommonEvent
#------------------------------------------------------------------------------
# This class handles common events. It includes execution of parallel process
# event. This class is used within the Game_Map class ($game_map).
#==============================================================================
class Game_CommonEvent
#--------------------------------------------------------------------------
# * Alias Listings
#--------------------------------------------------------------------------
unless method_defined?(:pk8_sce_refresh)
alias_method(:pk8_sce_refresh, :refresh)
end
#--------------------------------------------------------------------------
# * Refresh
#--------------------------------------------------------------------------
def refresh
pk8_sce_refresh
if PK8::Switchless_CommonEvents::Parallel.include?(@common_event_id)
@interpreter = Game_Interpreter.new if @interpreter == nil
end
end
end |
Mis à jour le 22 novembre 2020.
|