[RMVX ACE] FORCE SPEND SHOP

Posts

Pages: 1
I'm not sure how hard this will be to implement, just a heads-up there.

So, what I'm requesting is a script snippet that will force the player to spend all their money before being allowed to leave the shop scene.

So, only when they have 0 currency can they leave that scene.

I know I could do this by eventing, but it would be pretty awkward since I'll be using this store a lot in the game.

I don't mind if this replaces the default shop scene - in fact, I'd prefer it.

So, if anyone can help with this, I'd really appreciate it! Thanks for your time if you read this!
LouisCyphre
can't make a bad game if you don't finish any games
4523
This is about as basic as it gets. Set the string to whatever you need it to be.
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("You must spend all of your gold before you can leave.")
      Sound.play_buzzer
      @command_window.activate
      return
    end
    super
  end
end
Ah, thank you! This should make things a lot easier. I thought it might be a simple thing to do but you can never tell without actually knowing what you'd have to change/refer to.

Thanks again! ^.^)b
Ah, seems to be an issue. >.<;
Crashes on start-up with this error message.
"Script 'ForceSell Shop' line 12: SyntaxError occurred.
unexpected $end, expecting keyword_end
end"


I tried adding another 'end' at the bottom but that didn't work. >.<
LouisCyphre
can't make a bad game if you don't finish any games
4523
I edited my post before I saw your response. The version in my post should work without issue.
Now there's a new error instead:
"Script 'ForceSell Shop' line 1: TypeError occurred
superclass mismatch for class Scene_Shop"

>.<;

Ah, nevermind - it was supposed to be Scene_MenuBase instead of Scene_Base. ^.^;

Thanks again~


Orz
Now it hangs on the denial message. ;.;
LouisCyphre
can't make a bad game if you don't finish any games
4523
...Because I'm a dunce. Scene_Shop serves Scene_MenuBase, not Scene_Base. Corrected.
Thank you, but now it freezes on the denial. If I try to leave without paying it just freezes after showing the message. >.<;

Sorry for being troublesome! :<
LouisCyphre
can't make a bad game if you don't finish any games
4523
One last amendment, then! I didn't pass priority back to the command window like I should have. You're keeping me on my toes today.

My games don't have shops. I don't... do shops.
Ah, perfect! That works a treat~

Thank you for helping me out and 'doing the shop thing'. (And especially for the extra support in making this work.) I really do appreciate it. If you find yourself needing any RTP edits or mapping help, feel free to PM me. I'll gladly help out!

^.^)b
Thank you!
Max McGee
with sorrow down past the fence
9159
author=LouisCyphre
This is about as basic as it gets.


author=LouisCyphre
*three separate crashbugs to fix*


: P

@Liberty: Can I ask why you would ever, ever want this feature in your game? I'm actually really intrigued by the concept of a shop that won't let you leave until it's sucked you dry of every last piece of gold.
The game is basically a dungeon crawler and it's just you and a merchant. At the start you strike a deal with him - he'll keep you supplied but he gets all the money you find through your travels.

It was just an idea I had to get around chests that just happen to have loot. I wanted to try something a little different - sort of like a 'choose your own loot' thing. So you buy the loot you want from the merchant. Items you sell - old armour/weapons and enemy drops - will unlock more items, armour and weapons from him, too.

I still need to find a good shop limitation script (so that the amount of his goods depends on you supplying him with certain items that enemies drop) but I know there's at least one that already exists.

I'm just experimenting with this idea and so far I think it works well. It's not going to be a long game.
LouisCyphre
can't make a bad game if you don't finish any games
4523
author=Max McGee
author=LouisCyphre
This is about as basic as it gets.
author=LouisCyphre
*three separate crashbugs to fix*


I don't do shops.
For not doing shops, you did a shop! And a great job you did on said shop, too~ ^.^
Gee @Liberty that sounds weeeeeeally fun! ・*u*)・
Pages: 1