#💻・modding-dev
1 messages · Page 462 of 1
How do I set a cards rank?
SMODS.change_base(card, nil, "Rank")
is there any way to for lack of a better word, "spawn in" a joker for testing purposes?
Yes.
thats great :D could you direct me to where i could find the documentation on this? (or just tell me if thats easier lol)
thank you !!
How would I upgrade a specific hand in a joker?
SMODS.smart_level_up_hand(card, "handname")
@red flower oh btw
SMODS.merge_effects' behavior with retriggers is rather weird
How can I stop this from drawing when the joker is undiscovered?
draw = function(self, card, layer)
if (layer == 'card' or layer == 'both') and card.sprite_facing == 'front' then
local scale_mod = 0.05 + 0.05 * math.sin(1.8 * G.TIMERS.REAL) +
0.07 * math.sin((G.TIMERS.REAL - math.floor(G.TIMERS.REAL)) * math.pi * 14) *
(1 - (G.TIMERS.REAL - math.floor(G.TIMERS.REAL))) ^ 3
local rotate_mod = 0.1 * math.sin(1.219 * G.TIMERS.REAL) +
0.07 * math.sin((G.TIMERS.REAL) * math.pi * 5) * (1 - (G.TIMERS.REAL - math.floor(G.TIMERS.REAL))) ^ 2
local image = Sprite(0, 0, 71, 95, G.ASSET_ATLAS["willatro_WillatroOrgans"], {x = 1, y = 0})
image.role.draw_major = card
image:draw_shader('dissolve', 0, nil, nil, card.children.center, scale_mod, rotate_mod, nil,
0.1 + 0.03 * math.sin(1.8 * G.TIMERS.REAL), nil, 0.6)
image:draw_shader('dissolve', nil, nil, nil, card.children.center, scale_mod, rotate_mod)
end
end
if card.config.center.discovered?
how do i stop my Bass-Bamb joker's Sprite not showing?
how do i make a joker have a numerator other than 1 in its probability?
Are you on the dev version of SMODS?
i don't believe so
Then you would do (G.GAME.probabilities.normal * number)
not enough info
what sprite is it showing now
i just have this currently, do i just replace all of it with your thing?
G.GAME and G.GAME.probabilities.normal or 1
oh mb it's showing nothing
G.GAME and (G.GAME.probabilities.normal * number) or number?
how do i make it so a joker checks if the score of the hand played is equal to or greater than the blind size?
is this right for the if on if it activates now? i feel like it activates very rarely when testing it in-game now 🤔
if pseudorandom("theduo_book") < G.GAME.probabilities.normal / card.ability.extra.odds
(or i might just be unlucky)
if pseudorandom("theduo_book") < (G.GAME.probabilities.normal * number) / card.ability.extra.odds?
that'll probability do it
{
"id": "joker_one_punch_man",
"name": "One punch man",
"description": "Your hand size is 1. Played hands gain x5 mult.",
"type": "joker",
"rarity": "3",
"effect": {
"on_start_turn": {
"set_hand_size": 1
},
"on_hand_played": {
"multiply_score": 5
}
},
"art": "tunnel_vision.png",
"price": 10,
"tags": ["hand_size", "multiplier"]
}
Will this code work I made it using chatgpt . Set hand to 1 and give 5x mult
uh,
No
you should learn the basics of lua and look at the smods wiki. chatgpt wont help you
it doesnt know anything about making balatro mods
or at least not that i know of
Hmmm
learning the basics of lua is very easy, it shouldnt be that hard. you can also check for references from other mods or online.
wtf gpt got joker tags before smods
I know about SMODS.change_play_limit but is there a way to get the play limit?
that's insane
G.GAME.starting_params.play_limit?
Can't seem to find it on the wiki, how do you check what enhancement a playing card has?
SMODS.has_enhancement
or SMODS.get_enhancements to get a table of what enhancements the card has
ohhh so the "key" parameter is what enhancement youre checking for?
does anyone know why the game would crash when you hover over your custom joker
sweet thanks :^) is there a reference somewhere for the name of each one? im specifically looking for the mult enhancement but cant find it
is there no other context provided other than this
- whats the crash log
- whats the code
here's the code for it. ignore the funny stats it was just for testing
unrelated but use mult instead of mult_mod :3
i don't know much about lua i've just been copying off of example code so i'm curious why it's crashing
the art and price show up fine in the shop but as soon as my mouse goes near it, it crashes
vars in your loc_vars should be a table
loc_vars = function(self, info_queue, card)
return{vars = {card.ability.extra.mult}}
end,
how would i check if the current joker is in the rightmost joker slot
elaborate a bit pls
alrighty
if G.jokers.cards[#G.jokers.cards] == card then
G.GAME.round_resets.ante? 🤔
could be wrong though, lemme check
yeah nevermind its correct
tyty
So if I wanted a joker to remove hands and grant an xmult what would the calculate look like as such removing all hands but one and granting 5x mult
Because I'm a little confused as the context is different
Never done such thing before
hmmmm can anyone help me find out what's causing the error to throw? it looks like some bracket mess-ups but they seem to be all properly closed to me 🤔
is there a way to detect specifically when a boss blind is defeated?
how?
if context.end_of_round and context.main_eval and G.GAME.blind.boss
Have you tried installing the lua extension?
what's at line 65 in jrwi.lua
oops, thought i did already, did that now! no red squiggles or anything illuminating though unfortunately
ah , thought i caught the line nums in the original screenshot!
You're missing a , after the key
ahhhh! thank you!
was so caught up looking for brackets i didn't think about commas XD
restart your VS Code window
i have
Bump
does anybody know what's causing the extra yellow box text to appear after the initial "+6 mult" red box
Remove the message.
so that doesn't remove the initial +6 mult message as well?
ah okay thanks
i'm reading this annotated lua code (from examplejokers mod) and some of the stuff they're saying is slightly off
if #context.full_hand == 1 and context.destroy_card == context.full_hand[1] and G.GAME.current_round.hands_played == 0 then
return {
remove = true
}
end```
i wanna make a variable increase but i cant put it in the return, where else can i put it?
Outside of the return.
oh, it was just not working earlier. ok thanks
what mod are you playing holy
wait no i meant
what guide are you following
I'm guessing the example hasn't been updated in some time
soooo
i think you might want to look at vanillaremade
Question: why can't I do SMODS.create_card({set = "Joker", area = G.jokers, key = G.jokers.cards[1].key}) to create the joker in the first slot? Ik G.jokers.cards[1].key works (It just makes a random joker)
the message in the return table isn't doing anything?
nor is the rest of the return table for that matter
G.joker.cards[1] isn’t the key of the joker
Use a local variable
G.jokers.cards[1].config.center.key returns the key
That's such a long string of words but noted, ty!
Hi Everyone. I have a rather hard question. I've already asked it yesterday and thankfully N gave me a hint, but also after looking in the source code and other mods, i still cant find out how to use G.STATE to create a new "Screen" (I want to have some sort of countdown with two tags displayed)
Edit: I know that each "state" is a screen (G.STATES.SELECTING_HAND = 1, G.STATES.TAROT_PACK = 9, etc.) so the last thing i need to know is how to create a state and how to define what comes in that state. (And what conditions there are to needing to modify the state)
Hey there! For some reason this line here crashes the game if jokerExists('j_FinusHD_totk') then decrementingTickEvent('j_FinusHD_totk',0) end With it saying attempt to call global 'jokerExists' [a nil value]
seems liike the jokerExists functioin/variable isnt defined
Oooooh, okay that makes sense hahaha
I thought that was like a standart method but no lmao thx
r u german
btw
while i was searching for something i found this
find_joker('Chaos the Clown')
idk if that works, but SMODS.find_card('j_prefix_key') works
yes
das funktioniert auch
I would still be talking in english here tho lmao
lmao
its an easyer language for me tho so i alwways speak it when i dont need to speak english
makes sense
So I am trying to make an animated joker, but it for some obscure reason stretch the hell out on the vertical axis 😭
(first image is the strechted version the right is what it's supposed to be)
I am trying to "borrow" the yahimod code for subway surfers for that, but the code that is from that mod is credited (1/2)
key = 'totkanim',
path = 'highlighsvid.png',
px = 71,
py = 96
}
SMODS.Joker {
key = 'totk',
atlas = 'totkanim',
pos = {x=0, y=0},
cost = 6,
pixel_size = { w = 71 , h = 96 },
frame = 0,
unlocked = true,
discovered = true,
blueprint_compat = false,
eternal_compat = true,
perishable_compat = true,
config = {extra = {chips = 871,77, mult = 23}},
loc_txt = {
name = 'Willkommen zu den TOTK Highlights',
text = {
'Gibt die Anzahl an',
'{C:chips}Chips{} basierend auf',
'die total View Duration',
'von allen TOTK Highlights,',
'{C:mult}Mult{} basierend auf',
'die Anzahl an TOTK Highlights',
'und {C:money}Geld{} basierend auf',
'die Einahmen von allen',
'TOTK Highlights'
}
},
calculate = function(self, card, context)
if context.joker_main then
return {
chip_mod = card.ability.extra.chips,
mult_mod = card.ability.extra.mult,
message = 'Willkommen zu den Tears of the Kingdom Highlights, mit mir FinusHD!',
sound = 'FinusHD_totksfx'
}
end
end,
calc_dollar_bonus = function(Self, card, context)
return 0
end
}```
local upd = Game.update
function Game:update(dt)
upd(self, dt)
-- tick based events
if ticks == nil then ticks = 0 end
if dtcounter == nil then dtcounter = 0 end
dtcounter = dtcounter+dt
dt = dt
while dtcounter >= 0.010 do
ticks = ticks + 1
dtcounter = dtcounter - 0.010
if SMODS.find_card('j_FinusHD_totk') then decrementingTickEvent('j_FinusHD_totk',0) end
end
end
-- Yahimod lmao
function decrementingTickEvent(type,tick)
if math.fmod(ticks,12) == 0 then
local _subcardcenter = G.P_CENTERS.j_FinusHD_totk
_subcardcenter.frame = _subcardcenter.frame + 1
local _fr = _subcardcenter.frame
_subcardcenter.pos.x = math.fmod(_fr,16)
_subcardcenter.pos.y = math.floor(_fr/16)
if _subcardcenter.frame > 253 then _subcardcenter.frame = 0 end
end
end``` (2/2 sry for the huge wall of text lmao)
why isn't my decks texture here ?
(and yes my texutres are in the asset folder)
Send a screenshot of the sprite
the pos was indeed wrong i might have miss types
typed*
wtf why does my deck does that to the jokers ? the jokers themselves don't do that
sorry for the lagyy asf recording my pc handles badly obs
Maybe check your atlas id
It should be different if they’re in different atlases
Wait is the background the problem ?
no the joker being able to be everywhere and not returning to the joker bar where they should be
Hmmm
You know that
This only
Emplaces the last card right ?
You have to do it after each addition of joker
Try that
still does it
Cute boys
indeed
for future reference, SMODS.add_card is a function added that does the same thing as create_card then add_to_deck
thnaks, but my deck works like this, knowing myself i'll probably copy paste it for future decks like this x)
First time trying to do retriggers and such, trying to make a joker that's basically double sided blueprint
any tips?
have you tested it like this ?
You need context.repetition
but i rhink you should add a repetition = 1 in the config part
To do repetetions=
also this
(For crossmod stuff yes )
Jokers that double values , etc
hol up so the rest of the code is correct??
Context.orher_card need context.individual and context.cardarea==“specific card area “ as example G.play
Depends on if you’re trying to trigger jokers or card
Or both
jokers
hi, does someone know how to change a sound using a mod? bcs im getting a brain aneurysm using gpt (I cant find any mods that do that, thats why im using gpt)
replace an existing one
yeah I can see that
Do you know the basics of modding by any chance
Also you sound need to be ogg format ( you can find a convertor online )
bare minimum
did that alredy
thnx
sure
Some people genuinely are brain dead , its simple just follow what i tell you to😭
Do you have any code editing software? Vscode preferably
is notepadd++ ok?
Sure
You’re gonna make a basic mod folder
You need to file codes
First is .lua
Second is .json
Mods
└──your mod name
├── code.lua
└── assets
└── sounds
├── sound.ogg
i have it like that
Great
can assets be Assets or does it need to be "a"
empty
Okay 1 sec
"id": "VSMODS",
"name": "Vanilla SMODS",
"author": ["someone23832"],
"description": "Turns some vanilla jokers into an SMODS format, and changes them to give some examples of what you can do.",
"prefix": "mvan",
"main_file": "ModdedVanilla.lua",
"badge_colour": "c7638f",
"dependencies": [
"Steamodded (>=1.0.0~ALPHA-1225a)"
],
"version": "1.0.0"
}```
Put this in your .json
And change the needed stuff
ok, give me a sec
(Main_file)
Take your time
what is a prefix?
Anything
Its an identification for your mod
Name it whatever
Oh ok
im done
Great work
what should be the .json called? can it be mod.json?
Anything
ok
its the same
ok
You’re gonna do this
so erm i knda need help i tried to restructure idol to only chose a rank and just wipe that rank out of the deck at the end of the round but its not working and i have no idea why
path = {
default= 'my_sound.ogg'
}
Key=“something”,}
can jokers have the hidden attribute and appear in spectral packs
whoosh1.ogg
No like which sound in game to you want to replace with that
thats the sounds name
or do you mean that to play my sound instead of this one? (like in one instance, and not to replace it permanently)
yeah
Okay wait let me see
it plays when the game is opened
Ohhh
(it plays slowed and it took me like 15 mins to find what is it bcs I couldnt find that sound in game files)
damm 😔
Check other files
ok
bump
Check this
Replace :
self:create_replace_sound(replace)
Try using the file name instead of key
i was there, and i didnt understend most of it
Add this to your SMODS.sound
it looks like the whoosh1 sound (idk abt the other ones) doesnt have a key (? if thats possible) and when its supposed to play its just play_sound('whoosh1', 0.55, 0.62)
where?
Try “whoosh1” or “whoosh1.ohh” here
oh ok
Wrong context
what should i be using bcoz i tried everythig befre this lmao at that point i gave up and put anything i can think of
You need to do a for loop in playing_cards and when v==your card
Return {remove=true}
it should look like this?```
SMODS.sound={
path = {
default= 'Witches_call.ogg'
}
Key="call",
self:create_replace_sound("whoosh1")
} or like thisSMODS.sound={
path = {
default= 'Witches_call.ogg'
}
Key="call",}
self:create_replace_sound("whoosh1")
1st
If you’re using
For _, v in inprais(context.playing_cards )
Add a ,
After path
After the }
ohh
Yeah lua tend to do it a lot lmao
how do i do that
Local Card=your chosen card
For _,v in inpairs (context.playing_cards) do
If v==card then
Return {remove=true }
End
End
it didnt work
For you the card is called deathnote
Here
ok
SMODS.sound={
path = {
default= 'Witches_call.ogg'
},
Key="call",
self:create_replace_sound("whoosh1")
}```
Wait
Alright
This should work
Ohhh
Wait lemme double check
@daring fern NEED HELP
you might need to include
A function
is this to me or to him?
Replace =function(self)
Return {self:the rest of the line}
End
I think !
Keyword think
Man i really don’t know
Wait
@tall wharf
HELP !!
hi
hi
it's the thought that counts
😭sorry i couldn’t help
or smth (idk if i translated it good)
no problem
i didnt saw any mods that do that so its probobly hard
what do you want to replace
THATS THE PROBLEM
add replace = "whoosh1"
💀
doesn't replace = "whoosh1" work
I’m gonna kill myself
to where brother 😔
SMODS.Sound
dont do that
and replace it with what?
where do I put it? (the thing that im replacing with)
Aiko please stab me and throw my body in a bathtub full of acid
SMODS.Sound{
key = "key",
replace = "whoosh1",
other variables
}
It's a me again.
I gave up on making a new ui since i for the love of god coulddnt find the code where ui defs are stored.
But I had another question. Is it theoretically possible to make some sort of notification popup. Like ik how to make ui but not how to make a persistent one that goes over every item and moves in and out
omw asking hiiragi to dmca aikoshen
😭
i can try that
sec
idk if thats what you are looking for
mine only replaces vanilla when in story mode
idk what a story mode is
it's a thing akin to my mod, #1366605767167443006
Did you figured it out yet ?
how do you use create_card to make a specific joker
And a second question: how can i make an event or function run after a set time
nope
Delay =
Show code
i mean like
path = {
default= 'Witches_call.ogg'
},
Key="call",
Replace =function(self)
Return {self:create_replace_sound("whoosh1")},
}```
I think add_card does that
path = {
default= 'Witches_call.ogg'
},
Key="call",
Replace=“whoosh1”,
}```
Try this
Idk if create_card takes key as a value
i have good news and bad news
Good news is
i remembered that more fluff does it
good news is that it doesnt crash
everything is case sensitive, so:
sound={ should be Sound{ (without equal)
Key should be key
Replace should be replace and just "whoosh1" instead of a function
Lmao
and bad that it doesnt work
Sound{ or sound{
the former
Sound{
omg thank you so much
if anyone is curious it sounds like complete ass
Change values and pitch
There are optional values
Change them
ok
Good luck
ch_c_mintconditioncards_money_limit = "Money held can not exceed {C:money}$#1#{}"
}```
i want to create a challenge's restriction description but this just crashes the game on load
bcs i dont understend a single bit of whats here or how to reverse it (its the part that plays the sound) ```if card.T.scale <= 0 then
if temp_i < 30 then
play_sound('whoosh1', temp_pitch + math.random()0.05, 0.25(1 - temp_i/50))
end
if temp_i == 15 then
play_sound('whoosh_long',0.9, 0.7)
end
G.VIBRATION = G.VIBRATION + 0.1
card:remove()
return true
Ok i hope this reaches the correct person:
Does anyone know how i can hook up a new state to a UI Screen. I've heard hardly anyone has done that. Please i need help
useful joker award
the "the" rarity really sells this
im trying to make certain jokers in my booster pack show up less than other jokers and this doesnt work, knowing me im 100% doing something incredibly wrong (this is in the objectType btw)
nvm
figured it out
Just like theone fr
yeah idk what i did but it didnt work yet again i gave it time and tried everything
how would i make different sell conditions for different jokers without overwriting one another's can_sell_card function?
so changing the pich and volume does nothing but ill leavie it be
hi i wanted to change the base game music but i dont understand what this means in the wiki, what code does it refer to? Your track's sound code must contain the string music if you are using this.
you dont necessarily need to overwrite it, just do a hook
actually, one more thing
i want this hook to reduce the money to the money limit if the money exceeds the limit
but it's not doing anything
this is what myst's firebird does
im guessing your if statement doesnt go through? 🤔
try putting a print in there to see
Can you show code
Lr haven’t you coded anything yet
the smods.sound?
Yes
SMODS.Sound{
key = "BOOM",
path = "BOOM.wav",
select_music_track = function (self)
return 99999999999999
end
}
oh
path = {
default= 'sound.ogg'
},
Key="call",
Replace=“sound 2”,
}```
This is how to replace
Find “Sound 2” in the game code
The string for the main menu
doesn't look like it's doing anything
ok thanks
[behind the text is 14$ btw]
mm the if statements are wrong then
idk watchu doin tho, is this limiting payout to a certain number?
basically
it acts as a "cap" for the total money you can hold
oh, i think i see whats wrong
would something like this work?
the first one is checking whether G.GAME.modifiers is "money_limit", aka when its a string, and the second one seems to use G.GAME.modifiers like a table?
im pretty sure G.GAME.modifiers is a table anyways, so the first check is wrong 🤔
oh
so how else would I check for the current rule
ive tried doing something like this and the game still crashes
how do i make a shader always apply to a joker? i know ill need to use a drawstep of some kind most likely but i. do not understand drawsteps at all
if G.GAME.modifiers.money_limit and ...?
isnt there a draw function on the joker
well yes but as stated i dont understand jack shit about it
if i wanted to make it replace all music would i have to make multiple copies of this or just put something else in the replace?
You can give it a table
Check the wiki
it works!
just had to get rid of the "tonumber(" part because G.GAME.dollars is already a number
I have a mod that changes tarot cards and planet cards, is there any way to make a menu ingame to for example turn off the planet texture and only show the tarot card one?
You have to code ui
Which is
HARD
there is a first time for everything no?
if im understanding correctly this should make the title song the song in the path right? ```lua
SMODS.Sound{
key = "BOOM",
path = "BOOM.wav",
replace = "music1"
}
some table is probably empty, you need to check for that
still dont work
i feel like spunch bob
im so confused
stupid game stop crashing
it was JUST working
yeah I think so too
does it work?
I think the format is ogg
from what I read the .wav should work too
might be an old upload or smth tho
does anyone know how to make this work because im clueless
yeah the ui might be a little too hard for me...
just a little bit
Still nothing ```lua
SMODS.Sound{
key = "BOOM",
path = "BOOM.ogg",
replace = "music1"
}
You sure its the correct one
this is the code that I used, maybe try to tweak it a little bit?
path = {
default= 'Witches_call.ogg'
},
key="call",
replace = "whoosh1",
}```
There’s another method @stiff quiver
what is it?
that did work but the song is slowed down and pitched down
is that something balatro does or something i did wrong?
Change values
I think it slows it or something
Idk😭
try to find in game files where the music plays
Making a simple deckskin mod using the example and there's both skin pngs and icon pngs. Does someone here know what the icon ones are used for?
if next(full_ret) then return full_ret end?
No problemo
at your service (im not much help but I can be emotional support)
unfortunately changing the pitch did help for me (it might be hardcoded somewhere else) 😔
what do you mean?
it would be something like
local full_ret = {}
local ret = blueprint(card)
if ret and next(ret) then
table.insert(full_ret,ret)
end
if it still shows the error then then some card has a bad return
I actually just found the answer in the documentation. I guess it's for the suit icons which... I currently have as part of the card images, but I guess I'm not supposed to.
wait you are not supposed to have them as the same thing?
damm
i didnt look into making deck skins yet
That seems to be what it's implying.
local merge = {}
if left_joker_ret and next(left_joker_ret) then -- i dont even know if you need next
table.insert(merge, left_joker_ret)
end
the problem is if one of them is nil you end up with a table like {extra = {}}
do the work
that during context.repetition, repetitions = num isn't returned
I'm just gonna leave a blank transparent image in the icon and see if it works anyway.
^
it should, my guess is that its for clarity later on
Hey y'all, I'm trying to replicate those speech bubbles that Jimbo uses, based on vanilla code and code from the Partner mod. I seem to be very close to getting it to work, but for some reason no text is showing up.
function G.UIDEF.tf_speech_bubble(input_key)
local text = {}
localize{type = "quips", key = input_key, nodes=text}
local row = {}
for k, v in ipairs(text) do
row[#row+1] = {n=G.UIT.R, config={align = "cl"}, nodes=v}
end
local t = {n=G.UIT.ROOT, config = {align = "cm", minh = 1, r = 0.3, padding = 0.07, minw = 1, colour = G.C.JOKER_GREY, shadow = true}, nodes={
{n=G.UIT.C, config={align = "cm", minh = 1, r = 0.2, padding = 0.1, minw = 1, colour = G.C.WHITE}, nodes={
{n=G.UIT.C, config={align = "cm", minh = 1, r = 0.2, padding = 0.03, minw = 1, colour = G.C.WHITE}, nodes=row}
}}
}}
return t
end
yeah the key is for the rarity, not the joker
jokers don't have individual weights
bruh
so i would just put something like
key = 'legendary' or something
'Legendary' but yes
ok now the game doesn't crash when loading but crashes when the booster is about to open
im making progress!!!
whats the crash
wait did
i think i might have named something wrong
OK
i was supposed to name this rarity and not rarities
which is confusing cuz the smod documentation for ObjectTypes says its called rarities
looking at the code it looks like rarities is correct
i swear putting it rarities was making it crash
yes because something else was wrong
if you name it rarity then it just doesn't use it
yeah i just realized that lol ;-;
anyways thanks for helping me with fixing this lol
Well, the mod """Works""" but the cards come up as blank so I think I've probably misunderstood something about the template and/or its language.
Changed the icons back just in case and it didn't fix anything.
how is it?
uh
and the lc version is identical.
show the code
the tabs dont show here?
...apparently.
ok
I copy-pasted it and used Discord's "upload message as file". Maybe if I'd saved it as a text file and posted it that way the tabs would have come across.
makes sesne
is there a way to reset a custom global variable when starting a new run?
hey sup, how do i make the floating sprite of a legendary joker actually appear ? i just get the BG of it ingame
you need to set soul_pos = {x = ... , y = ...}
that's the sprite of the floating one
aight
If your custom global is inside G.GAME, it'll automatically reset on new runs.
chat will this be useful
oh neat! thanks
whats the pixel size for 1x an2x joker assets
i have no idea, try to tweak this?
its stolen but it works
the usual 1x size is 71x95 (71 in width, 95 in height)
2x is double that so 142x190
71 by 95
double it for the x2
oh you're fast
lmao
wait actually how would you initialize a custom global in G.GAME
how do i feed an image into a shader? trying to make a shader that masks out a colour in a joker and puts another image under it
just setting it with G.GAME.globalname crashes the game
why is it \\{ and not \{
escape moment
What's the error? That's how I've been setting it and it works fine.
Wait so the hearts, clubs, spades, and diamonds are all in one file?
I mean, I'll try it. Just not sure how it actually works.
oh i get it
attempt to index field 'GAME' (a nil value) and that's how i initialized it
thats an old code if i remember corectly but it works
i will donate this patch to steamodded yet again
I think it would be better to have {{} maybe
i think \\{ is less intuitive imo
If it's just at the very start of a file like that, there's probably no G.GAME until you start or load a run.
anything following \\ will be escaped
oh so i'd need to initialize it IF a run is loaded/started??
then wouldnt that prevent using \\ or do you have to do \\\\
you can just double escape yeah
sounds annoying but probably not many mods use it so its fine
besides
Likely you'd need to move the initialization into some function or context that you know will run after a run is started.
All content within G.GAME is preserved between reloads of the same run, so you don't have to worry about that.
alright, got it
thanks
Okay well now the decks aren't blank, they're using the **default **images which... I expected it to go to one or the other if it was broken, but having both come up in different cases is a bit odd to me. Can't tell if it's an improvement.
Anyway I got other stuff to do at the moment.
could you show the card images (that you are using)
hello, does anybody know why my joker is crashing when specifically trying to create a hierophant tarot card. other tarot cards work perfectly fine, just specifically hierophant gives this crash. am i spelling it wrong or something or does smods refer to it by a different name?
when you are back ping me, im interested why isnt it working
Well this is quick enough.
i am tring to make an asset but the image is becoming blur
its my first time please help
what softwere are you using?
balatro spells it wrong in the game files, its c_heirophant
i have a joker that randomizes its ability and i want it to show that value in its description but the colour tags or whatever you call them mess up and don't display
how did you eve find out
photoshope
i just guessed and swapped it around lmao
if it works it works i guess
no other error would make sense because it was working with every tarot card except that one haha
lol
try to make it 142x190
(pixels)
bcs its just compresed and idk how to get the letter to not have the outline
photoshop just does that
(most softwares do that if not all)
it looks good at 2x
How do you make it so that created card is an ace of clubs
SMODS.add_card{set="Playing Card", rank = "A", suit = "Clubs"}
thats the point, lets just say noone uses 1x and its all good
(still put the pixelated version in 1x bcs if you dont and someone turns on 1x the game just crashes)
some people said to use main_end but i have no idea how that works and i think there would prob be another way
what happends if you dont put it in ' '
game crashes on load
yeah stupid question
Can I share my progress?
I need some feedback
yeah
you can have multiple descriptions and change between them
how would i do this?
if you return key = "some_key" in loc_vars it uses that localization key inside descriptions.Joker
whats not working
also how did you make that description in three different boxes??
Xchips doesnt work btw, it needs to be x_chips or xchips
so like this?
Deadass?
if center.ability.extra.text is a localization key, yes
yes
its pretty new
wide sleeve
idk how
do i even need to use add_to_deck?
if #G.deck.cards < G.deck.config.card_limit then
local new_card = SMODS.add_card{set = "Playing Card", rank = "A", suit = "Clubs",}
if new_card then
new_card:add_to_deck()
G.deck:emplace(new_card)
end
end
now it just isnt showing anything
wait does it have to be the ENITRE joker description
no, add_card does it for you
same with emplace
the localization needs to be structured like loc_txt
like with name and text
you also need to put the whole text in
ok what do i do with "local new_card = SMODS.add_card{set = "Playing Card", rank = "A", suit = "Clubs",}"?
nothing it adds it automatically
if you want it to be added to the deck do area = G.deck
When cards are added like that, do you still need to use playing_card_joker_effects?
yes
Cool
it works!
Uni!!!!!
can i ditch local new_card?
if you want to
in the brackets?
yes
for _ = 1, scored_count do
if #G.deck.cards < G.deck.config.card_limit then
SMODS.add_card{set = "Playing Card", rank = "A", suit = "Clubs", area = G.deck}
end
end```
there's no deck card limit (it exists but it's usually equal to the amount of cards in deck)
here's the full calculation snippet
calculate = function(self, card, context)
if context.joker_main and #context.scoring_hand > 0 then
local club_count = 0
local scored_count = #context.scoring_hand
local base_chips = 0
for _, scored_card in ipairs(context.scoring_hand) do
if scored_card:is_suit("Clubs") then
club_count = club_count + 1
end
base_chips = base_chips + (scored_card:get_chip_bonus() or 0)
end
if club_count > 0 then
card.ability.extra.xchips = card.ability.extra.xchips * (card.ability.extra.club_chips ^ club_count)
card.ability.extra.xmult = card.ability.extra.xmult * (card.ability.extra.club_mult ^ club_count)
end
for _ = 1, scored_count do
if #G.deck.cards < G.deck.config.card_limit then
SMODS.add_card{set = "Playing Card", rank = "A", suit = "Clubs", area = G.deck}
end
end
return {
xchips = math.floor(base_chips * card.ability.extra.xchips),
Xmult_mod = card.ability.extra.xmult,
card = card
}
end
end,
the idea was to make the joker spawn club aces per played card in hand and gain x1 chips and mult per scored club card
what's the problem
is it ossible to know what the next card in draw is
it doesn't actually add club aces
isnt it always shuffled
and i think the xchips and xmult aren't actually doing their thing
it's shuffled before and after a blind iirc
so during blind its possible to know what the top card on deck is with such line
remove the if #G.deck.cards < G.deck.config.card_limit then
also what version of smods
yes
thank you
1.0.0 beta 0626b
how would i check (in an unlock condition) if the player has beaten painted deck gold stake?
Would it be possible to have an effect where it changes the scoring system to base 4 but keeps the blind requirements to base 10?
clarify
the number will be the same anyways itll just look different
Question that I've had for awhile: What is the point of self in calculate when you use card to have the card refer to itself?
it still does not create club aces
It might be possible, I'd ask Aiko because you're messing with scoring calculations and they seem to have some experience in that area
what does it do
self is the same as card.config.center
it's just convention
it should give ace of clubs per card in played hand.
and it should gain xchips and xmult per played club card
it might be giving xmult too but the _mod is hiding the message
my main concern currently is the club aces not showing up at my deck.
this works for me idk
i played a pair
and for every club card played, sans gains x1 chips and mult
Oohhh, oki, ty
ok, one problem at the time
if a club card is played, sans gains x1 chips
how much is card.ability.extra.club_chips
how would i get that to display as text on a joker..... i cant get it to work i just get deck as a nil value crash
you need to check if G.deck exists in loc_vars
club_chips = 1
1^x = 1
Can we find out which card is coming next
What does shuffle means
x = club_chips?
Does misprint not tells us the next card
I heard that in one short
yes, it does what i said
shuffle means this
1 to the power of anything is 1 is what i mean, your math is wrong
So if your are in a blind you can check which card will come next
yes
oh
i'm a dumbass
What about next 5 cards
they're in order in the deck array from last to first
Thanks
The only thing I can think of is maybe I'm supposed to format my images differently, like separating the suits into different rows or some such... or it doesn't like the fact that I don't have a spade suit (because it'd be redundant)
...would you have one of the images that go with this so I could compare the layout?
Ok so if you are in blind is there any way to destroy all card of a specific rank in hand and in deck also
yes, during score calculation?
Definitely possible
if anyone needs ideas for jokers for their mod i can help
ive been writing down a lot
me i would love a list of ideas my mod is slow rn bcoz i have no ideas
and im never gonna make a mod because
- coding too hard
- drawing too hard
i could learn but im lazy
my friend does the art for my main mod and coding just takes practice
then not during score calculation lol
i think by that time the cards in hand are already shuffled into the deck so you would have to loop through G.deck.cards and check if card:get_id() is the id of the rank you want and then call SMODS.destroy_cards(card)
yeah i tried to figure it out on my own basing it off of idol and just using the rank selector and i got lost
my extra ace clubs aren't showing up
it's instead cloning other playing cards
i have more ace of hearts than ace of clubs
dunno works fine for me
Is there a way to check whether the current context is happening within the scoring window? I'm wanting a joker to give xmult on post_trigger for the adjacent joker, but the simplest implementation of that would trigger even when scoring shouldn't happen
calculate = function(self, card, context)
if context.joker_main and #context.scoring_hand > 0 then
local scored_count = #context.scoring_hand
for _ = 1, scored_count do
SMODS.add_card{set = "Playing Card", rank = "A", suit = "Clubs", area = G.deck}
end
end
if context.individual and context.cardarea == G.play then
local base_chips = context.other_card:get_chip_bonus() or 0
if context.other_card:is_suit("Clubs") then
card.ability.extra.xchips = card.ability.extra.xchips * card.ability.extra.club_chips
card.ability.extra.xmult = card.ability.extra.xmult * card.ability.extra.club_mult
return {
xchips = math.floor(base_chips * card.ability.extra.xchips),
xmult = card.ability.extra.xmult,
card = card
}
end
end
end
maybe G.STATES.HAND_PLAYED?
do i have to add key_append = sans?
Oooh, yeah, that might work
no, that works as is
what other mods do you have installed
well i dont even know what to say
a card is a table yes
how come it says this and not the card
because it's a table
you need to manually check for the properties you want to display
galdur, talisman, debugplus, cryptid, fusion jokers, joker studio, card sleeves, sample jimbos, my own jokers as individual mods, and the inactive ones like yahimod, saturn, and preorder cards.
try disabling cryptid
how do i do that one then
if cryptid doesnt work with my smods features im going to explode
idk what do you want to show
the card which is next to be drawn
i used the line you told me to and it gives me that
yes i get that, which properties of the card
if you want to show the card graphic itself you need a cardarea and stuff
yeah after it was dumbed down i get it
oh my god, it exponentially rises
oh fuck
i just realized
it's supposed to be + 1, that's why it exponentially rises
when i reenable cryptid
it creates clones of random playing cards
but if i play vanilla
it gives ace clubs
i hate cryptid
i will see if i can fix it for them
it's probably their create_card override
whats the question mark
I thought they fixed that.
how can i make a joker award money only on the boss blind?
no, they actually override whatever front the card had with a random one it seems
i believe it's G.GAME.blind.boss
can i just use that in there?
this is a snippet from my noisette joker
if context.end_of_round and context.game_over == false and context.main_eval and not context.blueprint and G.GAME.blind.boss then
there's the G.GAME.blind.boss
god cryptid doesnt have an issues page?? do i have to join the discord
Tried arranging the cards in a 3x3 grid and it still used the default images. Noticed a spelling mistake in the code, fixed it, and now it's back to showing me blanks. Gonna see if changing it back to rows remedies anything.
i believe so
i already reported it
Text (joker) is appearing bluey in Photoshop is there any solution
Got something when I accidentally exported the full sprite sheet instead of just the grid sections with content. I might be on to something. Scribbled some stuff into the empty spaces and I'm gonna see if that gives me a better idea of what's happening.
is there an alternative?
Hey N' can you help me out with smth?
Hey. I'm experiencing a weird crash with my custom ui. I understand the error, and in the game code it seems to try to find the alpha value of a color, but i can't find the object where it cant index it since there is no trace.
UIBox {
definition = {
{
n = G.UIT.ROOT,
config = {r = 0.1, minw = 8, minh = 6, align = "tm", padding = 0.2, colour = G.C.BLACK},
nodes = {
n = G.UIT.T,
config = { text = "Hello, world!", colour = G.C.UI.TEXT_LIGHT, scale = 0.5 }
}
}
},
config = { }
}
i could try help
pretty sure this error occurs when your UI tree is nested one too many times somewhere
try removing one of the {} around the ROOT node
yeah use create_playing_card
or dont use cryptid
shoot
is there a way to easily define a table like G.mytable.myvar = (G.mytable.myvar or somthing)
IT IS FUNCTIONING PROPERLY!
How can I make a joker "store" another joker for a round? I was thinking of deleting and recreating the joker, but if it was something like green joker, then doing that would reset it and I don't want this to reset the joker
you would need to save it to another cardarea
I have a joker that changes the values of Glass Cards upon being picked up.
G.P_CENTERS.m_glass.config.extra = card.ability.extra.glass_break
for _, v in pairs(G.I.CARD) do
if v.config and v.config.center and v.config.center.key == 'm_glass' then
sendDebugMessage('updating glass cards')
v.ability.extra = card.ability.extra.glass_break
v.ability.x_mult = card.ability.extra.glass_mult
end
end```
This does work for *new* glass cards, but the changes to existing ones upon adding or removing the joker from the deck don't seem to work right? Usually it ignores the changes to the Xmult properties even though afaik the code for Glass Cards in `generate_card_ui` uses `center.config.Xmult` which I *do* change for the center itself
So I get results like this, where I sell the card and it reverts the destruction chance (1 in 2 -> 1 in 4) but the Xmult doesn't change back to X2
Do I have to also change like card.ability.Xmult????
when i try doing it like that it tell me that it can't index in mytable
probably
Ugh I hate the fact that there are two Xmult properties and they do the same thing and one just assigns to the other

Anyway if anyone could tell me what it is about this that forces the cards to be stuck in the far right of a ridiculously oversized image I would appreciate it, but I'm pretty happy with how it is now.
How would I do a "complete conversion" mod? So removing all default vouchers, consumables, and jokers before adding more.
If I had to guess it'd be pos_style = 'deck'
Try using 'ranks' instead
As in moving the joker to, for example, G.discard then grabbing it back out of there?
-# I've never done something like this
yes but i wouldnt do it in G.discard, i would create a new area for it
check banishing in joyousspring for an example :3
I will, ty!
you are right
definition dosent take an array
👍
We goin' Yugioh?
i have been going yugioh for a while
Yo tysm for the hint with G.STATE! I got the custom ui working. I also coulddnt find any documentation for a new screen anywhere tho lmao
Awesome
play #1338302514616995892
Sweet
Well that sure did something... they're all coming up as hearts now, but maybe putting the suits in the same row will fix that.
card.ability.extra.scored_suits = {}
end
if context.individual and context.cardarea == G.play then
if context.other_card.base.suit
and not card.ability.extra.scored_suits[context.other_card.base.suit]
then
card.ability.extra.scored_suits[context.other_card.base.suit] = true
return {
x_mult = card.ability.extra.xmult
}
end
end
end```
why doesnt this work with blueprint
-# i don't understand a word of this
Okay that just made things worse. I'm going back to having an awkward chunk of empty space for the time being.
i think they say that you can go look in the fill banishment of joyousspring mod
I am, I'm saying i don't understand a word of banishment in that mod.
oh okay
My sans joker acts weird, I’ll ask for some help later.
It’s kinda actually broken
In the literal sense because I don’t remember making it give chips based on your cards
i honestly have no idea where i couldve possible went wrong
no comma after the pos table
i think you just need to create a variable to keep the card in it ?
ohhh lmao thank you
yea that was it LMAO
Blueprint and similar active rely upon the copied card's abilty.extra, rather that its own, for triggering the copied effects. So by the time Blueprint takes a turn, the scored_suits[suit] value for that card is already true, and whichever card runs second can't do anything.
You should run a second table in the ability.extra, something like scored_cards[suit] that tracks the exact card that the bonus is granted for. If other_card is this card, automatically return the xmult and don't bother with the rest of the function.
This will also retrigger the xmult whenever the other_card retriggers. If this is how you want it, great! If not, you'll need to more radically change the function. Likely by switching to the joker_main context and running a for k, v in ipairs(context.scoring_hand) do loop.
okay well now it says 20 in 14 chance..... i GENUINELY dont know how to fix that... its taking my dollar value and putting it in the chance 💔
Hey does some1 know what the transparent hand background is reffered to internally?
because #1# is the amount of dollars you earn and #2# is the chance of that event occuring
make the text
"{C:green}1 in #2#{} chance to",
"earn {C:attention}$#1#{} at the end of round
hi there, I've been trying to edit a pokermon joker to make an upgraded version
the joker in question is scizor, it kills the joker to the right and if it had a edition, it steals it and it stacks, been trying to make it so it works with negatives too.
been able to make it get negative if it kills a negative joker, but I don't know how I could make it stack or add extra joker slots anyone could help me please?
thanks in advance btw ❤️
What does the T property in card stand for?
G.jokers.config.card_limit = G.jokers.config.card_limit + 1 for an extra Joker Slot.
thanks a lot
and probably I should hold that data in the joker itself , the amount of max jokers added, so if it is removed you go back to the normal amount right?
Yeah
I have it declared as
scizor_negatives = 0
and they are added I think.. not sure how to make it pop into the ui xD
yet*
and then I would do the same code you dropped but instead of +1 it would be - scizor_negatives
eh.. I ike it :3 it sounds funny heh
perhaps chance could be slightly bigger but only make it trigger after boss blinds?
You can do {X:Mult,C:White} to make it more like typical XMult styling.
thanks
oof heh bouncing from so many different programming languages
is there a sort of like print function to debug? like writting in the console?
eh probably normal lua should work right?
print()
ye just googled print in lua and it was just print xD
how do I fix the little lines on either side
wdym
Is there a way to get a joker to trigger when a specific planet card is played?
for some reason I'm not able to print the local vars that the card has .. well better said I don't know how to reach the vars..
print(" amount of negatives added = ",self.config.extra.scizor_negatives)
tried, also without the self, but it crashed :3
yes look at context.using_consumeable
alr
this is the declaration of the variable itself
local scizor={
name = "scizor",
pos = {x = 0, y = 6},
config = {extra = {mult = 0, scizor_chips = 0, scizor_Xmult = 1, mult_mod = 4,scizor_negatives = 0}},
replace the , with ..
that appends the two strings
where did you put the print
does it needs to emm be touching the next variable?
as in ..self.config and such or
.. self.config.etc
both work
ah oki

the print is inside an if statement inside the local declaration of scizor
so, you declare scizor
and try to get print to work
what makes you think you can't declare stuff
ah yes its inside calculate
then switch from self.config.extra.scizor_negatives to card.ability.extra.scizor_negatives
oki
self.config serves as a blueprint for an object
its content gets copied over to card.ability, which tracks the card's in-game state
What's the error and current code?
let me see if I didn't missed something obvious
was it attempt to call method 'set_ability'
so im trying to figure out how to make this apply to only one specific new suit but i cant seem to wrap my head around it
would i set new_suit to the suit i want it to be somewhere? if so, how?
weird
was thinking that perhaps it crashed for trying to use card before it was like created, but earlier code in the calculate function does use it without issues
even I added code like it a few lines before and didn't crash
if card.edition.negative then
card.ability.extra.scizor_negatives = card.ability.extra.scizor_negatives + 1
end
if new_suit == "Spades" then
im searching for it rn but i want to hide that "playing card holder" like the round eval does
so i would put that in the for loop right
but then how can it keep track of the suits i had before?
if #self.base.suit == 0 then or something?
or no i guess itd have switched by then
so then like i have an old_suit variable?? or like a table that stores the number of cards of each suit before the change??
check for card count per suit inside the object's update function
that's how Steel and Stone Joker calculate theirs
okay made it work, I'm a dumbass xD
ahhh ok ok
thanks a lot ❤️
let me workshop something rq
you can store the values inside card.ability.immutable
I'm suggesting immutable for Cryptid compat, you can ignore it
wont hurt
name = "Carl",
key = "carl",
config = {
extra = {
moneycheck = 0,
moneygive = 25
}
},
loc_txt = {
['name'] = 'Carl',
['text'] = {
[1] = 'If exactly {C:money}$#1#{} is held at',
[2] = 'end of round, gain {C:money}$#2#{}'
}
},
pos = {
x = 5,
y = 2
},
cost = 8,
rarity = 2,
blueprint_compat = false,
atlas = 'CustomJokers',
loc_vars = function(self, info_queue, card)
return {vars = {card.ability.extra.moneycheck, card.ability.extra.moneygive}}
end,
calculate = function(self, card, context)
-- At the end of the round
if context.end_of_round and not context.individual and not context.repetition and not context.blueprint then
if G.GAME.dollars == moneycheck then
ease_dollars(card.ability.extra.moneygive)
return {
message = "SUPPLY FUNDS.",
colour = G.C.MONEY,
delay = 0.45,
remove = true,
card = self
}
end
end
end
}
anyone know why this doesn't work? it's intended to give 25 dollars if you have 0 dollars at the end of round, but it does nothing currently
ummm
idk what that means
sorry
@pure salmon can you listen to this dude and rewrite it
wait i thought they did that in main
(you're missing the card.etcetc)
np 👍
how could I make this
have a list of scored suits that resets when a hand is played, when a card is scored check if it's suit is in the list, if not add it and score x1.5 mult
how could I make that with vanilla remade jokers
im trying to figure ts out
uhhh dunno
I had this but it doesnt work with blueprint
so im rewriting it
and also its not mine someone else gavei t to me
maybe add an extra array to store the cards that score 1.5x, and check if they have a new suit OR if theyre in that array
so blueprints can check if theyve already been scored 1.5x and do that again
idk how to do that
same as the scored_suits array but instead of setting the suit index, just do table.insert(card.ability.extra.scored_cards, context.other_card)
and if the table contains that card already then score 1.5x
Yeah idk
this is how Photograph works
just store the cards in an array and check if context.other_card is one of the stored cards
the area is G.hand
i dont exactly know how the game does it but you can do G.hand.states.visible = false
