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,262
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 found a book about game localization. It costs R$708,00 on Amazon. ;_;
I really wish my game was far enough along for it to be actually playable beyond certain aspects. I think I've crafted a really fun battle system thanks to ATB, fighting game, and Boost point mechanics.
Play test of my current progress on Happy Camper
Cutscene Contest Winners have been announced!

I'm heading back to Orlando tomorrow! My dad and I have forgiven each other, so we're planning to spend Spring Break together. We'll probably go to SeaWorld and Aquatica one day, and maybe even use my air fryer to make something to go with Dad's grilled steak. The train leaves tomorrow, and I'll be working on my game on board!

Forum statistics

Threads
109,111
Messages
1,042,180
Members
141,608
Latest member
Sinthea
Top