Hudomi

Warper
Member
Joined
Jan 23, 2021
Messages
1
Reaction score
0
First Language
German
Primarily Uses
RMMV
Hey guys,

I'm trying to integrate the shop into the menu. I took the following thread as an example to code the menu command in rpg_scenes.js and rpg_windows.js:

Now I'm hitting a wall. I attached the rpg_scenes.js and rpg_windows.js for better insight.

I was able to add the command to the menu in rpg_windows.js and assigned the following function in rpg_scenes.js:

SceneManager.push(Scene_Shop);
SceneManager.prepareNextScene([[0, 2, 0, 0],[0, 3, 0, 0],[3, 1, 1, 10]], true);

which opens the shop with the items just fine.

My problem: No matter how far the player is in the game, it will always be the same shop with the same items. I want the available items to be dynamic with the player's progress though. Since I can't code at all, that would become too complicated and confusing for me. I'm glad I somehow managed to get to this point at all.

So I had the idea that the easiest solution would be to make the command call a common event which opens the shop. This is where I'm stuck. I replaced the SceneManager bit with

$gameTemp.reserveCommonEvent(2);

With common event 2 being the shop. However, this freezes the game. Executing it through a normal script call event works like intended.

What do I have to code instead of SceneManager.push to make the command call a common event? I'm thankful for every little piece of help.

Have a nice weekend.
 

Attachments

  • rpg_scenes.js
    79.9 KB · Views: 0
  • rpg_windows.js
    178.5 KB · Views: 0

Shaz

Global Moderators
Global Mod
Joined
Mar 2, 2012
Messages
41,252
Reaction score
14,261
First Language
English
Primarily Uses
RMMV

I've moved this thread to Javascript/Plugin Support. Please be sure to post your threads in the correct forum next time. Thank you.



I haven't downloaded & looked at your files, but I really wouldn't modify the core scripts. Make them into a plugin so you don't risk losing them if you update your project.
 

ShadowDragon

Veteran
Veteran
Joined
Oct 8, 2018
Messages
3,383
Reaction score
1,263
First Language
Dutch
Primarily Uses
RMMV
making direct changes is only recommend for high js people that know javascript
and know what they do, because if you break something, it would be harder to
reverse the change to it.

Like shaz said, make a plugin that either alias the function or overwrite the function
what it should do instead.

to make it more dynamic, YEP_MainMenuManager (paid) but there are others, that
can be linked to a common event, so you can control the shops through a variable.

if variable X = 0
shop with 3 items
end
if variable X = 1
shop with 6 items
end

and continue the list like this.
there are other ways like 1 shop, but not showed or not available until
a lvl is met or switch is ON to show (like a progress switch that is used anyway
during the game which can update the list.

however you approach that way is up to you, this is only an idea how to accomplish it.
 

Latest Threads

Latest Posts

Latest Profile Posts

I know it looks more like a apple but...its a cherry, his name is: Cherry Knight
i just started uploading some of my selfmade Pixel Art on DA,
visit me there if you are interrested^^
Im sorry but..I Want to play a game.
Anyone here is familiar with the US Law ? I'm working on a game idea at the moment and I have several questions on my mind :p

Forum statistics

Threads
109,108
Messages
1,042,151
Members
141,603
Latest member
MarkStudios
Top