#💻・modding-dev
1 messages · Page 386 of 1
ok so interestingly negative playing cards don't show in the deck
is that... normal or
erm actually its n'
no
Can someone help me with this please?
how does your json look
"id": "GaffMod",
"name": "GaffMod",
"display_name": "GaffMod",
"author": ["CallOn84"],
"description": "Adds five consumables inspired by gaff cards and decks used for magic tricks",
"prefix": "gaff",
"main_file": "GaffMod.lua",
"priority": 0,
"badge_colour": "F4A6C7",
"version": "0.0.1",
"dependencies": ["Steamodded (>1.0.0~ALPHA-1319c-STEAMODDED)"]
}```
strange, might be an issue specific to me, what i'm running, i guess
no idea, looks fine
It still only triggers the spade part when using smeared joker
can i see how the code looks now
yeah i edited it after but your variable is extra.Xmult not xmult
Gotcha
It was the dependancies
oh does it not do >?
yeah. when I did >=, it worked, but it then said I had missing dependancies
does anyone know why my mod folder doesnt show up in game (other mods will work, just not mine)
not without more info
what's the standard hand size? 
8
does using G.hand:change_size() not revert after the end of the blind? 
no

is there a placeholder image for assets?
most smods objects use the default atlas for their type
How would I go about having a joker swap places with another card. Like moving 1 slot to the left or right?
are there any good tutorials on making jokers/consumables
theres an example mod on steam modded that goes through it, other than that I've been scraping by by looking at other code 😭
I recommend VanillaRemade over ExampleMod
https://github.com/nh6574/VanillaRemade/tree/main
not made by the smods folks but made by people that know what they're doing
and much more thorough
the keyboard controller mod from example mod is a good example for learning how to do configs tho
:p
aesome!
is there a set u need to put in for create card if a consumable makes a playing card or nil
I think you don't use create card for playing cards
I think there's another function for that, create_playing_card maybe? Should be on the wiki
im having way too much trouble with making a single joker
This is normal lol
What's going on
Many code ive tried just doesnt do anything within the mod
Does your mod show up in the mods menu?
yeah
Does your joker show up
no
Can you show your code
yeah hold on a sec
the function hasnt been coded, but it doesnt show up anyway
i followed this tutorial https://www.youtube.com/watch?v=Zp-4U5TlbxY&t=314s&ab_channel=artmuncher
STEAMODDED 1.0.0
A tutorial on how to make a modded Joker.
https://github.com/art-muncher/Example-Mod -- EXAMPLE MOD
https://github.com/Steamopollys/Steamodded -- STEAMODDED
https://github.com/WilsontheWolf/DebugPlus -- DEBUGPLUS
-----------------------------------------------------...
And it doesn't even show up in the collection?
no
It's strange that your mod is being detected but your joker isn't
Did you set up a metadata file or did you use a mod header
uh
you used parentheses for defining the atlas
not brackets
thats maybe tje issue
since i dont know what those are
Yeah they're not even using the atlas so that shouldn't be the main issue
it's a little hacky but it works™️
maybe bcuz it doesnt use atlas and doesnt have any sprite to use from>
what is this for?
How do I get a table of my played hands?
generic hover-tooltips
(is what I'm using it for, but it also works for the side-tooltips on card hovers)
mm i see
nah it'll default to the vanilla atlas
whats the difference between just using info_queue and that tho
so it will just use jimbo?
info_queue doesn't work on decks 
yeah if no atlas or pos is defined
fair
(i was using The Head tooltip for testing, ill make a proper testing screen soontm)
yeah but for custom hover tooltips you'd need to do some weird stuff to get it working
this just standardizes it a bit
i see
create a translation key -> add translation to P_CENTERS or P_TAGS -> use tooltip
so would i use this and then my joker code?
the json method would just be its own file
#G.jokers.cards is howmany jokers you own right
yes
what does conflicts do
basically a list of mods that your mod does not enjoy being around and will cause crashes
has anyone here added their own ambient sounds before or do i need to figure this out myself
you don't need to worry about that
mods that your mod depends on to run
local random_trig = math.random(1,(#G.jokers.cards))
local ret = SMODS.blueprint_effect(card, G.jokers.cards[random_trig], context)
if ret then
ret.colour = G.C.RED
end
return ret
end```
does this work
wait wtf
don't use math.random
main menu -> continue run strat goes so hard tho
use one of the pseudorandom methods
pseudorandom("seed", 1, #G.jokers.cards)
is what you want to use
or you can just use pseudorandom_element to pick a random joker instead, actually
pseudorandom_element(G.jokers.cards) ?
uHHH when the hell do I add to G.ARGS.ambient_sounds
pseudorandom_element(jokers, pseudoseed('seed')) this right
how would I increase the rank of all the cards played before they score
would i still use the SMODS wiki for jokers
the SMODS wiki is the best resource that exists
I really don't want to write a lovely patch just to add goddamn sound effects egh
alriguty
it's just VanillaRemade that I suggest
and honestly that's not necessarily a replacement of any of the smods stuff, it's just a very helpful additional resource
it's also literally listed on the smods wiki
pseudorandom("seed", 1, #G.jokers.cards) has a chance to trigger itself right
oh whoa I hadn't seen that link
how do i make it ignores itself
.
use a repeat until loop to make sure the chosen joker isn't itself
still having trouble finding how u create a playing card for a consumable how do you use create_playing_card?
so check if it triggers itself then just loop until it doesnt
man i have no idea what any of this means, i hate being new
you will get there
Note to any future person that wants to add their own ambient sound:
SMODS.Sound {
key = "ambient_whatever",
path = "ambient_whatever.wav",
}
local _modulate_sound = modulate_sound
function modulate_sound(dt)
_modulate_sound(dt)
G.ARGS.ambient_sounds.MODRPEFIX_KEY = {
volfunc = function(_prevvolume)
-- calculate volume of sound for frame and return here
return 0
end,
}
end
okay FUCK this plays the ambient for a frame when the game first launches maybe you do need to lovely patch
wheres the part in the SMODS.joker where it like does the sprites and functions
cant din it
atlas and pos are for sprites, calculate is for joker effects
all the important stuff about the calculate function is here, but it's really hard to understand, so this is where I recommend looking at VanillaRemade to understand how to write a calculate function
https://github.com/Steamodded/smods/wiki/Calculate-Functions
Is it actually called MODRPEFIX?
no that's supposed to be a placeholder
Ah
SMODS loads your audio files and names it MODPREFIX_KEY so there's no conflict
Mhm
so how would i put these in or use them
you did already
Does anyone know how I can get a table of all played cards this round?
Final question before i sleep - how do I make the joker even show up in the game
Sorry, I meant scoring cards mb
you would probably have to manually track every played card
well in theory it should, which is why I'm confused
Like, the played hand at the given moment
nvm, figured it out
i have an enhancement that has a 1 in 5 chance to create a random consumable. before it worked and added the consumable fine, but it did it immediately when the hand is scored. how could i make the consumables only appear when the specific card containing the enhancement is scored? context.other_card == card doesn't work and neither does this variable-based system
it doesnt print anything at all, even when the glass cards break
you probably need to use an event to get the timing right
all the calculate code is run instantaneously when you press play, everything that happens afterwards is the result of events that were queued up during the calculation
funnily enough i cant even seem to find this patch anywhere
oh wait nvm, thats grim
hm
so theres nothign else taking ownership of the glass cards, and nothing patching glass cards right now
i wonder why it doesnt work
OH
its fucking m_glass, not glass right??
yup lol
I don't think you need the prefix for take_ownership
this worked almost perfectly 🔥 just gotta fiddle with the delay, ty
i tried changing this to both m_glass and keeping it at glass, still no prints
although the cards got destroyed
weird
and neither print statement is run?
mhm
no other mod is taking ownership?
...well crap, should have accounted for that
how do i check if the glass cards are destroyed by their own effects then
sob
does "glass" and "m_glass" both work actually
isn't there a way to call the previous calculate with take_ownership
i just noticed that
there should be at least
dunno, i only know that take_ownership completely overrides stuff
question, does it significantly affect the design if you wrote the effect to be when a glass card is destroyed in general vs. specifically when it destroys itself?
maybe if you do local prev_calc = G.P_CENTERS.m_glass.calculate
oh or you could just hook it yeah
i want to encourage breaking glass cards from playing them specifically (since theres too many effects preventing that instead), being able to use other destroy effects like the hanged man and immolate would kind of ruin what im going for
is it something like this
that looks right to me
although you probably want to call hookTo first and check its return table
oh, makes sense
cause the return table will containremove = true if it's destroying itself
mmm thanks, let me try
turns out the game does not like storing inside cards inside jokers
do you mean specifically saving and reloading a run
that worked, thanks
cause yeah it won't serialize tables inside of card.ability.extra
try saving a function
it does?
it doesn't do the recursive ones
the last time I tried I got MANUAL_REPLACE all over my joker
I ran into issues saving a reference to a card
wait actually how the hell is this becoming recursive
I also get stack overflow errors when I copy it
cards are recursive
yeah
is there a way to get the relevant consumable in context.using_consumeable
(gif of the crying emoji with two arms raised distingerating in an explosion)
im pretty sure it's context.consumeable but check the docs
if context.using_consumeable then
{
cardarea = G.jokers, -- G.hand, (G.deck and G.discard optionally enabled)
using_consumeable = true,
consumeable = card, -- the consumable being used
area = G.consumeables, -- the area the card was used from (could be G.shop_jokers, G.pack_cards)
}
the wiki is your friend'
in my defense the wiki is sometimes unclear so its not my first choicce
here's how I dealt with storing playing cards in a joker
https://github.com/chaseoqueso/Powerful_Balatro/blob/master/jokers/frog.lua
ughh is there a good way to hold a reference to a joker inside a joker
fun fact: context.area will be G.jokers if you use a Pendulum in JoyousSpring(tm)
excuse me
oh you're tryng to do jokers
no save them to a cardarea
I did that too sort of
https://github.com/chaseoqueso/Powerful_Balatro/blob/master/jokers/lich.lua
without a cardarea
(though maybe a cardarea would've been easier than what I did)
(cause what I did was wack)
did u try to win the game not in STATE.SELECTING_HAND?
the game was at the payout screen, i reloaded the run at that timing
it created two payout uis
i had that happen when i have like 200 cards on my hand
and uhh that
I want the cards to know who's storing who so I still need some way for them to reference each other
probably just use my GUID method then
that's what I did in the link I sent you
G.microwave_area1 = CardArea(...)
card.ability.extra.area = "1"
G["microwave_area"..card.ability.extra.area]:emplace(other_card)
Bringing this back down again because I've made absolutely no progress 
im pretty sure this works
local thunk = G.jokers.cards[1]
G.jokers.cards[1] = G.jokers.cards[2]
G.jokers.cards[2] = thunk
thunk
The number being where the joker is?
OMG thank you y'all are life savers 😭
sort_id kinda counts
thats what i did for photocopier to save the adjacent jokers
though normally theyre just used for pinned jokers
is there a way to make a mod display a custom crash message if it gets a specific crash
assert(function_that_crashes(), "error message")?
my mod needs a very specific version of smods and if you dont have it it gives this
and everyone who gets this keeps reporting it
so i wanna make it actually tell them what to do
you can also set a dependency for a version of smods or the mod doesn't load
why cant you just change dependency in the json file
i didnt think about that
though
oops wrong channel
this version of smods it needs isnt in smods main branch at all
its a modified version containing a pull request that still hasnt been merged
oh, aiko's font addition right
yeah
i would recommend having a dev branch in your mod for those cases
i really really wish they would merge it
so you can have a version for normal smods and a version for experimental
iirc flowwey was working on it
because it needed some changes
ah
but idk im waiting for it to get merged to do my changes for it
mhm
it just would not sit right with me omitting the fonts until its merged yknow
since its like
a MAJOR thematic design in my mod
local my_pos = nil
local random_trig
for i = 1, #G.jokers.cards do
if G.jokers.cards[i] == card then
my_pos = i
break
end
end
repeat
random_trig = pseudorandom("seed", 1, #G.jokers.cards)
until random_trig ~= my_pos
local ret = SMODS.blueprint_effect(card, G.jokers.cards[random_trig], context)
if ret then
ret.colour = G.C.RED
end
return ret
end```
is there a way to prevent infinite loop
package it with ur mod then
it happens when theres no target to retrigger since it cant retrigger itself
this is not too efficient
that's what I'm currently doing
tried implementing it in lovely patches but that was way beyond my abilities
calculate = function(self, card, context)
local valid_jokers = {}
for _,v in ipairs(G.jokers.cards) do
if v ~= card then valid_jokers[#valid_jokers + 1] end
end
if #valid_jokers > 0 then
local rad_joker = pseudorandom_element(valid_jokers, pseudoseed("something here idk"))
if rad_joker then
local ret = SMODS.blueprint_effect(card, rad_joker, context)
if ret then
ret.colour = G.C.RED
end
return ret
end
end
end
id probably do smt like this instead
hey y'all, i'm trying to check if a playing card was face down before it is scored. what context should i use to do that? (i can't seem to find the right context since cards get flipped face up before scoring)
context.before doesn't work sadly
can u explain how can this check for valid joker
for _,v in ipairs(G.jokers.cards) do
if v ~= card then valid_jokers[#valid_jokers + 1]
end
a table with all jokers except for itself
so theres no need for the finding random position stuff
its like continue right
nope
if v ~= card <- if v isn't card
but i guess you can see it as that?
wait i forgot an end there
in my defense i typed that on discord
:3
so if there isnt any valid jokers it the valid_jokers will have nothing in it
what exactly is the result of the ["Straight"] component in evaluate_poker_hand(cards)? Having a hard time parsing the table to understand it
isn't it all the straights contained in the hand?
How do I make a global variable increment by one at the end of round instead of randomizing?
thats what its supposed to be but keep trying to print the nested tables in tables to find the actual cards lol
wait maybe im a fool
G.GAME.prefix_variable = (G.GAME.prefix_variable or 0) + 1
Fair
I end up getting a crash with this code when playing any card with an edition or seal, anyone know why?
calculate = function(self, card, context)
if context.before and context.main_eval then
for k, v in ipairs(context.scoring_hand) do
if v.enhancement or v.seal or v.edition then
G.playing_card = (G.playing_card and G.playing_card + 1) or 1
local card = copy_card(context.scoring_hand[v], nil, nil, G.playing_card)
card:add_to_deck()
table.insert(G.playing_cards, card)
G.hand:emplace(_card)
card.states.visible = nil
G.E_MANAGER:add_event(Event({
func = function()
card:start_materialize()
return true
end
}))
return {
message = localize('k_copied_ex'),
colour = G.C.CHIPS,
playing_cards_created = {true}
}
end
end
end
end
like, not sure why get_id is nil here
thats where I started but that still gave me an error
but let me try again
oh pshht now it works lmao. thanks!
okay turns out I can't just expect the game to instantiate cardareas I made for me when loading them
am I understanding this correctly
uhh wait
Anyone know how I could change this code to only copy editioned/sealed/enhanced cards, and then destroy those cards?
if context.before and context.main_eval then
G.playing_card = (G.playing_card and G.playing_card + 1) or 1
local copy_card = copy_card(context.full_hand[1], nil, nil, G.playing_card)
copy_card:add_to_deck()
G.deck.config.card_limit = G.deck.config.card_limit + 1
table.insert(G.playing_cards, copy_card)
G.hand:emplace(copy_card)
copy_card.states.visible = nil
G.E_MANAGER:add_event(Event({
func = function()
copy_card:start_materialize()
return true
end
}))
return {
message = localize('k_copied_ex'),
colour = G.C.CHIPS,
func = function() -- This is for timing purposes, it runs after the message
G.E_MANAGER:add_event(Event({
func = function()
SMODS.calculate_context({ playing_card_added = true, cards = { copy_card } })
return true
end
}))
end
}
end
end
And also make two copies of each of those cards.
I don't know if I'm being stupid but right now the problem is
- I'm making a card area for each instance of the Joker when they need to be accessed
- When the game is saved it saves the cardareas in G
- but it fails to load it because when the game is loaded the cardareas I made are not instantiated
so do I need to get to patching the code that loads runs or am I doing something very flawed
why aren't you saving them to G directly
they are in G
it fails to load any cards that were stored inside though
add_to_deck = function(self, card, from_debuff)
local cae = card.ability.extra
if not from_debuff then
print("adding")
G.supper_microwave_counter = (G.supper_microwave_counter or 0)
cae.cardarea_name = "supper_microwave_area_" .. tostring(G.supper_microwave_counter)
G.supper_microwave_counter = (G.supper_microwave_counter or 0) + 1
end
end,
remove_from_deck = function(self, card, from_debuff)
local cae = card.ability.extra
if not from_debuff then
print("remove")
G[cae.cardarea_name]:remove()
G[cae.cardarea_name] = nil
end
end,
supper_get_owned_cardarea = function(card)
local cae = card.ability.extra
if not card or not cae.cardarea_name then return nil end
if not G[cae.cardarea_name] then
G[cae.cardarea_name] = CardArea(0, 0, 1, 1, {
card_limit = 1,
type = "joker",
})
G[cae.cardarea_name].states.visible = false
end
return G[cae.cardarea_name]
end,
relevant portion of the code
what if you instantiate it in load()
oh that's a thing I see
card.ability doesn't exist in load
hmm i saw other mods do similar things i wonder how they did it
hmm what
the only thing i can think of is patching before the cardareas get loaded and saving all the area keys to G.GAME (which gets loaded first)
... if the card area isn't instantiated at the item of loading it stores the load data somewhere else and you can grab it later
¯_(ツ)_/¯
I did not know about the lovely/dump folder, this is the greatest thing ever
its cool you can actually find what code runs instead of guessing
I dont have to scour the source files with 7zip for an hour to find 1 thing lol
Dunno what text editors can reload the files silently when the game is restarted, like with DebugPlus. Kinda wanna avoid VS Code or VS Codium due to bloat.
ok thank you mr john jokerdisplay it works fine if i ignore the annoying red message
tasty joker stencil
now I just gotta properly handle it being duplicated with stuff inside it!!!!!!!!
Hii, I'm trying to make a joker that has a X2 multiplier and when you one shot a blind it gets a upgrade to that multiplier, and in case you don't one shot the blind then it destroys itself, but i have a error in which it destroys everytime and idk why ;;
self.mano = G.GAME.current_round.hands_left
end,
calculate = function(self, card, context, info_queue)
if context.setting_blind then
self.mano = G.GAME.current_round.hands_left
end
if context.end_of_round then
if (self.mano - 1) == G.GAME.current_round.hands_left and G.GAME.chips >= G.GAME.blind.chips then
card.ability.extra.xmult = card.ability.extra.xmult + card.ability.extra.xgain
return {
message = localize { type = 'variable', key = 'a_xmult', vars = { card.ability.extra.xmult } },
}
end
end
if context.after then
if G.GAME.chips < G.GAME.blind.chips then
G.E_MANAGER:add_event(Event({
func = function()
G.E_MANAGER:add_event(Event({
trigger = 'after',
delay = 0.3,
func = function()
card:start_dissolve(nil, self)
return true
end
}))
return true
end
}))
end
end
if context.joker_main then
return{
Xmult =card.ability.extra.xmult
}
end
end
}```
you know what I hate this dumb red message
im patching to instantiate it ahead of time and im really not sure why it works like this
how are asterisks used in lovely patches?
how are you determining what is a one-shot and what isn't?
i'm specifically looking to two-birds-with-one-stone these two lines but idk if that's possible
i wasn't sure if it worked the same as a regex one when not used in a regex patch
eh personally i would do two patches
alright
can't risk someone else doing something that matches the pattern if it's too generic
Supposedly if G.GAME.chips (the chips that are currently scored) are bigger or equal than G.GAME.blind.chips (The chips that are needed to beat a blind) and if you've only used one hand (self.mano saves the hands that you start the blind with) then it should be a oneshot
what if you run the upgrade part when the round ends if only one hand has been played, rather than checking the chips amount.
If more than one hand is played then destroy the card
Also if you use > chips what happens if someone scores exactly the blind amount?
uhh
you can just count the number of hands played?
I am making a joker but idk if it should be Rare or Legendary.
Medusa:
Add x0.25 mult to this card for each Stone Card in full deck.
Turns scored Face Cards into Stone Cards.
maybe you're right and i'm just dumb xd, lemme try
also thanks for the help ares
and i do think medusa should be legendary hahaha
np, not sure how you need it to work or if any issues will arise but that's what testing is for :3
Should probably follow the Midas Mask rarity imo.
splash+Pareidolia+Medusa + Stone Joker + Marble Joker or DNA and you have a fast all stone deck :3
Stone joker can be replaced with anything else tbh, blueprint/brainstorm, another Medusa, etc.
Even if it's technically better than Midas Mask?
So it will give X13 Mult if your deck has 52 Stone
Hey y'all, what does the crash message Cycle detected in table mean?
yes, but you can only play high card technically so get yourself some Pluto's :3
If it can only convert the face cards into stone, I think Uncommon works fine for it, because otherwise you would still have the numbered cards
If it converted all cards into stone, then it would be worth Rare
I guess that's what other jokers are for, to have synergy with it
x13 mult for a full deck of stone cards seems not too bad tbh
Originally was planning on having it turn Mortal Cards into Stone Cards but don't know how the Mortal enhancement will work yet so... this is fine
Can someone help me or tell me where I can find help for the loc_txt when making a joker?
I had a link but now it's gone 
ty
But what if you want to change the existing UI?
You can’t change the existing UI by creating it from scratch
That’s just creating a new UI
Is there a way to make my mod changes reflect in realtime as opposed to closing and relaunching whenever I make changes?
god i wish
debugplus watch command will reload some changes realtime
watch the mods/yourmodfolder/yourmodfile.lua
@graceful vapor pinging you here because the other chat is busy with talking not about mods
https://github.com/Steamodded/smods/wiki/Utility has documents for functions that create joker cards and the parameters
thanks a lot :)
as for using the consumable I believe you describe the behacior you want in the consumable's use method
all you want is to make a joker so nothing too fancy just call the creating card function in it and you should be good to go
what exactly do i have to change here?
because ingame it doesnt let me use it
where did you get player from
autocompletion lmao
you got a chatbot to write it for you?? bro
it doesnt know shit about the balatro codebase so it wont be helpful
man i just started a few hours ago, let me be 😔
aight aight
the method should look like use(self, card, area, copier)
i have no idea area means in this context actually (area of the consumable it was in?)
hm
It's SMODS.add_card.
Anyways the create_card function expects a table
yeah that too
SMODS.add_card {
set = "jokers",
key = enter key of the joker you want here
}
heres the bare minimum of how it should look
How do I check if the played hand contains scoring cards of x suit?
I looked at the vanilla remade for seeing double to try and get some insight but I've got nothing
so this is what i tried, still crashes when i buy the consumable 😵💫
when you buy the consumable?
yes
wats the crash messahe
G.jokers.cards
Thanks
youve somehow broken the UI and I have no idea how
im.going to sleep though so you should repost the code here and see if anyone else can help
The UI?? 😭
yeah
thats crazy
alright, thanks for the help tho
Which colour palette looks better?
i like the right
i mean did you write the consumable by looking at the wiki or did a chatbot generate somsthing for you
if the latter it probably has done a bunch of things wrong
nah, watched this one youtube video on how to create a consumable
oki then
STEAMODDED 1.0.0
A tutorial on how to make a Modded Consumable!
Hope y'all like it!
https://www.youtube.com/watch?v=Zp-4U5TlbxY&lc=Ugzcg04r-IbJO-nCbUZ4AaABAg -- PREVIOUS VIDEO
https://github.com/art-muncher/Example-Mod -- EXAMPLE MOD
https://github.com/Steamopollys/Steamodded -- ST...
that one
How do I use the add_joker() function to add a negative joker?
You don't, you do SMODS.add_card({set = "Joker", edition = "e_negative})
In SMODS’ GitHub
Ohhh
there
thanks
btw
how do I get a list of all the jokers like
currently owned
like in the top bar
cause G.jokers.cards doesnt seem to be it
G.jokers.cards
It is.
I tried it but it didnt work
Code?
if SMODS.seeing_double_check(context.scoring_hand, 'Hearts') and SMODS.seeing_double_check(context.scoring_hand, 'Diamonds') and SMODS.seeing_double_check(context.scoring_hand, 'Clubs') then
local c = pseudorandom_element(G.jokers.cards, G.SEED)
while c.ability.name == "Equin" do
c = pseudorandom_element(G.jokers.cards, G.SEED)
end
SMODS.add_card({set = "Joker", edition = "e_negative", key = c.key})
end
Oop
thats not formatted correctly
wtv
c.key should be c.config.center.key
Anyone else know what the problem is here?
What context do I use for after scoring is done but before hand is like put away or wtv
context.after?
how do i access loc_vars from in the joker functions?
would you mind dming me your mod code?
I have a joker doing that, I think. One moment while I look for it.
card.config.center.loc_vars maybe?
I don't understand what you mean.
ty
How do I make my calculate function stop if a condition is met, because right now it seems to simply be running again
Im using a return, but it doesnt work right
Code?
if SMODS.seeing_double_check(context.scoring_hand, 'Hearts') and SMODS.seeing_double_check(context.scoring_hand, 'Diamonds') and SMODS.seeing_double_check(context.scoring_hand, 'Clubs') then
local c = pseudorandom_element(G.jokers.cards, G.SEED)
if #G.jokers.cards == 1 and G.jokers.cards[1].ability.name == "something" then
return
end
while c.ability.name == "Equin" do
c = pseudorandom_element(G.jokers.cards, G.SEED)
end
SMODS.add_card({set = "Joker", edition = "e_negative", key = c.config.center.key})
card_eval_status_text(context.blueprint_card or card, 'extra', nil, nil, nil, { message = "{C:attention}Copied!{}"})
end
Dont worry about the ability name something
nvm
looking at aikoyori's code for hibana's joker but i don't understand how it works and how i could change it to instead of drawing cards of a rank, to draw cards played in priority next round for example, does anyone know of another joker / mod that does it so i can look it up too?
i tried card.config.center.loc_vars.elle_use and it didn't work,,
even though elle_use is a key that exists in the loc_vars return
I believe the loc_vars return is for setting values within the loc_txt area
it does more than that outside of extra
hmm i'll have to check the docs and your loc_vars section
Im trying to copy a joker, but I dont know how to make sure it doesnt copy itself, how would I do that, ive been trying for an hour and I havent gotten any farther
brainstorm style copy or duplication style copy?
duplication
if context.joker_main then
if #G.jokers.cards == 1 and G.jokers.cards[1].config.center.key == card.config.center.key then
return {}
end
if SMODS.seeing_double_check(context.scoring_hand, 'Hearts') and SMODS.seeing_double_check(context.scoring_hand, 'Diamonds') and SMODS.seeing_double_check(context.scoring_hand, 'Clubs') then
local copy = copy_card(pseudorandom_element(G.jokers.cards, pseudoseed('seed')), nil)
copy:set_edition('e_negative', true)
copy:add_to_deck()
G.jokers:emplace(copy)
end
end
Yeah
Well the exact effect will be an edition given by a joker and if the joker rolls the card again, it stacks the effect
for _, joker in pairs(G.jokers.cards) do
if joker ~= copy then
copy:set_edition('e_negative', true)
copy:add_to_deck()
G.jokers:emplace(copy)
return end
maybe this for your issue? No wait...
?
this might copy every joker instead of just the one you want
What if I return after the emplace
then it wont copy anything else
right?
Or am I stupid
Try it out, imo it's all trial and error
Yeah
It copied a card, but then copied itself...
Before I tried using a while loop like so:
while copy.config.center.key == card.config.center.key do copy = copy_card() end
but this didnt work
if copy ~= self then
copy:set_edition('e_negative', true)
copy:add_to_deck()
G.jokers:emplace(copy)
end
something like this perhaps?
although I don't think self would work in this context
But then if the copy is the card, wouldn't the card just not trigger?
for _, joker in pairs(G.jokers.cards) do
local copy = copy_card(pseudorandom_element(G.jokers.cards, pseudoseed('seed')), nil)
if copy ~= self then
copy:set_edition('e_negative', true)
copy:add_to_deck()
G.jokers:emplace(copy)
return end
end```
formatting is horrible there
but that might just work?
Does anyone know how to fix this error
Ill try it
Hi ares
return card.ability.extra.money, I think instead of GoldSeal.money?
I believe GoldSeal adds to the card.ability.extra.money value instead of having its own value, but do not quote me on that.
howdy ^~^
It seems like it worked, thank you so much
Ofc!
That's not the problem the line where the problem is before that line
521
nope it adds to card.ability.seal.extra.money so maybe...
card.ability.GoldSeal.extra```
?
oop
my bad
Is just a bool to check if the copied seal effect is the gold seal
i can show the entire code
maybe if you change this to
if card.ability.GoldSeal.isGoldSeal == true then
?
the screenshot to the text there
well damn
why does using card_eval_status_text(context.blueprint_card or card, 'extra', nil, nil, nil, { message = localize('k_duplicated_ex') }) (for the perkeo-like: "Duplicated" message) in context.joker_main not trigger immediately?
Because it goes before everything else.
?
You have to return it for it to go normally.
i will lose it
Can you give me an example, im kinda lost here, sorry
return {
message = "message"
}
Where does that go
It should be self.config not card.ability
Where you want to send the message.
Ok
So I thought badge text of a seal works the same as the ones of stickers...
What is the correct way to do this, though?
You need to define it in labels in localization.
I've define it in the third pic, and I know it is not exactly the way to do so.
You need to add _seal to the end of the variable.
Thanks
So in general works fine
Geo-Pin + Global(from cryptid) about to be crazy
this looks like a final boss to an rpg
im gonna need a health bar
thats so cool what
gonna need that song in the background
Composer: nicopatty https://soundcloud.com/nicopatty
of course i haven't implemented the boss blind mechanic yet i wanted to make sure i could add health to boss blinds
the asriel boss blind will keep the same health mechanic, needing to always meet the requirement of the score otherwise you score nothing is a good boss mechanic for that blind
i'll have to add boss descriptions though
how can i check if the playable card is not held in hand?
dont worry you revive him
oh ok that makes sense
omg the six human chips
If a card is played it would not be in hand.
Yeah but I got a problem with my seal rerolling cause the seal.effect only rerolls if that card with the seal is in hand which I want it to reroll even when it's not in hand
okay if anyone is in this scenario, the correct answer is context.press_play
Omg this is awesome
how do I get my mod to pick up on a second lua file I make?
I want to categorize each file by what they do. Right now I have one file for jokers and enhancements, and soon I'll add a couple vouchers too, and I want to split them up into different files
Imagine dying on the big blind before god of hyper death
assert(SMODS.load_file(path))()
in the main file?
yea
fantastic. thank you
i'll buff him up even further, since you can use the tarot at any ante, even early on, i'll just make the score requirement multiply on the final boss life by 10
it crashed on startup. Is this correct?
the path needs to be a string
FIXED IT I THINK, I just didn't return correctly
Still experimenting with it though
Trying to see if it triggers when I want it to
hey im getting the feeling im not using SMODS.calculate_context{joker_clicked = true} quite right any1 know more than me?
Yep, should be fixed now :D
is it possible to "freeze" cards in the shop so the same cards come up after a blind?
entropy did this
You need to call the context when you want the context to happen.
You need to use SMODS.calculate_context{joker_clicked = true} when you want context.joker_clicked to happen?
ok so im gonna sound like an idiot saying but
i have no idea where to put SMODS.calculate_context{joker_clicked = true}
i mean i want context.joker_clicked to happen whenever.. u guessed it a joker is highlighted (or un-highlighted) so that my nlrg_cost updates not only when partner_click
anyone know how to make mods?
Guy walks into a bar and asks if anyone likes to drink
....
i dont
wow
holy shit there are so many cards there's no way i could find which one does that
one of the inverse tarots
i think
nope
dammit gimme a moment
yeah i'm trying to find how it works but they use their own function to get all shop cards so that probably means there's no way to do that without patching
u got any idea how to do ts?
im desperate
anyone knows if would that be possible without patching
you could maybe make a consumable that changes the highlighted shop items pool rate to 100% appearance until the start/end of the next shop, altho i'm not sure if that's even possible, I do know you can edit the appearance rate of jokers/consumables
why dont you want to patch?
loc_txt + should be loc_txt = and nsmr should be name
?
I would patch
You forgot the = for loc_txt
loc_txt = {
name = "happy joker"
text = "he is happy"
}
...
hard :(
...
SMODS.Joker should have a capital J no?
maybe?
yeah that too
idk
download that and it will make sure you don't forget commas
ok i shoved some comas
yup
we good?
yeah probably
I mean in real time
nope....
please right click and press format document
?
yeah cuz the mod id can't have spacebar between it
just saw that
oh shiii
i would suggest scrapping that and do it all in a new file called smods.json
?
json
isnt this ment to be lua tho
nvm chat this made it work
yeah but they introduced a way to write mod metadata on a json file
so without that green header
like this
you can skip most of stuff there but make sure to have id, name, prefix and main_file
bruh can u stop with the huh and the ? when we're explaining things to you
sorry : (
dw abt it, this stuff can take a while to get used to
ty
mod header is outdated, still works but it's better to have a smods.json file
that's the only file that's not lua so dw
the humble lovely.toml file:
k so like in steam modded is like a pack thats what json does?
lovely is out of my league for now so i deleted it from my brain
haha i was like that dw but if anything i overuse them now
how do i call a list from another file?
no you make an smods.json file in your mod folder
I can even write it for you
rly?
load the file using this, then u should be fine to call any tablesassert(SMODS.load_file('items/common.lua'))()
thanks
"id": "happyjoker",
"name": "Happy Joker",
"display_name": "Happy Joker",
"author": ["I DID SOMETHING"],
"description": "he is happy....",
"prefix": "happy",
"main_file": "main.lua"
yeah oops i forgot you need to put all this inside brackets {}
yeah but remember to delete the green stuff you had in main.lua before
kk
oo works but my pic isnt there that i made
: (
oh
nvm
its cap j not lowercase
lol
im getting there slowly but surely thanks to u
still doesnt work....
show both files
?
actually do i have to use some special layout or does
local nlrg_list = {}
return nlrg_list
work for this
cuz when i tried using nlrg_list it just gets nil
yeah
why can't i get step by step guides like these 🥀
this man is the nicest : ) dw u might get help
im not qwq
cuz that guys problem is the most basic thing so I know how to do that and on everything else im as clueless as you
Make it a global variable
: )
File loading order matters too tho
see guys
this is all i get
like hell i know what ts means TwT
Oh sorry
dont be rude
local x = 5
y = 5
here, I can read x wherever it is defined, but y I can read it anywhere else
its not ur fault
its just normal to assume ppl are smarter than i am
For example if I set a local variable in a loop I can only read it in said loop or under
you need to set an atlas for the joker, the joker "doesn't know" by default that your atlas is meant for him so you need to specify in his code
i dont under stand :/
write this after loc_txt (the purple '}') and it will work (remember about the comma)
Actually SMODS.Joker sets an atlas by default if one isn't specified
thank uuu
It uses the default vanilla "Jokers" atlas
really? but that's the vanilla one and what position does it set by default
i got blue
@charred magnet change x=1 to x=0 btw
not purple
0, 0, so default jimbo
ye
purple in pos thing
what
pos = purple bracket x=1 ect
yeah but I meant that you write that after the loc_txt purple bracket so you know where to write it
Weird, that should work, does your mod shows up in game in the mod tab?
No
...
I recreated it like this and it works fine
Is your mod loaded in Balatro? Check ingame in the Mods button
lua’ing
maybe his insane writing is causing that, he has a tab in between key and =
quick question, does anyone know if i need to do a hook or such to influence shuffle (like to place cards from a table atop), looked at aikoyori stuff but it doesn't seem that similar to what i'm looking for, or i misunderstood it
I meant ingame, not in the balatro mod manager
i think im lost
atp i dont even understand my own code anymore
ask cluade ai
he is good
hell nah
What if you click on it and click on "Additions"?
joker 1/1
Click on it?
ai dont work cuz it dont got the libraries
shows joker without my png
yeah cuz of the atlas
write it like this
Copilot thing idk
The problem is using an atlas called "Jokers" uses the vanilla joker atlas
I think
I only ask ai for basic lua stuff since I have no idea about it
nope
Huh, ok then
?
Is your asset file named "Joker" and is a png?
yes
yup
yes
Oooh
change x=1 to x=0
set the x in pos to 0
alr lets see if it works
AHHH
it does
luv u
sm
ima do some stuff if i run into some error ill see u
now can u add joker that pay rent for you
whatever i do my ipairs doesnt pull the table
and im not sure if i rly want it global global in my context
What exactly are you making?
me or dvod
Dvod
big mod
whats ur thoughts on my joker
very beautiful
I meant what are you trying to do exactly that requires a global table
: )
i mean it doesnt require a global table
i just want a table
that i write in another file
and call in a loop to go through
cuz im not writing all the different ability paths in my main file
i could send the code but thats gonna be a lot
(80 lines)
value multiplication (like cryptids oil lamp)
Ah
This is a lot 
i have to upload as file cuz my broke ass cant type that many symbols
you could have just sent a screenshot tbh
Does your partner have a description yet?
Interesting
in that code i currently got 2 main problems that im trying to fix
one of them is that nlrg_list i need
I think your code could be simplified for such an effect. btw it might not work for some vanilla jokers because sometimes their values are hardcoded
Which means they can't be modified
yea idc
i mean currently it looks for allowed paths instead of disallowed
after ive heard changing values is like challenging god ive accepted any hardship
and telling me it can be simplified is nice but uh
i aint that smart
im trying my best with what i got
I haven't experimented with partner click, I know one of the vanilla partner do that
Yea tbh for something this long and complex I'm not a good teacher
i mean it works pretty well except for the fact it doesnt update the nlrg_cost at the right times and that list
I'm attempting to make a global function that when the round ends, checks all cards in your deck for a specific seal, then changes values on said seal(because for some reason seals only run their code if in hand/played and not if discarded or not drawn)
The nlrg_cost being the cost it takes to double values?
Like it increments on each use?
did you try enabling the deck and discard optional features?
wdym enabling them---
it doesnt use it at all
its just what the description uses to show how much its gonna cost
Oh so it doesn't spend the money?
By default, some things are not checked for. You can enable such.
SMODS.current_mod.optional_features
you know how it in the calculate docs says G.deck and G.discard optionally enabled? well those are optional features you have to tell smods to enable
thats... the issuepl
the partner appends a new variable to the highlighted joker .ppay which keeps track of the cost for each joker
Ok and why does it need to track it?
Your description doesn't mention anything about joker cost
bc the cost doubles as the effects of the jokers do
avoid that
thats why im using the base_cost as the beginning
now that im explaining all this im surprised this server doesnt have any vcs
would this go in the seal/joker script or just out by itself somewhere?
Here's what you can try to do
local old_extra_value = G.jokers.highlighted[1].ability.extra_value or 0
local mai = SMODS.shallow_copy(G.jokers.highlighted[1].ability)
for _, key in ipairs(Nlrg_list) do
if mai[key] ~= nil then
mai[key] = mai[key] * card.ability.extra.nlrg
end
end
G.jokers.highlighted[1].ability = mai
G.jokers.highlighted[1].ability.extra_value = old_extra_value
i see we've been facing different directions
my current issue is the table that isnt recognised and i crash cuz of nil
Which table isn't recognized?
Nlrg_list
where would a sticker have a localization entry?
What's Nlrg_list supposed to be?
descriptions.Other
a table of entries like "mult"
or "extra.mult"
or some like that
as a whitelist for what values to multiply
Try replacing Nlrg_list by G.jokers.highlighted[1].ability?
that uh
doesnt quite make sense to me
You're trying to double joker values
Just loop over said values
You don't even need to copy the joker actually
You want the values in config doubled only?
gimme a moment to understand what im trying to say
ill just give an example of how it currently works/ how i want it to work
using Joker (the jimbo one (like that base joker yk))
i select Joker
i click on the partner
from nlrg_list which has "mult" in it it knows to check for the value mai[key] with mai being G.jokers.highlighted[1].ability and key going over "mult"
in other words mai[key] takes G.jokers.highlighted[1].ability.mult from Joker and multiplies it by card.ability.extra.nlrg aka 2
thats the value doubling done
then it also takes the base_cost of Joker which is 2 and makes that G.jokers.highlighted[1].ability.ppay and multiplies that by strt_cost which is 5
thats what im being charged
on every consecutive use .ppay exists and it uses that as the cost and multiplies it by .rate which is 2
does that make sense?
and my problem is
From the code you sent me Nlrg_list isn't set I think
What I don't understand is what you want in this Nlrg_list
the list is over here
Ok this might not be what you want by why don't you do this for now?
Did you load the file?
Could always put said list in your main file too, I don't think you need a whole new file just for this
but i dont want 500 lines of table in my main :(
Add this at the top of your file if it ain't here
assert(SMODS.load_file("enlargements.lua"))()
I think it would be easier and better if you made a blacklist instead of a whitelist imo
WHAT WHY TF DOES THIS WORK NOW?!?!?!?!?!
Because you didn't load the file lol
-# no like i tried exactly that before with the assert
🤷
how do i write a seal in localization
-# istg if it was just dyslexia
how do i highlight a card by code?
descriptions = {
Other = {
sealkey_seal = { ... }
}
}
area:add_to_highlighted(card)
did you add the extra () at the end? i made that mistake before
ty
wth is that, I didn't have to do that with jokers or consumables
Writing rules I suppose
i literally copied from this and just put my own file location
Did you change the items/common to your file name?
in the documentation it also says something about labels in misc.labels
anyone know why this error appears?
i even said i did in the msg qwq
I think that's for the badge
It's SMODS.current_mod
also where do i write that, inside SMODS.Seal ?
Also it seems that you have a header and a JSON?
Try doing this
JonklerPack = SMODS.current_mod
JonklerPack.optional_features = ...
Do you have a localization file?
yes
Put it in here then, under misc = { labels = {
misc is at the same level as descriptions
so like that?
That's not your localization file?
it is, inside descriptions = { Other }
Is this how you've been doing localization?
uuh yup, that's how they do it in the documentation
That's how a localization file looks like
and that is how it looks like, i just didn't send a screenshot of my whole screen
At no point they call that SMODS.func, that was way before ago
Why are you calling process_loc_text in your localization file?
that's what you send me
Yea I sent you that to show you the tree and the key you had to write
the crash porblem is caused by this function and im not sure why? is there another way of the scored card with the seal to give out the money?
what?
Does extra.GoldSeal.money exist?
Contribute to nh6574/VanillaRemade development by creating an account on GitHub.
yep
thats where i got it from
