#💻・modding-dev
1 messages · Page 617 of 1
because its funny
Reminds me of spyro 3 in the eu copy when it trips of the anti piracy it changes the languages at timss
any clue how
the real reason is that a friend of mine really loves to translate memes and shit into our native language
so
Also your pfp is fire
i think its funny to add that as a joker
ty ty
Persona i think with that sponge bob money meme
Ah yes the one with hitler
Try looking at G.FUNCS.change_lang
like hooking it in main and calling it as G.change_language?
but yeah to answer your question
SMODS.Joker {
key = 'checkered_deck_joker',
loc_txt = {
name = 'Checkered Deck Joker',
text = {'creates {C:tarot}sun{} card and {C:tarot}world{} card after leaving shop'}
},
rarity = 2,
pos = {
x = 0,
y = 0
},
cost = 3,
discovered = true,
config = {consumables = {'c_sun', 'c_world'}},
loc_vars = function(self, info_queue, card)
return {
vars = {
localize { type = 'name_text', key = card.ability.consumables[1], set = 'Tarot' },
localize { type = 'name_text', key = card.ability.consumables[2], set = 'Tarot' },
}
}
end,
calculate = function(self, card, context)
if context.ending_shop and not context.individual and #G.consumeables.cards + G.GAME.consumeable_buffer < G.consumeables.config.card_limit then
G.GAME.consumeable_buffer = G.GAME.consumeable_buffer + 1
G.E_MANAGER:add_event(Event({
func = function()
for k, v in ipairs(card.ability.consumables) do
SMODS.add_card({ key = v })
end
return true
end
}))
end
end,
atlas = "checkered_deck_joker"
}
SMODS.Atlas {
key = "checkered_deck_joker",
path = "checkered_deck_joker.png",
px = 71,
py = 95
}
is there a way to make this give the world, then the sun
oh wait
asking again since quite a bit of time has passed
how do make an info_queue of modded jokers with custom values
on vanilla jokers it works fine but on modded ones it doesn't
i've tried all sorts of things
oh i think i did something similar to this
what exactly are you trying to do?
a prieview for my mod's upgrade system
which turns one joker into another, but can carry over some relevant values
and i want those changed values to show in the preview
one stupid fix, did you add your mod prefix?
yes
what you could do is make a custom infoqueue
and how would i do that
i've been told that by multiple people but i was never told how
like i have a joker that eats food jokers and i made little info queues for them to see what you would gain
first you make a localization folder (not necessary for it to work but just cleaner)
and would i be able to make it autogenerate or would i have to copypaste each joker description for the preview versions?
uhhh
well you can copy the text
one sec
_ _
Popcorn = {
name = "Popcorn",
text = {
"gives {C:mult}+10{} Mult"
}
},
this is what i did for popcorn
i don't want to have to copy-paste the text
you can copy the description and put in text
since i'd have to do that for every upgrade
i don't think so
im not sure tho
dont take my word as fact
bcs im very new to this scene myself 😭
ideally i want to be able to have it automatically make the description by just setting the upgrade joker and the changed values
without having to make a second description
also i was told before that this is bc vanilla jokers have their info_vars hardcoded
well back to your original thing
you probably have to cast moddd jokers in a different way
because of how smods works
the issue is how which idk bcs i have not done anything of the sort

this still doesn't answer my question
Have you tried:```lua
local center = SMODS.shallow_copy(G.P_CENTERS.j_modprefix_key)
center.loc_vars = function() return {vars = vars} end
info_queue[#info_queue+1] = center
where would i put this
In the loc_vars
ok
i'll try it
omg
the vars aren't quite working but it's actually showing the description now
Code?
guys quick how do i remove the titloe screen card
G.title_top.cards[1]:remove()
so i just put that in my code right
on a semi-related note, anyone got np++ formatting for lovely patches? i found one a while back and it isn't compatible with my dark mode theme (the text has white bg)
is it lang(language) or lang("language")
actually where do i put that
it goes in a SMODS.Current_mod calculate function right
No.
if (_c.elle_upgrade) then
local t = G.P_CENTERS[_c.elle_upgrade.card] -- Upgrade target
local j = copy_table(G.P_CENTERS[_c.elle_upgrade.card].config.extra) -- OG Joker's vars
local u = _c.elle_upgrade.values and _c.elle_upgrade:values(card) or {} --
-- Upgrade variable stuff
for i,v in pairs(u) do
j[i] = v
end
local test = SMODS.shallow_copy(t)
test.loc_vars = function() return {vars = j} end
info_queue[#info_queue+1] = test
end```
then where
In a Game:main_menu hook.
oh ok
G.FUNCS.change_lang({config = {ref_table = G.LANGUAGES.key}})
.key being the language?
No, it would be the key.
but what is the key of a language?
or are you talking about the joker?
or my mod?
im so confused
so is this good code then
how do i get a joker's default loc_vars
you might want to run the original first just for safety
also from_debuff is unneccessary
yeah i removed that
ya then id just recommend putting the original beforehand and then i will not ignore the hook itself because its perfectly fine
which one is the original
like
local ret = ...
unless you have a unique reason to put code before the original code runs i would usually recommend putting it afterwards, especially if youre modifying the end result like what cards are on the main menu
so like this, or do I also have to move the return
... it didnt work 😢
crashed or just did nothing
crashed
oh
you need to keep self in the game_main_menu_ref
that's good, its just that from_debuff doesn't exist so it has no reason to be there
where self would go is empty
oh i need to add it ok
you had it earlier and i assum you removed it alongside the from_debuff part
it worked thanks man
card:generate_UIBox_ability_table(true)
since i'm still trying to get this working
A card or a fake card.
Yes.
how do i make a fake card?
SMODS.Center.create_fake_card(G.P_CENTERS.j_modprefix_key)
thanks
Is there a way to check when a card gets enhanced by any means?
how do i change/modify the name of the fake card?
if context.setting_ability and G.P_CENTERS[context.new].set == 'Enhanced'
You mean the localized name?
okay, sweet. tyvm!
yea
i wanna have it say, for example,, Upgrade - Hanging Chad
okay so i figured this out, but on obtaining the joker the game goes to the main menu, do you know how to fix that?
local upgrade_fake_card = SMODS.Center.create_fake_card(upgrade_center)
local upgrade_loc_vars = upgrade_fake_card:generate_UIBox_ability_table(true)```this is giving an error,, ,
Log?
upgrade_center is the G.P_CENTERS entry for the joker
where are the logs stored
or is it just the error
Yes, the crash log.
Card.generate_UIBox_ability_table(upgrade_fake_card, true)
ah ty
full code for ref
-- Upgrade support
if (_c.elle_upgrade) then
local upgrade_center = G.P_CENTERS[_c.elle_upgrade.card] -- Upgrade target
local upgrade_config = copy_table(upgrade_center.config) -- OG vars
local upgrade_vars = _c.elle_upgrade.values and _c.elle_upgrade:values(card) or {} --
-- Upgrade variable stuff
for i,v in pairs(upgrade_vars) do
upgrade_config.extra[i] = v
end
local upgrade_fake_card = SMODS.Center.create_fake_card(upgrade_center)
local upgrade_loc_vars = Card.generate_UIBox_ability_table(upgrade_fake_card, true)
local test = SMODS.shallow_copy(upgrade_center)
--test.config = function() return upgrade_config end -- commented so i can add it after
test.loc_vars = function() return {vars = upgrade_loc_vars} end
print(upgrade_vars)
info_queue[#info_queue+1] = test
end```
another question, can i check for the card being enhanced specifically?
Card.generate_UIBox_ability_table({ability = upgrade_config, config = {center = upgrade_center}}, true)
oh ty
context.other_card
still niling but not crashing anymore
if (_c.elle_upgrade) then
local upgrade_center = G.P_CENTERS[_c.elle_upgrade.card] -- Upgrade target
local upgrade_config = copy_table(upgrade_center.config) -- OG vars
local upgrade_vars = _c.elle_upgrade.values and _c.elle_upgrade:values(card) or {} --
-- Upgrade variable stuff
for i,v in pairs(upgrade_vars) do
upgrade_config.extra[i] = v
end
local upgrade_fake_card = SMODS.Center.create_fake_card(upgrade_center)
local upgrade_uibox = Card.generate_UIBox_ability_table({ability = upgrade_config, config = {center = upgrade_center}})
local test = SMODS.shallow_copy(upgrade_center)
test.loc_vars = function() return {vars = upgrade_uibox} end
print(upgrade_vars)
info_queue[#info_queue+1] = test
end```
Have you tried printing Card.generate_UIBox_ability_table({ability = upgrade_config, config = {center = test}}, true)?
Table:
badges: Table:
card_type: None
info: Table:
type: Table:
main: Table:
1: Table:
1: Table:
config: table: 0x2b9d52f0
+1 more value.
2: Table:
1: Table:
config: table: 0x2b7af798
+1 more value.
2: Table:
config: table: 0x2b7c2e00
+1 more value.
3: Table:
1: Table:
nodes: table: 0x2bfae1c0
+2 more values.
2: Table:
config: table: 0x2b4af738
+1 more value.
4: Table:
1: Table:
nodes: table: 0x2b9e85d8
+2 more values.
card_type: None
name: Table:
1: Table:
nodes: Table:
1: table: 0x2b832000
n: 4
config: Table:
align: m
box_colours: Table:```
oh wait should i tprint it
No, you should add true as the second argument for both calls of Card.generate_UIBox_ability_table
Code?
same as this but upgrade_uibox = Card.generate_UIBox_ability_table({ability = upgrade_config, config = {center = test}}, true) instead (and i changed the print ofc)
if u think it'd make things easier for u tho
if (_c.elle_upgrade) then
local upgrade_center = G.P_CENTERS[_c.elle_upgrade.card] -- Upgrade target
local upgrade_config = copy_table(upgrade_center.config) -- OG vars
local upgrade_vars = _c.elle_upgrade.values and _c.elle_upgrade:values(card) or {} --
-- Upgrade variable stuff
for i,v in pairs(upgrade_vars) do
upgrade_config.extra[i] = v
end
local upgrade_fake_card = SMODS.Center.create_fake_card(upgrade_center)
local test = SMODS.shallow_copy(upgrade_center)
local upgrade_uibox = Card.generate_UIBox_ability_table({ability = upgrade_config, config = {center = test}}, true)
test.loc_vars = function() return {vars = upgrade_uibox} end
print(upgrade_uibox)
info_queue[#info_queue+1] = test
end```
here :3
if (_c.elle_upgrade) then
local upgrade_center = SMODS.shallow_copy(G.P_CENTERS[_c.elle_upgrade.card]) -- Upgrade target
upgrade_center.config = copy_table(upgrade_center.config) -- OG vars
local upgrade_vars = _c.elle_upgrade.values and _c.elle_upgrade:values(card) or {}
-- Upgrade variable stuff
for k, v in pairs(upgrade_vars) do
upgrade_center.config.extra[k] = v
end
local upgrade_uibox = Card.generate_UIBox_ability_table({ability = upgrade_center.config, config = {center = upgrade_center}}, true)
upgrade_center.loc_vars = function() return {vars = upgrade_uibox} end
print(upgrade_uibox)
info_queue[#info_queue+1] = upgrade_center
end
```?
Hi friends! I have an idea that's a bit more simple but I'm still gonna need help with.
I know The Fool generates the last used planet/tarot card, and there's a direct function for that, but is there a specific way to gather the last consumable of any type?
Or would I have to set up a loop that constantly checks for it?
You could attach a calculate to your mod object, then set a global variable under G.GAME to the key of context.consumeable whilst checking for context.using_consumeable.
Could you walk me through it?
SMODS.current_mod.calculate = function(self, context)
if context.using_consumeable and context.consumeable then G.GAME.last_used_cons = context.consumeable.config.center.key end
end
I know if I want to modify the base code with a mod I use a lovely patch, I was able to create a new card area that I plan to do something with, but I seem to be having trouble manipulating the UI to shrink the run info and options buttons. I've been referencing other mods that manipulate the UI to see how it's done but no matter what I do, even if it's a simple color change just to sanity check, it doesn't work.
so where would i put this?
Anywhere outside of SMODS.Joker and what not.
could I put it in the main file?
Ye.
so how would I call this function as a joker effect?
per say, if I were to use if context.setting_blind then
you can replace center.key with center_key here (i think)
what's the difference?
you use _ instead of .
is there any functional difference or is it just visual?
not really
In a Joker,
if context.setting_blind then
if G.GAME.last_used_cons and G.P_CENTERS[G.GAME.last_used_cons] then
-- Assuming The Fool-like behaviour of giving last used consumable...
SMODS.add_card({key = G.GAME.last_used_cons})
end
end
you dont index the table center but , its not like indexing one table has a downside
im trying to do something pretty simple here but i am unfortunately struggling
so im basically trying to make ride the bus, but instead of resetting with scoring face cards it resets when an ace is discarded
this is the code:
loc_vars = function(self, info_queue, card)
return { vars = { card.ability.extra.mult_gain, card.ability.extra.mult } }
end,
calculate = function(self, card, context)
if context.discard and not context.blueprint then
--- ".discard" was originally ".before"
local aces = false
for _, playing_card in ipairs(context.discard) do
--- ".discard" was originally ".scoring_hand"
if playing_card:is_ace() then
aces = true
break
end
end
if aces then
local last_mult = card.ability.extra.mult
card.ability.extra.mult = 0
if last_mult > 0 then
return {
message = localize('k_reset')
}
end
else
card.ability.extra.mult = card.ability.extra.mult + card.ability.extra.mult_gain
end
end
if context.joker_main then
return {
mult = card.ability.extra.mult
}
end
end
}```
this is vanillaremade's ride the bus but with every mention of "face" and "faces" being replaced with "ace" and "aces"
I also replaced the context with context.discard
Surprisingly, just replacing every mention of "face" and "faces" with "ace" and "aces" makes it work, but replacing the context makes the joker just do nothing
Im not sure what would get this to work, i cant really find a good reference for this sorta thing
Card:is_ace() doesn't exist
also, please check the smods docs for calculate functions
context.discard is a boolean, so calling ipairs on it doesn't make sense
@lament agate
How do I change the weight of a consumable, the likelihood of it appearing in a booster pack
Is it just weight = [number]?
nvm i got it
I think it's soul_rate = [number],
how to check what blind is next, or all blinds
G.GAME.round_resets.blind_choices
tyyyyyyyyyyyyyyy
tomatoes shut the fuck up
if your consumable isn't hidden (i.e. like how soul and black hole work), then i don't think this does anything
and note that if you do decide to make it hidden, soul_rate is the probability that it replaces any given card in its booster packs, so it might not behave as expected. if it's common enough, it might appear multiple times in a single booster pack
to have non-hidden rarities, i think you'll need to set the consumabletype to have rarities in the first place and assign that rarity to the consumables
(maybe check how hotpot bottlecaps work?)
if you don't want whole rarities, then you'll probably have to do it in the booster's create_card function
augh
hotpot is a lot of code, and it might be a lot of jargon for me to understand if I do find it
yea it's not. a great resource
great mod, not good for referencing code lol
shoutouts to the whole file that's nothing but commented out ui code
Hey guys! Trying to get this to work again where the card destroys itself when you click on it and I cannot for the love of me figure out why this aint working
yeah never figured out how to make it exist
You don't.
I tried puttting it outside the joker script but it still doesn't work for me is it still in the joker?
see yahiamod/el wiwi
Is there a way to make create_card() create cards you already have in your tray as if showman were there
No, use SMODS.create_card and allow_duplicates = true
how do i make a new playing card
i dont mean smth like stone because afaik thats just a fancy enhancement
and is there a way to do special things when the new playing card is played like how enhancements do it without a enhancement
like, smth seperate from the rest of the regular cards
not supported without another mod
Took your advice on the yahimod and came up with some new code. How does this look?
@daring fern you mentioned the negative joker stuff in #⚙・modding-general i just wanted to move it over here
it probably has something to do with the calculate function but uh
calculate = function(self, card, context)
if context.joker_main and card.edition and card.edition.negative then
return {
xmult = card.ability.extra.xmult
}
end
end
}```
this is not working :(
Hi everyone , i was wondering how can i put like a joker in the deck on hand area , i tried to just change his cardarea but yeah it didn't work , any idea ?
whats the other mod...
hey guys uhhh i was tryna make the final file for a beta tester version of my mod
why are my decks doing this
also the backing is wrong on this
i love drawing placeholders 😭
rooms and doors elite ball knowledge
Elite ball knowledge
idk how ill implement the light sources
but i have charms and hiding spots planned out
speaking of charms.....
oh my GOD its so much easier to draw 120 on paper
does anyone know how can i make the player 'draw' a card?
or just check the top card of deck
SMODS.draw_cards(1)
G.deck.cards[#G.deck.cards]
tysm
is there a way to make a sound when a Tarot card (in this case the fool) is used? im really new to this
so im trying to make it so that it moves the scored cards around and for some reason it doesnt work??
i made a helper function to shuffle the table, but when i run it, nothing happens for some reason
do you have the sound defined yet?
yeah
defined as in like in the files of the game?
first define the sound
-- basic sound definition
SMODS.Sound{
key = "key", -- the key
path = "path" -- the path
pitch = 1 -- the pitch
}
leave pitch empty if you want it to be random
that sounds like a funny thing to do
okay so just include key and path
done
one of the questions i have is where should i place the code?
oh well i wanted to play when the fool is used
so i started to look into how to do it but i find it pretty confusing
okay lemme cook 👍
Oh thank you
SMODS.current_mod.calculate = function(self, context)
if context.using_consumeable and not context.blueprint and context.consumeable.config.center.key == 'c_fool' then
return {
sound = "your sound key"
}
end
end
end
i thiiink this should be right
do make sure to include your mod prefix before the key though
thanks
okay
im still a little confused as to where do i place this?
as of now i only have my notes app to well take notes
Okay i have this function I wanna hook to or patch, and end goal is adding an extra condition to desired track
yes this is like important that i do it this way
would patching or hooking be better here
patching right?
in this case patching would be better
yeah patching seems like the right choice
why is hooking or patching get_current_music not something that would work? but yeah patching would be better in this case
alright
update on this,
i got the cards to shuffle VISUALLY, but they still score in order of what you played it in, any help?
for i = 1, math.min(#G.hand.highlighted, card.ability.max_highlighted) do
local _card = G.hand.highlighted[i]
--local cardFound = false
while G.deck.cards[#G.deck.cards]:get_id() =! _card:get_id() then do <--- THIS IS LINE 143
G.E_MANAGER.add_event(Event({func = function()
G.deck.cards[#G.deck.cards]:remove()
end}))
end
G.E_MANAGER.add_event(Event({trigger = 'after', delay = 0.2,func = function() G.hand:unhighlight_all(); SMODS.draw_cards(1); return true end }))
end
end```
could anyone help me with this
ill send the error
You
12:44 pm, Nov 8, 2025
Oops! The game crashed:
[SMODS _ "src/loader.lua"]:571: [SMODS CONSP "ConsumablesPlus.lua"]:143: 'do' expected near '='
Additional Context:
Balatro Version: 1.0.1o-FULL
Modded Version: 1.0.0~BETA-1016c-STEAMODDED
LÖVE Version: 11.5.0
Lovely Version: 0.8.0
Platform: Windows
Steamodded Mods:
1: TwS EPOK testmid by ME [ID: CONSP, Version: 1.0.0]
2: Cryptid by MathIsFun_, Cryptid and Balatro Discords [ID: Cryptid, Priority: 114, Version: 0.5.13, Uses Lovely]
3: Debug Plus Plus by Jogla [ID: dpp, Version: 1.2.0, Uses Lovely]
4: Talisman by MathIsFun_, Mathguy24, jenwalter666, cg-223, lord.ruby [ID: Talisman, Version: 2.6, Uses Lovely]
5: Vocalatro by Aikoyori [ID: vocalatro, Version: 1.0.0, Uses Lovely]
6: DebugPlus by WilsontheWolf [ID: DebugPlus, Version: 1.5.1, Uses Lovely]
Lovely Mods:```
whats the code
i got it to work :)
awesome
only issue is that now it causes unscored cards to score...
That's a feature now
Honestly why not
real
wawa please help
also if ur in cold beans go away
||
[[patches]] # Teeny music
[patches.pattern]
target = 'functions/misc_functions.lua'
pattern = '''(G.GAME.blind and G.GAME.blind.boss and 'music5') or'''
position = "after"
payload = '''
(G.GAME.blind and G.GAME.blind.config.blind and G.GAME.blind.config.blind.colonparen_blindtype == "Teeny" and 'cbean_TeenyMusic') or
'''
match_indent = true
[[patches]] # CEO music
[patches.pattern]
target = 'functions/misc_functions.lua'
pattern = '''(G.GAME.blind and G.GAME.blind.boss and 'music5') or'''
position = "after"
payload = '''
(G.GAME.blind and G.GAME.blind.config.blind and G.GAME.blind.config.blind.colonparen_blindtype == "CEO" and 'cbean_CeoMusic') or
'''
match_indent = true```
||
thats a spoiler btw
when ever the music triggers it makes everything laggy?
either that or everything gets slown down
and takes shit tons of time to do
oh ive had that before
what my issue was
is that i loaded a long function everytime i wanted it to trigger
to fix it i moved the long function to my main and named it a value so it does the long load on start up
and then you can call the thing you want to trigger in a very minimalistic way
you should use toml instead of lua for formatting patches with discord
also changing music should be done in the select_music_track function of the SMODS.Sound, not with whatever this is
theres like 500 trillion errors in the dutch localization i thought
just look in the thread for it in #1207803392978853898 theres so much
yeah
hi im having a few issues the problem seems to be the end of the code? i tried to figure it out by myself but i got kinda stuck
can you send the code?
one end too many i think
yeah one end too many
assuming you just copy pasted
yeah
i was gonna fix it but then i got sidetracked
oh its okay dont worry
so i removed one before
lemme try removing 2
well this is new
did i mess something up?
yes you removed the end that you did actually need this time
oh
also is that notepad 🥀
yeah
get a code editor cro 🙏
?
fellow notepad coder 🔥
Asking again
the sound doesnt have your mod prefix
you need your mod prefix
THANKS
THAT WAS THE ISSUE
Yes
Ssss
Tysm
Okay.
Then do was added bc i didn't know what to do
Tysm again
how do you do localization of the decks?
j_mod_prefix_joker key
this is how you do jokers, what is the deck version?
figured it out
im sorry for confusing this before but mod prefix is the meta data from like who made the mod right? cause if it is then i have it outside the code file but i put it in there to check and it only made another issue i apologize if im being too confusing here and for not understanding a thing
i looked it up and thats what it said so i said i knew what it was so thats my bad
youre missing a ,
what
it should be path = "FollyLaugh.ogg",
OH
well this is just confusing now
i thought that was fixed?
do i add another end? im sorry for asking for help every 5 minutes
<@&1133519078540185692>
You need VSCode and the Lua language server, they'll highlight these issues for you. Looks like you're using just a simple text editor.
thank you
yeah i was just using the notes app
lemme check it out and see what it does
context.card.config.center.key == 'j_morne_egomaniac'
this is how im checking if a card is this joker
if context.buying_card and context.card.ability.set == 'Joker' and not context.card.config.center.key == 'j_morne_egomaniac' and not context.blueprint then
print(context.card.config.center.key)
card.ability.extra.active = false
card:juice_up(0.3, 0.3)
card_eval_status_text(card, 'extra', nil, nil, nil, {
message = 'What?!',
})
end
in context.buying_card am i referring to the wrong card here
im trying to nab the bought card to evaluate
think im using the not wrong
Yes, you should be using ~= also you should be returning.
ok yea i have no idea what i am trying to do with the freeze slot
true
key = "wheelbarrow",
config = { extra = { multvar = 1} },
loc_vars = function(self, info_queue, card)
local numerator, denominator = SMODS.get_probability_vars(card, 1, card.ability.extra.odds,
'vremade_wheelbarrow' .. G.GAME.round_resets.ante)
return { vars = { numerator, denominator }, card.ability.extra.mult }
end,
loc_txt = {
['name'] = 'Wheelbarrow',
['text'] = {
[1] = 'Gains {X:red,C:white}X0.5{} Mult per round',
[2] = '{C:green}1 of 2{} cards get drawn face down'
},
['unlock'] = {
[1] = ''
}
},
pos = {
x = 6,
y = 3
},
display_size = {
w = 71 * 1,
h = 95 * 1
},
cost = 4,
rarity = 2,
blueprint_compat = true,
eternal_compat = true,
perishable_compat = true,
unlocked = true,
discovered = false,
atlas = 'CustomJokers',
pools = { ["hatchet_hatchet_jokers"] = true },
calculate = function(self, blind, context)
if context.stay_flipped and context.to_area == G.hand and
SMODS.pseudorandom_probability(blind, 'vremade_wheelbarrow', 1, 2) then
return {
stay_flipped = true
}
end
if context.end_of_round and context.game_over == false and context.main_eval then
return {
func = function()
card.ability.extra.multvar = (card.ability.extra.multvar) + 0.5
return true
end
}
end
if context.cardarea == G.jokers and context.joker_main then
return {
Xmult = card.ability.extra.multvar
}
end
end
}```
it no work
it manages to draw 1/2 of all cards facedown
but if i play anything, ts comes up
because you use card in calculate when the argument is called blind
Does G.play return all cards played in a hand, regardless of whether or not they score?
yes
No, it's G.play.cards
What returns all scored cards in a hand?
context.scoring_hand usually
i dont think theres a context that happens during scoring where that doesnt exist
So, would context.destroy_card and context.cardarea == context.scoring_hand destroy scored cards?
in that case G.play is the scored card yes
context.cardarea == G.play I mean
it's kinda confusing because G play.cards has all cards but the context only considers scoring
But G.play only returns cards played, not cards scored!
Wait, does that specify scoring?
yes
What is Folly Laughing about
for not scored it's context.cardarea == "unscored"
That wasn't what I was looking for.
I know it isn't
I said G.play is for scored and told you "unscored" is for not scored to clarify
oh hm
someone told me beforehand i had to use blind instead of card
just change the blind to card
idk
that changes nothing 😭
lets try that again
ok it works
now all thats left for me to do is edit the text a tiny bit
where would i actually implement the card persistence and how would i spawn it in the card area since after the shop loading while a card is set, it seems to crash
you need a comma at the end of line 18
nvm now it just doesnt show up, but it doesnt crash as far as i can tell (except when i reload the save 😔 )
i dont know how but fireworks is broken
it was working and now its not
im acc losing my mind
slightly updated version, it still just shows up as "0"
how can i make negative numbers show up correctly during scoring in the mult and chips boxes?
You're returning card.ability.extra.n which is 0 in loc_vars
No, you change it to G.GAME.current_round.pokervar_hand
thank you
tomorrow is here,, 
iam making a localization patch but when i swap back to english my mod thingies stay in that language bubt the normal game doesnt that how do i fix that?
for example i swap it to french then change it back to english my modded jokers would stay in french
what is your patch exactly
well its not a patch
bad writing on my end
im just translating my own mod for a meme
so i've not touched the code since u wrote this and it's still only giving nil in the print
Does it print nil or nil, nil, nil?
wheelbarrow has a strange text glitch
it works fine, but the text doesnt update nor does it account for probability
@daring fern
What mods do you have installed?
- handy
- jen's lib
- nopeus
- debugplus
- my mod
card.ability.extra.mult is not in vars also the probability isn't using variables.
the probability in the description is hardcoded and the mult is not inside vars and has the wrong name
okay i've disabled everything except my mod & debugplus
and it's still happening
anyone know what the other mod specified here is
also dammit they were fancy enhancements
ok i've disabled every mod and it's still happening
Have you tried running upgrade_center.loc_vars instead of using Card:generate_UIBox_ability_table?
u mean printing?
No, doing upgrade_center:loc_vars({}, {ability = upgrade_center.config, config = {center = upgrade_center}}).vars instead of Card.generate_UIBox_ability_table({ability = upgrade_center.config, config = {center = upgrade_center}}, true)
like this?
-- Upgrade support
if (_c.elle_upgrade) then
local upgrade_center = SMODS.shallow_copy(G.P_CENTERS[_c.elle_upgrade.card]) -- Upgrade target
upgrade_center.config = copy_table(upgrade_center.config) -- OG vars
local upgrade_vars = _c.elle_upgrade.values and _c.elle_upgrade:values(card) or {}
-- Upgrade variable stuff
for k, v in pairs(upgrade_vars) do
upgrade_center.config.extra[k] = v
end
upgrade_center.loc_vars = function() return {vars = upgrade_vars} end
local upgrade_uibox = upgrade_center:loc_vars({}, {ability = upgrade_center.config, config = {center = upgrade_center}}) --Card.generate_UIBox_ability_table({ability = upgrade_center.config, config = {center = upgrade_center}}, true)
print(upgrade_uibox)
info_queue[#info_queue+1] = upgrade_center
end```
No, you need to add .vars to the end.
oh idk how i missed that in my copy-paste
thanks
-# prob bc lovely patches don't have the lua text formatting
it's just returning the vars table
since upgrade_center.loc_vars has no arguments
No, you need to keep the upgrade_center.loc_vars = function() return {vars = upgrade_uibox} end where it was.
ah ok
what does context.full_hand store exactly?
have you tried printing it?
i cant open balatro atm
it's printing a table of the correct values
the full played hand
its just G.play.cards effectively
all that's left is to put those vars in the info_queue thingy
SMODS.Back{
name = "Blind Deck",
key = "blinddeck",
pos = {x = 0, y = 4},
config = {},
loc_txt = {
name = "Blinds Deck",
text = {
"Makes you use Blind Cards."
}
},
apply = function()
G.E_MANAGER:add_event(Event({
func = function()
local total = #G.playing_cards
local half = math.floor(total / 2)
for i = 1, half do
local card = G.playing_cards[i]
card:set_ability(G.P_CENTERS.blinds_red)
end
for i = half + 1, total do
local card = G.playing_cards[i]
card:set_ability(G.P_CENTERS.blinds_blank)
end
return true
end
}))
end
}
trying to do this but it seems to not set the cards to the enhancements
the enhancements arent the issue i think
ok i got it working
Yes, you're missing the class prefix and mod prefix.
..?
card:set_ability(G.P_CENTERS.m_modprefix_blinds_red)
ahhh
how would i go about adding smtn to the name on this?
like,, changing it to Upgrade - Fallen Angel
when is context.individual true exactly? or is it not a Boolean?
it is a boolean
its used for effects on individual playing cards during scoring or at the end of round
well this is for my jokerblocks thingy, and idk what to name it (the 5th one from top)
is that good? ^
what's the info_queue center for Not Discovered?
i mean probably?
🤷
its difficult to generally name
man
instead of developing just another jokerforge you better develop dependencies manager idk
This is much more prefferable in current modding state
eh, whatever
how do i make an info_queue use Not Discovered if the given thingy isn't discovered?
how do i make a custom info_queue?
bunco's trying to use a shader incorrectly
well how do i fix that...
disable the mod
i misspoke: the mod's shader is just straight up coded wrong
maybe i installed it from the wrong place or something...
did you install it from github?
if so, was there a release you could've downloaded or did you just download the most recent commit
of course i install everything from github
Card.debuff checks if it is debuffed right?
oh yeah i usually just install the most recent commit...
that's prob why
if it isn't a release it's likely gonna be buggy as it's not meant for regular gameplay
yeah thats what i usually did when playtesting cardsauce
Yes.
is this how you "self destruct" a joker?
local idx = (function()
local my_pos = nil
for i = 1, #G.jokers.cards do
if G.jokers.cards[i] == card then
my_pos = i
return my_pos
break
end
end
end)()
if #G.jokers.cards > 0 and #G.jokers.cards <= idx then
SMODS.destroy_cards(G.jokers.cards[idx])
end
or would it work atleast
SMODS.destroy_cards(card)
if your goal is to destroy the joker when its the rightmost joker, and this code is in the relevant joker's calculate function, then yes that should work fine (although it's a little weird)
but also yea SMODS.destroy_cards(card) is clearer
breaking after returning isnt necessary btw
Yes, because it will crash.
info_queue[#info_queue+1] = {type = 'name_text', set = "Upgrade", key = _c.key, specific_vars = (_c.elle_upgrade.loc_vars and _c.elle_upgrade:loc_vars(card) or {}) }
why is only the name showing in the info_queue?
wheres the localization for what youre trying to localize
in my default.lua
no i mean like. show us that
also whats _c.key here
it's a patch into the function that handles info_queue stuff, that's the center
localthunk named the var, don't blame me 
i assume its the string "j_elle_sophie" in this case?
yea
type name_text is only the name?
the game pre-processes the localization so you can't just add a new localization table without hooking the respective functions
how would i do that?
also Upgrade is too generic anyway and might clash with other mods so I recommend not doing that
use the Other table instead of Upgrade and do { set = "Other", key = key, vars = vars}
oh dang are those your ocs??
yea
i love the purple one
🔥
yes it is?
its toml
oh
ohhhhhhhhhhh
ohhhhhhhhhhhhhhhhhhhhh
Lmfao
its meant to be like that
its meant to be patched in so other mods can do the thingy
select_music_track would work perfectly fine in this scenario
how do i get whether a joker's discovered?
Just check if its any of those in select_music_track
may you please show an example
are you able to make a joker unlock if you win a run on a certain stake or complete a number of challanges
win a run on certain stake can be found from vremade
just look for like plasma deck in back.lua
then look at the unlock condition
👍
card.config.center.discovered
Mmm yummy card
😋
if i use unlock_condition = { type = 'money', extra = X } would i need to patch it for talisman?
and would that only work for positive or at above conditions as im working on a joker that unlocks when you go into debt
hey chat how do you recreate the thing where consumables go to the center of the screen before they're used?
would i need to do something like an if statement like it talisman then or would the dummy function work
no
because that already checks if to_big exists
and only creates the dummy function if it doesnt
this up to the start_dissolve line recreates that
it says G.jokers because it's for jokers that can be used as consumables
okay thanks so if i just put it in the main or a preload file (like atlas) it should just be fine
yea
peak tysm
if card.area.config.collection
SHES SO CUTE???
ty
note that that doesnt work for stats screen
idea/theme is a loan shark but not fully sure what the effect should be
maybe takes part of your payout and gains chips?
should i include the minus part in the number?
how about this?
vol = 0.6,
pitch = 0.7,
key = "drop",
path = "music_Drop.ogg",
}``` how owuld i use selectmusictrack here if i want it to replace title screen music
here's what i was using it for
if i'm right, I just need a bare selectmusictrack right
select_music_track = function() return G.STAGE == G.STAGES.MAIN_MENU end
vol = 0.6,
pitch = 1.0,
key = "music_drop",
path = "music_Drop.ogg",
select_music_track = function()
return G.STAGE == G.STAGES.MAIN_MENU
end
}``` ok so now how do i sync it with my config options
return SMODS.Mods.modid.config.copyrighted_music.drop and G.STAGE == G.STAGES.MAIN_MENU
Can someone playtest my mod
sure i can do that
bumping this now that i've implemented everything else abt the feature
give me a moment
personal stuff real quick and i am going test out the mod fully
okay 🙂
Hook generate_card_ui and localize
It doesn't add too much, it's like 11 jokers and that's it
i'm already patching into generate_card_ui
all my code for this is in that patch
how would i get if ha hand has a level greater than one when played
Guess whos back to ask questions that have surely been asked before:
I've been stumped on how to destroy every card in the current hand before they score. context.destroy_card scores the cards first, what i dont want
if context.before then return {func = function() SMODS.destroy_cards(context.full_hand) end} end
local passed = false
for k, v in pairs(G.GAME.hands) do
if SMODS.is_poker_hand_visible(k) and v.level > G.GAME.hands[context.scoring_name].level then
passed = true
end
end
if passed then
end
@final valley well we are off to a good start
not jokerforge 💔
not sure if you forgot to fill out a field or something but there are several errors
how would i patch here?
let me delete detergent and see what the others do
Wait I forgot that that existed tysm <3
While im at questioning, how do i debuff/undebuff a joker on round start?
im gonna crtl+f it rq
multiline patch target?
you might have to escape the single quotes
@final valley yeah sorry there is bug upon bug
o i didn't know u could do that i'm not too familiar with patch stuff
what are you trying to accomplish
uh. ok
wow
eh i made it for fun anyways
is there an any_rank variable for enhancements or does it just not
why don't you just add it to the name
or do Upgrade - #1#
fair enough
joker is done out of the art which is fine since its in alpha
because it's directly using joker centers, not a custom info_queue type thingy
also somethingcom515 said to patch
chat how do i create a balatro ui slider like in the settings for audio
i dont like patching here personally, how are you doing the centers
-# Suspicously bumping this
create_slider iirc
thank you
No, I said to hook.
in a generate_card_ui patch
if (upgrade_center.discovered) then
upgrade_center.config = copy_table(upgrade_center.config) -- OG vars
local upgrade_vars = _c.elle_upgrade.values and _c.elle_upgrade:values(card) or {}
for k, v in pairs(upgrade_vars) do
upgrade_center.config.extra[k] = v
end
-- Use correct localization
local upgrade_loc_values = upgrade_center:loc_vars({}, {ability = upgrade_center.config, config = {center = upgrade_center}}).vars
upgrade_center.loc_vars = function() return {vars = upgrade_loc_values} end
else
upgrade_center = {set = "Other", key = "elle_upgr_not_discovered"}
end
info_queue[#info_queue+1] = upgrade_center```
how do you change the error text to something custom from your mod?
so,, how do i hook localize? i've only hooked functions that have a self argument
was searching the channel's message history for any insight on suits having custom effects and saw this as a similar idea, was curious as to how you implemented it? Since suits don't have calculate functions im wondering if its something i have to write a patch for
Hook eval_card
Practically like any other hook. Just make sure you include all of the arguments fromt he original func
idk how to do that i've not rly done much hook stuff 😭
nvmd i think i got it
Here's an example
yea i think i've got it lol
nice
how do i tell the hook when it should do it?
(when it's handling the name of the upgrade preview)
got a nice little proof of concept going here
development going pretty well on super paper balatro :D
oh oops should've thrown this in the other modding channel - mb
There any way to hook context.selling_card, to know when a card is being sold without having to have that ability dependent on a held card?
No, because you can only hook functions, but yes, use the mod calculate.
You're saying I can hook calculate?
No, SMODS.current_mod.calculate
okay so the localize hook isn't working out for me
i can't figure out how to add a check
bc all i can access is the ui tables
Trying to look around for that, but I can't find a calculate() function within src/utils.lua.
Here's what I'm asking for: I want to keep a table of every consumable card sold in the current run.
Yes, you need to define it yourself.
don't know why this is not triggering on hands with a spade in them
(context is, i'm making a joker that "builds up" tarot cards when a hand is played without a spade, then gives the stored tarots when a hand with a spade is played)
calculate = function(self, card, context)
if context.joker_main and card.edition and card.edition.negative then
return {
xmult = card.ability.extra.xmult
}
end
end
}```
does card.edition.negative work here?
i was told to use it but this is not triggering
i know this is irrelevant but i swear that i recognise you from somewhere
oh actually i don't think card.edition.negative works
maybe try card.edition.key = "e_negative"
No, it does.
oh
What is the full joker code?
key = "senel",
path = 'jokers.png',
px = 71,
py = 95,
})
SMODS.Joker {
key = "senel",
loc_txt = { name = 'Senel',
text = { 'X5 Mult',
'if this Joker is',
'Negative'}
},
pos = { x = 2, y = 2 },
atlas = 'senel',
blueprint_compat = true,
rarity = 1,
cost = 5,
config = { extra = { xmult = 5 } },
calculate = function(self, card, context)
if context.joker_main and card.edition and card.edition.negative then
return {
xmult = card.ability.extra.xmult
}
end
end
}```
ive been around (and constantly asking for help because i cant code to save my life)
also yes i know i haven't added the colors to the text yet im doing that after i get it working
Actually, you were right! i needed to replace card.edition.negative with card.edition.key == "e_negative"
thank you so much for the help
How does one force a font to everything?
In Balatro's functions/misc_functions.lua, there's a set_consumable_usage() function that kicks in when a consumable card is used; d'you know of anything similar for selling such a card?
Idk man
have you ever heard of a lovely patch
fuck off george 😭
maybe you could lovely patch it out
best guess is to patch the smods localize_box function?
unless u mean
literally everything
like the ui fonts
which file
Have you ever heard of a lovely patch? Maybe you could lovely patch it out?
heres an example
[manifest]
version = "0.0.8"
priority = 0
dump_lua = true
[[patches]]
[patches.pattern]
target = "functions/UI_definitions.lua"
pattern = '''
{n=G.UIT.R, config={align = "cm", id = 'row_round'}, nodes={
{n=G.UIT.C, config={align = "cm"}, nodes=contents.buttons},
{n=G.UIT.C, config={align = "cm"}, nodes=contents.round}
}},
'''
position = "after"
payload = '''
{n=G.UIT.R, config={align = "cm", id = "row_thaumaturgy"}, nodes = {
{n=G.UIT.C, config={align = "cm", padding = 0.05, minw = 1.45, minh = 0.55, colour = temp_col, emboss = 0.05, r = 0.1, detailed_tooltip = {set = "Other", key = not G.GAME.mul_thaumaturgy_energy_rate or G.GAME.mul_thaumaturgy_energy_rate >= 0 and "mul_thaumaturgy_desc" or "mul_thaumaturgy_desc_alt"}}, nodes={
{n=G.UIT.R, config={align = "cm", padding = 0.05}, nodes={
{n=G.UIT.T, config={text = localize('k_mul_thaumaturgy_energy') .. ":", minh = 0.33, scale = 0.85*scale, colour = G.C.UI.TEXT_LIGHT, shadow = true}},
{n=G.UIT.C, config={minw = 0.05}},
{n=G.UIT.C, config={align = "cm", r = 0.1, minw = 1.2, colour = temp_col2, id = 'col_thaumaturgy_text'}, nodes={
{n=G.UIT.O, config={object = DynaText({string = "+", colours = {Multiverse.TRANSMUTED_GRADIENT}, shadow = true, scale = 1.4*scale, text_effect = "mul_rotate", font = SMODS.Fonts["mul_thaum_icon"], y_offset = -10})}},
{n=G.UIT.B, config={h=0.08,w=0.08}},
{n=G.UIT.O, config={object = DynaText({string = {{ref_table = G.GAME, ref_value = 'mul_thaumaturgy_energy'}}, colours = {Multiverse.TRANSMUTED_GRADIENT},shadow = true, scale = 1.4*scale}),id = 'thaumaturgy_UI_count'}},
}},
}},
}},
}},
'''
match_indent = true
times = 1
wait I could change G.LANG.font
final question how do I make balatro a crypto miner
😭
/srs
Have you ever heard of a lovely patch? Maybe you could lovely patch crypto mining in?
maybe you should povely latch
SMODS.current_mod.calculate = function(self, context)
if context.selling_card then
-- Code
end
end
step 1:
make crypto mining program
step 2:
force game to install mining program when desired
step 3:
force game to execute said program
step 4:
profit???
ahh
or you could just lovely patch it
joker idea, 5x mult but you are
||crypto mining||
dont leak our cold beans ideas
yeah
not really sold on "5x mult but pc resource hog" tbh
shhh
gotta be more than that xP
That won't work for my purpose, I want this to take place regardless of what card's being used. Like how The Ox keeps track of the most-played hand.
but it makes me money
crypto minin
yeah $0.02/hr
No, that's what it does.
per player
and actually it just installs a virus
besides i dont think people would be comfortable installing a mod that could potentially install crypto miners
hotpot is crazy but its not the kinda crazy to install malware
so if 50 download that's 20 cents an hour constantly among the 5 of us
we won't tell em
shhh
that doesnt make it any better
its a feature
also the fact that you are implying that this is to make profit makes this less ethical
Do I need to hook that or patch it or can I plop it in my utility/functions.lua file as is?
we're not going to do it
i think
well its a joker ur doing it to yourself 
well
ur still deceiving unsuspecting users
nah just retroactive across the whole mod
new joker: x0.5 mult but removes viruses from your comoputer
cleaner
McAfee joker:
mcafee is this
Any pointers for me?
no hooks or patches needed
whats the goal
mod calculate is essentially just "what if your mod was a joker that was always there"
My goal is keeping a table of every consumable card that's been sold in the current run.
it doesnt have access to a couple things (like context.joker_main) though
no lovely patches?
uuuh how do I change font of everything
cuz i havent gotten it work
please dear god make the pain of font setting stop
Earth to @rocky plaza?
im trying to figure out a good way to check if an arbitrary card is a consumable
Say, if it has a use() function?
maybe
card.ability.consumeable
thats what vanilla uses
So, would if context.selling_card and card.ability.consumeable suffice?
if context.selling_card and context.card.ability.consumeable
Anyone know how to check for a specific tarot being used?
I know you can do context.consumeable.ability.set == "Tarot" to check if a tarot is being used but I want to check a specific tarot
No, it's consumeable not consumable
context.consumeable.config.center.key
ah
spelling is very important lmao
Could I also use that to get the ID of the card being sold?
yes
that would be the key of the consumable being sold
and if u store it in a table
you could recreate a consumable from a randomly selected key
which line is the line where the issue is coming from
I did something similar for another Joker of mine (which I've since upgraded to Legendary).
second-to-last
G.shared_stickers[self.key]:draw_shader('dissolve',0, nil, nil, self.children.center,scale_mod, rotate_mod,nil, 0.1 + 0.03*math.sin(1.8*G.TIMERS.REAL),nil, 0.6)
``` this one
context.consumeable.config.center.key == "sun" should check for if the sun tarot is being used no?
if context.using_consumeable and not context.blueprint and context.consumeable.config.center.key == "sun"
Try c_sun, I think that's what it's stored as.
Gotcha
yeah "c_sun"
Is there a place with those documented?
consumables always have "c_" before them
I run into issues sometimes with figuring out the names for things stored in the game
I use this a lot but where does it have those kinds of names?
It has the keys but I think I might just need to keep stuff in mind like consumeables having c_ before them
the keys yeah
this is probably a common question but
how do you fill in that empty box?
how are you adding the empty box
you need to define the infobox in descriptions -> other -> name_of_infobox
in localization
i think it was automatically created because i created a tag called cloned tag
and thats localization for the tag and not the joker that mentions it right
how does your loc_vars function look like
how do you check if a joker has a stake sticker in the collection? is it like regular stickers, with something like "joker.ability.gold"?
instead of joker.ability.perishable
would reccomend seeing how the game sets these upon beating a run
was hoping there was smods documentation, but i suppose that's fair
wait no i see it how i made it duh
info_queue[#info_queue + 1] = { key = 'tag_cloned', set = 'Tag' }
local numerator, denominator = SMODS.get_probability_vars(card, 1, card.ability.extra.odds, 'cl_baron')
return { vars = { numerator, denominator } }```
i made it with info_queue
Thanks, absolutely perfect
the tag key is missing your mod's prefix
tag_prefix_cloned
i fear i am simply never right with these sorts of things
welp. time to start looking
joker.sticker_run it seems
or get_joker_win_sticker(joker.config.center)
thank you
info_queue[#info_queue + 1] = { key = 'tag_cl_cloned', set = 'Tag' }
local numerator, denominator = SMODS.get_probability_vars(card, 1, card.ability.extra.odds, 'cl_baron')
return { vars = { numerator, denominator } }
end,```
gosh darn it, that box still is empty
is that your prefix
if it is you should change it to something more unique anyway
i mean yeah maybe
this is how i do it in my mod btw
https://github.com/nh6574/JoyousSpring/blob/0a5c0f6951f7f3073acb7f06ee1fafed950eef16/src/jokers/01Dragonmaid.lua#L165
is there a way to put a hash # in a name or description without it getting eaten by the parser
wait why would a # in a mod name get eaten by the parser
not a mod name, the name/description of a card
it'd get eaten by the parser because localization lets you do #1# to have variables
Trying to make effects that only work on scored cards by using stuff like context.scoring_hand but it still affects cards that are debuffed, is there a way around that
yeah that did not help either D:
Figured it out nvm
if not scored_card.debuff checks for if its debuffed
to be hyper hyper specific
this first image is my code for the cloned tag
this second image is for the joker that creates it
its probably something obvious since i started modding and coding like last week
wait you can use loc vars in a joker's name?
info_queue[#info_queue + 1] = G.P_TAGS.tag_cl_cloned
pretty sure, yea
good news! the text box is no longer empty
bad news! the text box is no longer there
this is hell and steammodded is my tormentor
if it helps i should point out most of the Baron code here is just from VanillaRemade's Diet Cola
the only thing i changed was the condition, added probability, and changed what tag it summoned
which is why it was originally just tag_cloned
Why does my pattern not work when it's more than a single line?
[patches.pattern]
target = "localization/en-us.lua"
pattern = '''
j_egg={
name="Egg",
text={
"Gains {C:money}$#1#{} of",
"{C:attention}sell value{} at",
"end of round",
},
},
'''
position = 'at'
payload = '''
j_egg={
name="Egg",
text={
"{C:dark_edition}Egg{}"
},
},
'''
match_indent = true ```
might be due to the way variables are being searched
havent looked into the code but i assume it probably goes "if #, look at next character, if not digit, then move on" and the # is unintentionally discarded
oh also the game crashes whenever Baron tries to summon the tag
it says theres a nil value somewhere in here but not anywhere specific
im sorry one of my characters is named Baron he has nothing to do with mr. kings held in hand gives x1.5 mult
how do i retrigger adjacent cards in a enhancement
mod calculate maybe?
yeah but how do i retrigger the cards
i cant find anything to retrigger cards
calculate = function(self, card, context)
local other_joker = nil
for i = 1, #G.hand.cards do
if G.hand.cards[i] == card then other_joker = G.hand.cards[i + 1] end
end
return SMODS.blueprint_effect(card, other_joker, context)
end``` doesnt seem to work
config = { extra = {real_ante = 0}},
loc_vars = function(self, info_queue, card)
return { vars = { card.ability.extra.real_ante } }
end,
calculate = function(self, card, context)
if G.GAME.round_resets.ante >= G.GAME.win_ante and context.ante_end and context.main_eval and not context.blueprint then
card.ability.extra.real_ante = G.GAME.round_resets.ante - (G.GAME.win_ante - 1)
ease_ante(-card.ability.extra.real_ante)
G.GAME.round_resets.blind_ante = G.GAME.round_resets.blind_ante or G.GAME.round_resets.ante
G.GAME.round_resets.blind_ante = G.GAME.round_resets.blind_ante - card.ability.extra.real_ante
end
end
trying to make my joker to always go back to the ante before the winning ante (for exemple, if the winning Ante is 8, you'll always be set back to Ante 7 if you try getting past Ante 8)
but right now my code just..crash the game, no error message, just crash, what did i do wrong ?
it's context.repetition and repetitions that is equal to how many you want for example repetitions = card.ability.extra.retriggers
blueprint doesn't work for scoring cards just jokers
You can’t patch localization files
did you ever get this figured out? I'm having some trouble with this as well
uhh, maybe, i havent modded in a bit so i dont exactly remember what my issue was
could you explain what your having trouble with?
so it would be 1 here?
this is the code, I'm trying to make a joker who creates a custom tag
however i cannot get it to properly get that custom tag, it crashes instead
well if you want it to retrigger once, yeah
the popup box is also empty, which makes me believe they are both issues with G.P_TAGS.tag_cl_cloned
i remember now, let me go check the code i used for that
to clarify the tags key is "cloned" and the prefix is "cl"
terraria is the prefix, the tag is lesserMult
info_queue[#info_queue+1] = {key = 'tag_cl_cloned', set = 'Tag'
end,```
that should work for you
Bumping this again
but what do i return in the calculate func
just to be sure, what you want is your playing cards to retrigger right ?
all cards no matter what ?
yes
and just once ?
why you state other_joker then
stealing code from vremade blueprint
it unfortunately did not :(
thank you so much for helping though
for rettrigering playing cards, you should have checked seizer andhanging chad too
ive never seen those two jokers
but anyway
if context.repetition and context.cardarea == G.play then
if other_joker then
return { message = localize("k_again_ex"), repetitions = 1}
end
end
something like that should do the work, but blue print here won't do anything
dang, i hope you can figure it out tho
my suggestion would be to look at how another mod does it and try to replicate that
wait wouldnt this just retrigger every card played
ive been given a few, they all seem to do it differently
i shall continue that hunt though
that's why i set other_joker
but i think there's a way to properly does this
just gave you most of what i knew
that just retriggers every card played if theres a card to the right of it
oh yeah i might be wrong on that
i think you still gotta experiment about it cuz i'm not sure you can exactly retrigger adjacent jokers
but the code i shared should help a bit
agh
calculate = function(self, card, context)
if context.joker_main then
local random_edition = poll_edition("modprefix_seed", nil, true, true)
SMODS.add_card { set = "pr_food", area = "G.jokers", edition = random_edition }
end
end
what i'm doing wrong ?
SMODS.ObjectType({
key = "pr_food",
default = "j_ice_cream",
cards = {
j_gros_michel = true,
j_egg = true,
j_ice_cream = true,
j_cavendish = true,
j_turtle_bean = true,
j_diet_cola = true,
j_popcorn = true,
j_ramen = true,
j_selzer = true,
},
inject = function(self)
SMODS.ObjectType.inject(self)
-- insert base game food jokers
end,
})
i've set everything
to be honest with the wording "anyway" i thought you were just commenting on something unrelated and being mean
i deeply apologize for that assumption the problem was, in fact, my prefix
uh
is it normal for enhancement calculate functions to be ran when cards are being added to the hand
because my enhancement is dying because the calculate function that retriggers them are being ran before one of the cards are there and dying
and if so how do i make it only run when the card is played and not when its being added into the hand at the start of a blind
nvm i needed if context.cardarea ~= G.play then return end
okay so apparently area = "G.jokers" was the issue..
repetitions
like specifically adjacent cards to another card
im trying to make a enhancement that retriggers adjacent cards
okay wait retrigger a playing card from a playing card?
yeah
first you gotta get the index of the playing card within whatever area its supposed to target (I presume G.play)
yeah
So have you done that
ive done it
and then gotten the indecies of the adjacent ones?
yeah
ive got lua calculate = function(self, card, context) if context.cardarea ~= G.play then return end local card2 = nil local card1 = nil for i = 1, #G.hand.cards do if G.hand.cards[i] == card then card1 = G.hand.cards[i + 1] end if G.hand.cards[i] == card then card2 = G.hand.cards[i - 1] end end end so far
uh I can't be bothered doing it rn but like check how jokers do it idk
i removed the other failed attempts to retrigger the cards cause it either crashed or did nothin
ive tried checking how jokers do it but from what i can gleam none of them have anything to retrigger a specific playing card
they all retrigger every card
well what they do is that when a playing card is scored, they find its index and check if its e.g. the rightmost or the 2nd card before then returning repetitions iirc
pretty sure what you are saying is about blueprint
i havent found any jokers that retrigger specific playing cards
the only ones i can find retrigger EVERY card played
modded ones
i dont know any mods that have jokers that retrigger cards
vanillaremade hanging chad
real
fuck me
rahh
my dumbass forgot how hanging chad works
actually no
i win
vremade technically isnt a mod
vremade is a mod
technically not
it adds nothing new
technically not a mod
it doesnt modify anything
everything stays the same
no it modifies the game
the noble context.other_card:
not working
no it doesnt it adds a second copy of everything in vanilla
depends on the kind of wobbly youre talkin
https://github.com/Steamodded/smods/wiki/Text-Styling#text-motion-modifier-e
if you want something from vanilla, here are the three kinds of moving text it uses
Faster E:1
If it means patching forget it, it's a one time thing, so I wouldn't care
can you use calculate functions outside of smods objects? I'd like to add a mechanic that only works in certain contexts
SMODS.DynaTextEffect
not really any documentation on it outside of the PR for it i think
hi eris :3
