#💻・modding-dev
1 messages · Page 399 of 1
this is absolutely perfect where did you find this?
VanillaRemade probably
@red flower 's VanillaRemade 
https://github.com/nh6574/VanillaRemade/blob/599f32c1caeee6f17e64d849c36768435f77d418/src/jokers.lua#L3903
I was trying to pull that up myself lol
tysm
ok, i think i got the solution?
real?
he's so goated
Speaking of VR I just sent a PR for challenges for it today
I’m credited as a co-author 😭
if context.other_joker ~= card
no idea if that will work but try it
how do you set up a function in an enhancement to change a variable?
already tried, it's working
oh well W
enhancement has calculate, dunno what you mean tho
hii
what's the new key here?
key pointing to the new description in localization file
o
see how in the localization i did hpfx_trapezoid_alt
yea
like I'm trying to create a new function called setLevel so I can control the chip value when giving the enhancement to a card
in that instance, thats the new key
hook to set_ability, probably
ohh okii
rn I have this
oh neat
is there a wiki page on hooks?
i love code optimization
an enhancement I'm making
oh nvm then
dude
holy fuck this used to be so bloated
blame mathisfun
Hi, does anyone happen to have the assets for the playable cards? I searched the example mods and didn't find anything.
the before image is code mostly copied from old blueprint
seems to work fine
which was coded before blueprint_effect was a thing
all Balatro assets and source code can be easily accessed using a file archiving tool
i think you will want to check set_ability, i havent tried making a new function in centers before 🤔
https://twitch.tv/autmchiu
https://www.patreon.com/autmchiu
I'm a nonbinary-ish trans woman with kind of an androgynous voice. I'm not going to waste my precious time tracking down everyone who misgenders me, but if you care, i use she/they pronouns and prefer feminine-coded language where applicable (and also thank you ❤)
inspired by this...
I can't find anything about hooks on the wiki, but I probably just checked the wrong area or smthn
oh no, you dont need hooks
ah ok
you only need them if you want to use setLevel with all enhancements
got it
i tried this but now the mult value isn't updating
put samehand out of events
Thanks, it's my first time making mods of this style and I'm also terrible at English.
I have put my mods folder in vsc. But it's still underlines some smods documentation
oooOOOoooo you wanna set up a luarc json so baaad oooOOOooOOooo
what's the difference between object.thing and object:thing
Hi, I'm new trying to do a mod. Can someone tell me How I debug my mod?
I mean, I made a Joker mod, Should I beggin a New game until get my Joker? I don't think so, right?
debugplus
will the chips = math.floor(pseudorandom("fish") * 10), line work?
Also, whenever I set up a new code document at pets it as a .txt
Is that just how it is supposed to be or is there a different way
colons call functions with the object as the leading argument
object.thing is a property and object::thing is a class basically
what are you trying to do here
set a random value for chips from 1 to 10
or 0 to 10. Whatever it ends up coming out as lol
actually it should be 1,10 since I remembered a mechanic that's coming later
it returns a whole number from 0 to 10
Gaet debugplus.
Once you're in Balatro press the tab button.
its hold actually, but yeah
I gonna try, ty
is there any way to target two jokers at once with blueprint_effect
My bad.
use SMODS.calculate_effect(return_table, card) instead of using return
i think i goofed
happens
oki
sorry, how exactly?
Works pretty nice, ty xd
SMODS.blueprint_effect returns a table of effects, see it as return_table as an example
you want to put that in SMODS.calculate_effect
key = 'stand_starPlatinum',
j_jojo_starPlatinum = {
name = 'Star Platinum',
text = {
"{C:mult}+#1# {}Mult when played hand is the same as most played hand",
"{C:inactive}This Stand appears to have more potential hidden deep within...{}"
}
},
j_jojo_starPlatinum_theWorld = {
name = 'Star Platinum : The World',
text = {
"{C:mult}+#1# {}Mult when played hand is the same as most played hand",
"{C:inactive}\"So, The World is the same type of Stand as Star Platinum...\"{}"
}
},
config = {extra = {mult = 12, time_chips = 0, time_mult = 0, new_key = "j_jojo_stand_starPlatinum_theWorld"}},
loc_vars = function(self, info_queue, card)
return {vars = {card.ability.extra.mult, card.ability.extra.time_chips, card.ability.extra.time_mult, card.ability.extra.new_key}}
end,
-- [...]
generate_ui = function(self, info_queue, card, desc_nodes, specific_vars, full_UI_table)
full_UI_table.name = localize {type = 'name', set = "Joker", key = card.ability and card.ability.extra.new_key or "j_jojo_starPlatinum", nodes = {} }
SMODS.Center.generate_ui(self, info_queue, card, desc_nodes, specific_vars, full_UI_table)
end,
add_to_deck = function(self, card, from_debuff)
card.ability.extra.new_key = "j_jojo_stand_starPlatinum_theWorld"
end,
meow
ok, new problem. the game crashes if i view the card in collection when outside the game
local count = 0
for i = 1, #G.jokers.cards do
if (G.jokers.cards[i].config.center.rarity == "CR_common") and (G.jokers.cards[i] ~= card) then
count = count + 1
end
end
return { vars = { card.ability.extra.mult, card.ability.extra.mult + (card.ability.extra.bonus * count) } }
end,```
G.jokers doesn't exist outside a run
where is this
wdym
you gotta put the localization stuff in localization,,
i thought u said put the stuff behind the calculate function :<
How I can add the text (Currently <count> mult) ?
yeah the generate ui stuff
the descriptions themselves are still localizations
i might be stupid but it's still not updating
ok, added an if condition for that
if you're doing dynamic descriptions, it's better to do a localization file
example
o
which will go in a localization folder
i might need to rewrite my metadata for that one
Shouldn't, metadata is separate
it is in fact separate
o i thought u wouldve needed to link the file
Not if it's in the right place
metadata is autoloaded, so is localization if it's in the folder
Thus ^
just curious can you take ownership then use alternate loc keys depending on a check?
probably. i havent done it myself so feel free to try
how do you use it?
its interesting seeing how different games handle this kinda stuff
nah i mean having alt descs
got you
inside of loc_vars, the order you put arguments in can tell the game what to display in the description.
so Vampire's loc_vars looks like this:
loc_vars = function(self, info_queue, card)
return {
vars = {
card.ability.extra.mult_gain,
card.ability.extra.Xmult
}
}
end
or something similar, and the description is written like this:
loc_txt = {
name = "Vampire",
text = {
"This Joker gains {X:red,C:white}X##1#{} Mult",
"per scoring {C:attention}Enhanced card{} played,",
"removes card {C:attention}Enhancement",
"{C:inactive}(Currently {}{X:red,C:white}X#2#{}{C:inactive} Mult)"
}
}
ahh I haven't played around with generate ui yet
if context.setting_blind and not context.blueprint and context.blind_boss then
local value = psuedorandom("flies")
if value < G.GAME.probabilities.normal / card.ability.extra.odds then
return {
func = function()
G.E_MANAGER:add_event(Event({
func = function()
G.E_MANAGER:add_event(Event({
func = function()
G.GAME.blind:disable()
play_sound("timpani")
delay(0.4)
return true
end
}))
SMODS.calculate_effect({ message = localize("ph_boss_disabled")}, card)
return true
end
}))
end
}
end
end
trying to disable boss blinds like this but it doesn't work, even with tons of copies of Oops
example with trapezoid, which will change the desc when you get the joker
you call the new_key whenever you want it to change the desc to the other (as seen in add_to_deck)
Pro tip, just put or true in your probability check when testing
ahh
that's some tech
boss doesn't get disabled. pretty sure the game isn't even reaching that if statement
inside of loc_vars, the order you put
run some print checks
So probably your context check is wrong?
But yes do this
yeah I think so, adding a print statement after the context check never gets reached
e before u
you spelled pseudo wrong
tryna understand and make the jimball animation code work for a joker spritesheet but it keeps stretching some frames and doesn't loop through the whole thing even when changing values around
still though, the pseudo line is never even being reached
you also did it in reverse i think lmao
if I obtain the card mid-blind it works, so that's not the code I have wrong
oh well nvm then
wait wdym works
the boss blind gets disabled if I obtain the joker mid-blind
I have an add_to_deck that works the same as the calculate, and it works there
I have the or true, the line just isn't being reached smh
oh yeah the or true lmao
i have mine in reverse and it works
(top line and if statement)
I stole your tag btw
Can you try replacing context.blind_boss with G.GAME.blind.boss
yeah I'll try that
if that doesnt work try swapping them
There's no reason I can think of that swapping the order would cause it to be evaluated differently
But the probability code isn't where the error is, because the probability code isn't being reached
@sonic cedar isaac enjoyer?

w
how do you fumble twice
shut up lol
you need nitro pal
i could tell
you gonna get Mewgenics when that comes out
ofc
this worked, thanks
oh wait you're working with probability duh
i don't have a grasp for the balance of this joker
the root mean square is sqrt((a^2 + b^2)/2)
oh it shouldn't be
now how would that work
but it is right
do it again lmao

stacks?
no
:c
no fun
the RMS is a type of average
why are people trying to stack averages
Dude who uses the Balatro font to code you should use a proper code font like Jetbrains Mono which is way more readable
@sonic cedar I'm making an Isaac mod for the game
RMS(90, 3) is 63, for example
I'm interested
I finally figured out how to get things started, but whenever I close VSC and reopen it. It puts any file as a txt. And afterwards I can't continue to code in lua or json.
you dont say
brooo
https://github.com/AlexM-CS/The-Balatro-of-Isaac
this is what I got so far, started yesterday
That looks 🔥
Seals On Everything guy pointed up at my message... bro that was ragebait
does G.GAME.round_resets.free_rerolls exist or does adding to G.GAME.current_round.free_rerolls actually give one per round
so this should work, no?
☝️🥸
shi it might be private visibility
XDDDD
let's find out 👅
dont get me excited
bruh
fuck
oh hey there it is
send your localization
what is this 😭
my eyes
Alright I think I'm gonna return to developing mods but I don't know where to start even though I know lua, the basics of modding... but the only thing that is holding me back is the severely limited steamodded wiki
fixed visibility issue
can you fix mine
Why aren't you just returning key in loc_vars?
huh
where's your alt description 😭
theyre doing dynamic
deam thats awesome, but tf spoonbender will do?
shhhhhhh
that is my alt
i don't understand why people use the m6x11 font to code
we'll cross that bridge when we get to it
thematic
"redirects the score to the boss"
i play to have fun
so what uh isnt the alt
i think it looks ass for coding purposes
You could have something like ```lua
if conditions then
return {key = self.key .. "_alt"}
end
"25% of chips scored will carry over to the next boss blind, resets on beating boss blind"
the default, for now tho i just want to get this to work
fire
and this would go into a generate_ui?
True
monospace ftw
spoon bender isn't even the worst of it
also literally rigged sticker
No, this would go in loc_vars
oh i didnt know you could return a loc key in loc_vars
i love to play you mod, but i dont have a pc now
I mean this one is obviously super unfinished, I haven't even bug tested most of the jokers yet
but my Deckception one is finished
add greedier
the default????
:v
yeah! im changing lucky cards
new balatro mode goes crazy
Just curious but
How exactly does the generate_ui stuff work
I can't get the name/text change to actually work right and the documentation feels less than it should be
dont be nice to have to play 6 boss blinds in the order you want to advance from "ante"?
lmao
most balanced Cryptid Joker:
I know just making a joke
full_UI_table.name = localize { type = 'name', set = "Joker", key = card.ability and card.ability.extra.new_key or "j_hpfx_bard", nodes = {} }
type = what you're focusing on, in this case the name of it
set = self explanatory
key = your card's ability along with the new key, or the default of the non-alternate key
nodes aren't needed here
thats not even the closest thing to the most broken card in my mod
if i wanted to change the description text box as well do i just replace 'name' with 'text'
Is it possible to change a blinds blind size while not in the blind?
hows this?
change the description within the alt key iirc (in the localization ofc)
o
the thing I've noticed is happening is it's taking the name of the alt and the description of the normal one 
oh well in that case that's probably more of a take_ownership thing
yeah i did that instead
how rare are these jokers?
special grade? pretty rare
I need them in Ante 1 shop for $4
that's cause the descriptions have to match when done like this, then you change the desc through the loc_vars
lmaooo (theres a deck where u start with them) #1358478527934103572
whuh
if you wanna do like a whole diff description though try @daring fern 's method
I mean the name doesn't even really have to change
The description was the main thing
see the #2# at the end there
yea
corresponds to this value i have in loc_vars
which gives it the ...? when the card is added
any way I could replicate the ability of The Flint in a Joker?

what exactly does the "and" on the left contribute
base chips and mult get modified
im coming for you
in context.modify_hand, modify mult and hand_chips directly
if card.area is nil the conditional check stops
what have you done
How does one make the blinds update what they are supposed to be?
what
I only need the chips modification:
name = "The Inner Eye",
text = {
"Retrigger 3 random",
"scored cards, base chips",
"{C:attention}halved",
"{s:0.8}{C:inactive}\"Triple shot\""
}
i tried everything for like 12 hours that was the only thing that worked for me ;-;
I ended up with this
G.GAME.blind.chip_text = number_format(G.GAME.blind.chips)
even if its not as balanced I want the Jokers to feel the same as their isaac counterparts yknow
this is one of the languages of all time
No, I want the blind to change.
First image is what it is supposed to be second image is what it is:
What would that method be 
I'm pretty sure post_trigger doesn't iterate if no jokers iterate? but if it happens just once then you can just ignore that
because I believe it also happens when a joker is retriggered
pretty sure that's a nil check
Yes, but it does not get triggered for the joker that is retriggering.
I mean you can ignore it as in like
do some like
if somerandomboolean then
somerandomboolean = false
else
-- do all the code and stuff
o
so does that mean if i run it in the main file and set a variable to true if it's triggered that'll work
❓
wha
the first iteration it sets the boolean to false
and then the second and subsequent iterations it's still false so it runs the code
before the obligatory "what are you trying to do" question comes
tracker for if you beat an ante without triggering a joker (yes you have to have one)
(new to balatro modding, aiming to create a normal joker mod)
can someone tell me what do 1x and 2x folders contain?
in a random mod I downloaded they contain multiple pngs with joker textures, but in example mod they contain one png with a spritesheet
They contain images of what the mod uses in normal scale and double scale.
1x and 2x are the same, except the 2x image is twice the size. Used for graphics
its better to use a single image because SMODS has an atlas object that makes mapping images easy
what was johnmaged on man 😭
ok this is a pretty loaded question
- 2x folder contains a bigger version of the same texture for the pixel smoothing feature
- normally when you create an atlas you'd make a big sprite that contains multiple art in the same file so that it's easier for the game to load
i do the same thing as the example mod
so I can put multiple pngs in 1x and 2x but putting a spritesheet there is better
got it, thanks
If I wanted to make a joker that gains chips anytime you lose money how would I go about that? Do I need to track every context in which you can possibly lose money to see if dollar_buffer is negative?
i have a joker that does the same thing but it's whenever you lose scoring mult
youll need a tracker yeah
something like this but not this
and then youd call it as its own context
It seems to just change the blinds mult
oh really?
(i did not know this)
wait isnt that what all blinds use though
the chips stay static and the mult chanes
changes
yeah that's just what they do
i mean it makes sense all blinds are just multiples of the base score so
why wouldnt it be mult
Yes, I need to change the base blind size.
Yes, but it changes a number to be 2 if I wanted to change the blind size depending on it self, I would need the base blind size.
so does mod_mult trigger whenever mult is lost? if not then how did you make it trigger
It is used when mult is changed at all.
ok got it but is that function triggered automatically when mult is changed or do i have to set that up in my code?
It is used to determine what the mult should be when changing the mult.
i don't understand what that means
For example Lemon Trophy prevents the mult from going higher than chips, so it tells mod_mult to return the current chips if it is higher than the current chips.
It seems I just had to hook get_blind_amount
But the chip text doesn't change.
It changes when you enter the blind but not on the blind select screen.
is there a way to give the player additional hands/discards mid-blind?
that doesn't permanently give them more?
Yes.
yeah just remove them how you would normally
ease_hands_played and ease_discard
bumping this
think ease_dollars
it's like that
You would check for context.post_trigger and cancel it if it happens.
You would probably hook calculate_joker then.
Also I still need to get the blinds to update on the blind select screen because when you enter them they don't change into the blind they are supposed to be.
can consumables give mult and chips in the same way as jokers? or it can only affect the playing cards?
Yes.
Consumables have calculate
was thinking of a consumable that adds chips or mult for one hand or round
so what's the end of ante context?
i think they do that in Blind.lua
context.end_of_round and context.main_eval and G.GAME.blind.boss
in card.lua theres a section in the context tree for
if context.cardarea == g.jokers
if context.before
elseif context.after
else
...
what would fall under the else context, like cardarea == g.jokers but not before or after
or when would that activate rather
I wouldn’t suggest looking at that function
that should do it yeah?
No, it's just Card:calculate_joker
ok but where does the rest go
Also you should probably put nothingEverHappens in a G.GAME variable.
So it saves between loads and saves.
i was gonna dw
I think everything else is fine.
The function is just called Card:calculate_joker
that gives a syntax error dawg
It would be function Card:calculate_joker()
oh THATS what you meant
ok thanks
you would add the Card: right then
pretend its there
so it's good otherwise right
Every except nothingEverHappens not in a G.GAME variable seems fine.
it's in the main file
No, I mean it should be like G.GAME.modprefix_nothingEverHappens
this is an ovverrides fi-ohhh yeah true
You need the function arguments too
the who
It should be being defined as Card:calculate_joker(context)
can I get the number of scored chips and mult from the context?
like context.after.chips or something
how about NOW
No, it should be in G.GAME not the profile.
Using post trigger for this seems very silly btw
no one said otherwise man 
Just hook calc joker and see if it returns anything
Otherwise you are doubling the amount of calculations done for no reason
is there a version of this that updates for money?
local calchook = Card.calculate_joker
function Card:calculate_joker(context)
local ret, trig = calchook(self, context)
if next(ret) or trig then
— set your flag
end
— do your unlock check
return ret, trig
end```
No, but you would probably hook ease_dollars
like yeah?
No, it would be G.GAME.modprefix_nothingEverHappens
Change the return
trying to make a sticker, and it's crashing
key = "light",
loc_vars = function(self, info_queue, card)
return {
vars = colours { HEX('F7AA05') }
}
end,
loc_txt = {
name = 'Element',
text = {
'{B:1,C:default}Light{}',
},
},
rate = 0.0,
atlas = 'elements',
pos = { x = 0, y = 0 },
}```
Good catch
Otherwise good?
Log?
Though if it requires a joker for every round I’m not sure this effect is even possible
So it needs you to complete an entire ante whilst having st least one joker but not having any jokers trigger right?
No that’s not the problem
Im listening
So you’d need to find a joker that exists without trigger ever, and then it would have to be at least ante 2 effectively jokerless
It seems very difficult
I mean a difficult unlock was the intention
It’s a gag joker
Is it TOO difficult though?
/genq
it 's still crashing
Youd never unlock it by just playing naturally
Code?
key = "light",
loc_vars = function(self, info_queue, card)
return {
vars = { colours { HEX('F7AA05') } }
}
end,
badge_colour = HEX("F7AA05"),
loc_txt = {
name = 'Element',
text = {
'{B:1,C:default}Light{}',
},
},
rate = 0.0,
atlas = 'elements',
pos = { x = 0, y = 0 },
}```
It's colours = {}
any ideas to make it slightly more possible then? still want it to be difficult, but i don’t want it to be impossible
Having jokers that dont trigger is the tricky bit
yeah thats why I picked a lower ante
I don’t want say 2 though thats too low
so either 3 or 4
is 4 even possible
maybe if you’re playing plasma
Is it possible to change the blind mid-blind?
I hope
I set this to true in the main file and it crashes my game
it’s saying GAME is a nil value
You need to set it to true when the run is started.
what I have rn
why does the badge says error?
No.
ok so then how do I set it at the start of a run
Is this a seal?
sticker
You need to set the label in localization.
You need to hook Game:start_run
What arguments does it use
args
Got it
yeah?
are you in school?
no my computer just sucks
ah
It would be self.GAME.modprefix_nothingEverHappens
Also it would be self, args
Game crashed on run start
Same crash
Code?
You need to run the hook first
same as earlier, just the G is now self and I added the argument
Iirc
It’s probably better to use init game object too
oh well I have one of those set up already so I can just add on to it
local g = gsr(self, args)
-- Set variable.
return g
is it better to do this ⬆️ or use igo
well igo it is ig since I’ve already got it it set up
but now I have a backup plan
ultimately it doesn’t matter but I would use igo as you’re adding something to the game object
It just makes more sense to out that stuff in there
i think I did it wrong
cause it gave me the index crash
do I just get rid of Game
oh wait duh ofc
It’s literally in an igo
How hard is making editions 🤔
I wanna make one that just increases mult, chips and xmult, visually it would just have the voucher effect but with a new sprite (if that’s possible)
attempt to call method ‘prep_stage’ (a nil value)
Did you delete your start run hook?
I… left it empty
Forgot to get rid of it
at least it was a simple one
ok this time for sure
I tried to copy a card to my joker area and the game said no
should i be using brackets instead of parentheses
i mean i know the code said parentheses but it's expecting a table
if (ret and next(ret)) or trig
k
crashed when the conditions were fulfilled
i guess i cant do this?
i thought it would count ante
it's late tho so i'll figure it out later
idk what's crashing it now
key = "s_fire",
badge_colour = HEX("E73020"),
loc_txt = {
name = 'Element',
text = {
'{C:1,B:fire}Fire{}',
},
},
rate = 0.0,
atlas = 'elements',
pos = { x = 0, y = 0 },
}```
You're using B but you're not returning any colours.
i defined them in the main lua file
No? If your using B then you need to return colours.
Use X then
I unpacked Balatro's source code and only found surface-level stuff, where's the code for vanilla jokers? as in the code that is used for joker effects. I need it for references while writing code for new jokers
card.lua
thanks :)
this chips = line is throwing an error. Any ideas to fix it?
think I fixed it
ok so
the pseudorandom is still throwing an error, but when I remove it the code works perfectly fine
so is it possible to use the pseudorandom function at all?
Yes, you're just using it when it doesn't exist yet I assume.
Also chips is not a valid input.
You need to use calculate if you want it to give a random amount of chips.
yeah, I figured that much out 😅
ah, ok. Why does pseudorandom work in some files and not others?
i've added labels for it in en-us.lua but it doesn't display the label
What does misc > labels look like?
@sage crater
but like
why does it exist in some files and not others
because I've used it with no issues in other contexts
It does exist, it just doesn't exist when the game is loading your joker.
misc = {
labels = {
s_fire = "Fire",
s_poison = "Poison",
s_light = "Light",
s_water = "Water",
s_earth = "Earth",
s_ice = "Ice",
s_electric = "Electricity",
s_dark = "Darkness",
s_wind = "Wind",
s_steel = "Steel",
s_grass = "Grass",
s_mix = "Mix",
},
}
}```
You need your mod prefix.
interesting
on every key mentioned here?
Yes.
nope, still isn't working
What does misc > labels look like?
misc = {
labels = {
CRPack_s_fire = "Fire",
CRPack_s_poison = "Poison",
CRPack_s_light = "Light",
CRPack_s_water = "Water",
CRPack_s_earth = "Earth",
CRPack_s_ice = "Ice",
CRPack_s_electric = "Electricity",
CRPack_s_dark = "Darkness",
CRPack_s_wind = "Wind",
CRPack_s_steel = "Steel",
CRPack_s_grass = "Grass",
CRPack_s_mix = "Mix",
},
}
}```
how do I change this so it runs the function on the enhancement instead of the card that has the enhancement?
is it with .center?
fish_card.config.center:setChips?
and is this set up correctly?
I think so.
Log?
think I fixed it
I used math.randomseed("fish") to set a seed so it follows the convention of every other use of randomness in this game, but it turns out the seed needs to be a number instead of a string
nvm it's still crashing, but now for a different reason 😔
it's complaining about line 163
I'm probably misunderstanding how to set up a function or something
ok, I think I figured it out
ok, I did :D
I think the latest version of SMODS changed how the custom deck is implemented
How would I alter the code so that it doesn't crash when I view the deck?
What is that line in src/overrides.lua?
Here is the relevant line within SMODS
i should make a modded deck soon so i can help with these
I should mention that it only crashes when clicking on the deck to view it
Playing through the modified deck works fine
Try putting if not G.playing_cards then return false end in the event.
How would I go about making a tooltip for Wheel of Fortune in my Joker's description
I'm not sure what the tooltip key would be
G.P_CENTERS["c_wheel_of_fortune"]?
Either of these does not change the outcome, it crashes with the same error
thank u :>
how wud i go about adding that tooltip actually 
Unless it's just {V:G.P_CENTERS["c_wheel_of_fortune"]}
Hey guys, how do I make it so a custom seal is applied as the card kinda wiggles when it is selected. This is happening
info_queue[#info_queue+1] = G.P_CENTERS["c_wheel_of_fortune"]?
o
Thanks 
You use set_seal
I know, but that applies the seal before the card is raised up and 'wiggled'
Put it outside of an event.
ok
that didn't work, all the seals appear as soon as I click use
Yes.
Those are the only two ways.
I am trying to make it act like that one spectral card that adds the red or purple seal
But this is close enough ig
do you know how to read source code of the game?
the source code is not in SMOD format
basic logic is the same?
sorta
you just replace vanilla functions with SMODS ones
are you using VScode?
yes
that is definition
you have more than 1 search result
you can see them on the left
I see
this took a bit, but the execution is something magnificent
I would watch the video but my internet is slower than an adult without coffee rn
That might just be the slowest thing ever
it has been like 10 minutes and the video is still not fully loaded
😭
it's not applying my gradient on the sticker description and badge
sticker code (in stickers.lua):
key = "sticker_mix",
badge_colour = mixture,
loc_txt = {
name = 'Element',
text = {
'{C:white,X:CRPack_mixture}Mix{}',
},
},
rate = 0.0,
atlas = 'elements',
pos = { x = 5, y = 1 },
}```
gradiant code (in main file):
```local mixture = SMODS.Gradient {
key = 'mixture',
colours = {HEX("F57B4B"), HEX("FEF377"), HEX("9AF983"), HEX("6E9EFE")},
cycle = 5,
interpolation = 'trig',
}```
Did you put the gradient in loc_colours?
How would I go about modifying Wheel of Fortune with a Joker
I had an idea for a Joker that upgraded Wheel of Fortune by changing the foil probability to holo, changing the holo probability to poly, and changing the poly probability to negative
1.0.0 beta 0509c
and you're sure that's your prefix right?
yep, CRPack
You would either hook poll_edition or take ownership of wheel of fortune.
wait nvm lol
Hmm
How easy is taking ownership
Does anyone know what type of timer i could use within set_blind that wouldn't crash the game?
ok, so i fixed the prefix. the gradient is still not working
What is the goal?
uhh idk then
that's what im saying
Decrease the scored chips by 25 per second
While in the blind or while in the ante?
only while in the blind
You would hook update and check if the current blind is that blind then you would do some math with dt and decrease the chips accordingly.
Yahi's mod has a blind that actively sets your "scored chips" to lower values, even if you're still selecting cards and what not.
how can i check how many cards there are in a played hand?
#context.full_hand or #G.play.cards work.
how do you add description of a sticker to joker description?
i got this crash with this code ```lua calculate = function(self,card,context)
if not context.end_of_round and context.repetition and context.other_card == context.scoring_hand[pseudorandom("seed",1,context.full_hand)] then
return {repetitions = pseudorandom("seed", 1, 10)}
end
end,
It's #context.full_hand
oh my bad
that's going to randomize once for each card btw
How I can get the card's chips value?
I'm trying to multiply the chips with a seal's mult
card:get_chip_bonus()
chip_bonus() count as base chips?
yeah i saw that while testing, its not my intention, how would i make it only trigger on one of the cards?
I mean, the word "bonus" make me think that is a extra amount of chips, like a 10 card + get_chip_bonus()
No, it's all the chips from a card.
bonus is another word for chips
is it possible to add description of sticker to joker's description?
I want to change the chip's value of a card with a seal, What is the context for that?
loc_vars = function(self, info_queue, card) -- Add description of G.P_Joker info_queue[#info_queue + 1] = G.P_CENTERS.m_stone ... end,
This should work
you would need to pick a card in an earlier context and save the index
Is it possible to make it so that you can draw more cards even if your hand is full?
would this work?```lua calculate = function(self,card,context)
if context.before and context.cardarea == G.play then
card.ability.extra.sel_card = pseudorandom("seed",1,#context.full_hand)
if not context.end_of_round and context.repetition and context.other_card == context.scoring_hand[sel_card] then
return {repetitions = pseudorandom("seed", 1, 10)}
end
end,```
yes
hi i have a question
ok, thanks for your help everyone!
How difficult is it to create a new card?
what type of card
it's not that hard https://github.com/Steamodded/smods/wiki/SMODS.Rank-and-SMODS.Suit
damn
dayum
doesn't seem to work at all
I want to change the bonus of a card with a seal, what I sould do?
ohhhh thx
i tough it would be more difficult
i might try the other way by making an entry for it
this doesnt seem to be updating the value of the selected card, anyone know why? ```lua calculate = function(self,card,context)
if context.before and context.cardarea == G.play then
card.ability.extra.sel_card = pseudorandom("seed",1,#context.full_hand)
end
if not context.end_of_round and context.repetition and context.other_card == context.scoring_hand[card.ability.extra.sel_card] then
return {repetitions = pseudorandom("seed", 1, 10)}
end
end, ```
its supposed to change it before playing the hand but its not doing it
oh wait remove context.cardarea == G.play in the before
ok that worked, thank you again!
i made descriptions in en-use.lua as a workaround to add sticker descriptions to joker decriptions. but how do i add these custom descriptions?
element_fire = {
name = "Element",
text = {
'{C:white,X:fire}Fire{}',
},
},```
{ set = "Other", key = "element_fire" }
why isnt it working?
loc_vars?
oh right
uh... i wanted it to show beside the main description, not replace it
not in the return
info_queue[#info_queue+1] = { set = "Other", key = "element_fire" }
Earth
it's only visual for now. might need to make a function to actually detect elements from cards
using pokermon to reference code was a bad idea because nothing's in the same place
how would i make a joker that retriggers a card if it has a specific seal on it?
if context.repetition and card.seal == "modprefix_seal" then return {repetitions = 1} end
thanks!
this code doesnt retrigger the cards though?
i just tried it
context.other_card.seal
do i do this then?
Yes.
alr thanks that works!
why is it not changing the color? (the text is stored in en-us.lua)
Are those colours in loc_colours?
uh, no
Where are they then?
how do i make a joker destroy itself?
card:start_dissolve()
in the same file that contains the rarities
Yes, where did you define the colours?
i was referencing the rarities for the colors
Is that your prefix and key?
yes. the keys are for rarities
wasnt your rarity crcommon
where do i put that?, i added it to the calculate and it isnt working calculate = function(self,card,context) if context.end_of_round and context.cardarea == G.jokers then card:start_dissolve() card.ability.extra.gain = card.ability.extra.gain + 1 return { dollars = card.ability.extra.gain } end end,
i changed it to just "common"
because i would be using the prefix anyway
anyways, i'll just define all the static colors
still have no idea why gradients won't work
yeah, the gradients don't work
Please add Milky Way cookie and strawberry shortcake cookie
Because they are cute
🥺
how would i make a joker that gives xchips if a card with a certain seal is played?
bc this doesnt work
ok, gradients are totally broken everywhere
if context.individual and context.cardarea == G.play
never mind, they don't work in descriptions only
How do you throw an error and halt/crash/stop/whatever the game?
error('msg')
thank you
If you don't want to show the source line of crash, error('msg',0).
I use it in my Incantation fork check on startup. 0 is the verbosity level, fwiw.
are there any more verbosity levels?
why even mention this in the guide if you can't even use those colors?
1 and 2...
does that make it crash?
error() triggers the exception handler, so, yes.
you can
ive done it
then why it isn't working?
Try logging G.LOC_COLOURS in the console
You might be using the wrong key
how do you do that?
i honestly haven't been using it because i have no idea how to
If you have it you should be able to just press / to open the console
yeah, that's the only thing i know
In that console type help
And press enter
You'll get a list of commands
You can execute lua code with eval
So try running "eval G.LOC_COLOURS"
it will print the table for you to see
that didn't help a bit
how would i make it so a joker can check if theres another specific joker and pull off a calculate function off of that
I must've gotten the variable name wrong
I don't remember exactly what it was
Try G.LOC_COLOUR or G.LOC_COLORS
it has to be one of those I swear
eval G.ARGS.LOC_COLOURS
Thanks!
why is other_joker a nil value here?
context.other_joker doesnt exist in context.end_of_round
so what would i do if i want that effect to be active at the end of round
Well, it might exist at some point, but not in every end_of_round context
context.end_of_round and context.main_eval
What is your goal exactly?
so i just do this?
Have an end of round effect if you have a specific joker?
no sob, but yeah itd be helpful if we know what ur trying to do here
i want good whatsapp to disappear if evil whatsapp is present at the end of round
kind of yeah
context.end_of_round and context.main_eval in if statement
then use for loop to go through G.jokers.cards and check if evil whatsapp exists
or that, yeah
hiya — i'm making a Partner with the ability Tarot cards in your consumable area give X1.5 Mult
context.end_of_round and context.main_eval and next(SMODS.find_card("your_joker_id"))
how would i do this? would context.cardarea == G.consumeables be part of it? [if so, i should be able to finish the code]
context.other_consumeable and context.other_consumeable.ability.set == "Tarot"?
If that doesn't work try context.individual and the cardarea check
context.individual is only for playing cards?
I think it happens for all cardareas
Try it! Print context inside an if context.individual
how would i make a for loop to look for it though?
Use this @north swallow
oh alr i didnt see that
Replace your joker id with the key for the joker you want to check for
let me see if it works
it should be prefix_jokerkey, where prefix is your mod prefix
what about j_
so i do this?
It definitely doesn't.
The condition looks right, idk about the rest
Weird
How do I "score" held in hand card abilities?
individual is for hand, discard and deck
other_* is for the joker-like areas
neither of these worked
Code?
here's what it's like at the moment, this is me trying the second condition but removing the context
does SMODS.calculate_context({cardarea = G.hand, individual = true, other_card = "card in here"}) work?
just a guess
both do nothing, regardless of context.individual
I swear it wasn't like this before
i mean maybe, ive only been modding since newcalc
[oh ya, i also tried context.other_card to see if that would work too]
Anyway, you didn't use other_consumeable here
I'm mainly messing around with SMODS.calculate_main_scoring... and, well, I'd want to trigger such abilities, but in reverse order. calculate_context would do it in the right order.
[i did also try other_consumeable]
Show the code but with context.other_consumeable
in the right order?
From left to right... I'd want to do it backwards from right to left.
xmult is valid too
you can certainly do that, im pretty sure, smt like a for loop with a table of cards from right to left and calculate_context should work?
Mainly to match this.
ah wait, lemme try something
-# actually... hm... :)
why isn't there "blueprint_compat" in example joker mod? are jokers compatible with print/storm by default?
aha! ya it's different for the Partner API :}
if context.partner_other_main and context.other_card and context.other_card.ability.set == "Tarot" then
how do you load lua files that arent the main one
im getting started with modding (again) and need to know
assert(SMODS.load_file("file.lua"))()
No.
ye.
thanks
how would you go about updating a card's soul layer given a spritesheet of soul layers
this is the sprite sheet, the rightmost is the base layer
card.children.floating_sprite:set_sprite_pos({x = number, y = number})?
oooh
so i WAS using the wrong key
yeah that was perf ty!!!
the prefix is always lowercase
it was not working because i kept the prefix in uppercase
Did you manage to make it work
sorry for asking again, how can i make a joker destroy itself, kinda like how gross michel does it (at end of round i mean)? someone told me to add card:start_dissolve() but it didnt seem to work
yeah. apparently prefix has to be in lowercase if the key is referenced as a color
you should be able to just use gross michel's destroying code
adapting it to your joker of course
where do i find that in the game's code?
Mods/lovely/dump/card.lua
and ctrl + f for "gros michel"
reminder that where the game uses self you want to use card instead
hey at least you learned to use debugplus console thanks to this, very helpful tool
ok thanks!
Assuming you are on newest smods use SMODS.destroy_cards(card)
local seljoker = pseudorandom_element(G.jokers.cards, pseudoseed('aeiou'))
if not seljoker.edition then ... end
@ancient plinth
im on this version (1.0.0~BETA-0419b-STEAMODDED) is this the newest?
ok, i'll get the newest then
yippieee
i got this crash after adding that
if context.end_of_round and context.cardarea == G.jokers then
SMODS.destroy_cards(card)
card.ability.extra.gain = card.ability.extra.gain + 1
return { dollars = card.ability.extra.gain }
end
end, ```
update smods
-# it’s not on the release candidate yet, just the dev build, but I think I’ll probably update the release tomorrow
oh i didnt download the dev build, only the normal one, my bad
ok its working now, thanks everyone!
sorry for late response, i basically just saw this. How would i set something like this up?
what's the default joker atlas called
Thanks
Joker
how do call the increase in chance of oops all sixes to make a random ability more likely to happen?
i want this to be more likely if you have oops all sixes```lua pseudorandom("seed",1,4) * chance >= 4
Does anyone know where exactly the function for a card tallying the chips/mult attached to it is?
as in, the animation itself
I looked through Talisman's disable_anims thing and couldn't find anything associated with it
anybody happen to know where I can find the legendary joker background like perkeo or chichot or something?
extract the game as a zip file -> assets/1x/
how can i destroy every heart suit card?
the chance is in G.GAME.probabilities.normal
that value will be 1 if no oops, and 2 with oops
you can find that used everywhere in the card.lua file of the game if you need examples
Or 0.5 with Debian.
-# #completelyunoriginal
ok thanks everyone!
what am i supposed to put in the pseudorandom? ```lua if pseudorandom("seed",1,4) <= G.GAME.probabilities.normal/self.ability.extra.odds then
Remove ,1,4
note that this doesn't work on macos until next plausible lovely update
is it possible to reference an array from a different file?
yes, make it a global
uh... how?
im getting this crash, whats wrong with the code? lua calculate = function(self,card,context) if context.end_of_round and context.cardarea == G.jokers then if pseudorandom("seed") <= G.GAME.probabilities.normal/card.ability.extra.odds then SMODS.destroy_cards(card) return { message = "Destroyed" } end card.ability.extra.gain = card.ability.extra.gain + 1 return { dollars = card.ability.extra.gain } end end,
so i'll put global instead?
weird
no
No, you just remove local
just var = x
so... how i'll reference this from a different file? each joker has their own list
It would be teams = {
nvm i figured it out
What actually happens?
so if i want to access it in a for loop in different file, i'll do for i = 1, teams{brave_team}?
what yall think
No, it would be #teams.brave_team
new joker subtype "forager" will create a card when completing a boss blind
Be aware that this is a global declaration for the entire program and all of its code, so if any other mod declares a global table called teams, you'll be stepping on each other's toes. Consider using a more specific name, or adding it as a member of your mod's table if you already have a global table declared
Addition to the forager card part: eating the card produced by the harpy will destroy it instead of debuffing it
The only reason this wouldn't be op is because fruit cards can ONLY play a high card, and only the first fruit will score. Of course, the chips and mult are adjusted for this but still
back from yesterday
this line causes my game to crash. is this not how i can ante check?
i can't load the file
in main .lua file:
local func = NFS.getDirectoryItems(mod_dir.."functions")
for _, file in ipairs(func) do
SMODS.load_file("functions/"..file)()
end```
youre not loading the file
nothing
uh... yeah, i can clearly see it's not loaded 😭
the patch does not apply
Yeah but does anything at all show in the console I mean
Like that it couldn't find a match or smth
then how do i actually load it?
typing
i only know how to use SMODS.load_file to access files in the root, but not inside other folders
what's your mod_dir set to
"cookie run" folder in the mods folder
is that what you ask?


