• Do not use Discord to host any images you post, these links expire quickly! You can learn how to add images to your posts here.
  • Eevee Expo's webhost has been having technical issues since Nov. 20th and you might be unable to connect to our site. Staff are also facing issues connecting, so please send a DM to Cat on-site or through Discord directly for faster service!
[v20.1\v21.1] Arcky's Poké Market

Resource [v20.1\v21.1] Arcky's Poké Market v1.4.0

Arcky

Arcky's Region Map Developer
Member
Joined
Aug 18, 2022
Posts
232

Rot8er_ConeX

Trainer
Member
Joined
May 17, 2023
Posts
52
If I am reading the code on line 618 correctly, you make a list of items and separate all of them by commas except the last two, when the last two items should still have a comma between them (before the word "and").
Within my own game, I've already written a function that formats lists properly (and it even lets me use "or" if need be) which I imported from an earlier non-Pokémon project of mine. But for your own plugin, I'd suggest this:
if tallyItems.length > 2
string = tallyItems[0..-2].join(', ')
string += ", and #{tallyItems[-1]}"
else
string = tallyItems.join(" and ")
end
Notice that the top line is now if the list size is greater than 2, not 1, and that there's now a comma on the second line. And then the else statement now uses a join of its own.

Additionally, you're going to want to remove all the dollar signs in the pre-set text in the settings menu. Now that you can handle more currencies than just Pokedollars, it's causing the text to display that symbol twice if developers use a pre-set seller.

In a similar vein, I suggest adding this (or something similar) to before the using() do loop within pbChooseNumber:
f = ""
f2 = ""
case $currency.downcase
when "money", "gold"
f = "$ "
when "coins"
f2 = " Coins"
when "battle points", "bp"
f2 = " BP"
end
And then you want to change the instances of numwindow.text to:
numwindow.text = _INTL("x{1}<r>{2}{3}{4}", curnumber, f, (curnumber * itemprice).to_s_formatted, f2)

Lastly, if discount is numeric during the beginning stages of pbPokemonMart where it is parsing the developer's inputs, currency will always be set to "money" regardless of what the developer uses as the currency input.
You want to write the code as follows:
elsif checkTrueFalseOrNil(useCat) # useCat is given or cantSell is given
if discount.is_a?(Numeric) # discount given (currency and cantSell optional)
if checkTrueFalseOrNil(currency)
cantSell = currency
currency = "money"
end
elsif discount.is_a?(String) # currency given (cantSell optional)
if checkTrueFalseOrNil(currency)
cantSell = currency
currency = discount
discount = nil
end
 
Last edited:

Arcky

Arcky's Region Map Developer
Member
Joined
Aug 18, 2022
Posts
232
If I am reading the code on line 618 correctly, you make a list of items and separate all of them by commas except the last two, when the last two items should still have a comma between them (before the word "and").
Within my own game, I've already written a function that formats lists properly (and it even lets me use "or" if need be) which I imported from an earlier non-Pokémon project of mine. But for your own plugin, I'd suggest this:
if tallyItems.length > 2
string = tallyItems[0..-2].join(', ')
string += ", and #{tallyItems[-1]}"
else
string = tallyItems.join(" and ")
end
Notice that the top line is now if the list size is greater than 2, not 1, and that there's now a comma on the second line. And then the else statement now uses a join of its own.

Additionally, you're going to want to remove all the dollar signs in the pre-set text in the settings menu. Now that you can handle more currencies than just Pokedollars, it's causing the text to display that symbol twice if developers use a pre-set seller.

In a similar vein, I suggest adding this (or something similar) to before the using() do loop within pbChooseNumber:
f = ""
f2 = ""
case $currency.downcase
when "money", "gold"
f = "$ "
when "coins"
f2 = " Coins"
when "battle points", "bp"
f2 = " BP"
end
And then you want to change the instances of numwindow.text to:
numwindow.text = _INTL("x{1}<r>{2}{3}{4}", curnumber, f, (curnumber * itemprice).to_s_formatted, f2)

Lastly, if discount is numeric during the beginning stages of pbPokemonMart where it is parsing the developer's inputs, currency will always be set to "money" regardless of what the developer uses as the currency input.
You want to write the code as follows:
elsif checkTrueFalseOrNil(useCat) # useCat is given or cantSell is given
if discount.is_a?(Numeric) # discount given (currency and cantSell optional)
if checkTrueFalseOrNil(currency)
cantSell = currency
currency = "money"
end
elsif discount.is_a?(String) # currency given (cantSell optional)
if checkTrueFalseOrNil(currency)
cantSell = currency
currency = discount
discount = nil
end
Hey, I appreciate your suggestions but I don't see a point in changing any of these. I did delete the dollar signs in the presets so maybe you didn't copy over the new settings file. About the commas that list the items, if you bother with it that it should be item1, and item2 feel free to change that but I see it more correctly when it's item1 and item2. Otherwise idk what you're pointing at. For the argument converting, I tested this and it worked for every possibility but in v1.4.0 I'll remove this and use a new argument handler. If you want to discuss more about this with me, feel free to join my server
 

halily

Novice
Member
Joined
May 19, 2024
Posts
11
Seemingly incompatible with Secret Bases Remade
When I was using his script, an error occurred:
[Pokémon Essentials version 21.1]
[v21.1 Hotfixes 1.0.9]
Script error in event 9 (coords 15,8), map 101 (Zero Town)
Exception: ArgumentError
Message: wrong number of arguments (given 6, expected 7..9)
***Full script:
pbSecretBaseMart([
:SMALLDESK
])
Backtrace:
[Arcky's Poke Market] 001_PokeMarket_Main.rb:1020:in `initialize'
[Secret Bases Remade] 007_SecretBaseMart.rb:151:in `new'
[Secret Bases Remade] 007_SecretBaseMart.rb:151:in `pbStartBuyOrSellScene'
[Secret Bases Remade] 007_SecretBaseMart.rb:187:in `pbStartBuyScene'
[Secret Bases Remade] 007_SecretBaseMart.rb:391:in `pbBuyScreen'
[Secret Bases Remade] 007_SecretBaseMart.rb:482:in `block in pbSecretBaseMart'
[Secret Bases Remade] 007_SecretBaseMart.rb:478:in `loop'
[Secret Bases Remade] 007_SecretBaseMart.rb:478:in `pbSecretBaseMart'
(eval):1:in `execute_script'
Interpreter:138:in `eval'
 

Arcky

Arcky's Region Map Developer
Member
Joined
Aug 18, 2022
Posts
232
Seemingly incompatible with Secret Bases Remade
When I was using his script, an error occurred:
[Pokémon Essentials version 21.1]
[v21.1 Hotfixes 1.0.9]
Script error in event 9 (coords 15,8), map 101 (Zero Town)
Exception: ArgumentError
Message: wrong number of arguments (given 6, expected 7..9)
***Full script:
pbSecretBaseMart([
:SMALLDESK
])
Backtrace:
[Arcky's Poke Market] 001_PokeMarket_Main.rb:1020:in `initialize'
[Secret Bases Remade] 007_SecretBaseMart.rb:151:in `new'
[Secret Bases Remade] 007_SecretBaseMart.rb:151:in `pbStartBuyOrSellScene'
[Secret Bases Remade] 007_SecretBaseMart.rb:187:in `pbStartBuyScene'
[Secret Bases Remade] 007_SecretBaseMart.rb:391:in `pbBuyScreen'
[Secret Bases Remade] 007_SecretBaseMart.rb:482:in `block in pbSecretBaseMart'
[Secret Bases Remade] 007_SecretBaseMart.rb:478:in `loop'
[Secret Bases Remade] 007_SecretBaseMart.rb:478:in `pbSecretBaseMart'
(eval):1:in `execute_script'
Interpreter:138:in `eval'
Ye that might be the case indeed that it's not compatible. I saw you joining my server so I can help you further there if you want, it'll be easier than here.
 

Arcky

Arcky's Region Map Developer
Member
Joined
Aug 18, 2022
Posts
232

Appletun's Apples

Trainer
Member
Joined
Jan 5, 2021
Posts
60
Seems if you enable use cat for Shelf Marts, they don't actually sort the categories. 'Regular' Poke Marts do however.
 

Arcky

Arcky's Region Map Developer
Member
Joined
Aug 18, 2022
Posts
232
Seems if you enable use cat for Shelf Marts, they don't actually sort the categories. 'Regular' Poke Marts do however.
That's normal, shelfs are categories on their own. And in the guide it doesn't say anything about enabling categories as far as I remember.
 
Back
Top