Jump to content

Help on Galv's Shop Upgrade Script Calls

Recommended Posts

Hey fellas, this is my first-ever post on this forum, so please bear with me.

It's a long one, so tl;dr

[1] I implemented a script that has function calls.

[2] I tried using those function calls in an event, and I don't think it's working.

[3] I need some help understanding how to call functions from a script I imported.



I'm using Galv's Shop Upgrade v.2.8 (link) to stock certain items in my shop. I have this script under  "▼ Materials" in my script library.

In the settings around line 83-141, he gives instructions on how to use his script calls. I included the lines pertinent to the shop stock

# shop(shop_id)    # Use this script call to set the next shop processing event
#                  # to be a certain shop number. If you do not use this script
#                  # call before a shop event, the shop will not use stock.
# add_stock(shop_id,type,item_id,amount)     # Add a number of items to the shop
#                                            # number you specify.
# rem_stock(shop_id,type,item_id,amount)     # Remove a number of items from the
#                                            # shop number you specify.
# bulk_fill(shop_id,type,amount,[id,id,id])  # Add items to a shop in bulk.

#  add_stock(2,0,1,20)     # Will add 20 of item 1 to shop number 2
#  add_stock(6,1,10,2)     # Will add 2 of weapon 10 to shop number 6
#  rem_stock(6,1,10,2)     # Will remove 2 of weapon 10 from shop number 6
#  bulk_fill(1,0,20,[1,2,3,4,5,6])  # Will add 20 of each item inside square 
#                                   # brackets to shop number 1
#  bulk_fill(3,2,1,[12,22,13])      # Will add 1 of each armor inside square 
#                                   # brackets to shop number 3
#  shop(3)                 # The next shop processing will use shop number 3


I used the bulk_fill() call in a script box inside an event that's supposed to run every time the player enters the shop. For debugging purposes, I've added dialogue messages before and after the script call:



And this is what it looks like for the shop event:



When I play-test the shop, I know that Event ID:010 works because the "shop stocker starts" message pops up:



But afterwards, the message saying "shop stocker finished" does not show up. This leads me to believe that something wrong happened in the middle, with the bulk_fill() call.


Essentially, it boils down to this: am I making syntax errors in my script calls?

Share this post

Link to post
Share on other sites
5 hours ago, GRAgauge said:

something wrong happened

It's hard to say, I just tested this script and it works fine. You're script commands look fine. Maybe put the turn self_switch on at the bottom.



But it could be something to do with the event processing. As you have it on a parallel process.

Share this post

Link to post
Share on other sites

Move the self switch call to the bottom of the list. That should solve that issue. When set to Autorun or Parallel Process, events after switch calls, if said switch goes to the next event page, usually are ignored unless there's some loop in place. There are some exceptions in that some event commands will force the interpreter to run them before switching to the next event page, but showing dialogue is not one of them (it did run your script calls though).

All in all, setting that to switch on after all commands are finished is the best idea. 👍

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.

Top ArrowTop Arrow Highlighted