Call a new instance of Scene Shop

I have tried to do:

Code:
var sceneShop = new Scene_Shop();sceneShop.prepare($datsItems);SceneManager.push(sceneShop); // Type Error object is not a function.// Same happens for:SceneManager.goto(sceneShop);// How do I open a new insatnce, via javascript, of a shop?
Look at how shop processing is done in the interpreter

Code:
// Shop ProcessingGame_Interpreter.prototype.command302 = function() {    if (!$gameParty.inBattle()) {        var goods = [this._params];        while (this.nextEventCode() === 605) {            this._index++;            goods.push(this.currentCommand().parameters);        }        SceneManager.push(Scene_Shop);        SceneManager.prepareNextScene(goods, this._params[4]);    }    return true;};
This is where I got my idea from.  That didnt help.

I got it, it doesnt populate but it opens

Code:
SceneManager.push(Scene_Shop);SceneManager.prepareNextScene([$dataItems]);
for this you have to prepare your scene if you overwrite a method you still need to adjust this for fit the need what you done here don't fit at all the need.

Game_Interpreter.prototype.new_command = function(content,sell_only) { if (!$gameParty.inBattle()) { var goods = []; while (this.nextEventCode() === 605) { this._index++; goods.push(content); } SceneManager.push(Scene_Shop); SceneManager.prepareNextScene(goods, sell_only) } return true}};didn't have the chance to test this but it's permit to input what you need.

after you can always do a temporary var who will get erase after the script call

var temporary_data = 1 new_command(temporary_data,false);it's actually the basis of rm to know how work the transfert of data from a scene to  a another via prepare
This is where I got my idea from.  That didnt help.

I got it, it doesnt populate but it opens

SceneManager.push(Scene_Shop);SceneManager.prepareNextScene([$dataItems]);

You don't pass in an array like $dataItems, you pass in array in the following format:

Index 0 => The item type. 0 is item, 1 is weapon, 2 is armor.

Index 1 => The item ID  for that type.

Index 2 => 0 to use the database's price for the item, any other number otherwise.

Index 3 => The price to use if index 2 is not 0.

This means that you have to pass in an array of arrays. Each item is it's own array, and it's all enclosed in an array to keep them together. If you need to see how the code acts itself, please refer to Window_ShopBuy's makeItemList function.
Coolio got it working, did non of this 😛

Original thread: https://forums.rpgmakerweb.com/threads/call-a-new-instance-of-scene-shop.48603/