• Anmelden

1

Freitag, 2. Januar 2009, 15:49

Einfaches Menü ändern...

Hallo Leute...also ich habe ein kleines Problem, bei den ich einfach nicht weiter komme.
Jedoch glaube ich, dass die Lösung für manche von euch auf der Hand liegt. Und zwar versuche ich, dass
einfache Menü aus dem Srcipt Explorer so umzuschreiben, dass die Punkte : "Fähigkeiten", "Ausrüstung", "Status" nicht verfügbar sind.
Ich habe versucht ein wenig umzuschreiben, jedoch ohne jegliche Script - Kenntnisse. Ich habe nur erreicht, dass diese Punkte nicht mehr angezeigt wurden, sie waren aber dennoch vorhanden.

Ich habe das Script mal angehängt, wie gesagt ich will nur die Punkte : - "Item", "Gold", "Spielzeit", "Speicher", evt. noch "Laden" wenn möglich und "Ende" haben. Wenn es machbar ist in dieser Reihenfolge...würde mich sehr über eure Hilfe freuen...vielen Dank im Vorraus.

[php]
#===================================#
#Very Easy and Editable Menu by Xk8 #
#===================================#
class Scene_Menu
#'#...'comments mean: 'see above'
def initialize(menu_index = 0)
@menu_index = menu_index
end

def main
@sprite = Spriteset_Map.new #shows the map behind the menu
s1 = "Item" #s1 - s8 are the names of the commands in the menu
s2 = "Fähgkeiten"
s3 = "Ausrüstung"
s4 = "Status"
s5 = "Speichern"
s6 = "Gold"
s7 = "Spielzeit"
s8 = "Beenden"
@command_window = Window_Command.new(160, [s1, s2, s3, s4, s5, s6, s7, s8]) #this
#line draws the commands in the command window (s1 = 0)
@command_window.index = @menu_index
@command_window.back_opacity = 160 #this line makes the menu 'see-through'
if $game_party.actors.size == 0
@command_window.disable_item(0)
@command_window.disable_item(1)
@command_window.disable_item(2)
@command_window.disable_item(3)
end
if $game_system.save_disabled #this line controls the save-game ability
@command_window.disable_item(4)
end
#the functions of each command are further below the script

#playtime window is drawn
@playtime_window = Window_PlayTime.new
@playtime_window.x = 160 #x pos of the playtime window
@playtime_window.y = 208 #y pos of the playtime window
@playtime_window.back_opacity = 160 #makes the window see-through
@playtime_window.visible = false #the window is invisible until called

#goldwindow is drawn
@gold_window = Window_Gold.new
@gold_window.x = 160 #x pos of the gold window
@gold_window.y = 176 #y pos of the gold window
@gold_window.back_opacity = 160 #makes the window see-through
@gold_window.visible = false #makes the window invisible until called

#drawing the status window (Window_NewMenuStatus); the window where you select
#a character to view it's stats or skills or whatever
@status_window = Window_NewMenuStatus.new #defines what window to draw
@status_window.x = 160 #x pos of the status window
@status_window.y = 0 #default y pos of the status window
@status_window.back_opacity = 160 #makes the window see-through
@status_window.visible = false #makes the window invisible until called

Graphics.transition
loop do
Graphics.update
Input.update
update
if $scene != self
break
end
end
Graphics.freeze
#these lines delete the windows after pressing 'B' to exit the menu
@command_window.dispose
@playtime_window.dispose
@gold_window.dispose
@status_window.dispose
@sprite.dispose
end

def update
#these lines update the various active windows in the menu
@command_window.update
@playtime_window.update
@gold_window.update
@status_window.update

if @command_window.active #this line see if the command window is active
update_command #looks up which definition of functions is used for this window
return
end

if @status_window.active #...
update_status #...
return
end
if @gold_window.active #...
update_status #...
return
end
if @playtime_window.active #...
update_status #...
return
end
end

def update_command #the definitions of the menu commands
if Input.trigger?(Input::B) #press B in menu to exit the menu
$game_system.se_play($data_system.cancel_se) #plays a sound effect
$scene = Scene_Map.new #exit the menu and go back to the game
return
end
if Input.trigger?(Input::C) #press confirm
if $game_party.actors.size == 0 and @command_window.index < 4
$game_system.se_play($data_system.buzzer_se)
return
end

case @command_window.index
when 0 #item (first command always starts with 0)
$game_system.se_play($data_system.decision_se)
$scene = Scene_Item.new
when 1 #skill further comments are at the bottom of the page
$game_system.se_play($data_system.decision_se)
@command_window.active = false #make the command window inactive (no control)
@status_window.visible = true #make the status window visible
@status_window.active = true #makes the status window active (control)
@status_window.index = 0 #the start position of the status window
@status_window.y = 48 #the y pos of the status window for THIS option
when 2 #Equipment further comments are at the bottom of the page
$game_system.se_play($data_system.decision_se)
@command_window.active = false #...
@status_window.visible = true #...
@status_window.active = true #...
@status_window.index = 0 #...
@status_window.y = 80 #...
when 3 #Status further comments are at the bottom of the page
$game_system.se_play($data_system.decision_se)
@command_window.active = false #...
@status_window.visible = true #...
@status_window.active = true #...
@status_window.index = 0 #...
@status_window.y = 112 #...
when 4 #Save
if $game_system.save_disabled #checks if saving is enabled or not
$game_system.se_play($data_system.buzzer_se) #saving disabled
return
end
$game_system.se_play($data_system.decision_se) #saving enabled
$scene = Scene_Save.new #save game screen
when 5 #Gold
$game_system.se_play($data_system.decision_se)
@command_window.active = false #...
@gold_window.visible = true #makes gold window visible
when 6 #Playtime
$game_system.se_play($data_system.decision_se)
@command_window.active = false #...
@playtime_window.visible = true #...
when 7 #Quit
$game_system.se_play($data_system.decision_se)
$scene = Scene_End.new #quits the game
end
return
end
end

def update_status
if Input.trigger?(Input::B) #when pressing 'B', control of the command window
#is regained and the other window's 'dissappear' until called again
$game_system.se_play($data_system.cancel_se)
@command_window.active = true
@gold_window.visible = false
@playtime_window.visible = false
@status_window.active = false
@status_window.visible = false
@status_window.index = -1
return
end
if Input.trigger?(Input::C)
#what happens when 'C' is pressed in the first 3 options of the menu
#'Skill' 'Equip' 'Status'
case @command_window.index
when 1
if $game_party.actors[@status_window.index].restriction >= 2
$game_system.se_play($data_system.buzzer_se)
return
end
$game_system.se_play($data_system.decision_se)
$scene = Scene_Skill.new(@status_window.index)
when 2
$game_system.se_play($data_system.decision_se)
$scene = Scene_Equip.new(@status_window.index)
when 3
$game_system.se_play($data_system.decision_se)
$scene = Scene_Status.new(@status_window.index)
end
return
end
end
end
#===================================#
#Very Easy and Editable Menu by Xk8 #
#===================================#
#(edited from Zieg's ringmenu)
#all the important things are commented, meaning, if you want to edit, edit the
#commented lines, as they are the ones that matter..sorta..
# -Xk8
class Window_NewMenuStatus < Window_Selectable

def initialize
super(204, 64, 160, 240) #x, y, width, height of the char select window
self.contents = Bitmap.new(width - 32, height - 32)
refresh
self.active = false
self.index = -1
end

def refresh
self.contents.clear
self.contents.font.name = $fontface #fontname for the names displaying
#'$fontface' is defined in 'Main', for a different font, 'fontname' e.g. 'Arial'
@item_max = $game_party.actors.size
for i in 0...$game_party.actors.size
x = 80 #x pos. of the hero's info
y = 50 * i #y pos. for each hero's info
actor = $game_party.actors
draw_actor_face(actor, x - 72, y 37) #where the character graphic is drawn
draw_actor_name(actor, x - 20, y 1) #where the hero's name is drawn
end
end

def update_cursor_rect
if @index < 0
self.cursor_rect.empty
else
self.cursor_rect.set(0, @index * 50, self.width - 34, 38)
end
end

def draw_actor_face(actor, x, y) #definition of the character graphic
bitmap = RPG::Cache.character(actor.character_name, actor.character_hue)
cw = bitmap.rect.width / 4
ch = bitmap.rect.height / 4
src_rect = Rect.new(0, 0, cw, ch)
self.contents.blt(x - cw / 23, y - ch, bitmap, src_rect)
end
end[/php]

Neo-Bahamut

Himmelsgleicher

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

  • Nachricht senden

2

Freitag, 2. Januar 2009, 15:56

Es müsste eigentlich reichen (bin mir aber nicht 100% sicher^^) diese zwei Stellen zu ändern:
Spoiler: Zeilen 12-20

Ruby Quellcode

1
2
3
4
5
6
s1 = "Item"     #s1 - s8 are the names of the commands in the menu
s2 = "Speichern"
s3 = "Gold"
s4 = "Spielzeit"
s5 = "Beenden"
@command_window = Window_Command.new(160, [s1, s2, s3, s4, s5]) #this
zum Lesen den Text mit der Maus markieren


Spoiler: Zeilen 113-156

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
case @command_window.index
   when 0 #item (first command always starts with 0) 
   $game_system.se_play($data_system.decision_se)
   $scene = Scene_Item.new
   when 1  #Save
   if $game_system.save_disabled #checks if saving is enabled or not
   $game_system.se_play($data_system.buzzer_se) #saving disabled
   return
   end
   $game_system.se_play($data_system.decision_se) #saving enabled
   $scene = Scene_Save.new #save game screen
   when 2 #Gold
   $game_system.se_play($data_system.decision_se)
   @command_window.active = false #...
   @gold_window.visible = true #makes gold window visible
   when 3 #Playtime
   $game_system.se_play($data_system.decision_se)
   @command_window.active = false #...
   @playtime_window.visible = true #...
   when 4  #Quit
   $game_system.se_play($data_system.decision_se)
   $scene = Scene_End.new #quits the game
end
zum Lesen den Text mit der Maus markieren
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

3

Freitag, 2. Januar 2009, 17:57

Mh genau so hat ich es auch versucht und im Spiel wird auch nur das angezeigt, jedoch wenn ich nun 2mal auf z.B. Gold mit Enter bestätige lande ich plötzlich dennoch im Ausrüstungsmenü....Moment ich mach mal ne' Liste...

...also wie gesagt bei einmal drauf klicken klappt es, bei zweimal drauf klicken kommt folgendes :

Item -> item :thumbsup:

Speichern - > Speichern :thumbsup:

Gold - > Ausrüstung :cursing:

Spielzeit - > Status :cursing:

Beenden - > Beenden :thumbsup:

Neo-Bahamut

Himmelsgleicher

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

  • Nachricht senden

4

Freitag, 2. Januar 2009, 17:59

Zeile 87 bis 90 löschen könnte klappen...
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

5

Freitag, 2. Januar 2009, 18:10

Also bei mir ist das hier Zeile 87 - 90 und es klappt nicht....
end
if @gold_window.active #...
update_status #...
return
:(

Neo-Bahamut

Himmelsgleicher

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

  • Nachricht senden

6

Freitag, 2. Januar 2009, 18:14

Ich meinte jetzt von dem unveränderten Skript, also

Ruby Quellcode

1
2
3
4
if @status_window.active #...
update_status #...
return
end
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

FlipelyFlip

unregistriert

7

Freitag, 2. Januar 2009, 18:34

heyho,

hier

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
#===================================#
#Very Easy and Editable Menu by Xk8 #
#===================================#
class Scene_Menu
#'#...'comments mean: 'see above'  
def initialize(menu_index = 0)
@menu_index = menu_index
end
 
def main
@sprite = Spriteset_Map.new #shows the map behind the menu
s1 = "Item" 	#s1 - s8 are the names of the commands in the menu
s2 = "Speichern"
s3 = "Gold"
s4 = "Spielzeit"
s5 = "Beenden"
@command_window = Window_Command.new(160, [s1, s2, s3, s4, s5]) #this
#line draws the commands in the command window (s1 = 0)
@command_window.index = @menu_index
@command_window.back_opacity = 160 #this line makes the menu 'see-through'
if $game_party.actors.size == 0
@command_window.disable_item(0)
@command_window.disable_item(1)
@command_window.disable_item(2)
@command_window.disable_item(3)
end
if $game_system.save_disabled #this line controls the save-game ability
@command_window.disable_item(4)
end
#the functions of each command are further below the script
 
#playtime window is drawn
@playtime_window = Window_PlayTime.new
@playtime_window.x = 160 #x pos of the playtime window
@playtime_window.y = 208 #y pos of the playtime window
@playtime_window.back_opacity = 160 #makes the window see-through
@playtime_window.visible = false #the window is invisible until called
 
#goldwindow is drawn
@gold_window = Window_Gold.new
@gold_window.x = 160 #x pos of the gold window
@gold_window.y = 176 #y pos of the gold window
@gold_window.back_opacity = 160 #makes the window see-through
@gold_window.visible = false #makes the window invisible until called
 
#drawing the status window (Window_NewMenuStatus); the window where you select
#a character to view it's stats or skills or whatever
@status_window = Window_NewMenuStatus.new #defines what window to draw
@status_window.x = 160 #x pos of the status window
@status_window.y = 0 #default y pos of the status window
@status_window.back_opacity = 160 #makes the window see-through
@status_window.visible = false #makes the window invisible until called
 
Graphics.transition
loop do
Graphics.update
Input.update
update
if $scene != self
break
end
end
Graphics.freeze
#these lines delete the windows after pressing 'B' to exit the menu
@command_window.dispose
@playtime_window.dispose
@gold_window.dispose
@status_window.dispose
@sprite.dispose
end
 
def update
#these lines update the various active windows in the menu  
@command_window.update
@playtime_window.update
@gold_window.update
@status_window.update
 
if @command_window.active #this line see if the command window is active
update_command #looks up which definition of functions is used for this window
return
end
 
if @status_window.active #...
update_status #...
return
end
if @gold_window.active #...
update_status #...
return
end
if @playtime_window.active #...
update_status #...
return 
end
end
 
def update_command #the definitions of the menu commands
if Input.trigger?(Input::B) #press B in menu to exit the menu
$game_system.se_play($data_system.cancel_se) #plays a sound effect
$scene = Scene_Map.new #exit the menu and go back to the game
return
end
if Input.trigger?(Input::C) #press confirm
if $game_party.actors.size == 0 and @command_window.index < 4
$game_system.se_play($data_system.buzzer_se)
return
end
 
case @command_window.index
   when 0 #item (first command always starts with 0) 
   $game_system.se_play($data_system.decision_se)
   $scene = Scene_Item.new
   when 1  #Save
   if $game_system.save_disabled #checks if saving is enabled or not
   $game_system.se_play($data_system.buzzer_se) #saving disabled
   return
   end
   $game_system.se_play($data_system.decision_se) #saving enabled
   $scene = Scene_Save.new #save game screen
   when 2 #Gold
   $game_system.se_play($data_system.decision_se)
   @command_window.active = false #...
   @gold_window.visible = true #makes gold window visible
   when 3 #Playtime
   $game_system.se_play($data_system.decision_se)
   @command_window.active = false #...
   @playtime_window.visible = true #...
   when 4  #Quit
   $game_system.se_play($data_system.decision_se)
   $scene = Scene_End.new #quits the game
end
return
end
end
 
def update_status
if Input.trigger?(Input::B) #when pressing 'B', control of the command window
#is regained and the other window's 'dissappear' until called again
$game_system.se_play($data_system.cancel_se)
@command_window.active = true
@gold_window.visible = false
@playtime_window.visible = false
@status_window.active = false
@status_window.visible = false
@status_window.index = -1
return
end
end
end
#===================================#
#Very Easy and Editable Menu by Xk8 #
#===================================#
#(edited from Zieg's ringmenu)
#all the important things are commented, meaning, if you want to edit, edit the
#commented lines, as they are the ones that matter..sorta..
# -Xk8
class Window_NewMenuStatus < Window_Selectable 
 
def initialize
super(204, 64, 160, 240) #x, y, width, height of the char select window
self.contents = Bitmap.new(width - 32, height - 32)
refresh
self.active = false
self.index = -1
end
 
def refresh
self.contents.clear
self.contents.font.name = $fontface #fontname for the names displaying 
#'$fontface' is defined in 'Main', for a different font, 'fontname' e.g. 'Arial'
@item_max = $game_party.actors.size
for i in 0...$game_party.actors.size
x = 80 #x pos. of the hero's info
y = 50 * i #y pos. for each hero's info
actor = $game_party.actors[i]
draw_actor_graphic(actor, x - 72, y + 37) #where the character graphic is drawn
draw_actor_name(actor, x - 20, y + 1) #where the hero's name is drawn
end
end
 
def update_cursor_rect
if @index < 0
self.cursor_rect.empty
else
self.cursor_rect.set(0, @index * 50, self.width - 34, 38)
end
end
 
def draw_actor_face(actor, x, y) #definition of the character graphic
bitmap = RPG::Cache.character(actor.character_name, actor.character_hue)
cw = bitmap.rect.width / 4
ch = bitmap.rect.height / 4
src_rect = Rect.new(0, 0, cw, ch)
self.contents.blt(x - cw / 23, y - ch, bitmap, src_rect)
end
end
zum Lesen den Text mit der Maus markieren

8

Freitag, 2. Januar 2009, 18:45

Dickes Ding !
So hauts hin :dance:

Digges Danke an euch bis zum nächsten Problem bye !

Ähnliche Themen

Social Bookmarks