#💻・modding-dev
1 messages · Page 699 of 1
pokermon is a cryptid-like
does SMODS.gradient work for primary color in consumable type?
How should I shuffle played cards on play? I am currently trying to add a detrimental card effect for my mod that does an amber acorn effect on played cards
When I tried to do something like this: for context.before or context.press_play doesnt work becasue G.play.cards apparently isnt a proper cardarea before then
I tried adding my own context to shuffle the held area before playing cards, but apparently highlighted cards simply like resort themselves in the original arranged order before being played
Here's part of my code
if card.area == G.hand and context.on_select_play and card.facing ~= 'back' then
G.E_MANAGER:add_event(Event({
func = function()
if #G.jokers.cards > 0 then
print("suffle")
G.jokers:shuffle('NUTTY'); play_sound('cardSlide1', 0.85); return true
end
if #G.hand.cards > 0 then
print("suffle2")
G.hand:shuffle('NUTTY2'); play_sound('cardSlide1', 0.85); return true
end
G.hand:hard_set_T()
end
}))
delay(0.1)
i keep getting an error code saying there's no primary color for the consumable type
It should be SMODS.Gradients.modprefix_gradientkey
ohhhhhhhhhhhh
it says the 'Uber' is a nil value
uber is my mod prefix
oh
i used a period instead of an underscore
i fixed it, but it still says its missing primary_colour
nvm
i was missing an s
did you try press_play and rearranging G.hand.highlighted
without events
I just realised that it was due to the premature return statements I made in the code from copying it from paperback's ouya board without moving the return statements
this works better now
if card.area == G.hand and context.press_play and card.facing ~= 'back' then
G.E_MANAGER:add_event(Event({
func = function()
if #G.jokers.cards > 0 then
print("suffle")
G.jokers:shuffle('NUTTY'); play_sound('cardSlide1', 0.85)
end
if #G.hand.cards > 0 then
print("suffle2")
G.hand:shuffle('NUTTY2'); play_sound('cardSlide1', 0.85)
end
if #G.play.cards > 0 then
print("suffle2")
G.play:shuffle('NUTTY3'); play_sound('cardSlide1', 0.85)
end
return true
end
}))
someone knows if there is a way to make a joker search in your deck and select a random enhancement from it?
something like idol, but for enhancements
you would need to manually iterate through the cards to find the enhancements and then pick one
there is a G. or variable for enhancements?
Example mod for Balatro. Contribute to nh6574/VanillaRemade development by creating an account on GitHub.
I think I'm cooking
it does say there that to get an enhancement you use SMODS.get_enhancements but I do recommend in your case to not care about quantum enhancements and just use [playing card].config.center_key
is there a way to visually delay debuff showing on jokers? i have it in context.after and it shows as soon as you play a hand
you would need to hook/patch the debuff drawstep
someone else asked for that the other day i can see if i can add it as a feature tomorrow
wait if it's in context.after you can just use an event
how do i make a joker pool?
cant figure it out after trying for a little bit
my game keeps crashing because my jokers are trying to be put into an empty pool..?
nvm figured it out
For the love of god do not use quantum enhancements
Man I should learn UI stuff
I would like some tips on making a UI, for something like run info
Does Vanilla remade remaking creating the UIs?
That might be very useful actually
no, but you can look into smods and balatro to see the UI code
smods adds additional features but uses the same methods of making g ui
I see
wait how do you set a custom sell price
You would have to hook Card:set_sell_value
You set the buy price to twice the value you want, or that
what if i want it to be negative
Twice the negative value?
no, set it to a specific value (incl. a negative value so it wont default to 1)
I didn't know you can just directly hook the sell price
this will default to 1 (sell price)
Well I think the hook thing said above might work instead
I think cryptid uses that hook
well i just added the hook
im so silly
-# forgot to add a - at the start but its there now
Can someone please help? I'm trying to add two new ranks, 1's and 0's... its displaying as ERROR however.
just fixed the problem where one didnt use a sprite by just subtracting 1 from the xpos but
why is it displaying as error?
uhhhh
tried playing a straight using a 0, Ace, 2, 3, and 4 and this happened.
i give up on this
adding new ranks is too hard
How can I overlay UI akin to the skipped text in the blind UI
it's a uibox added as a child of the ui
I have not a clue where the smods stuff is for the UI
what are you looking for
Making another tab for run info
that's in G.UIDEF.run_info in the vanilla code
i want to do the flip animation that the enhance/convert tarots do, during context.other_card, but all the things i found were for highlighted cards
highlighted cards are still cards
you can do the same with context.other_card
G.hand.highlighted[i]:flip()
do you just replace highlighted[i] with other
Do I need a lovely patch for this?
context.other_card:flip()
yes
whats the thing to get rid of the card limit display in card areas again
I have not done a lovely patch before so it would be nice to see how to make one
currently hating lua rn, i keep forgetting the commas
More of a mild inconvenience
Since it typically tells you where you need to add something
I see
nvm I got it
How would I get specifically the first 3 cards drawn?
And how would I keep them from being played or discarded?
So, I'm trying to add new blinds, and currently I got "The 1", "The 10", "The 20", and "The 100", (The numerals of the Phoenician alphabet for the symbols on it) but I don't really know what to do for its functionality.
i got The 1 being debuffing all even cards and The 10 debuffing all odd cards tho
actually... what if i tried to make it more easier by just making them face down instead of a debuff
what causes this in booster packs?
lack of localization on the booster packs
not having a valid group_name or group_key
SMODS.Booster {
key = "stellar_normal_1",
loc_txt = {
name = "Stellar Pack",
text = {
[1] = 'Choose {C:attention}#1#{} of',
[2] = '{C:attention}#2#{} {C:tarot}Astrological{} cards'
},
group_name = "Stellar Pack"
},
would this not be valid?
its identical to my other packs but with different names
what is this asking for?
install mod called Spectrallib
idk i just did this on the localization lua
sevendea_boosters being the group key
Maybe this message should be rephrased so non-programmers can understand
looks fine unless you also have a group_key
issue is i'm using the group key for a joker
for an astronmer style card, i setting it so anything with the key wasw $0
that's not controlled by group_key
at least it shouldn't be
you should use kind for that
i dont know what to do for functionallity
weird thing ive noticed, when i set a variable using pseudorandom_element(G.handlist, 'SEED') its fine, but if its printed it has a number after like Flush 11 and i think its causing issues when i use it like SMODS.upgrade_poker_hands({hands = {pseudorandom_element(G.handlist, 'SEED')}, level_up = 1, from = card})
because ive been doing that and its been crashing
and im pretty sure it wasnt doing that before
Pseudorandom element returns the result and the result's key in that array
So you have to store it in a variable and then you can use it in your function, if you want to avoid issues
you can do select(1, pseudorandom_element(...))
Awesome, thanks!
putting the result of a function call directly into a table unpacks it to use all results
Ohh that makes sense
though iirc you can also just do hands = ... without the table
im currently trying to make a blind that destroys cards in deck after 5 seconds, but im not sure how to get it to do that
i assume it's something with SMODS.destroy_cards(card) but i dont know if that affects all cards including cards in hand
key = "blackhole",
loc_txt = {
name = "Black Hole",
text = {"Slowly destroys all cards in deck"}
},
dollars = 5,
mult = 5,
atlas = 'bwaaablind',
pos = {x = 0, y = 4}, -- change later
boss = {min = 2, max = 6}, -- change later
boss_colour = HEX("f600ff") -- change later
set_blind = function(self)
SMODS.destroy_cards(card)
}
i also don't know how to get psuedorandomized things (ex: a 1/5 chance to do bwaaa or bwuhhh)
if you want it to affect all cards you might want to go through every cardarea containing cards and add them to the list
and then pick a random card from that table
and destroy it
local list = { }
local areas = { } -- list your areas in there
--loop areas
--loop every card in areas.cards
list[#list+1] = the_card_you_want_to_add
--end loop every card
--end loop aread
local random_card = pseudorandom_element(list, "modprefix_seed".. G.GAME.round_resets.ante)
SMODS.destroy_cards(random_card,nil,nil,nil) -- change the first nil to true if you want it to remove eternals
you can use G.playing_cards but remember this not an area and therefore does not have a .cards table in it, you have to list through it directly
so you can like loop through G.jokers.cards, G.consumeables.cards and G.playing_cards
what does the_card_you_want_to_add do
sorry for late reply, but is there any rough idea of when this will be being released?
nope
from me at least
its the current card when you're looping through
for example
for _, playing_card in G.playing_cards do -- For each card in the scoring hand
list[#list+1] = playing_card
end
ah
local list = {}
local areas = {G.playing_cards, G.jokers.cards, G.consumeables.cards } -- list your areas in there
if #list >= 1 then
for _, area in areas do
for _a, _card in area do -- For each card in the scoring hand
list[#list+1] = _card
end
end
end
local random_card = pseudorandom_element(list, "modprefix_seed".. G.GAME.round_resets.ante)
SMODS.destroy_cards(random_card,nil,nil,nil)
i think this should be the code
how do i have it so that all cards in the first hand change their ability to m_hatch_salt
im guessing the assert is wrong
in first hand played or first hand drawn
calculate = function(self, card, context)
if context.joker_main and G.GAME.current_round.hands_played == 0 then
for i = 1, #context.full_hand do
local percent = 1.15 - (i - 0.999) / (#G.hand.cards - 0.998) * 0.3
local target = context.full_hand[i]
G.E_MANAGER:add_event(Event({
trigger = "after",
delay = 0.15,
func = function()
target:flip()
play_sound("card1", percent)
target:juice_up(0.3, 0.3)
return true
end,
}))
end
for i = 1, #context.full_hand do
local target = context.full_hand[i]
G.E_MANAGER:add_event(Event({
func = function()
assert(card:set_ability("m_hatch_salt"))
return true
end,
}))
end
for i = 1, #context.full_hand do
local percent = 1.15 - (i - 0.999) / (#G.hand.cards - 0.998) * 0.3
local target = context.full_hand[i]
G.E_MANAGER:add_event(Event({
trigger = "after",
delay = 0.15,
func = function()
target:flip()
play_sound("card1", percent)
target:juice_up(0.3, 0.3)
return true
end,
}))
end
end
no i mean like
how do i make every single card played the salt enhancement
i think you dont have to assert for this
also it should be target:set_ability("m_hatch_salt")
can someone help me make a planet card?
gotcha
how would i make a blind that debuffs all cards that have a rank lower than the lowest ranked card in the last played hand?
nevermind, that would probally be too complicated for me to code.
how do i check if a round is being played?
G.GAME.blind.in_blind is true when you're in a blind
thanks ^^
did it work
i havent tested it yet sorry
Thst would not be that difficult at all!
Im sure you could figure it out
whats the best way to get the ante number? making a joker that only appears ante 2 and before
not sure if i have to continue building up on it but
key = "blackhole",
loc_txt = {
name = "Black Hole",
text = {"Slowly destroys all cards in deck"}
},
dollars = 5,
mult = 5,
atlas = 'bwaaablind',
pos = {x = 0, y = 4}, -- change later
boss = {min = 2, max = 6}, -- change later
boss_colour = HEX("f600ff"), -- change later
set_blind = function(self)
local list = {}
local area = {
G.deck,
G.hand
}
if #list >= 1 then
for _, area in areas do
for _a, _card in area do -- For each card in the scoring hand
list[#list+1] = _card
end
end
end
local random_card = pseudorandom_element(list, "bwaaa_seed".. G.GAME.round_resets.ante)
SMODS.destroy_cards(random_card, nil, nil, nil)
end
}
G.GAME.round_resets.ante
oh. I already gave it a different function already.
fair enough
your listed areas dont have cards in them
yeaa it works c:
you need to go through G.deck.cards or G.hand.cards
but you can simply go through G.playing_cards, its a list of the full deck@dusk stream
code would be
SMODS.Blind {
key = "blackhole",
loc_txt = {
name = "Black Hole",
text = {"Slowly destroys all cards in deck"}
},
dollars = 5,
mult = 5,
atlas = 'bwaaablind',
pos = {x = 0, y = 4}, -- change later
boss = {min = 2, max = 6}, -- change later
boss_colour = HEX("f600ff"), -- change later
set_blind = function(self)
local random_card = pseudorandom_element(G.playing_cards, "bwaaa_seed".. G.GAME.round_resets.ante)
SMODS.destroy_cards(random_card, nil, nil, nil)
end
}
and you wouldnt need to list every card in every area
since you only delete playing cards
i gave you the double loop incase you wanted to delete jokers too
but the code how it is right now would destroy one single card when you set the blind
wait what lua interpeter should i use?
you do not use an interpeter, testing is done ingame
what is there to explain?
you dont need something to run code when the game already does so
well whats this?
srry
is that in notepad?
thats just discord code block
the formatting is done thru grave accents
i assume you mean an editor and not an interpeter
it’s just showing how the Code Is
which is up to preference
many ppl use vscode for Editing tho
but probably dont use base notepad at least
-# myself included
vscode is what most people use
if only there was a resource that answered these kinds of questions..
if only...
yeah that would be crazy
?????
like some king of modding-resources…
im kinda new to modding
i wasn’t trying to mb but there is a lot of info about it there
both in the above link and the respective forum
a single Google search or quick look into modding resources should answer most qeustions
at least in regards to the simpler starting questions anyway I’d think
idk
🤔
but ya VSCode is definitely the recommended starting editor for that
where could I find the code that makes all the scoring animations happen faster
I need to make it not accelerate while a specific event is occueing
Is there a context for when a rental sticker deducts money?
do which ever fits you best
context.money_altered -- flag to identify this context, always TRUE
context.amount -- the amount that money has changed by
context.from_shop -- true if the money changed while in the shop
context.from_tarot -- true if the money changed from using a consumeable
context.from_scoring -- true if the money changed while scoring
i dont think so
thetes context.money_altered
you could track the amount though
hmm there's no way from that to figurenit out
i think if you do if context.money_altered and context.amount == -1
you'll need to modify the rental stick to give a custom context
yeah I considered money_altered but I don't think it can exclusively regard rental
its -3
right
and that would also consider purchasing jimbo
then do and context.from_shop == false
that should work for pure vanilla, but any extra mods may break it
I'll play it safe and just patch rental
if a mod adds an enhancement that takes $3
oh wait, ox and wraith would break
if you have 3 dollars
wait
rental doesnt remove the dollars during scoring
right
so i think if you set everything else to false you'd be good
its better to make your own custom context
yeah
bump
oh wait I figured it out
wait maybe not
whats the best way to make packs bigger / have more choices? of a specific type too?
idk about specific types https://github.com/Steamodded/smods/wiki/0827#new-modifiers
for specific types you could probably look at cardsleeves
G.GAME.round_resets.booster_pack_choices or something similar is a thing
nvm its G.GAME.modifiers.booster_size_mod
therss another one for choices
that's what i linked 💔
what would be the best way to go about doubling the levels you recieve from level ups?
hooking level_up_hand probably
quick question does other_card.ability.perma_bonus also apply to xchips
perma xchips is perma_x_chips
how would i make a seal grant a spectral card when it is played and scores?
i've got the function and stuff for it
i just dont know how to make it choose a random spectral card
SMODS.add_card { set = "Spectral" }
thanks
another joker has hit the photochad meta.
does anyone know how to make a blind only appear on ante 0?
you can mess around with in_pool currently, soon the max value of your blind definition will be functional though so it's probably easier to wait for that
oh
my idea was a way to get to ante -1 without voucher shenanigans, a blind that when defeated would instead take you back an ante, and maybe it has a chance of appearing on ante 1, and guaranteed on ante 0.
check aikoshen
lore accurate you are an idiot
check aikoyori's shenanigans and its "forgotten blinds"
Bump
likely need to hook one of the draw_cards
wait
context.stay_flipped with to_area being G.hand
first 3 calls
does anyone know why this isnt working? It's only debuffing the Diamond suit...
hey whats the varible for the base blind size?
1
youre defining the same suit field three times, which overrides the previous each time
The NAME?
to debuff multiple suits you should use i think the debuff_card function
and check if its not clubs
mult
base for each ante is calculated in get_blind_amount, it doesnt get stored
and the multiplier is G.GAME.starting_params.ante_scaling which is used by plasma
in a string of code how do i update it?
how would i go about doing this?
update what
update how and when
update who
blind galore coming soon?
probs not...
recalc_debuff = function(self, card, from_blind)
if card.area ~= G.jokers and card.is_suit and not card:is_suit("Clubs") then return true end
end,
why are you replying to my joke and not my actual question
sob
but i want it to be:
ante 1: 1
ante 2: 2
ante 3: 4
what
WRONG REPLY
\😭
if so just double this every ante
but i want it to be:
ante 1: 1
ante 2: 2
ante 3: 4
ONE WHAT
do you mean round?
i think its the ante scaling
not ante
if so this is hard coded into the blinds themselves iirc
you'd have to take ownership of them
i think he wants to do return {xblindsize = (9+10)} and it should do x21
i gave the damn answer to the ante multiplier
ante 1: 1X base blind size, ante 2: 2X blind size, ante 3: 4X blind size.
^^^^^
oh wait so i can change starting_parems mid run?
🤦
blame thunk
you can change anything almost anywhere
all that matters is that its reflected correctly
it makes sens for it to be in starting params since you kinda want to reset it every new run
you would expect it to be stored somewhere else though
it shouldve been called something else though
wym?
well editing most starting params doesnt actually do anything because theyre used to set another value
if I change the object a scrollbar is connected too I also have to change like 5 other variables to get it work again
tf you talking about bruh 😭
ui slop
ui is just propaganda for big html
ui gem
and nested tables
ui slop no double down
buttons are pain
paingas
i am not dynamically adding buttons
so basicly
game.starting_parems.ante_scaling = 2^game.round_resets.ante
?
but how do i update that every ante change?
context check
how?
How to use calculate correctly?
wtf is a loc_target
Hello, everyone! I am new to Balatro and hoping to learn how to make a mod version of Balatro for my partner’s birthday:) Could folks point me to what you think is worthwhile tutorials for beginners? I’m hoping illustrate myself too- Is that something I can do too? 😊
Thank you so much!
how do i make spritesheets for things like seals?
aseprite is kinda annoying to do it with, its just overlapping the frames and causes this
What
??????/
ello, I am trying to make a bot that can play balatro(earlier when I mentioned it here, there was some discussion about rule 9, but it seemed like the general understanding was that it was specificaly for generative ai, but if it is a problem, if you are a mod, please ping me, and I will take down all my posts about it). Has anyone made a mod that would allow a script to play the game that I could latch into, if not that would be my next steps, I know that typist is a thing which has keyboard inputs for all actions which I would probably be a base, but if some other framework would work better, that would be great to know.
wdym, what bruh
TY!
How even
250 lines of joker code, 12 ui functions, 1 patch, and 6 hooks
had to make my own state event system within the joker
is there something im doing wrong in here? Maybe its the max but i added kraM ehT and now I tried rerolling and the game crashed
how is it crashing
replace talisman with amulet, but thast not the source of uour crash
oh
i think the problem was just me loading in from something on a low ante
just incase, i replaced the max one with a minimum of -69420 because, nice.
It's just straight up not debuffing anything. I've tried using the return debuff and the SMODS:debuff_card along with some combinations of context checks
always remember mod makers
just because your mod’s joker “copies” the effect of a joker of a different mod, it’s ok!
with how many mods there are it’s difficult to be “original”, so go crazy
is there a way to change a played poker hand into a different one
like Straight to Straight Flush
like before scoring
during context.evaluate_poker_hand, if context.scoring_name is "Straight", then return replace_scoring_name = "Straight Flush"
alr thanks

And how would I add something to the list of contained Poker Hands?
it's that "advanced use" mentioned in the screenshot
So would I not be able to just table.insert(context.poker_hands, "Hand Name")?
No, it would be context.poker_hands['handkey'] = {hand}
@jagged gulch why did you add a comma 😭
loc_vars = function(self, info_queue, card)
return {vars = {card.ability.extra.chips}}
end,
use this
Because every single other time if there isn't a comma it breaks
have you taken any time to learn lua syntax?
Yes but my memory is shit
ah okay
I know commas are how you sperarte code but I think that was sperate code since it looked line a line
so, to make every hand contain, say, a flush, it would be
local handlist = {}
handlist = context.poker_hands
table.insert(context.poker_hands, "Flush")
return{replace_poker_hands = handlist}
```?
quick refresher
tables are like
{
-- list like tables
item1, item2,
item3, item4, item5,
item6,
item7,
-- keyed tables
loc_vars = function()-- the function is NOT done don't use a comma
line_of_code_1 -- still not done
if true then -- still no
return true -- nope
end -- almost there
end, -- now its done
other_key = 2
}
its a keyed table just use table["Flush"] 😭
no like to add it
No, it would be context.poker_hands['Flush'] = {context.scoring_hand}
so a pair is considered a flush with a pair (while still scoring as a pair normally) and not just a flush with nothing else
oh yeah that too
i don't know about scoring but yes it will be considered to contain a flush
Why isn't it working
is xmpl your mod prefix
then Idk what's wrong here
the indent is a bit annoying, but nothing else is bad
Oops
Forgot that was the tutorials mod prefix
lmao
lol
xmpl sounds like a actual file extension to be fair
"xmpl" was meant to sound like "example"
I know
.example files 
It's just that it also sounds like .xml a actual file extension
i've recently started developing a mod (following https://github.com/Steamodded/smods/wiki/Your-First-Mod and https://github.com/nh6574/VanillaRemade/blob/main/src/jokers.lua), mostly going well so far, but for some inexplicable reason, jokers (even vanilla, as pictured) are appearing in duplicates, as if showman was applied. it happens on multiple decks and i'm absolutely dumbfounded. has anyone encountered anything like this before?
Out of coincidence, does someone have the spritesheet of a Boss Blind?
smth like this or?
like the vanilla spritesheet/etc
-# np! :3
how do I get the key of the current poker hand being played? everything I've found either gives me the Localized name of the hand or every hand that it contains, and I only want the key.
context.scoring_name
okay next question, how can I tell if the hand played is a hidden hand type? trying G.GAME.hands[context.scoring_name].visible always returns true because once you play the hidden hand type it shows up
would I have to scan all the poker hands at the beginning of the game and save that visible status to reference later?
Yes.
Do you have any other mods active? What have you personally added?
the only other mod i had added was handy. at the time, i had only implemented two jokers (attached). i have a custom in_pool function on one of them, which i thought might've been the source of my woes, but i cannot conceive of how
(there's a helper function there to manage my mod id for me)
Have you considered using SMODS.find_card instead of doing a loop check?
It wouldn't solve your pool problem but it is more optimal
thanks for the heads up! i was not aware of that, ty :3
no prob
What else have you done in your mod? I'm assuming it's more than just these joker inits
at the time i first noticed the issue, it was just those two jokers and the config files
i feel like i must have done something wrong with config somehow somewhere cuz it manifested so early
None of these files were present?
util was, rest not
-- debugging function
function print_keys(tab)
local keyset = {}
local idx = 0
for k, v in pairs(tab) do
idx = idx + 1
keyset[idx] = k
end
table.sort(keyset)
print("[print_keys]", table.concat(keyset, " | "))
end
function whimsy_prefix(prefix, id)
return prefix .. "_whim_" .. id
end
function whimsy_joker(id)
return whimsy_prefix("j", id)
end
function whimsy_modifier(id)
return whimsy_prefix("m", id)
end
function whimsy_sound(id)
return "whim_" .. id
end
hm, very odd
.....i did disable _RELASE_MODE in the game file manually before starting the mod, now that i think of it, to get the debug menu. is it possible that has something to do with it?
What Steamodded version are you running?
should be latest, i git clone'd the repo
Might be an issue on dev maybe. Usually it's recommended to develop on latest release, not latest commit
yeah, i think you must be right - i just tested it without my mod, and i'm still getting the error. thanks for the help debugging, i never considered dev would have this issue!!
er, not an error. *unexpected behavior.
I'll grab latest myself and see if I can repro
Actually I should've asked you this too: Did you spawn those cards in?
no problem, and dw that's a pretty weird one to learn lol
-# I'm honestly just glad it's not a smods bug
??? That's weird lol
Although I guess debugging will always bring its own set of oddities
Huh, I'm surprised you didn't know that one 😭
I always thought it was like "if this card is in an area it's not in the pool unless showman"
see, i don't touch the pool, much like i dont touch the scoring loop
I believe "adding a card to the deck" is what removes it from the pool, and I think for whatever reason, spawning a card through debug doesn't do that lol
Maybe it has something to do with the buy button and stuff
I literally just don't think card:add_to_deck() gets called on debug spawn lmao
No, it's because a card's key is only added to G.GAME.used_jokers if G.OVERLAY_MENU does not exist.
that's an oddly specific restriction
i wonder what thunk had in mind with it
My guess would be so viewing collection mid-run doesn't mess with it
Where can I find the values to change the positions in the collection menu
I wanna make the first page normal and have the second mirror that of the first
reload it ?
They're kind like that no matter how many times I restart the game
The disorganization was something I figured could be fixed after all the blinds were added
message = "something",
func = function()
print("something")
end
}```
how would you make the function actually trigger when the message does
add it in an event
https://discord.com/channels/1116389027176787968/1507682513244655687 i am currently making a mod but i desperatly need coders. so if anyone wants to help i would be really thankful
specifically anyone thats good at making custom api would be great
You could add dummy blinds that have no texture (it does still need an atlas but the atlas should point to a transparent png) or anything, can't appear in game and do nothing
Is there a proper way to prevent multiple context.destroying_card effects from going off from the same card?
Like how Sixth Sense only works once on one played 6, even if you have multiple Sixth Sense
I think you can either check existing flags like card.getting_sliced or smthin, or set your own flag e.g. card.sixth_sensed, and then check that it isn't set already.
just also make an Event to reset the flag if the card remains in the deck
what would i use to set a gradient for the title splash, cus this didnt seem to work
code?
SMODS.Gradient {
key = "BgOne",
colours = {
HEX("c48454"),
HEX("895d3b"),
interpolation = "trig",
cycle = 15
},
}
SMODS.Gradient {
key = "BgTwo",
colours = {
HEX("ab744a"),
HEX("e69e66"),
interpolation = "trig",
cycle = 15
},
}
G.C.mid_flash = 0
G.C.vort_time = 7
G.C.vort_speed = 0.4
-- Thank you yahimod for easy accessa 🇫🇷🇫🇷🇫🇷🇫🇷
local game_main_menu_ref = Game.main_menu
Game.main_menu = function(change_context)
local ret = game_main_menu_ref(change_context)
G.SPLASH_BACK:define_draw_steps({
{
shader = "splash",
send = {
{ name = "time", ref_table = G.TIMERS, ref_value = "REAL_SHADER" },
{name = 'vort_speed', val = G.C.vort_speed},
{name = 'colour_1', ref_table = G.C, ref_value = 'BgOne'},
{name = 'colour_2', ref_table = G.C, ref_value = 'BgTwo'},
{name = 'mid_flash', ref_table = G.C, ref_value = 'mid_flash'},
},
},
})
return ret
end
idk how it works precisely
ref_table = SMODS.Gradients, ref_value = 'modprefix_BgOne'
granted, i think it will only pick the starting color but im not sure
im basing off of intuition since it appeared to work with polter
ah also
Game.main_menu = function(self, change_context)
local ret = game_main_menu_ref(self, change_context)
thanks
yea hold on, it appears to be getting nil?
nvm im just a bot and forgot i had a toml file with the same bit
i switched vanillaremade to recommend a patch instead of a hook because it's easier to preserve the title flash
yea, and hooking the splash, atleast when i tried it, deleted the cards that honed into the centre
so probably for the best
why does the balatro logo on the main menu drift to the right when you have multiple mods enabled that add cards to the title cardarea
because cryptid was like the first mod to add a card to the main menu i think(?) and it multiplied the cardarea size for the title card
which kinda became the standard
but that breaks when theres a lot of mods doing that
at least SMODS.current_mod.menu_cards exists now
yes, use that instead and you won't have this issue
(or, y'know, tell the mod devs)
I'm trying to make an event for when the wheel is used via toml. I should see "consumable print" in the console, but i don't when the tarot is used. Did I miss something?
--game_state.lua
GameState = {
playing_cards = {}, -- the playing cards in hand during a blind
jokers = {} -- the jokers at the top area
}
function GameState.consumable_print()
print("consumable print")
end
return GameState
--main.lua
GameState = assert(SMODS.load_file('game_state.lua'))()
[[patches]]
[patches.pattern]
target = "card.lua"
pattern = "eligible_card:set_edition(edition, true)"
position = 'before'
match_indent = true
payload = '''
GameState.consumable_print()
'''
how would i make my mod description look something like this
thanks
woah who made this
did you check the lovely/dump to see if it's patching correctly
Meawhile me 
if context.selling_card and context.card.type == 'Planet' and not context.blueprint then
card.ability.extra.xmult = card.ability.extra.xmult + card.ability.extra.xmult_gain
return {
message = localize('k_upgrade_ex')
}
end
end```
trying to make the joker gain mult when a planet card is sold, but `context.card.type` is wrong and the wiki doesnt say what's right
context.card.ability.set
the structure of a Card instance isnt on the steamodded wiki because it is a vanilla thing
i tried that and it crashed
nvm something happened to make that not crash
ill take what i have ig
how would I return/shuffle cards from the hand into the deck?
I used SMODS.create_card to make booster packs appear in the shop and all is well, except that they're tiny. I've seen code in other mods to correct this, but those are done totally differently and are always coded for specific packs instead of random ones. I've not gotten it to work when trying to get a random pack key. So is there a way to stick with SMODS.create_card and resize them?
do you want the shop to have an extra booster permanently or conditionally
permanently
SMODS.change_booster_limit(1)
Thank you very much!
Why is it crashing like this? It should be able to either pull the value from the mod calc or just take the 0 over it.
config is initialized when the game is loaded, G.GAME doesn't exist yet at that point
if you want to initalize a config variable based on something in G.GAME, you have to do so in set_ability
is there a way to have scored enhanced cards do something
like for example theres SMODS.has_enhancement(context.other_card, "m_gold")
is there like an "m_all" or something like that
would next(SMODS.get_enhancements(context.other_card)) work
ok it does
lol
SMODS.Atlas {
key = 'miniwage',
path = 'miniwage.png',
px = 71,
py = 95
}
SMODS.Joker {
key = 'miniwage',
loc_txt = {
name = 'Minimum Wage Working Joker',
text = {
'After {C:attention}60 minutes,{} gain {C:money}$7{}',
}
},
atlas = 'miniwage',
pos = { x = 0, y = 0 },
rarity = 1,
cost = 2,
blueprint_compat = false,
eternal_compat = true,
perishable_compat = true,
unlocked = true,
discovered = true,
config = { start = 0, inblind = 0, time = 5, timecolor = copy_table(G.C.GREEN), extra = { dollars = 7 } },
loc_vars = function(self, info_queue, card)
return { vars = { card.ability.extra.dollars } }
end,
update = function(self, card)
local time = 5 - (G.TIMERS.REAL - card.ability.start) * card.ability.inblind
if time <= 0 then
card.ability.timecolor[1] = G.C.RED[1]
card.ability.timecolor[2] = G.C.RED[2]
card.ability.timecolor[3] = G.C.RED[3]
card.ability.timecolor[4] = G.C.RED[4]
card.ability.time = "00:00"
else
card.ability.timecolor[1] = G.C.GREEN[1]
card.ability.timecolor[2] = G.C.GREEN[2]
card.ability.timecolor[3] = G.C.GREEN[3]
card.ability.timecolor[4] = G.C.RED[4]
card.ability.time = string.gsub(string.format("%.2f", time), "%.", ":")
end
if time == 0 then
return card.ability.extra.dollars
end
calculate = function(self, card, context)
if context.blueprint then return end
if context.add_to_deck then
card.children.timer = UIBox { definition = { n = G.UIT.ROOT,
config = { align = "cm", colour = { 0, 0, 0, 0 } },
nodes = {
{
n = G.UIT.O,
config = {
object = DynaText {
string = { {
ref_table = card.ability,
ref_value = "time" } },
scale = 1.2,
shadow = true,
colours = { card.ability.timecolor }
},
align = 'cm'
}
}
} }, config = { align = 'cm', major = card, parent = card } }
card.ability.start = G.TIMERS.REAL
card.ability.inblind = 1
return {
func = function()
G.E_MANAGER:add_event(Event({
trigger = 'immediate',
func = function()
return true
end
}))
end,
}
end
end
end,
set_badges = function(self, card, badges) end,
inv_badge_info = {
{ key = "credits_code", vars = { "sinkhole" } },
{ key = "credits_art", vars = { "sinkhole" }},
{ key = "credits_idea", vars = { "sinkhole" }},
},
}```
this guy doesn't add a timer to the card's description, and doesnt give me moeny after 5 seconds (5 seconds for testing)
sorry for wall of text
does anyone know how to make negative antes have score requirements of the non-negative counterpart?
Like, make ante -1 and 1 have the same requirement, and -2 and 2 having the same score requirement, etc, instead of negatives having the same requirements of ante 0?
hook get_blind_amount(ante) to take the absolute value of ante instead
I'm not sure if this is exactly a modding question, but does anyone know how to expand the collab skin area like picture 1? I wanna take a preview screenshot but it shows as picture 2 and i'm not sure if it's just a mod I don't know about
so, how would i do it in a way that works? I tried just copying the function from the game and just pasted it and modified it in my mod lua file and the game crashed.
99% sure u can just add to the display_ranks property of the SMODS.DeckSkin
I tried this but it seems to be the same as setting the ranks property
does seltzer not count as a "food joker" in the code?
No, it does.
if context.card:has_attribute('food') then
card.ability.extra.Xmult = card.ability.extra.Xmult + card.ability.extra.Xmult_gain
return {
message = localize('k_upgrade_ex'),
colour = G.C.MULT,
}
end
end```
using up seltzer doesn't trigger this code
oh wait now it did
hmm
perhaps a bug
First time making a mod, please send help
text = { "description" }
?
how do i check if the player is in a booster pack, and how do i increase the currently open booster pack's number of choices?
oh, you again
<@&1133519078540185692>
cheers
?
[hmm i suspect they might be deleting their own messages]
[they weren't banned last time]
what
A scammer, where?
add a } at the end of your file
not here atm
i've figured out the first half of this question
uhhhh, i dont understand-
i literally add {} at the end and start of the file?
nono
add just a }
the error says there's a mismatched { somewhere
so you need to close it
This is the whole joker btw
My god, thats was it
yay :D
maybe those four Jokers have the wrong atlas, in the code?
local gba = get_blind_amount
function get_blind_amount(ante)
ante = math.abs(ante)
return gba(ante)
end
i will see
G.STATE == G.STATES.SMODS_BOOSTER_OPENED
(from memory so idk if it's exactly that)
The atlas seems right
idk about the choices while you're in the pack
nail on the head, yes
i'll try something, but it might not work
check the cards' assigned atlases
wahoo! you found the bug ^u^ well done /gen
trying to make a divine blueprint, but i have no idea how to make the joker itself retrigger
IT WORKS, IS ALIVE
well. that was easy
[also, hello mmmmmjokers joker]
i did G.GAME.pack_choices = G.GAME.pack_choices + card.ability.extra.added_choices, for reference
it seems that variable is what the booster uses for its selections
this looks like it never returns ret
hello??? cool okay
how do i make it return ret without the localisation going all funky, bc i tried doing end statements and it kinda didnt want to
omg hawker hai ^u^
Not sure what I'm looking for exactly. But I opened dump in vsc, and tried looking for consumable_print in all the files, and didn't find anything
i dont want to sound mean but i would really recommend that you do some basic lua practice
😭 its just one joker
the other divine jokers worked out fine, this is the last one i need to program
i managed to get divine smeared, divine swashbuckler, divine walkie talkie and a few others working without any bit of help
then it probably didn't patch im guessing
search for the pattern to see if the code is there
pattern as in regex? Through the same search bar?
whatever ill just scrap it
I mean the eligible_joker:set_edition part
Scrapping it is passing on an opportunity to learn imo
I'm trying to be positive 😭
yes, I found that in two files
is your code above the second one
No, bc ctrl + f is not giving anything for GameState
i was typing an explanation out but it sounds incomprehensible so ill just get rid of it
my main point is
i dont want to
hmm can i see where the toml is
at the very least im not relying on ai to help me figure out how to make this work (neither are any of you, but thats besides the point)
it's in the root of my mod
oh yeah theres a tutorial for that hold on
https://www.youtube.com/watch?v=aHL6DVQFww8 <- is it this one?
In this episode, I teach you how to create Lovely patches and hook functions
Repo: https://github.com/the-Astra/ExampleMod/tree/Episode-3
Tools:
- toomanyjokers: https://github.com/cg-223/toomanyjokers
Resources:
- SMODS wiki: https://github.com/Steamodded/smods/wiki
- VanillaRemade: https://github.com/nh6574/VanillaRemade
there's a tutorial on https://github.nh6574.com/vanillaremade/wiki
ah nvm
is there a reason why you put your tomls in a sub folder here?
i used AI for shaders initially
@torn thunder i dont anymore I have learned
I use it for lua patterns and regexes because they're stupid
I have an idea but i need help
look, uhhh
is basically a joker called "Go fish" and functions like this:
when (Random card) is drawn from the deck, +10$
the random card should work like Idol
the problem is "drawn from deck", the fact that appears in your hand, not in the scored cards
there is a way?
look for death note from hotpot
hot potato?
yes
Why there is 2?
idk
Because Bmm Sucks
or this
Nevermind, is just this
now the problem is putting this in basically stolen Idol code
Is it possible to make the infobox related to config = { card_limit = 5 } say "Joker slots" as opposed to "area slots" if it's on a joker?
How works "context.end.of.round"?
this answered in VanillaRemade wiki, I believe
where if i can ask?
just seen, the problem now is the random card
idk what post_draw_individual is in hot pot but you probably want context.hand_drawn
is it custom context?
context
oh no
context.hand_drawn is the context for when cards are drawn in a round
oh, thanks
but now my problem is generating the same card
I could use the same as Idol but that could be kinda cheap
wdym kinda cheap
like, too lazy?, idk
i was about to tell you to look at what idol does lol
no that's how you program effects 😭
i wrote all the ones in vanillaremade so people copy best practices instead of inventing their own stuff lmao
idol uses its own global variable
ah did you mean literally using the one for idol
yeah
My mod practices consists of Astra's tutorial videos, VRemade and the prayers of understanding SMODS Documentations
Good start
same
i can create a G. variable or i am just bullshitting?
you can create anything in any table in lua but it's usually recommended to either save it to G.GAME (everything there is saved to the run file) or if it's temporary make your own global with your mod name
Just replacing the values of mail in revate with other variable so it doesnt mix
yeah
Whole code btw
just changed everything mail related with fishing
(Because is the Go fish joker)
i want it so that if a specific deck is selected, every instance of the vanilla sound "card1" is replaced by a sound in my mod. how could i accomplish this?
hook play_sound probably
how does the config look like
fixed it
i think
i need help
again...
I need a way that the text shows the card selected by the variable fishing_card
i can send the whole code
in the loc_vars return you are using vremade_mail instead of your card
and then in the description you're not using the card which would be #2#
Well... don't know how we got here.
One of your contexts may be messed up.
My code is:
loc_vars = function(self, info_queue, card)
local fishing_card = G.GAME.actualround_fishingcard or { rank = 'Ace', suit = 'Spades' }
return { vars = { card.ability.extra.dollars, localize((G.GAME.current_round.going_fishing or {}).rank or 'Ace', 'ranks') } }
end,
calculate = function(self, info_queue, card)
if context.hand_drawn and not context.other_card.debuff and
context.other_card:get_id() == G.GAME.actualround_fishingcard.id then
G.GAME.dollar_buffer = (G.GAME.dollar_buffer or 0) + card.ability.extra.dollars
return {
dollars = card.ability.extra.dollars,
func = function() -- This is for timing purposes, it runs after the dollar manipulation
G.E_MANAGER:add_event(Event({
func = function()
G.GAME.dollar_buffer = 0
return true
end
}))
end
}
end
end
and for the generator or how is called:
local function reset_current_fishing_card()
G.GAME.actualround_fishingcard = { rank = 'Ace' }
local valid_fishing_cards = {}
for _, playing_card in ipairs(G.playing_cards) do
if not SMODS.has_no_rank(playing_card) then
valid_fishing_cards[#valid_fishing_cards + 1] = playing_card
end
end
local fishing__card = pseudorandom_element(valid_fishing_cards, 'going_fishing' .. G.GAME.round_resets.ante)
if fishing_card then
G.GAME.current_round.going_fishing.rank = fishing_card.base.value
G.GAME.current_round.going_fishing.id = fishing_card.base.id
end
end
it says self, info_queue, card
those are not the arguments for calculate
you can name them whatever you want but you know what i mean
thanks
uuuuhhhh
Then why in vanilla remade mail in rebate is like this?
how would i make it so that a card front (as in, the default card texture that you see on the front/technically middle of playing cards) is set to a custom texture when a specific deck is used?
kinda like how it's changed with enhancements
can someone help me make a planet card
depends on what you need help with
how could i , if possible get the total amount of time needed to finish all jokers scoring? like say you have a baron mime build and it takes 30s to score because it has like 10 red seal steel kings
you could use love.timer.getTime() before and after scoring
I am trying to check which specific playing card is being affected by the magician when in a blind. However, when I run what I have, the cards do not have the enhancement. Ik this bc print_playing_cards prints out "5 of Hearts, 9 of Diamonds..." when it should be "5 of Hearts (Lucky Card), 9 of Diamonds (Lucky Card) ...". I would show the print statement, but it's too long. I need to figure out either: 1. if there's a what to select a card via a individualized value like an id (not the way that variable is currently used) or 2. a way to get new G.hand.cards after the ehancements are applied. I would preferably like to do the latter bc it sounds easier. Does anyone know how to do either?
--gamestate.lua
GameState = {
playing_cards = {}, -- the playing cards in hand during a blind
}
function GameState.set_playing_cards(cards)
local copy = {}
for _, card in ipairs(cards) do
table.insert(copy, card)
end
GameState.playing_cards = copy
end
return GameState
[[patches]]
[patches.pattern]
target = "card.lua"
pattern = '''
for i=1, #G.hand.highlighted do
G.E_MANAGER:add_event(Event({trigger = 'after',delay = 0.1,func = function() G.hand.highlighted[i]:set_ability(G.P_CENTERS[self.ability.consumeable.mod_conv]);return true end }))
end
'''
position = 'after'
match_indent = true
payload = '''
if G.GAME.blind.config.blind.key ~= nil then
local key = self.config.center_key
if consumable_index[key] == "Magician" then
GameState.set_playing_cards(G.hand.cards)
GameState.print_playing_cards()
end
end
'''
I apologize for the edits. I try to cut out code that is irrelevant to the problem, but I realized there were some lines that didn't make sense, so I added them in
Here is the print function for anyone curious as a file
your code runs before the event magician creates
put it in another event
I'm not familiar with the consumables events. I was going off of the play log source code.
what code do i use to upgrade a specific hand type by multiple levels
how would i detect how many retriggers occurred in a played hand
check SMODS.upgrade_poker_hands in the utility docs
for a joker to activate on joker_main
the G.E_MANAGER thing puts an event in a queue to happen later basically, if your code is not in an event then it will run immediately
there are a couple of events in playlog for this reason
if it runs immediately here then it's before the cards are enhanced
i could use a hand in fixing the hand upgrade part of the code
error message im getting
instead of card.config it should be card.ability
also your smods seems very outdated
that's causing the crash
scrump bump
oops didn't mean to put that
ignore picture
how would i make it so that a text ui element is essentially given {E:1}
localizing iirc
would track
there's no other_card in hand_drawn
context.hand_drawn is the list of cards drawn
i already fixed that
it doesn't look like you did it properly from the code you sent in general
stay_flipped will run for other things other than from deck to hand so you also need to check the areas
why doesn't my sound play in my joker? (yes the mod prefix is correct)
return {
xmult = card.ability.extra.xmult,
sound = "bof_alarm_ring"
}
SMODS.Sound({
key = "alarm_ring",
path = "alarm_ring.ogg",
loop = false,
volume = 0.5,
})
sound doesn't work with default messages
you need to either use xmult_message with sound inside or remove_default_message + message
Hello! I really didn't want to be spoon fed code but at this point it is the only way I'm gonna figure this out.
Basically, I want to make a joker that swaps the cards in hand with cards played. I tried a bunch of different things and this was the closest one to actually working:
SMODS.Joker {
key="swap_joker",
loc_txt = {name = "Swap Joker", text= {"Cards in {C:attention}hand{} are","scored instead of"," cards {C:attention}played{}"}},
rarity = 2,
atlas = "swap_joker",
cost = 4,
unlocked = true,
blueprint_compat = false,
eternal_compat = true,
perishable_compat = true;
calculate = function (self, card, context)
if context.before then
local temp = G.play.cards;
G.play.cards = G.hand.cards;
G.hand.cards = temp;
end
end
}
This swaps the card positions alright, but for some reason none of the cards are scored and there is a bunch of jank with it, like for example after playing a hand the cards previously in hand aren't usable anymore. Can someone please help me solve this?
-# Also if there is another way to achieve the joker description I'd love to learn about that
you just swapped the references of 2 card areas that hold cards
of course it's gonna break
I did think of that and try to individually carry every card instead like this
but this ended up somehow not even carrying the cards properly and it had worse jank
i hope someone doesn't roast me for this code i genuinely have no idea what I'm doing 😭 im new to balatro modding
local cards = SMODS.shallow_copy(G.hand.cards)
for k, v in pairs(G.play.cards) do
v.area:remove_card(v)
G.hand:emplace(v)
end
for k, v in pairs(cards) do
v.area:remove_card(v)
G.play:emplace(v)
end
doesn't shallow_copy return a table tho? I thought that would get rid of the card objects being a Card
a shallow copy is just a shallow copy, not a deep one
it copies the existing Cards into a new table, it doesn't recreate them
anybody have an idea on how to do this
my attempts have been in vain
i'm talking about the sprite to the right of red deck here
You would have to hook Card:set_sprites, also that's called the center sprite, not the front.
oh ok
this is my best shot, but it's not replacing anything; what am i doing wrong?
local original_card_set_sprites = Card.set_sprites
function Card:set_sprites(_center, _front)
original_card_set_sprites(self, _center, _front)
if G.GAME and G.GAME.selected_back and G.GAME.selected_back.effect and G.GAME.selected_back.effect.center and G.GAME.selected_back.effect.center.key == "b_bof_l_wooden" and self.config.center and self.config.center.set == "Card" then
self.sprites.center = G.ASSET_ATLAS["wooden"]
end
end
the "l" in the key is intentional
set is never "Card"
it's "Default" for base cards and "Enhanced" for enhanced cards
ah
ok now i'm confused
local original_card_set_sprites = Card.set_sprites
function Card:set_sprites(_center, _front)
original_card_set_sprites(self, _center, _front)
if G.GAME and G.GAME.selected_back and G.GAME.selected_back.effect and G.GAME.selected_back.effect.center and G.GAME.selected_back.effect.center.key == "b_bof_l_wooden" and self.config.center and self.config.center.set == "Default" then
self.sprites.center = G.ASSET_ATLAS["wooden"]
end
end
ok the crash just needed a nil check but it still doesn't work
well yeah self.sprites doesn't exist
look at how base Card:set_sprites actually works
the sprite is stored in self.children.center and you need to create an actual Sprite, e.g., using SMODS.create_sprite
i mean i have a texture in an atlas of just that
i assume then i need something more than that?
yeah but that's an atlas and not a Sprite
Also the atlas key likely needs your mod prefix unless you've specifically made it not
i have a record of forgetting about that
ok well that's a step in some kind of direction
local original_card_set_sprites = Card.set_sprites
function Card:set_sprites(_center, _front)
original_card_set_sprites(self, _center, _front)
if G.GAME and G.GAME.selected_back and G.GAME.selected_back.effect and G.GAME.selected_back.effect.center and G.GAME.selected_back.effect.center.key == "b_bof_l_wooden" and self.config.center and self.config.center.set == "Default" and self.children then
self.children.center = SMODS.create_sprite(0, 0, self.T.w, self.T.h, "bof_wooden", { x = 0, y = 0 })
end
end
i tried doing what i saw but i don't think i got it all down
they're attached to the cards in some way just not where they're supposed to be
if self.children.center then self.children.center:remove() end
self.children.center = SMODS.create_sprite(0, 0, self.T.w, self.T.h, 'bof_wooden', {x = 0, y = 0})
self.children.center.states.hover = self.states.hover
self.children.center.states.click = self.states.click
self.children.center.states.drag = self.states.drag
self.children.center.states.collide.can = false
self.children.center:set_role({major = self, role_type = 'Glued', draw_major = self})
that worked perfectly thank you
getting this error because of SMODS.Font, not sure what the mistake is here
Can you send the full crash screen
yeah sure hangon
please ignore the name of the mod i started making it around the start of last year
also have noticed that it only crashes when i try and use it as a font in a loc_txt
how can i not ignore it 😭
just try your best to please 💔
okay 🥀
Your smods and lovely are over a year out of date
They predate font support
the mod's refusing to load over dependencies now
i have 1.0.0-beta-1620a and ive put that in the json
it still says this though, despite the fact that i've changed the dependency in the json
did you save the file
did you reload the game after that
yeah
are you editing the mod in the mods folder instead of some copy located elsewhere
ive saved both files several times and ive reopened the game several times
yeah its the mods folder
might just restart my pc and hope for the best honestly
oh
got it
just disabled and reenabled the mod in the mods menu
So like this?
SMODS.Consumable { -- I, Super Jump
key = 'superjump',
set = 'WheelofFate',
atlas = 'ghostfort',
pos = {
x = 0,
y = 0
},
set_ability = function(self, center)
center.ability.extra.xmult = 1.5
center.ability.extra.duration = math.ceil((2 + (G.GAME.extended_duration_turns or 0)) *
(G.GAME.extended_duration_mult or 1))
end,
-- select_card = 'consumeables',
loc_vars = function(self, info_queue, card)
return {
vars = {
card.ability.extra.xmult,
card.ability.extra.duration
}
}
end,
calculate = function(self, card, context)
if context.joker_main then
return {
xmult = card.ability.extra.xmult,
}
end
if context.end_of_round and context.game_over == false and context.main_eval and not context.blueprint then
card.ability.extra.duration = card.ability.extra.duration - 1
if card.ability.extra.duration <= 0 then
SMODS.destroy_cards(card, nil, nil, true)
end
end
end,
use = function(self, card, area, copier)
end,
can_use = function(self, card)
return true
end
}
not sure why you'd name the parameter center, but I guess that's fine. you do still need config with default values though, so that ability.extra actually exists and for tooltips
Probably due to me mugging Cryptid for spare code
what do you have in your applied_stakes?
why is it screaming
got mad.
ignore the screaming
why would I do that, keys are not case insensitive
the key as it actually is, which is "cry_ascendant", lower case. also applied_stakes are prefixed by default, which means you need to add prefix_config for it
sorry I got interrupted by something irl for literally 2 minutes, no need to get impatient
config?
prefix_config = { applied_stakes = { mod = false } } if you need that spoon-fed
it's so it doesn't add your mod prefix to the applied stake's key
smods otherwise assumes that the stake you want to apply is from your own mod
which it isn't, so you need to let it know that you've supplied the correct prefix yourself
ahhh
this is all explained in smods docs if you wanna learn about it in more detail
I have it bookmarked for when I decide to make another stupid thing in my mod, but yeah, it has almost every little thing documented.
i put this patch into my mod, but it doesnt seem to be taking effect? its supposed to just literally duplicate the hand level up code in the hand level up function basically, but nothing new happens, not even a crash. can someone point me to whats going wrong here exactly? (its worth noting, while im currently trying to just duplicate the level up, im gonna clean this up more later and make it like work better)
nevermind i figured out a way cleaner, faster, working implementation of exactly what i wanted to do LMAO
Dev ingenuity lol
either way: you need to base your patches on what you see in your lovely dump with smods patches applied and not base vanilla code
In this case, smods is adding an extra parameter: function level_up_hand(card, hand, instant, amount, statustext)
ahhh i see okay noted for the future
so
SMODS.Consumable { -- I, Super Jump
key = 'superjump',
set = 'WheelofFate',
atlas = 'ghostfort',
pos = {
x = 0,
y = 0
},
set_ability = function(self, card)
card.ability.extra.xmult = 1.5
card.ability.extra.duration = math.ceil((2 + (G.GAME.extended_duration_turns or 0)) *
(G.GAME.extended_duration_mult or 1))
end,
-- select_card = 'consumeables',
config = {
extra = {
xmult = 1.5,
duration = 2,
}
},
loc_vars = function(self, info_queue, card)
return {
vars = {
card.ability.extra.xmult,
card.ability.extra.duration
}
}
end,
calculate = function(self, card, context)
if context.joker_main then
return {
xmult = card.ability.extra.xmult,
}
end
if context.end_of_round and context.game_over == false and context.main_eval and not context.blueprint then
card.ability.extra.duration = card.ability.extra.duration - 1
if card.ability.extra.duration <= 0 then
SMODS.destroy_cards(card, nil, nil, true)
end
end
end,
use = function(self, card, area, copier)
end,
can_use = function(self, card)
return true
end
}
is there a question?
setting xmult in set_ability is redundant but this looks fine to me
if context.reroll_shop then
self.config.current_reroll_cost = context.cost + 1
end
if context.end_of_round then
G.GAME.current_round.reroll_cost = self.config.current_reroll_cost
G.GAME.round_resets.reroll_cost = self.config.current_reroll_cost
end
end```
this is the code i have right now for a deck who's rerolls only increase in price. the problem with this is that with the way i coded it, chaos the clown and both reroll vouchers basically scam you. is there a better way i can code this deck so that these don't break? or would i need to patch the game to fix these issues manually?
whats the code for a ui box?
yes, but-- i dont know wheter to make a folder with a ui.lua thingy in it
you can put ui code wherever
i honestly wouldn't recommend doing anything ui related if you are very new
i am very new
what does it do currently
i am very new to making ui
chaos the clown sets the rerolls to $0 when you buy him, but doesn't give you a free reroll in any future shop. the vouchers (last time i checked) give you a discounted first reroll price when bought but then it goes back in all future shops
or are you asking ab the code?
no it was that
and what is your deck supposed to do? just increment by 1 extra each time?
ah no i see
i would hook function calculate_reroll_cost
it starts at a value (in my case, 0) and increases the cost by 1 every reroll
mod calculate reroll_shop scale value
wait its a deck
deck calculate
and the increases are permanent, right?
or am i misunderstanding
yes, but i think having chaos the clown should still give you a free reroll each shop, as well as using the vouchers should permanently decrease the reroll cost by whatever it normally does
yeah ok then i would hook that function and change the logic for your deck
instead of using calculate
i've never done hooks before. can you link me to the documentation?
so i would just put the code i have in my calc function into a hook?
no, the logic should be different
you can look at the original, its like 5 lines
you would need a global that takes into account the increases like you had with self.config (which i just realized that is wrong because self.config is not saved it should be back.effect.config) and then change the current cost to that while taking into account the free rerolls
when you say "original", are you referring to the vanilla game code?
create a global variable that tracks total number of rerolls in a game, then set the price to that?
yeah
there's already a global reroll counter?
i assume i'm looking for the function that actually rerolls the shop
Someone can say whats wrong with my code? (The problem is that "valid_fishing_card" appears as null (This is my first time coding pls dont be so hard))
the one you posted might work idk, but you can also just use the deck calculate to count that
there's the Game:update_shop(dt) code, but i assume that runs each time the shop is loaded, not specifically rerolled
how to get past this?
hook it like this
i dont understand why youre looking for reroll code
oh wait i misread
its ran every frame
but i wouldn't recommending hooking it
?????
i think i'm just confused as to what i should be looking for then
theres definitely a better way
we are discussing a different problem be paitent
did you read the function i told you about?
this one
also if that doesn't work, G.FUNCS.reroll_shop probably exists
apologies
that would be the same as using calculate
that doesnt solve the problem
hmm
i already gave a solution!!
how would i go about making a deck start with no numbered cards? (A - 10)
use vscode settings, not the file
you can't edit that file so that vscode doesn't implode
ooo thank you! :3
Pls someone? at least i want to know what to fix
log?
do you call reset_vremade_mail_rank in the rest globals function
Oh... nope
how i do that?
read the comment in that section of vremade and check the bottom of the jokers.lua file
?
i genuinly can't make this any more clear
do you need step by step instructions?
file > preferences > settings
just made it, now appears this
I am a disaster dude
what is that line
replace info_queue with card in your calculate funciton

