Hey guys~
Right, so I need a bit of help and I figure it'll probably be pretty basic stuff all told.
Basically I'm trying to make it so that if a certain switch is on, one script will be referenced but if the switch is off, another is instead. In this case I've two shop scenes. One allows only selling items, the other won't let you leave the shop unless you spend all of your money. As you can probably tell, the two don't like each other - using both at the same time ends up in having a sell shop that won't let you leave because you have money... XD
The first script is Tsukihime's Sell-only Shop. The second script is very basic - just makes it so that I can't leave the shop scene without spending all your money. Yeah. The original form of it is below.
Here's a demo including the scripts and a simple call event. Change switch 23 via F9 to see what occurs (there's two shop calls in the event. One after turning off the switch so that it should always be the locked shop). What happens with this is that whichever shop gets triggered first stays as the default shop. So if the switch isn't turned on it gets locked to the Locked shop, even if you later do call the sell shop script in the event/turn on switch 23. If the switch is turned on then the sell shop is triggered and even if you later turn it off or don't call that script it still affects the shop scene.
Basically, this is what I currently have:
class Scene_Shop < Scene_MenuBase #-------------------------------------------------------------------------- # * RETURN TO PREVIOUS SCENE # Aborts the method if the player has gold. Otherwise, calls the normal # "return_scene" method found in Scene_Base #-------------------------------------------------------------------------- def return_scene if $game_switches[23] == true @shop_type = "SellOnlyShop" else if $game_party.gold > 0 @help_window.set_text("MILES: Now, now. We have a deal, remember? Don't be stingy.") Sound.play_buzzer @command_window.activate return end super end end endYeah, there's definitely something hinky there, I know. >.<;
The original script, without my edits, is like so:
class Scene_Shop < Scene_MenuBase #-------------------------------------------------------------------------- # * RETURN TO PREVIOUS SCENE # Aborts the method if the player has gold. Otherwise, calls the normal # "return_scene" method found in Scene_Base #-------------------------------------------------------------------------- def return_scene if $game_party.gold > 0 @help_window.set_text("MILES: Now, now. We have a deal, remember? Don't be stingy.") Sound.play_buzzer @command_window.activate return end super end endTo call the sell shop: @shop_type = "SellOnlyShop"
Now what happens is either only the sell shop activates or only the normal shop scene does. No matter what the switch is set to. In the case that the Sell Shop is the one that activates, it then won't allow me to leave the shop scene and freezes. >.<;
I tried checking online for how to use if cases and switch checks but I couldn't find anything bar one topic in this forum - which led to my adding the == (instead of just one) and changing how I was referencing the switches to the proper way. Usually I can brute force my way through scripts by just changing bits here and there but that doesn't seem to be working for me at the moment. >.<
If anyone could help I'd really appreciate it!
Right, so I need a bit of help and I figure it'll probably be pretty basic stuff all told.
Basically I'm trying to make it so that if a certain switch is on, one script will be referenced but if the switch is off, another is instead. In this case I've two shop scenes. One allows only selling items, the other won't let you leave the shop unless you spend all of your money. As you can probably tell, the two don't like each other - using both at the same time ends up in having a sell shop that won't let you leave because you have money... XD
The first script is Tsukihime's Sell-only Shop. The second script is very basic - just makes it so that I can't leave the shop scene without spending all your money. Yeah. The original form of it is below.
Here's a demo including the scripts and a simple call event. Change switch 23 via F9 to see what occurs (there's two shop calls in the event. One after turning off the switch so that it should always be the locked shop). What happens with this is that whichever shop gets triggered first stays as the default shop. So if the switch isn't turned on it gets locked to the Locked shop, even if you later do call the sell shop script in the event/turn on switch 23. If the switch is turned on then the sell shop is triggered and even if you later turn it off or don't call that script it still affects the shop scene.
Basically, this is what I currently have:
class Scene_Shop < Scene_MenuBase #-------------------------------------------------------------------------- # * RETURN TO PREVIOUS SCENE # Aborts the method if the player has gold. Otherwise, calls the normal # "return_scene" method found in Scene_Base #-------------------------------------------------------------------------- def return_scene if $game_switches[23] == true @shop_type = "SellOnlyShop" else if $game_party.gold > 0 @help_window.set_text("MILES: Now, now. We have a deal, remember? Don't be stingy.") Sound.play_buzzer @command_window.activate return end super end end endYeah, there's definitely something hinky there, I know. >.<;
The original script, without my edits, is like so:
class Scene_Shop < Scene_MenuBase #-------------------------------------------------------------------------- # * RETURN TO PREVIOUS SCENE # Aborts the method if the player has gold. Otherwise, calls the normal # "return_scene" method found in Scene_Base #-------------------------------------------------------------------------- def return_scene if $game_party.gold > 0 @help_window.set_text("MILES: Now, now. We have a deal, remember? Don't be stingy.") Sound.play_buzzer @command_window.activate return end super end endTo call the sell shop: @shop_type = "SellOnlyShop"
Now what happens is either only the sell shop activates or only the normal shop scene does. No matter what the switch is set to. In the case that the Sell Shop is the one that activates, it then won't allow me to leave the shop scene and freezes. >.<;
I tried checking online for how to use if cases and switch checks but I couldn't find anything bar one topic in this forum - which led to my adding the == (instead of just one) and changing how I was referencing the switches to the proper way. Usually I can brute force my way through scripts by just changing bits here and there but that doesn't seem to be working for me at the moment. >.<
If anyone could help I'd really appreciate it!
Last edited by a moderator:

