• Anmelden

1

Donnerstag, 5. März 2009, 19:17

Save Only Menue

Hallo ^_^

ich bräuchte ein Skript für ein Menü in dem man nur speichern und das Spiel beenden kann. Ich hoffe irgendjemand hat so was oder kann mir eines erstellen. Außerdem sollte es nur den Overworld Charakter mit Namen und HP anzeigen (keine anderen Werte oder ähnliches). Geld, Schritte und Ort wären auch toll.

Danke schonmal im Vorraus,

Heatran

Dieser Beitrag wurde bereits 2 mal editiert, zuletzt von »Heatra« (5. März 2009, 20:18)


Reborn

hat beim Stromkonzern schon Rabatt

Motto: Wer noch was vom Wochenende weis, hat es nie erlebt!

  • Nachricht senden

2

Donnerstag, 5. März 2009, 22:38

Wenn du mir vielleicht ne kleine Skizze anfretigen würdest, würde ich dir eins Coden.
Mehr als a Allgäuer ka a Mensch it wera.


Wie soll ich wissen was ich denke, bevor ich nicht höre was ich sage?


Spoiler: OpenSource-Projects
NES-Emulator - a simple NES-Emulator
ERDL - a embedded Ruby Interpreter with the abilltiy to render images with DirectX ERDL shall be 100% compatible to RPGXP-Ruby Scripts
zum Lesen den Text mit der Maus markieren

GUMPi

Landsknecht

Motto: Ich finde den "Like-Button" so ziemlich uncool, echt mal.

  • Nachricht senden

3

Freitag, 6. März 2009, 00:14

Warum nicht einfach das Standart-Menü ändern oO?
Bild

4

Freitag, 6. März 2009, 13:40

So in der Art sollte es aussehen (Speichern und Beenden Schrift mittig) :

Bild
BildDanke schonmal im Vorraus für deine Hilfe! ^.^

5

Freitag, 6. März 2009, 15:35

Wie viele Helden sollen denn in der Party sein?
Ist das ein Einzelspielerspiel oder hat man eine Gruppe, sowas muss man ja voraus planen.
Um den Platz einzuteilen.

Übrigens was ist mit dem Hintergrund? Da hast du keine Angaben gemacht, soll der Spielscreen zu sehen sein, also das man das Menü über das Spiel legt? Oder irgend ein Bild, eine Farbe, was sollte denn in den Hintergrund?

@Hindi: Machst du das jetzt?

6

Freitag, 6. März 2009, 16:12

hmm, in den kästen die normale festgelegte hintergrundfarbe (dieses normale blau da) und außerhalb der spielscreen. ist ein einzelspielerspiel

Reborn

hat beim Stromkonzern schon Rabatt

Motto: Wer noch was vom Wochenende weis, hat es nie erlebt!

  • Nachricht senden

7

Freitag, 6. März 2009, 17:20

Und fals du es ganz Stylisch haben willst, musst du zwar mehr machen sieht dann aba besser aus^^:
Scene_End:
Spoiler

Ruby Quellcode

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
#==============================================================================
# ** Scene_End
#------------------------------------------------------------------------------
#  This class performs game end screen processing.
#==============================================================================
 
class Scene_End
  #--------------------------------------------------------------------------
  # * Main Processing
  #--------------------------------------------------------------------------
  def main
	# Make command window
	s1 = "To Title"
	s2 = "Shutdown"
	s3 = "Cancel"
	@command_window = Window_Command.new(192, [s1, s2, s3])
	@command_window.x = 320 - @command_window.width / 2
	@command_window.y = 240 - @command_window.height / 2
	# Execute transition
	Graphics.transition
	# Main loop
	loop do
  	# Update game screen
  	Graphics.update
  	# Update input information
  	Input.update
  	# Frame Update
  	update
  	# Abort loop if screen is changed
  	if $scene != self
    	break
  	end
	end
	# Prepare for transition
	Graphics.freeze
	# Dispose of window
	@command_window.dispose
	# If switching to title screen
	if $scene.is_a?(Scene_Title)
  	# Fade out screen
  	Graphics.transition
  	Graphics.freeze
	end
  end
  #--------------------------------------------------------------------------
  # * Frame Update
  #--------------------------------------------------------------------------
  def update
	# Update command window
	@command_window.update
	# If B button was pressed
	if Input.trigger?(Input::B)
  	# Play cancel SE
  	$game_system.se_play($data_system.cancel_se)
  	# Switch to menu screen
  	$scene = Scene_Map.new
  	$menu = Scene_Menu.new(5)
  	return
	end
	# If C button was pressed
	if Input.trigger?(Input::C)
  	# Branch by command window cursor position
  	case @command_window.index
  	when 0  # to title
    	command_to_title
  	when 1  # shutdown
    	command_shutdown
  	when 2  # quit
    	$scene = Scene_Map.new
    	$menu = Scene_Menu.new(5)
  	end
  	return
	end
  end
  #--------------------------------------------------------------------------
  # * Process When Choosing [To Title] Command
  #--------------------------------------------------------------------------
  def command_to_title
	# Play decision SE
	$game_system.se_play($data_system.decision_se)
	# Fade out BGM, BGS, and ME
	Audio.bgm_fade(800)
	Audio.bgs_fade(800)
	Audio.me_fade(800)
	# Switch to title screen
	$scene = Scene_Title.new
  end
  #--------------------------------------------------------------------------
  # * Process When Choosing [Shutdown] Command
  #--------------------------------------------------------------------------
  def command_shutdown
	# Play decision SE
	$game_system.se_play($data_system.decision_se)
	# Fade out BGM, BGS, and ME
	Audio.bgm_fade(800)
	Audio.bgs_fade(800)
	Audio.me_fade(800)
	# Shutdown
	$scene = nil
  end
  #--------------------------------------------------------------------------
  # *  Process When Choosing [Cancel] Command
  #--------------------------------------------------------------------------
  def command_cancel
	# Play decision SE
	$game_system.se_play($data_system.decision_se)
	# Switch to menu screen
	$scene = Scene_Menu.new(5)
  end
end
zum Lesen den Text mit der Maus markieren

Scene_Save:
Spoiler

Ruby Quellcode

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
#==============================================================================
# ** Scene_Save
#------------------------------------------------------------------------------
#  This class performs save screen processing.
#==============================================================================
 
class Scene_Save < Scene_File
  #--------------------------------------------------------------------------
  # * Object Initialization
  #--------------------------------------------------------------------------
  def initialize
	super("Which file would you like to save to?")
  end
  #--------------------------------------------------------------------------
  # * Decision Processing
  #--------------------------------------------------------------------------
  def on_decision(filename)
	# Play save SE
	$game_system.se_play($data_system.save_se)
	# Write save data
	file = File.open(filename, "wb")
	write_save_data(file)
	file.close
	# If called from event
	if $game_temp.save_calling
  	# Clear save call flag
  	$game_temp.save_calling = false
  	# Switch to map screen
  	$scene = Scene_Map.new
  	return
	end
	# Switch to menu screen
	$scene = Scene_map.new
	$menu = Scene_Menu.new
  end
  #--------------------------------------------------------------------------
  # * Cancel Processing
  #--------------------------------------------------------------------------
  def on_cancel
	# Play cancel SE
	$game_system.se_play($data_system.cancel_se)
	# If called from event
	if $game_temp.save_calling
  	# Clear save call flag
  	$game_temp.save_calling = false
  	# Switch to map screen
  	$scene = Scene_Map.new
  	return
	end
	# Switch to menu screen
	$scene = Scene_Map.new
	$menu = Scene_Menu.new
  end
  #--------------------------------------------------------------------------
  # * Write Save Data
  # 	file : write file object (opened)
  #--------------------------------------------------------------------------
  def write_save_data(file)
	# Make character data for drawing save file
	characters = []
	for i in 0...$game_party.actors.size
  	actor = $game_party.actors[i]
  	characters.push([actor.character_name, actor.character_hue])
	end
	# Write character data for drawing save file
	Marshal.dump(characters, file)
	# Wrire frame count for measuring play time
	Marshal.dump(Graphics.frame_count, file)
	# Increase save count by 1
	$game_system.save_count += 1
	# Save magic number
	# (A random value will be written each time saving with editor)
	$game_system.magic_number = $data_system.magic_number
	# Write each type of game object
	Marshal.dump($game_system, file)
	Marshal.dump($game_switches, file)
	Marshal.dump($game_variables, file)
	Marshal.dump($game_self_switches, file)
	Marshal.dump($game_screen, file)
	Marshal.dump($game_actors, file)
	Marshal.dump($game_party, file)
	Marshal.dump($game_troop, file)
	Marshal.dump($game_map, file)
	Marshal.dump($game_player, file)
  end
end
zum Lesen den Text mit der Maus markieren

Scene_Menu:
Spoiler

Ruby Quellcode

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
#==============================================================================
# ** Scene_Menu
#------------------------------------------------------------------------------
#  This class performs menu screen processing.
#==============================================================================
 
class Scene_Menu
  #--------------------------------------------------------------------------
  # * Object Initialization
  # 	menu_index : command cursor's initial position
  #--------------------------------------------------------------------------
  def initialize(menu_index = 0)
	@menu_index = menu_index
  end
  #--------------------------------------------------------------------------
  # * Main Processing
  #--------------------------------------------------------------------------
  def main
	# Make command window
	s1 = "Save"
	s2 = "End Game"
	@command_window = Window_Command.new(160, [s1, s2])
	@command_window.index = @menu_index
	@command_window.x = 250
	@command_window.y = 100
	# If number of party members is 0
	if $game_party.actors.size == 0
  	# Disable items, skills, equipment, and status
  	@command_window.disable_item(0)
  	@command_window.disable_item(1)
  	@command_window.disable_item(2)
  	@command_window.disable_item(3)
	end
	# If save is forbidden
	if $game_system.save_disabled
  	# Disable save
  	@command_window.disable_item(4)
	end
	# Make status window
	@status_window = Window_MenuStatus.new
	@status_window.x = 100
	@status_window.y = 300
	# Execute transition
	Graphics.transition
	# Main loop
	loop do
  	# Update game screen
  	Graphics.update
  	# Update input information
  	Input.update
  	# Frame update
  	update
  	# Abort loop if screen is changed
  	if $menu != self
    	break
  	end
	end
	# Prepare for transition
	Graphics.freeze
	# Dispose of windows
	@command_window.dispose
	@status_window.dispose
  end
  #--------------------------------------------------------------------------
  # * Frame Update
  #--------------------------------------------------------------------------
  def update
	# Update windows
	@command_window.update
	@status_window.update
	# If command window is active: call update_command
	if @command_window.active
  	update_command
  	return
	end
	# If status window is active: call update_status
	if @status_window.active
  	update_status
  	return
	end
  end
  #--------------------------------------------------------------------------
  # * Frame Update (when command window is active)
  #--------------------------------------------------------------------------
  def update_command
	# If B button was pressed
	if Input.trigger?(Input::B)
  	p"test"
  	# Play cancel SE
  	$game_system.se_play($data_system.cancel_se)
  	# Switch to map screen
  	$scene = Scene_Map.new
  	$menu = nil
  	return
	end
	# If C button was pressed
	if Input.trigger?(Input::C)
  	# If command other than save or end game, and party members = 0
  	if $game_party.actors.size == 0 and @command_window.index < 4
    	# Play buzzer SE
    	$game_system.se_play($data_system.buzzer_se)
    	return
  	end
  	# Branch by command window cursor position
  	case @command_window.index
  	when 0  # save
    	# If saving is forbidden
    	if $game_system.save_disabled
      	# Play buzzer SE
      	$game_system.se_play($data_system.buzzer_se)
      	return
    	end
    	# Play decision SE
    	$game_system.se_play($data_system.decision_se)
    	# Switch to save screen
    	$scene = Scene_Save.new
    	$menu = nil
  	when 1  
    	# Play decision SE
    	$game_system.se_play($data_system.decision_se)
    	# Switch to end game screen
    	$scene = Scene_End.new
    	$menu = nil
  	end
  	return
	end
  end
  #--------------------------------------------------------------------------
  # * Frame Update (when status window is active)
  #--------------------------------------------------------------------------
  def update_status
	# If B button was pressed
	if Input.trigger?(Input::B)
  	# Play cancel SE
  	$game_system.se_play($data_system.cancel_se)
  	# Make command window active
  	@command_window.active = true
  	@status_window.active = false
  	@status_window.index = -1
  	return
	end
	# If C button was pressed
	if Input.trigger?(Input::C)
  	# Branch by command window cursor position
  	case @command_window.index
  	when 1  # skill
    	# If this actor's action limit is 2 or more
    	if $game_party.actors[@status_window.index].restriction >= 2
      	# Play buzzer SE
      	$game_system.se_play($data_system.buzzer_se)
      	return
    	end
    	# Play decision SE
    	$game_system.se_play($data_system.decision_se)
    	# Switch to skill screen
    	$scene = Scene_Skill.new(@status_window.index)
  	when 2  # equipment
    	# Play decision SE
    	$game_system.se_play($data_system.decision_se)
    	# Switch to equipment screen
    	$scene = Scene_Equip.new(@status_window.index)
  	when 3  # status
    	# Play decision SE
    	$game_system.se_play($data_system.decision_se)
    	# Switch to status screen
    	$scene = Scene_Status.new(@status_window.index)
  	end
  	return
	end
  end
end
zum Lesen den Text mit der Maus markieren

Scene_Menu:
Spoiler

Ruby Quellcode

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
#==============================================================================
# ** Scene_Map
#------------------------------------------------------------------------------
#  This class performs map screen processing.
#==============================================================================
 
class Scene_Map
  #--------------------------------------------------------------------------
  # * Main Processing
  #--------------------------------------------------------------------------
  def main
	# Make sprite set
	@spriteset = Spriteset_Map.new
	# Make message window
	@message_window = Window_Message.new
	# Transition run
	Graphics.transition
	# Main loop
	loop do
  	# Update game screen
  	Graphics.update
  	# Update input information
  	Input.update
  	# Frame update
  	update
  	# Abort loop if screen is changed
  	if $scene != self
    	break
  	end
	end
	# Prepare for transition
	Graphics.freeze
	# Dispose of sprite set
	@spriteset.dispose
	# Dispose of message window
	@message_window.dispose
	# If switching to title screen
	if $scene.is_a?(Scene_Title)
  	# Fade out screen
  	Graphics.transition
  	Graphics.freeze
	end
  end
  #--------------------------------------------------------------------------
  # * Frame Update
  #--------------------------------------------------------------------------
  def update
	# Loop
	loop do
  	# Update map, interpreter, and player order
  	# (this update order is important for when conditions are fulfilled 
  	# to run any event, and the player isn't provided the opportunity to
  	# move in an instant)
  	$game_map.update
  	$game_system.map_interpreter.update
  	$game_player.update
  	# Update system (timer), screen
  	$game_system.update
  	$game_screen.update
  	# Abort loop if player isn't place moving
  	unless $game_temp.player_transferring
    	break
  	end
  	# Run place move
  	transfer_player
  	# Abort loop if transition processing
  	if $game_temp.transition_processing
    	break
  	end
	end
	# Update sprite set
	@spriteset.update
	# Update message window
	@message_window.update
	# If game over
	if $game_temp.gameover
  	# Switch to game over screen
  	$scene = Scene_Gameover.new
  	return
	end
	# If returning to title screen
	if $game_temp.to_title
  	# Change to title screen
  	$scene = Scene_Title.new
  	return
	end
	# If transition processing
	if $game_temp.transition_processing
  	# Clear transition processing flag
  	$game_temp.transition_processing = false
  	# Execute transition
  	if $game_temp.transition_name == ""
    	Graphics.transition(20)
  	else
    	Graphics.transition(40, "Graphics/Transitions/" +
      	$game_temp.transition_name)
  	end
	end
	# If showing message window
	if $game_temp.message_window_showing
  	return
	end
	# If encounter list isn't empty, and encounter count is 0
	if $game_player.encounter_count == 0 and $game_map.encounter_list != []
  	# If event is running or encounter is not forbidden
  	unless $game_system.map_interpreter.running? or
         	$game_system.encounter_disabled
    	# Confirm troop
    	n = rand($game_map.encounter_list.size)
    	troop_id = $game_map.encounter_list[n]
    	# If troop is valid
    	if $data_troops[troop_id] != nil
      	# Set battle calling flag
      	$game_temp.battle_calling = true
      	$game_temp.battle_troop_id = troop_id
      	$game_temp.battle_can_escape = true
      	$game_temp.battle_can_lose = false
      	$game_temp.battle_proc = nil
    	end
  	end
	end
	# If B button was pressed
	if Input.trigger?(Input::B)
  	# If event is running, or menu is not forbidden
  	unless $game_system.map_interpreter.running? or
         	$game_system.menu_disabled
    	# Set menu calling flag or beep flag
    	$game_temp.menu_calling = true
    	$game_temp.menu_beep = true
  	end
	end
	# If debug mode is ON and F9 key was pressed
	if $DEBUG and Input.press?(Input::F9)
  	# Set debug calling flag
  	$game_temp.debug_calling = true
	end
	# If player is not moving
	unless $game_player.moving?
  	# Run calling of each screen
  	if $game_temp.battle_calling
    	call_battle
  	elsif $game_temp.shop_calling
    	call_shop
  	elsif $game_temp.name_calling
    	call_name
  	elsif $game_temp.menu_calling
    	call_menu
  	elsif $game_temp.save_calling
    	call_save
  	elsif $game_temp.debug_calling
    	call_debug
  	end
	end
  end
  #--------------------------------------------------------------------------
  # * Battle Call
  #--------------------------------------------------------------------------
  def call_battle
	# Clear battle calling flag
	$game_temp.battle_calling = false
	# Clear menu calling flag
	$game_temp.menu_calling = false
	$game_temp.menu_beep = false
	# Make encounter count
	$game_player.make_encounter_count
	# Memorize map BGM and stop BGM
	$game_temp.map_bgm = $game_system.playing_bgm
	$game_system.bgm_stop
	# Play battle start SE
	$game_system.se_play($data_system.battle_start_se)
	# Play battle BGM
	$game_system.bgm_play($game_system.battle_bgm)
	# Straighten player position
	$game_player.straighten
	# Switch to battle screen
	$scene = Scene_Battle.new
  end
  #--------------------------------------------------------------------------
  # * Shop Call
  #--------------------------------------------------------------------------
  def call_shop
	# Clear shop call flag
	$game_temp.shop_calling = false
	# Straighten player position
	$game_player.straighten
	# Switch to shop screen
	$scene = Scene_Shop.new
  end
  #--------------------------------------------------------------------------
  # * Name Input Call
  #--------------------------------------------------------------------------
  def call_name
	# Clear name input call flag
	$game_temp.name_calling = false
	# Straighten player position
	$game_player.straighten
	# Switch to name input screen
	$scene = Scene_Name.new
  end
  #--------------------------------------------------------------------------
  # * Menu Call
  #--------------------------------------------------------------------------
  def call_menu
	# Clear menu call flag
	$game_temp.menu_calling = false
	# If menu beep flag is set
	if $game_temp.menu_beep
  	# Play decision SE
  	$game_system.se_play($data_system.decision_se)
  	# Clear menu beep flag
  	$game_temp.menu_beep = false
	end
	# Straighten player position
	$game_player.straighten
	# Switch to menu screen
	$menu = Scene_Menu.new
	$menu.main
  end
  #--------------------------------------------------------------------------
  # * Save Call
  #--------------------------------------------------------------------------
  def call_save
	# Straighten player position
	$game_player.straighten
	# Switch to save screen
	$scene = Scene_Save.new
  end
  #--------------------------------------------------------------------------
  # * Debug Call
  #--------------------------------------------------------------------------
  def call_debug
	# Clear debug call flag
	$game_temp.debug_calling = false
	# Play decision SE
	$game_system.se_play($data_system.decision_se)
	# Straighten player position
	$game_player.straighten
	# Switch to debug screen
	$scene = Scene_Debug.new
  end
  #--------------------------------------------------------------------------
  # * Player Place Move
  #--------------------------------------------------------------------------
  def transfer_player
	# Clear player place move call flag
	$game_temp.player_transferring = false
	# If move destination is different than current map
	if $game_map.map_id != $game_temp.player_new_map_id
  	# Set up a new map
  	$game_map.setup($game_temp.player_new_map_id)
	end
	# Set up player position
	$game_player.moveto($game_temp.player_new_x, $game_temp.player_new_y)
	# Set player direction
	case $game_temp.player_new_direction
	when 2  # down
  	$game_player.turn_down
	when 4  # left
  	$game_player.turn_left
	when 6  # right
  	$game_player.turn_right
	when 8  # up
  	$game_player.turn_up
	end
	# Straighten player position
	$game_player.straighten
	# Update map (run parallel process event)
	$game_map.update
	# Remake sprite set
	@spriteset.dispose
	@spriteset = Spriteset_Map.new
	# If processing transition
	if $game_temp.transition_processing
  	# Clear transition processing flag
  	$game_temp.transition_processing = false
  	# Execute transition
  	Graphics.transition(20)
	end
	# Run automatic change for BGM and BGS set on the map
	$game_map.autoplay
	# Frame reset
	Graphics.frame_reset
	# Update input information
	Input.update
  end
end
zum Lesen den Text mit der Maus markieren

Window_MenuStatus:
Spoiler

Ruby Quellcode

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
#==============================================================================
# ** Window_MenuStatus
#------------------------------------------------------------------------------
#  This window displays party member status on the menu screen.
#==============================================================================
 
class Window_MenuStatus < Window_Selectable
  #--------------------------------------------------------------------------
  # * Object Initialization
  #--------------------------------------------------------------------------
  def initialize
	super(0, 0, 480, 120)
	self.contents = Bitmap.new(width - 32, height - 32)
	refresh
	self.active = false
	self.index = -1
  end
  #--------------------------------------------------------------------------
  # * Refresh
  #--------------------------------------------------------------------------
  def refresh
	self.contents.clear
	@item_max = 1
	for i in 0...1
  	x = 64
  	y = i * 116
  	actor = $game_party.actors[i]
  	draw_actor_graphic(actor, x - 40, y + 80)
  	draw_actor_name(actor, x, y)
  	draw_actor_class(actor, x + 144, y)
  	draw_actor_level(actor, x, y + 32)
  	draw_actor_state(actor, x + 90, y + 32)
  	draw_actor_exp(actor, x, y + 64)
  	draw_actor_hp(actor, x + 236, y + 32)
  	draw_actor_sp(actor, x + 236, y + 64)
	end
  end
  #--------------------------------------------------------------------------
  # * Cursor Rectangle Update
  #--------------------------------------------------------------------------
  def update_cursor_rect
	if @index < 0
  	self.cursor_rect.empty
	else
  	self.cursor_rect.set(0, @index * 116, self.width - 32, 96)
	end
  end
end
zum Lesen den Text mit der Maus markieren


Sieht ein bisl besser aus als dieser leere Bildschirm.
Mehr als a Allgäuer ka a Mensch it wera.


Wie soll ich wissen was ich denke, bevor ich nicht höre was ich sage?


Spoiler: OpenSource-Projects
NES-Emulator - a simple NES-Emulator
ERDL - a embedded Ruby Interpreter with the abilltiy to render images with DirectX ERDL shall be 100% compatible to RPGXP-Ruby Scripts
zum Lesen den Text mit der Maus markieren

8

Freitag, 6. März 2009, 17:37

ist soweit ganz gut, aber es wäre toll wenn du E und SP durch Geld und Ort austauschen würdest.

trotzdem aber schonmal ein großes DANKE.

EDIT unten: ah^^ ich bin nämlich in vielen anderen Foren angemeldet, da kann man nicht selber löschen^^

Dieser Beitrag wurde bereits 2 mal editiert, zuletzt von »Heatra« (6. März 2009, 17:53)


Reborn

hat beim Stromkonzern schon Rabatt

Motto: Wer noch was vom Wochenende weis, hat es nie erlebt!

  • Nachricht senden

9

Freitag, 6. März 2009, 17:51

Löschen kansnt du selber^^, bearbeiten dann steht oben löschen ;-). Bin schon dabei dir es zu Coden.
Mehr als a Allgäuer ka a Mensch it wera.


Wie soll ich wissen was ich denke, bevor ich nicht höre was ich sage?


Spoiler: OpenSource-Projects
NES-Emulator - a simple NES-Emulator
ERDL - a embedded Ruby Interpreter with the abilltiy to render images with DirectX ERDL shall be 100% compatible to RPGXP-Ruby Scripts
zum Lesen den Text mit der Maus markieren

10

Samstag, 7. März 2009, 00:36

einfach über main einfügen:
Spoiler

Ruby Quellcode

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
class Scene_Menu
 
  def initialize(menu_index = 0)
	@menu_index = menu_index
  end
  #--------------------------------------------------------------------------
  # * Main Processing
  #--------------------------------------------------------------------------
  def main
	# Make command window
	s1 = "Speichern"
	s2 = "Beenden"
	@command_extra = Window_Extra.new(0)
	@command_window = Window_Command.new(160, [s1, s2])
	@command_window.index = @menu_index
	@command_window.x = 320 - (@command_window.width / 2)
	@command_window.y = 240 - (@command_window.height / 2)
	@command_background = Spriteset_Map.new
	# If save is forbidden
	if $game_system.save_disabled
  	# Disable save
  	@command_window.disable_item(0)
	end
	# Execute transition
	Graphics.transition
	# Main loop
	loop do
  	# Update game screen
  	Graphics.update
  	# Update input information
  	Input.update
  	# Frame update
  	update
  	# Abort loop if screen is changed
  	if $scene != self
    	break
  	end
	end
	# Prepare for transition
	Graphics.freeze
	# Dispose of windows
	@command_window.dispose
	@command_background.dispose
	@command_extra.dispose
  end
  #--------------------------------------------------------------------------
  # * Frame Update
  #--------------------------------------------------------------------------
  def update
	# Update windows
	@command_window.update
	@command_background.update
	@command_extra.update
	update_command
  end
  #--------------------------------------------------------------------------
  # * Frame Update (when command window is active)
  #--------------------------------------------------------------------------
  def update_command
	# If B button was pressed
	if Input.trigger?(Input::B)
  	# Play cancel SE
  	$game_system.se_play($data_system.cancel_se)
  	# Switch to map screen
  	$scene = Scene_Map.new
  	return
	end
	if Input.trigger?(Input::C)
   	# Branch by command window cursor position
  	case @command_window.index
     	when 0  # save
      	if $game_system.save_disabled
      	# Play buzzer SE
      	$game_system.se_play($data_system.buzzer_se)
      	return
    	end
    	# Play decision SE
    	$game_system.se_play($data_system.decision_se)
    	# Switch to save screen
    	$scene = Scene_Save.new
   	when 1  # end game
    	# Play decision SE
    	$game_system.se_play($data_system.decision_se)
    	# Switch to end game screen
    	$scene = Scene_End.new
    	end
  	return
  	end
  end
end
 
 
class Scene_End
  #--------------------------------------------------------------------------
  # * Main Processing
  #--------------------------------------------------------------------------
  def main
	# Make command window
	s1 = "To Title"
	s2 = "Shutdown"
	s3 = "Cancel"
	@command_window = Window_Command.new(160, [s1, s2, s3])
	@command_window.x = 320 - @command_window.width / 2
	@command_window.y = 240 - @command_window.height / 2
	@command_window_background = Spriteset_Map.new
	# Execute transition
	Graphics.transition
	# Main loop
	loop do
  	# Update game screen
  	Graphics.update
  	# Update input information
  	Input.update
  	# Frame Update
  	update
  	# Abort loop if screen is changed
  	if $scene != self
    	break
  	end
	end
	# Prepare for transition
	Graphics.freeze
	# Dispose of window
	@command_window.dispose
	@command_window_background.dispose
	# If switching to title screen
	if $scene.is_a?(Scene_Title)
  	# Fade out screen
  	Graphics.transition
  	Graphics.freeze
	end
  end
  #--------------------------------------------------------------------------
  # * Frame Update
  #--------------------------------------------------------------------------
  def update
	# Update command window
	@command_window.update
	@command_window_background.update
	# If B button was pressed
	if Input.trigger?(Input::B)
  	# Play cancel SE
  	$game_system.se_play($data_system.cancel_se)
  	# Switch to menu screen
  	$scene = Scene_Menu.new(1)
  	return
	end
	# If C button was pressed
	if Input.trigger?(Input::C)
  	# Branch by command window cursor position
  	case @command_window.index
  	when 0  # to title
    	command_to_title
  	when 1  # shutdown
    	command_shutdown
  	when 2  # quit
    	command_cancel
  	end
  	return
	end
  end
  #--------------------------------------------------------------------------
  # * Process When Choosing [To Title] Command
  #--------------------------------------------------------------------------
  def command_to_title
	# Play decision SE
	$game_system.se_play($data_system.decision_se)
	# Fade out BGM, BGS, and ME
	Audio.bgm_fade(800)
	Audio.bgs_fade(800)
	Audio.me_fade(800)
	# Switch to title screen
	$scene = Scene_Title.new
  end
  #--------------------------------------------------------------------------
  # * Process When Choosing [Shutdown] Command
  #--------------------------------------------------------------------------
  def command_shutdown
	# Play decision SE
	$game_system.se_play($data_system.decision_se)
	# Fade out BGM, BGS, and ME
	Audio.bgm_fade(800)
	Audio.bgs_fade(800)
	Audio.me_fade(800)
	# Shutdown
	$scene = nil
  end
  #--------------------------------------------------------------------------
  # *  Process When Choosing [Cancel] Command
  #--------------------------------------------------------------------------
  def command_cancel
	# Play decision SE
	$game_system.se_play($data_system.decision_se)
	# Switch to menu screen
	$scene = Scene_Menu.new(1)
  end
end
 
#==============================================================================
# ** Scene_Save
#------------------------------------------------------------------------------
#  This class performs save screen processing.
#==============================================================================
 
class Scene_Save < Scene_File
  #--------------------------------------------------------------------------
  # * Object Initialization
  #--------------------------------------------------------------------------
  def initialize
	super("Which file would you like to save to?")
  end
  #--------------------------------------------------------------------------
  # * Decision Processing
  #--------------------------------------------------------------------------
  def on_decision(filename)
	# Play save SE
	$game_system.se_play($data_system.save_se)
	# Write save data
	file = File.open(filename, "wb")
	write_save_data(file)
	file.close
	# If called from event
	if $game_temp.save_calling
  	# Clear save call flag
  	$game_temp.save_calling = false
  	# Switch to map screen
  	$scene = Scene_Map.new
  	return
	end
	# Switch to menu screen
	$scene = Scene_Menu.new(0)
  end
  #--------------------------------------------------------------------------
  # * Cancel Processing
  #--------------------------------------------------------------------------
  def on_cancel
	# Play cancel SE
	$game_system.se_play($data_system.cancel_se)
	# If called from event
	if $game_temp.save_calling
  	# Clear save call flag
  	$game_temp.save_calling = false
  	# Switch to map screen
  	$scene = Scene_Map.new
  	return
	end
	# Switch to menu screen
	$scene = Scene_Menu.new(0)
  end
  #--------------------------------------------------------------------------
  # * Write Save Data
  # 	file : write file object (opened)
  #--------------------------------------------------------------------------
  def write_save_data(file)
	# Make character data for drawing save file
	characters = []
	for i in 0...$game_party.actors.size
  	actor = $game_party.actors[i]
  	characters.push([actor.character_name, actor.character_hue])
	end
	# Write character data for drawing save file
	Marshal.dump(characters, file)
	# Wrire frame count for measuring play time
	Marshal.dump(Graphics.frame_count, file)
	# Increase save count by 1
	$game_system.save_count  = 1
	# Save magic number
	# (A random value will be written each time saving with editor)
	$game_system.magic_number = $data_system.magic_number
	# Write each type of game object
	Marshal.dump($game_system, file)
	Marshal.dump($game_switches, file)
	Marshal.dump($game_variables, file)
	Marshal.dump($game_self_switches, file)
	Marshal.dump($game_screen, file)
	Marshal.dump($game_actors, file)
	Marshal.dump($game_party, file)
	Marshal.dump($game_troop, file)
	Marshal.dump($game_map, file)
	Marshal.dump($game_player, file)
  end
end
 
class Window_Extra < Window_Base
  #--------------------------------------------------------------------------
  # * Object Initialization
  # 	actor : actor
  #--------------------------------------------------------------------------
  def initialize(actor)
	super(0, 0, 220, 75)
	self.contents = Bitmap.new(width - 32, height - 32)
	@actor = $game_party.actors[actor]
	self.x = 290 - (160 / 2) 
	self.y = 240 - (60 / 2)   78
	refresh	
  end
  #--------------------------------------------------------------------------
  # * Refresh
  #--------------------------------------------------------------------------
  def refresh
	self.contents.clear
	draw_actor_graphic(@actor, 85, 45)
	self.contents.font.size = 16
	self.contents.font.color = system_color
	self.contents.draw_text(0, -10, 80, 32, "Spieler:")
	self.contents.font.color = normal_color
	self.contents.draw_text(-1, 5, 80, 32, @actor.name)
	self.contents.font.color = system_color
	self.contents.draw_text(0, 20, 80, 32, "HP:")
	self.contents.font.color = normal_color
	self.contents.draw_text(25,20,80,32,@actor.hp.to_s)
	self.contents.draw_text(45,20,80,32,"/")
	self.contents.draw_text(50,20,80,32,@actor.maxhp.to_s)
	self.contents.font.color = system_color
	self.contents.draw_text(100,-10,80,32, $data_system.words.gold ":")
	self.contents.font.color = normal_color
	self.contents.draw_text(135,-10,80,32, $game_party.gold.to_s)
	self.contents.font.color = system_color
	self.contents.draw_text(100,5,80,32, "Schritte:")
	self.contents.font.color = normal_color
	self.contents.draw_text(152,5,80,32, $game_party.steps.to_s)
	self.contents.font.color = system_color
	self.contents.draw_text(100,20,80,32, "Ort:")
	self.contents.font.color = normal_color
	self.contents.draw_text(125,20,80,32, $game_map.name)
  end
end
 
class Game_Map
  def name
	return $map_infos[@map_id]
  end
end
 
class Scene_Title
  $map_infos = load_data("Data/MapInfos.rxdata")
  for key in $map_infos.keys
	$map_infos[key] = $map_infos[key].name
  end
end
zum Lesen den Text mit der Maus markieren

11

Samstag, 7. März 2009, 08:24

Danke, das ist genau so wie ich es brauche.

Damit wäre das Thema dann erledigt.

Reborn

hat beim Stromkonzern schon Rabatt

Motto: Wer noch was vom Wochenende weis, hat es nie erlebt!

  • Nachricht senden

12

Samstag, 7. März 2009, 09:40

Da habe ich mal ne kleine Frage.
Wenn ich z.B. schreibe
Class Scene_menu
def Main
p"bla"
end
end
Hab ich damit das alte Scene_menu.Main überschrieben?
Mehr als a Allgäuer ka a Mensch it wera.


Wie soll ich wissen was ich denke, bevor ich nicht höre was ich sage?


Spoiler: OpenSource-Projects
NES-Emulator - a simple NES-Emulator
ERDL - a embedded Ruby Interpreter with the abilltiy to render images with DirectX ERDL shall be 100% compatible to RPGXP-Ruby Scripts
zum Lesen den Text mit der Maus markieren

RedLink

Landsknecht

Motto: Faulheit ist Relativ

  • Nachricht senden

13

Samstag, 7. März 2009, 09:55

ich weiß nur das du es damit erweitern lassen kannst. Aber teoretisch wenn du alles gleich bennenst schon.
  • Scripter

    Für den MV
  • Mitmacher

    nirgendswo

14

Samstag, 7. März 2009, 09:57

Ja hast du, aber du müsstest noch mehr verändern, in Scene_Map und anderen verlinkten Skripten, sonst gibts nen Error.

Neo-Bahamut

Himmelsgleicher

Motto: Wer anderen eine Bratwurst brät, der hat ein Bratwurstbratgerät.

  • Nachricht senden

15

Samstag, 7. März 2009, 11:42

Nein, müsste er nicht :o

Wenn du eine Methode mehrmals definierst, wird immer die letzte genommen. Klassen oder Module können nicht überschrieben werden.
Spoiler: Wurstinator
zum Lesen den Text mit der Maus markieren

Spoiler: Lazer-Wurst
zum Lesen den Text mit der Maus markieren

Spoiler: Hallowurst
zum Lesen den Text mit der Maus markieren

Reborn

hat beim Stromkonzern schon Rabatt

Motto: Wer noch was vom Wochenende weis, hat es nie erlebt!

  • Nachricht senden

16

Donnerstag, 12. März 2009, 18:28

Was meinst du mit "es wird immer das letzte genommen"?
Mehr als a Allgäuer ka a Mensch it wera.


Wie soll ich wissen was ich denke, bevor ich nicht höre was ich sage?


Spoiler: OpenSource-Projects
NES-Emulator - a simple NES-Emulator
ERDL - a embedded Ruby Interpreter with the abilltiy to render images with DirectX ERDL shall be 100% compatible to RPGXP-Ruby Scripts
zum Lesen den Text mit der Maus markieren

Neo-Bahamut

Himmelsgleicher

Motto: Wer anderen eine Bratwurst brät, der hat ein Bratwurstbratgerät.

  • Nachricht senden

17

Donnerstag, 12. März 2009, 18:30

Naja... die letze Methode... weiß nicht wies sonst sagen soll^^
Spoiler: Wurstinator
zum Lesen den Text mit der Maus markieren

Spoiler: Lazer-Wurst
zum Lesen den Text mit der Maus markieren

Spoiler: Hallowurst
zum Lesen den Text mit der Maus markieren

Reborn

hat beim Stromkonzern schon Rabatt

Motto: Wer noch was vom Wochenende weis, hat es nie erlebt!

  • Nachricht senden

18

Donnerstag, 12. März 2009, 19:20

Also wirds Theoretisch überschrieben, weil ja das letzte im script aufgerufen wurde in diesem fall die Methode von supaiku. Oder?
Mehr als a Allgäuer ka a Mensch it wera.


Wie soll ich wissen was ich denke, bevor ich nicht höre was ich sage?


Spoiler: OpenSource-Projects
NES-Emulator - a simple NES-Emulator
ERDL - a embedded Ruby Interpreter with the abilltiy to render images with DirectX ERDL shall be 100% compatible to RPGXP-Ruby Scripts
zum Lesen den Text mit der Maus markieren

Neo-Bahamut

Himmelsgleicher

Motto: Wer anderen eine Bratwurst brät, der hat ein Bratwurstbratgerät.

  • Nachricht senden

19

Donnerstag, 12. März 2009, 20:28

Bild


Das Problem ist dann beim aliasen, dass gealiste Methoden auch überschrieben werden...
Spoiler: Wurstinator
zum Lesen den Text mit der Maus markieren

Spoiler: Lazer-Wurst
zum Lesen den Text mit der Maus markieren

Spoiler: Hallowurst
zum Lesen den Text mit der Maus markieren

Reborn

hat beim Stromkonzern schon Rabatt

Motto: Wer noch was vom Wochenende weis, hat es nie erlebt!

  • Nachricht senden

20

Donnerstag, 12. März 2009, 22:11

Das mit alieas checke ich dann sowieso nicht^^^, aber danke.
Mehr als a Allgäuer ka a Mensch it wera.


Wie soll ich wissen was ich denke, bevor ich nicht höre was ich sage?


Spoiler: OpenSource-Projects
NES-Emulator - a simple NES-Emulator
ERDL - a embedded Ruby Interpreter with the abilltiy to render images with DirectX ERDL shall be 100% compatible to RPGXP-Ruby Scripts
zum Lesen den Text mit der Maus markieren

Ähnliche Themen

Social Bookmarks