HOW TO MAKE A FENCE WHO WILL ONLY BUY STOLEN ITEMS? RMVX ACE
Posts
Could someone show me how to make a fence who'll only buy stolen items? I expect this will have something to do with a variable connected with the numbers for each item, but I don't know how I'd go about doing this.
Here's a shot of item tab on the database so you can get the idea of how it's laid out. All stolen items are marked with an S and grouped together like this. Weapons and armour tabs are also set out the same.
Here's a shot of item tab on the database so you can get the idea of how it's laid out. All stolen items are marked with an S and grouped together like this. Weapons and armour tabs are also set out the same.
My first thought would be to make stealable items distinct in the database from items that can only be acquired legitimately. Label them the same, but have them as two different items. The only problem here would be that they would get their own slots in the inventory, but if they were indistinct, how would differentiate what was stolen from what was legitimately acquired?
Given the screenshot, it looks like stolen items already are separated from the legit items in the database. I'm going off this assumption with the rest of my post.
I can't look this up in much detail right now, but, I think what might be best for this fence is to basically have it's own sell menu. Which may involve making a custom shop process.
The basic idea in my head is that the sell process would look at the ID's of the items the player has, and skip over anything within a certain range of IDs. As in, if an item as one of those IDs, it wouldn't even display. Those would represent the legit items. If it's one of the stolen item ID's, display it as normal.
I can't look this up in much detail right now, but, I think what might be best for this fence is to basically have it's own sell menu. Which may involve making a custom shop process.
The basic idea in my head is that the sell process would look at the ID's of the items the player has, and skip over anything within a certain range of IDs. As in, if an item as one of those IDs, it wouldn't even display. Those would represent the legit items. If it's one of the stolen item ID's, display it as normal.
That or make a custom menu that shows a list of all the items you could sell, with amounts of them you have currently. So:
Weighted Dice x2
Broken Arm x0
Silver Platter x1
Then have an 'sell all?' option or pick which ones you want to sell, and which amounts.
It really depends how detailed you want it to be. You could just have a guy you talk to who buys everything you have in your pack that is stolen in one go.
"Hey got any goods?"
SELL
"Thanks"
- every item that you stole that was in your pack
That's pretty simple to whip up - just check how many of each item there are, multiply each by the price, then remove all the items that were sold.
Weighted Dice x2
Broken Arm x0
Silver Platter x1
Then have an 'sell all?' option or pick which ones you want to sell, and which amounts.
It really depends how detailed you want it to be. You could just have a guy you talk to who buys everything you have in your pack that is stolen in one go.
"Hey got any goods?"
SELL
"Thanks"
- every item that you stole that was in your pack
That's pretty simple to whip up - just check how many of each item there are, multiply each by the price, then remove all the items that were sold.
Hi Marrend
Could you let me know where I can find a custom shop guide which will work like that.
I've never been one to make custom menus and shops.
Could you let me know where I can find a custom shop guide which will work like that.
I've never been one to make custom menus and shops.
I think this would be hard to set up.
What I might try is to have a store that sell unique items based on your reputation.
If you steal you can gain a reputation making it easier to buy certain things.
This requires less scripting and more variable action paction.
MoonWolfV: Does the (S) on the end of item names mean stolen, or are you differentiating them some other way?
author=Trihan
MoonWolfV: Does the (S) on the end of item names mean stolen, or are you differentiating them some other way?
author=MoonWolfV
All stolen items are marked with an S.
Haha, missed that bit.
All you'll have to do is use $game_system.enable_fence before your shop command, and $game_system.disable_fence after it.
Game_System.class_eval do def enable_fence @only_stolen = true end def disable_fence @only_stolen = false end def fence_enabled? @only_stolen end end RPG::UsableItem.class_eval do def stolen? self.name[-3,3] == "(S)" end end Window_ShopSell.class_eval do alias tri_mwv_enable? enable? def enable?(item) $game_system.fence_enabled? ? tri_mwv_enable?(item) && item.stolen? : tri_mwv_enable?(item) end end
All you'll have to do is use $game_system.enable_fence before your shop command, and $game_system.disable_fence after it.
Above main in the bit that says "Materials".
Thanks Trihan. Is it possible to modify this so it also allows weapons and armour to be sold, and to make it that there is only the option to sell. Sorry about not asking about this earlier.
I'm assuming that to enable weapons and armour I'd just need to add under
def enable?(item)
def enable?(weapon) and def enable?(armor)?
and add for this one
$game_system.fence_enabled? ? tri_mwv_enable?(item) && item.stolen? : tri_mwv_enable?(item)
Replacing item with armor and then another line of it replacing with weapon,
or is it more complicated than simply doing this?
I'm assuming that to enable weapons and armour I'd just need to add under
def enable?(item)
def enable?(weapon) and def enable?(armor)?
and add for this one
$game_system.fence_enabled? ? tri_mwv_enable?(item) && item.stolen? : tri_mwv_enable?(item)
Replacing item with armor and then another line of it replacing with weapon,
or is it more complicated than simply doing this?
Hi there
I've tried adjusting the script to make it include weapons and armour as well (as there are plenty of tunics, togas, etc, in houses), but obviously something is wrong.
When I try to run the game it says
Script '$game_system.enable.fence_trial' line39: SyntaxError occured.
unexpected $end, expecting keyword_end
(Note: I changed this to have _trial on the end so I wasn't interfering with original script which worked fine).
I'd also like to make it that only "Sell" is available, not "Buy".
Could somebody take a look at this and tell me what needs to be fixed?
Cheers
I've tried adjusting the script to make it include weapons and armour as well (as there are plenty of tunics, togas, etc, in houses), but obviously something is wrong.
When I try to run the game it says
Script '$game_system.enable.fence_trial' line39: SyntaxError occured.
unexpected $end, expecting keyword_end
(Note: I changed this to have _trial on the end so I wasn't interfering with original script which worked fine).
I'd also like to make it that only "Sell" is available, not "Buy".
Could somebody take a look at this and tell me what needs to be fixed?
Cheers
For each of the RPG:: class evals, you need a corresponding "end". Right now, the interpreter thinks they're all part of one big class.
I can see what you were going for here, but essentially all you've done is declared the "enable?" method of Window_ShopSell three times, each time overwriting the one that came before it. Ruby doesn't give half a rat's hat what you call the variable for the parameter, it's still just an object. I'll have a look at this when I get a sec and tell you how to fix it.
I can see what you were going for here, but essentially all you've done is declared the "enable?" method of Window_ShopSell three times, each time overwriting the one that came before it. Ruby doesn't give half a rat's hat what you call the variable for the parameter, it's still just an object. I'll have a look at this when I get a sec and tell you how to fix it.
All you have to do is change RPG::UsableItem to RPG::BaseItem, then it'll give the stolen? method to weapons and armours as well and you can use the same suffix to denote them as stolen.
Alternatively, if you'd rather not have the "extra baggage" of this method also meaning that you could technically have stolen actors, classes, enemies and states, add this:
Alternatively, if you'd rather not have the "extra baggage" of this method also meaning that you could technically have stolen actors, classes, enemies and states, add this:
RPG::EquipItem.class_eval do def stolen? self.name[-3,3] == "(S)" end end
Hi Trihan
I've realised I'm going to have to have a similar script to make it that regular merchants won't accept stolen items.
I'm assuming it will be adjusting the script when it comes to this part.
RPG::BaseItem.class_eval do
def stolen?
self.name == "(S)"
end
end
Somehow instructing it to exclude all items with (S) in them.
Could you show me what I need to put in to make this work?
Thanks again.
I've realised I'm going to have to have a similar script to make it that regular merchants won't accept stolen items.
I'm assuming it will be adjusting the script when it comes to this part.
RPG::BaseItem.class_eval do
def stolen?
self.name == "(S)"
end
end
Somehow instructing it to exclude all items with (S) in them.
Could you show me what I need to put in to make this work?
Thanks again.
You can do this by modifying the enable? method:
Window_ShopSell.class_eval do alias tri_mwv_enable? enable? def enable?(item) $game_system.fence_enabled? ? tri_mwv_enable?(item) && item.stolen? : !item.stolen? && tri_mwv_enable?(item) end end
If I put this in as a separate script, do I have to give it a different name than
$game_system
Because now I get an error message saying "SystemStackError occurred" "stack level too deep"
I've copied and pasted the script and have made the alteration you mentioned. I've also put in the different script name where I think it was needed. Here's an image of what I've done.
For some reason, this was affecting every shop process in the game. I've taken out the new script and it's all working normally. I'm going to be using a different method to get the same result.
Cheers
$game_system
Because now I get an error message saying "SystemStackError occurred" "stack level too deep"
I've copied and pasted the script and have made the alteration you mentioned. I've also put in the different script name where I think it was needed. Here's an image of what I've done.
For some reason, this was affecting every shop process in the game. I've taken out the new script and it's all working normally. I'm going to be using a different method to get the same result.
Cheers
And yeah, using a thing that modifies all shops probably isn't to be desired... um, I think I've seen some MV Plugins at least that let you do like "sell shops" where you can sell only certain things, lemme look and see if I can find a VX Ace script of the same thing.
Edit: http://himeworks.com/2013/02/sell-only-shop/ seems to be a perfect option, basically you can create a shop that you can ONLY sell items at, and decide which ones, so you could basically say "I want to only sell items" and then select all your stolen goods! :D