Le deal à ne pas rater :
Smartphone Xiaomi 14 – 512 Go- 6,36″ 5G Double SIM à 599€
599 €
Voir le deal

Aller en bas
Rafidelis
Rafidelis
Membre

Nombre de messages : 55
Distinction : aucune
Date d'inscription : 01/05/2008

[Scripting - RGSS2] Adding New Options on the RMVX Menu Empty [Scripting - RGSS2] Adding New Options on the RMVX Menu

Jeu 22 Jan 2009 - 21:15
Adding New Options on the RMVX Menu
by:Rafidelis™️ | http://www.ReinoRpg.com |

___________________________________________________________________________________________

___________________________________________________________________________________________

Well people, I decided to make this tutorial for whose that want to modify the default menu optior or add new options there.

Let's begin:

___________________________________________________________________________________________


First, open your project or create a new one then press F11 to the scripts editor show up. After that create a new script section by pressing the mouse right button over main and choosing the insert option.

On the new script section, copy and paste the code below:

Spoiler:


Explanation of the script above:


Firstly acess the class Scene_Menu,then we are going to "rewrite" the method
create_command_window.
First you should create 7 local variables, which one storing a value.

s1 = Vocab::item

It means that this variable will have the value of the vocabulary used to name the window.
(Which can be modified on the database, on the system tab),if you write the name:

Item bag, The variable s1 will have the value of the string "Mochila de Itens"

The same occurs with the other variables, except the s7 which you you gave it's own name, in that case it's "Options".
On line 10 we create an variable named:

@command_window and it's values are:

Window_Command.new(160, [s1, s2, s3, s4, s5,s7, s6])

Window_Command is the class responsable for creating the script where you can
choose an option, here the options are the values stored on the 7 lacals variables
shown above.( 160 in the window width in pixels!)
On line 11 we determine that the "index",the window indicator(cursor) will start
on the defined variable @menu_index which by default is 0 (Itens).

But from line 12 till 16,determines that if the size of the group "heros" is equal to 0, it'll disable
the following options: Itens,Skills,Equipments and Status(As there won1t be any hero)

na linha 17,ele checa se o save esta desativado no jogo,se estiver desativa a opção de Salvar o Game.
Assim termina esse codigo,nada muito complicado ne?


Your menu will look like that:

Menu with a new option:
[Scripting - RGSS2] Adding New Options on the RMVX Menu Ss1hl8

OBS: The line 53 to 71 on the default rmvx scene_menu script, you'll see
that it's very similar to what we have just writeen.

___________________________________________________________________________________________


Now paste the script we have written and open the menu,you'll that the option “Options” is there on the menu, now click on it.
What happened?

The game over scene appeared when we clicked on the option “options”, but why?

I'll explain soon,but now turn back to the menu and click in the option “Exit”,You will see that nothing happens.

Which option on the menu has it's own “index”,that is, an indicator.

When the index is on 0 it will open the itens scene, on 1 the skill scene, on 2 the equipment one, on 3 the status one and if it is on 5 it will open the game over screen.

Take a look at the “array” that contains the menu options:

@command_window = Window_Command.new(160,[s1,s2, s3, s4, s5,s7, s6])

Lets start counting the "index" of that “array” after the [color:28d6="red"]160
:

s1 = 0
s2 = 1
s3 = 2
s4 = 3
s5 = 4
s7 = 5
s6 = 6

Before doing anything, remove the last "end" of the code we created at the start.
Now we will see the method that creates the action depending on our index value:

Obs.: Don't put the code below our script

___________________________________________________________________________________________

___________________________________________________________________________________________

Spoiler:

___________________________________________________________________________________________

This code can be read like that:

If buttom B is pressed (esc or x) play an SE and return to the map scene.
But if if button C(Enter or space)
○ And inside this condition if the group equals [color:28d6="red"]0 and the cursor is shorter than 4
○ If the command window is shorter than [color:28d6="red"]4 plays an error SE.
○ Still inside the condition press button : But if save is disabled and
○ if the command window cursor is equal, plays an SE and returns.
◘ [color:28d6="blue"]End of the condition

• If press button and none of the conditions above are true, plays an decision SE then continue.

• If the cursos is at:

when 0
○ Go to items window
when 1 2 e 3
○ Go to chose character window
when 4
○ Go to save game
when 5
○ Go to end game window
end
end
end

Well what is the array of the indicator when it is over "options"?

Spoiler:

And on the refresh of the cursor position when C is pressed (space or Enter) on the cursor 5?( Look at the code to see what happens)

Spoiler:

___________________________________________________________________________________________



Past the script below the one you have already pasted.

___________________________________________________________________________________________

___________________________________________________________________________________________


Spoiler:

The script now should look like this:


___________________________________________________________________________________________

Spoiler:

___________________________________________________________________________________________

___________________________________________________________________________________________


Now we are going to edit the part that when the cursor is over 5 it will open the options window.
First we are going to create the script to show the option, paste the code below in a new script section.
Spoiler:

___________________________________________________________________________________________

___________________________________________________________________________________________

Now back to our script, the menu one and on line 44 change to the following code:

Code:
$scene = Scene_Option.new

Now run the game and choose the option "options" one the menu that is possible to access the options window created by us, get back to the menu and click on the exit option and you'll see that it only plays a SE but it's not working.
Why that?

Options screen:

[Scripting - RGSS2] Adding New Options on the RMVX Menu Rafidelisoq3

Because on the script that refreshs the cursor position we didn't indicated what happens if it is on the indicator "6",there is only till 5 ([color=blue]when 5)

For that open it on line 44 of our menu script, press enter go to the empty line that should be line 45 and paste there :

Spoiler:

___________________________________________________________________________________________

___________________________________________________________________________________________

Done! Your new option was added on rmvx menu!
Just post if you have any question! I'll be glad to answer it^^

Criticizing and comments are welcome too xD


Tutorial by ::. Rafidelis .::

Thanks to a brazilian friend ~ JV ~, by translating the tutorial from Portuguese to English.
___________________________________________________________________________________________

___________________________________________________________________________________________

[Scripting - RGSS2] Adding New Options on the RMVX Menu 88x31

RGSS2 Tutorial Adding New Options on the RMVX Menu by Rafidelis is licensed under a
Creative Commons Atribuição-Uso Não-Comercial-Compartilhamento pela mesma Licença 2.5 Brasil License.
Permissions beyond the scope of this license may be available at ReinoRPG.com
Berka
Berka
Staffeux retraité

Nombre de messages : 1832
Age : 34
Localisation : Paris
Distinction : rubyste déglingué
9ème dan en scripting-no-jutsu

Nouveau Justine Beber ;P
Date d'inscription : 16/12/2007
http://rpgruby.olympe-network.com

[Scripting - RGSS2] Adding New Options on the RMVX Menu Empty Re: [Scripting - RGSS2] Adding New Options on the RMVX Menu

Jeu 22 Jan 2009 - 21:55
Thanks !
Very usefull !

this tut gonna help lots of guys !
Rafidelis
Rafidelis
Membre

Nombre de messages : 55
Distinction : aucune
Date d'inscription : 01/05/2008

[Scripting - RGSS2] Adding New Options on the RMVX Menu Empty Re: [Scripting - RGSS2] Adding New Options on the RMVX Menu

Ven 23 Jan 2009 - 0:36
Thankz berka^^
Coco'
Coco'
Staffeux retraité

Nombre de messages : 6578
Age : 31
Localisation : Nord/Douai
Distinction : EL DICTATOR COCO'
Coco-Dieu en puissance

[Scripting - RGSS2] Adding New Options on the RMVX Menu Magikarpe Grand gourou suppléant de la secte des MAGIKARP
Leader charismatique des 2beStaffieux

N°1 du forum
Président, vice-présidents et membres honoraires de la cour suprême du forum
Président de l'association des grosses distinctions CMB
Date d'inscription : 02/07/2008
http://www.rpgmakervx-fr.com

[Scripting - RGSS2] Adding New Options on the RMVX Menu Empty Re: [Scripting - RGSS2] Adding New Options on the RMVX Menu

Ven 23 Jan 2009 - 19:58
Oh! Thanks a lot Rafidelis! :o
This tutoriel is going to serve me a lot in the learning of the RGSS language!

Spoiler:
Rafidelis
Rafidelis
Membre

Nombre de messages : 55
Distinction : aucune
Date d'inscription : 01/05/2008

[Scripting - RGSS2] Adding New Options on the RMVX Menu Empty Re: [Scripting - RGSS2] Adding New Options on the RMVX Menu

Dim 15 Fév 2009 - 16:16
Merci pour les commentaires des amis ^ ^
wilkyo
wilkyo
Membre

Nombre de messages : 316
Age : 33
Localisation : Loiret
Distinction : Sauveur de miches // Chou (l)

[Coco' Smile]

Adepte de Pedobear // Lécheur de lolis

[Mist' Wink]

Personnage Colorée // Instructeur de boulet

[Wax Rolling Eyes]
Date d'inscription : 01/09/2008
http://www.wilkyo.com

[Scripting - RGSS2] Adding New Options on the RMVX Menu Empty Re: [Scripting - RGSS2] Adding New Options on the RMVX Menu

Dim 1 Mar 2009 - 15:27
J'espère que ce n'est pas du nécro-post mais, le menu des options n'est pas terminé...
Il met ça:
Spoiler:
Personne n'a pensé à les faire...

Si ce n'était qu'un tutoriel alors je me tais... mais c'est dommage...
Berka
Berka
Staffeux retraité

Nombre de messages : 1832
Age : 34
Localisation : Paris
Distinction : rubyste déglingué
9ème dan en scripting-no-jutsu

Nouveau Justine Beber ;P
Date d'inscription : 16/12/2007
http://rpgruby.olympe-network.com

[Scripting - RGSS2] Adding New Options on the RMVX Menu Empty Re: [Scripting - RGSS2] Adding New Options on the RMVX Menu

Dim 1 Mar 2009 - 15:33
ce tuto ne fait qu'indiquer comment rajouter les options dans le menu, pas leur contenu !
wilkyo
wilkyo
Membre

Nombre de messages : 316
Age : 33
Localisation : Loiret
Distinction : Sauveur de miches // Chou (l)

[Coco' Smile]

Adepte de Pedobear // Lécheur de lolis

[Mist' Wink]

Personnage Colorée // Instructeur de boulet

[Wax Rolling Eyes]
Date d'inscription : 01/09/2008
http://www.wilkyo.com

[Scripting - RGSS2] Adding New Options on the RMVX Menu Empty Re: [Scripting - RGSS2] Adding New Options on the RMVX Menu

Dim 1 Mar 2009 - 15:43
Ok...
Merci bien...
Ça reste un super tutoriel !
Contenu sponsorisé

[Scripting - RGSS2] Adding New Options on the RMVX Menu Empty Re: [Scripting - RGSS2] Adding New Options on the RMVX Menu

Revenir en haut
Permission de ce forum:
Vous ne pouvez pas répondre aux sujets dans ce forum