Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

Changing shop price in-game

Is it possible for me to:

- Change the item cost in-game using script. I mean lets say that I set an item "Potion" at 100 gold at the database, can I use a script to change the cost to 70 gold when at the shop processing scene.

- Temporary remove the "Sell" command at shops. Like making certain shops where the shopkeeper will not buy anything from the player

Care to help me? 8-)
 
for the first thing, you can use a line of code in the "call script" event command:

$data_items[ID of the potion item].price = (whatever you want to set the price to)

so if the potion item was item #1 it'd be:
$data_items[1].price = 70

i dunno about the second thing, but im sure it's possible.

hope this helps
 
Yup, its working. I was using that statement too before this (except that it is without the item ID), thanks lol.

How about the "Sell" command disable? I was thinking of copying another Scene_shop script without the Sell command and use the script to call the scene, will that work somehow?
 

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top