#💻・modding-dev
1 messages · Page 500 of 1
that looks right
since yggdrasil has something that changes the dynatext's color a lot
i mean for me it does too but like im here wondering how i'd create multiple tables if, for example, the player played a different first card in their three of a kind
isnt it SMODS.destroy_cards or am i wrong
yeah youre not wrong
maybe it's just the place I have everything
It's pretty messy
oh is it colours
if context.scoring_name == 'Three Of A Kind' then
local cardToDraw = context.scoring_hand[1]
for k,v in pairs(G.discard.cards) do
if cardToDraw == k then
SMODS.calculate_context({ playing_card_added = true, cards = { cardToDraw } })
table.insert(cardsCreated,cardToDraw)
end
end
end
if context.end_of_round then
for i = 1, pairs(cardsCreated) do
SMODS.destroy_cards(cardsCreated[i])
end
end```
put this in your calculate code and tell me if it errors
Alright, can do
if it does, send the error code
oh but is this not in the ui code's func?
not that specific UI
Should it be?
okii
can someone tell me why this crashes the game for my tester?
it works just fine for me?
nil check
. yeah, what i said, add a nil check
i thought the or 0 would prevent things like that, does it not
if im not mistaken this is supposed to
- log the card's key
- create a new card whenever a three of a kind is created of the first scored card
- store it in a local table
- destroy all instances of the created card so the deck remains the same after the round

I just need the number text blue ;-;
basically, you r checking the global variable of hpfx_crimsonCount, not grabbing it from G.PROFILES lmao
whats the code now....
-# god its hard to help without being able to directly do stuff on my end to test
let me create a joker and test it myself this dude is probably on mobile
you meant the nil check should go to the hook code right
no
whar
that is a very true point
G.PROFILES[G.SETTINGS.profile].hpfx_crimsonCount = G.PROFILES[G.SETTINGS.profile].hpfx_crimsonCount or 0
ohhh
wait why didnt i have to do that before? or was i just incredibly lucky with not crashing
would I do like
e.object.config.colours
SMODS.current_mod.set_debuff can be used to prevent debuffs, right?
i have hopefully for the final time fixed that table overflow issue i was having earlier
hi
e.config.object.colours
o
{n = G.UIT.O, config = {object = DynaText({scale = 0.4, string = localize(G.GAME.ygg_chosen_skill_tree_sec or 'ygg_skill_tree_sec1'), maxw = 9, colours = { G.C.WHITE }, float = true, silent = true})}} }},
hi smt
this time for sure
first time it hit table overflow whenever i played a hand, then it did after a few rounds
thanks! so set that as a function somewhere and it'll modify how debuffs are calculated?
realized it was because i was pulling drive named every time calculate ran and adding it to the table
so now i cache them
and it seemed to work for a few antes
-# why did i send this again
im sleepy, just ignore ot
it*
dementia
Yes, return 'prevent_debuff' to prevent debuffs to the card and true to debuff the card.
awesome, thanks
Is this enough of the error code?
I played a 3OAK and it did nothing, then I played another and it crashed to this
for i = 1, pairs(cardsCreated) do might be it?
make this your for loop
yeah
because pairs() returns something entirely different and for loops go off of a number
yeah i forgot you dont need to reference the table in a one variable loop
🤔 first time seeing pairs being used like this
it crashes lol
you haven't seen it used like that because ya can't
yeah that, makes sense 😭
does anyone have the bugged seed for erratic deck
so i can draw three of a kinds every time
just use debugplus
that's what I'm using
<@&1133519078540185692>
hacked account probably
alright so the joker is currently doing nothing
probably because it's not creating any cards
whaddaya got
oh gotcha
every time calculate is called cardsCreated is reset
a good rule of thumb for when using for k, v in pairs() is that k = key and v = value (whatever object corresponds to the key)
oh
im quite aware, i was just unsure of which one to use
k is gonna be a number with whatever index in the table it's at, v will be the actual object
(im pretty sure)
also you never want to do things outside of a strict context check, so you shouldnt use context.scoring_name without checking for a context first
wdym?
always check for one of the main contexts like before, after, joker_main, etc
(sorry if it came off rude, i wasn't meaning to sound that way)
ohh yeah
i'm probably guilty of not doing that a few times
nono i got you
so should i use if context.joker_main before anything
if that's the timing you want, yes
i haven't been following the convo to know what the effect is
draws the first scored card of a three of a kind again
im trying to circumvent drawing by creating that same card
you dont seem to be doing that in that code
oh
this is what I'm reading:
if hand is 3oak: check if any of the cards (it's actually the index but you already got corrected on that) in discard is the first card in played hand (which is never true because it hasn't been discarded yet in any scoring context) then emplace it in the played hand (without removing it from discard)
i was told by multiple sources that playing a card and discarding a card would put them in the same table (G.discard.cards)
yes, but they're not put there until after scoring, where context.scoring_hand doesn't exist
hold on i think certificate has what im looking for
nope, context is unique to first hand drawn
there's a context for before drawing the next hand, context.drawing_cards
i should use that
so how do i store cardToDraw without it dying in the next calculate call
actually cant i call it in my config

usually you save it to card.ability
but in this case I would save it to the playing card directly
in context.after you set context.scoring_hand[1].modprefix_card_to_draw = true
then in context.drawing_cards you loop through G.discard, draw that card and set that_card.modprefix_card_to_draw = nil
hi N'
how would i draw the card. what exactly am i checking for here
G.play:emplace(nv_card_to_draw)
table.remove(G.discard.cards,nv_card_to_draw)
end```???
Hello
say i have a consumable that wins the blind when you use it
[it does it by setting the chips count to the blind size if that matters but can only be used when actually in the blind ofc]
how do i get it to stop drawing other cards after the fact
it seems like setting G.STATE to G.STATES.HAND_PLAYED doesnt work either oddly enough
everything else works about it its just that that's a problem lol
no
this just does nothing
because it's nil
probably draw_card() idk never did anything like this
this helps so much dude
im pretty sure draw_card() isnt real
thats why im having to circumvent it
ykw lets go back to making copies of a card
it is
??
draw_card() basically does the whole shabang automatically
rather this is what happens to be precise
-# also yes i have deltarune deck skin
Probably also add G.STATE_COMPLETE = true
As well after the hand_played?
I think that's right anyway
it does everything for you essentially
yeah, i have that too,
also more specifically what is happening lol
how does your code look 🙏
I can't get it to work
i initally had this as a joker whose effect triggered when sold and it worked fine there but i reworked it to be a consumable for context
im considering like
having it trigger a variable and maybe it's checked like in context.after but then i'd have to play a hand first and im tryna Not do that
Its not great but I'll send it over for you to look at
okii
@red flower Here, if this would benefit you at all:
key = 'DARK_EDITION',
prefix_config = false,
colours = {HEX('99CC99'), HEX('CC9999'), HEX('66FF66')},
cycle = (2 * math.pi),
update = function (self, dt)
self[1] = 0.6 + 0.2 * math.sin(G.TIMERS.REAL * 1.3)
self[3] = 0.6 + 0.2 * (1 - math.sin(G.TIMERS.REAL * 1.3))
self[2] = math.min(self[3], self[1])
self[4] = 1
end
})```
err I guess it's actually 2pi/1.3
either way the cycle value itself is unused in the function
got all of them all fixed up!
have you tried having this in an event
i think it's because using a consumable might be messing with the state
i had a feeling it might involve that but idk how to get around it as a consumable
using it as an event doesnt seem to work either btw
oh shoot wait
that worked, thank you ;w;
-# yeah i think my problem was not knowing the proper G.STATE check that way there wouldn't be the conflict as you said
joy
how would you go about changing a sticker's spawn rate in the shop mid-run?
sanity check moment, context.consumeable.ability.type == 'Planet' is the right check for this, right? 
No.
ability.set not ability.type
ahhhhhhhh, set. was wondering why it looked wrong to me
how would i be able to give a joker a perma bonus?
I think patching or hooking?
Idk what or where to patch though
:D
Hook Card:calculate_joker I think.
the day i don't have any patches in my lovely.toml file is the day i can die at peace
(if you can't tell i dislike patches)
sssssssiiiiiiiiiggggggggghhhhhhhhhhhhh fine
confusing
I needed help to get this
i needed help patching 3 lines
patching isnt the way for the idiotic
I cant even type holy shit
was something changed in steamodded in the past couple months about how joker sprites are set? something i wrote that i haven't touched for ages suddenly stopped working
as we dont know how the fuck this works
i mean im certanly not a genious
I cant even use a keyboard correctly
No, you can.
there were a couple of changes to set_ability regarding visuals
You can xhange multiple lines?
yes
well whatever changed, idk how to adjust what i wrote here to make it work again
no idea
if context.end_of_round and not context.game_over and context.individual then
if blind_completion_as_percentage >= 1 and G.GAME.current_round.hands_played == 1 then
local shield_bonus = 5
ALLOY.ease_shield(shield_bonus)
end
end
not entirely sure why but this line of code activates like 20 times consecutively
add context.main_eval in there
thanks 
what's the property i check for to see if a passed center is fake for tooltips?
if card.fake_card?
ah, it's literally just that, thanks
^?
ive tried creating my own global variable and feeding it into the sticker's own rate and having just a joker modify that variable but it doesn't seem to really take the value in consideration(?)
SMODS.Stickers.modprefix_key.rate = number?
huh! wow that was surprisingly simple lol. i feel dumb. Thank you!
well now i need a new solution for changing the floating sprite via card:set_sprite or similar
card.children.floating_sprite:set_sprite_pos
doesn't work

something is crashing that didnt before
check spelling of your set name
correct
it's not mine it's cross mod and the name of the set is entirely correct
another instance where it doesnt crash
W e l l
Itd not xorrect
EnchancedDocuments
Is the set key
Sorre 😔
IDK
ykw let it be
okay now its generating two cards from scrap
what
hold on let me copy one of my previous consumables
why dont the xchips apply
Holy shit is that Edward Robinson
for some reason it works in debugplus when i do dp.hovered for card, but not in my actual code in calculate from that card
is the rotate mod for Sprite:draw_shader() in radians?
does it work without the semi-colon 
it worked after i started a new run 🤦♂️
the semicolons are fine.
ah
nvm, it was a problem in my calculate code
needed to add main eval to the condition
Question for anyone with knowledge of the draw_shader function: how do the offsets work????
I've been trying to scale, rotate, and offset some things, but I'm not sure why only the rotate is working as expected
how does one change the blind chip number on this screen?
Have you tried looking at The Clock from Cryptid?
i tried patching the UI_definitions to double the number but didnt work, and hmm i had looked in cryptid, but i didnt look there
oh. my thing was working i uh. forgot to write functions/ before the filename in my target path
i took a look at the cryptid patches and realized i just messed up the path PFFP
trying to figure out how to to keep a sprite that's set as a major from wobbling as it follows another card
Modify ph_improve_run in the Localization
how do you modify stuff in localization?
You just overwrite it by doing ph_improve_run = "String"
oh okay, thanks
something like this?
How are you setting the major?
No, it's in misc > dictionary
this?
Yes.
Trying to do the same thing as most shared sprites. They're declared majors by default, then it sets the draw_major when it needs to draw it:
icon.role.draw_major = self```
Yes.
The result however is that it doesn't seem like the resulting sprites corretly follow the major's rotation, evne when it's declared as the draw_from object?
In this case, trying to set the rotation specifically causes the weird offset they have. They're supposed to be dotted around the card. Not setting the rotation for them does get me something that more resembles the correct positions, but I don't know the math to transform the rotation correctly
Because I think the fundamental problem is that the newly drawn sprites match the rotation of specifically the top left of the card at all times, because that's the origin position it offsets from. For cards that are exactly the same dimensions (like basically all seals and stickers), it doesn't matter, but the individual sprites here are 18x18 and need to be offset
Hmmm, that’s an interesting one - I imagine you’ll have to calculate the rotation and offset based on the current rotation of the card, sounds fun 😂
I've got no idea how to do that tbh
I'm more used to calculating relative rotations with like 3D points but on 2D planes and with whatever strange offsetting/scaling this is doing, no clue
You dropped your suit
for some reason the sound plays when the hand is played and not around the same time as the message is displayed
on an individual card
Put sound = 'mkrk_cut' in the return table instead
is "if context.buying_card and cardarea == G.vouchers then" the right syntax for when checking for if a voucher gets redeemed?
No.
so you just need to write context.buying_card?
No, it's context.buying_card and context.card.ability.set == "Voucher"
@molten relic
you forgot a ' at the end of [3] =
best guess
oh and the [1] and [2] and such are unneccesary
What is the issue?
one is " and the other is '
Try removing the new line between triggers and (Currently
Okay i will try
I will try this one if the other doesn't work
this does look like something JokerForge would do
just saying
I am using joker forge
then delete the new line in the description
new line = enter
also for help with joker forge go to https://discord.com/channels/1116389027176787968/1386843228330004611
more people there know how to help with JokerForge
Have you already checked out how Soul-Cards draw their floating sprites? IIRC they rotate and bend with the card like you want to
Ah okay
looks like trying to assign something to rarity/type that doesn't exist
if context.individual and context.cardarea == G.play then
if context.other_card:is_suit(card.ability.extra.suit) then
card.ability.extra.spade = true
end
end
if context.joker_main then
if card.ability.extra.spade == true then
card.ability.extra.spade = false
return {
xmult = card.ability.extra.xmult
}
end
end
end
}```
why dont this a work
context.ability.extra.triggered ?
unneeded?
No, it's card not context
context doesn't have .ability
Why aren't you just looping over context.scoring_hand in context.joker_main?
no wait i missed that actually
because im stupid
wait ive never used context.scoring_hand
i have terrible reading comprehension
voucher.cost = 0
"attempt to index local 'voucher' [a function value]"
SMODS.add_voucher_to_shop is a function.
oh
wait then why does this work?
if context.starting_shop and not card.ability.extra.triggered then
local booster = SMODS.add_booster_to_shop("p_arcana_mega_1")
booster.cost = 0
card.ability.extra.triggered = true
end```
i ditched the random chance btw
because here you're calling the function
How does one do reversed text?
you mean string.reverse or something different?
No, I mean visually reversed.
Mirrored text?
Yes.
"Flip horizontally" mirrors the image.
No, I'm referring to mirroring half of the name of a card in game.
So something like aeiou becomes aeiea or uoiou...
No, something like this:
...closest, I guess, is a custom font that includes the flipped characters, though I am not sure about the shadows.
No, the shadows can be normal, that was just an example I made by flipping a screenshot.
¯_(ツ)_/¯
yeah youll need a custom font for that
i made one for iroyokia but its not entirely 100% accurate
is there an smods function for getting the result of get_current_pool without the unavailable entries?
just checking before i make one myself
No
like this? (should spawn the next seeded object each time according to the wiki)
if context.starting_shop and not card.ability.extra.triggered then
local voucher = SMODS.add_voucher_to_shop
voucher.cost = 0
card.ability.extra.triggered = true
end```
No, you need to call the function.
so i have to add a key
ok ty for quick response
No, you have to add ()
i never should've ignored those bluej classes
back in like 7th grade
oh yeah, how do i randomize which voucher spawns?
It does that for you.
what are the ids of ace, j, q and k?
14, 11, 12, 13 in that order
does it matter what you put into the seed of pseudorandom_element? i see some mods just put a raw string into it but some others do pseudoseed("text") instead which is confusing me a bit
i think raw strings are the newer thing
function pseudorandom_element(_t, seed, args)
if seed and type(seed) == "string" then seed = pseudoseed(seed) end
from lovely/dump
raw string is from smods
Ok so the joker works, now my only problem is how do I make it so that it does not give way too much money than it should
Code?
-- end of round dollars
if context.end_of_round and not context.blueprint then
return {
dollars = card.ability.extra.dollars
}
end```
so i just remembered i had a snippet for this exact purpose
and it's in one of my jokers
But honestly it’s much funnier to learn about these mistakes and how I can use this to make even more broken jokers
end_of_round is called with individual and repetition so you also need to check for context.main_eval
why does this happen
how can i replace the small and big blinds with a specific boss blind?
the values after #1 appear as nil
you need to have that many values in your loc vars
oh
eremel is planning a system for that in smods so i suggest waiting for that
okie :D thanks!
wait,can i use local variables with context.other_card:get_id()?
wdym
i wrote local rankvar = 2, i change it to random every ante, and then if context.cardarea == G.play and context.other_card:get_id() == rankvar then
every time i use that rank it crashes
log?
You should be putting it in card.ability, not a local variable.
a local is not saved between function calls
so i place it in extra?
Are you checking for context.individual in your code? context.other_card won't always exist, and if it doesn't, trying to use :get_id() on it will crash as a result.
Code?
card.ability.extra.xmult = card.ability.extra.xmult + card.ability.extra.xmulthand
return{message = 'ESENCIA'}
end```
Are you setting card.ability.extra.rankvar?
yes
How/when are you setting it?
extra = {
rankvar = 2,
}}```
did you restart the run
how 2 check played card amount
im genuiely lost i cant find much on the documentation
and what i find is just basic stuff
and sometimes the basic stuff i need is missing
i dunno if its just me
is it possible to include spaces in text with background color
{C:(color)}
You mean the id?
end the markup with a {}
no, just the amount of cards of the played hand
it will color the space too
#G.play.cards
is it possible to include that
ty
No actually, setting X deletes spaces for whatever reason. The game is just like that.
oh
not with X but it works with B
that makes no sense
B was added by smods so it works while X is vanilla :3
why didn't steamodded change X: to work like that as well
dunno
No, unless it's in a lovely folder.
so if its inside of that folder, i can name it anything?
Yes.
actually is there a way to check all the global values of balatro
not all but like
the important ones
where
globals.lua?
oh
thaqnks
much better
@maiden phoenix relating to the sprite, what size is the sprite, both the patch and the assets
It's fetched from the center (center.T.w, center.T.h)
so it can be any size?
Yes you can modify it
i see i see
Hi
I'm facing problems when trying to make a rank considered as an enhancement
I referenced Extra Credit's alloy joker and ive enabled quantum enhancements at the top of the file, but the game crashes without logging anything,
Would greatly appreciate any help
calculate = function(self, card, context)
if context.check_enhancement then
local id = context.other_card:get_id()
if id > 2 and id < 11 then
return {m_wild = true}
end
end
end
hopefully thisll work
thanks a lot!
how to check all the cards in the player's hand
wait where can i modify it
modify or replace center.T.w and center.T.h
for example?
like "12" or "center.T.w * 4" idk
ah alright
what the hell is center.T
that doesn't exist
a center is not an instance of a movable 😭
whuh
<@&1133519078540185692>
2.5-3 seconds
mods
KILL
come the fuck on
there you go
🔫
chill out
yeah its just htat im tired of seeing these kinds of bots everywhere
Wdym centers don't save that shit but save the atlas pos 😭
Cringe
Center is not a card
a center is a prototype for a card
It's card definition
I know but it's still dumb
it wouldn't make sense though
It is not
so which one is right
They're right
set the coordinates and the width and height manually
so numbers?
the first 4 parameters for a sprite definition is the x coordinate, y coordinate, width and height
so numbers
no way, numbers..
i believe the x and y coordinate doesn't matter since it gets snapped to the ui element anyway
I love hardcoded values
so width and height only?
That's true, you can just put 0, 0
Yea
I'm watching
D:
Make Spongebob proud
Yea
that's gonna appear pretty big ingame btw
Just try it
alright
[citation needed]
youre missing the manifest at the beginning of the file
fuck
let me reread the wiki
hold
crash
@maiden phoenix did i fuck something up
forget it
i fixed it
now it doesnt show up
What's your description like
ignore the dent
lemme see the entire patch
Right I fetch a center to show a sprite
[[patches]]
[patches.pattern]
target = "functions/misc_functions.lua"
pattern = "elseif part.control.E then"
position = "before"
payload = '''
elseif part.control.yourmodprefix_S then
local center = G.P_CENTERS[part.control.tngt_S]
if center then
final_line[#final_line + 1] = {
n = G.UIT.O,
config = {
object = Sprite(0, 0, 478, 120, G.ASSET_ATLAS["tvtime"], center.pos)
}
}
end
'''
match_indent = true
If yours is a sprite alone you'll have to use a different approach
Remove the center stuff and replace center.pos with {x = 0, y = 0} (or whatever value your sprite is located)
how would i reference the primary/secondary colors of a modded consumable type?
so remove local center?
Yea and the center check and the end below
elseif part.control.yourmodprefix_S then
ok
hOLD
[[patches]]
[patches.pattern]
target = "functions/misc_functions.lua"
pattern = "elseif part.control.E then"
position = "before"
payload = '''
elseif part.control.tngt_S then
final_line[#final_line + 1] = {
n = G.UIT.O,
config = {
object = Sprite(0, 0, 478, 120, G.ASSET_ATLAS["tvtime"], {x = 0, y = 0})
}
}
'''
match_indent = true
this should be right?
same name for both .ATLAS and ASSETS_ATLAS
whats wrong
Maybe I should build proper support for this
god please
why doesnt this debuff cards
how do i set a card's sell value
its half their cost
or card.sell_cost = number but keep in mind it will reset when card:set_cost() is called
i thought the res was right
You should make sure the pixels don't touch the border
Otherwise it will bleed
usually yea
worked
why does vanillaremade put "vremade_spe" into the key_append in SMODS.Booster when the mod prefix is just vremade?
Send screenshot
there
There's still contact it seems? Show your sprites
key_append is used both for the random pooling key and the source for in_pool, so it should be a unique string
vanilla uses spe
Maybe add even more spacing around the sprite
noted
And don't forget to change your atlas px and py if you change the sprite size ofc
then why does the smods wiki just say to put your mod prefix in there and nothing else
OH WHAT
anyone know the solution here
it matters???
that seems wierd
ohhhh
lol
tiny
smods wiki bad
tragic!
ill send a PR rn
I mean you can put anything in there it doesn’t matter
you can even put nothing
then why is it even a field to begin with if what you put in there changes nothing
I would say it does matter, I have used it
its for rng
brother 😭
It's also for in_pool
I mean it doesn’t matter what you decide the string to be
Why are you reducing the sprite size?
oh i dont need to?
Just change the width and height in the lovely patch
doesnt balatro use nearest neighbour
at moderators
<@&1133519078540185692>
I deed it
so i can just put the number here
Yea how do you even ping that role? Writing it out doesn't work
if discord gives a suggestion to it iirc
This is for the size of your sprite file
You have to look deep in your heart and believe
in mobile it disappears sometimes
I guess i'm troubled 😔
and never reappears until you restart the app
top 10 reason why discord mobile app sucks
okay let me make this clear rq
patch size: 17, 4
atlas size: 478, 120
0 0
Wtf
cuz its a single file
17 is very wide for a sprite btw
oh
Sprite width and height is for the visual size
object = Sprite(0, 0, 14, 7, G.ASSET_ATLAS["tngt_tvtime"], {x = 0, y = 0})
A card is like 2.1 iirc
you do not need to mess with your image in anyway if you wanna scale it down
there
I just wrote the text and sent it. It didn't even highlight for me (I'm on mobile tho)
dont worry about it
i see
@maiden phoenix
Keep your sprite how it was and just fiddle with 14, 7 making them lower
Is it possible to create animated jokers? I'm trying to set an animated atlas to a joker but my game keeps crashing
lower?
Like 2, 1 idk
??
Just test some values
not with an animation atlas, yet at least
ghhh
Is there any other way?
You still got sprite bleeding
changing sprite pos in update
Oh
I’ll get round to this too at some point 😂
update = function(self, card, dt)
if card.ability.extra.delay == 60 / card.ability.extra.FPS then
card.ability.extra.x_pos = (card.ability.extra.x_pos + 1) % 40
card.children.center:set_sprite_pos({x=card.ability.extra.x_pos,y=0})
card.ability.extra.delay = 0
else
card.ability.extra.delay = card.ability.extra.delay + 1
end
end,
This is a snippet from my animated joker
I am mobile so it’s hard to tell but that definitely looks like it doesn’t have a pixel border
Try with this (don't forget to modify the atlas px and py to this sprite size)
Tennaception
ill try this
oh much thanks mate
Note. This joker has it's own atlas where the sprites are side by side
speaking of boosters, they don't actually use in_pool, right? the docs say they do but I don't see where
I'm pretty sure they don't
I didn't need one when making mine and it worked just fine
I'm planning to do a PR for in_pool things so I can add that too
well thats true for any object
I mean yeah but what would the boosters even get from in_pool
They definitely do use in pool
Wait what
Its just not in get_current_pool
i dont see it in get_pack
what are your thoughts of an SMODS.is_in_pool() to be able to manipulate the pool like SMODS.showman
I don’t like pool manipulation as a mechanic in general but I can see the use of it
smods wiki says to put mod prefix before the key of a consumabletype when using it in text styling, but that doesnt work. is smods wiki stupid?
whats the vars for the box color again
box_colours = {}
you dont have the lsp pointed to the vanilla code
fair
but besides that
it doesnt work
i has to be inside vars iirc
how is your consumabletype defined
you're using sdm's sprite, yes?
who was making that debug plus plus mod with the tabs on the right side of the screen?
yes
and what px/py have you got rn?
still the same
which is?
478, 120
it should be 484/126
Jogla iirc
why's that
game only crashes when entering a shop too, not when doing anything else with the consumable type
i think it's trying to compare the shop_rate and failing but idk why
did you load a run from before you added the type
can you do eval G.GAME.wonder_rate
where?
debug plus console
I'm trying to use SMODS.create_card (https://github.com/Steamodded/smods/wiki/Utility#mod-facing-utilities) - I can't seem to find where to get complete lists of options for things like set, area. Am I just missing them somewhere?
use SMODS.add_card instead
no, there's no docs for that
yet
im making some
they create cards instantly
i can, returns 0
i swear to god, why is it always in the up corner
where is the black hole implementation in vanilla remade i think im blind
spectrals
have you tried adjusting the width and height of the sprite object
done that already
thats x and y
use ctrl + f more then
try removing the rate line completely and starting a new run
oh wait
you need to add align to your ui container
how to
align = 'cm' in whichever node's config
okay its fixed now
thanks
would be wierd since vanillaremade also sets the shop_rate for spectrals to 0.0
actually would adding a new booster during the run cause that
i also havent tested stuff in vanillaremade that well so dont take it as gospel :p
Is there a way to have a specific DebugPlus command activate when you press a specific key?
it has a lot of built-in hotkeys
but i dont think you can add new ones
ctrl+key
How do I add a command for when I press that?
how do i generate a card from an specific pool?
you'll have to look at the code of the mod to do that
SMODS.add_card({ set = <the key of whatever pool you want to generate from> })
for vanilla the pools are Base, Enhanced and Playing Card for playing cards (base = no enhancement, enhanced = yes enhancement, playing card = default enhancement rate), and then Joker, Tarot, Planet and Spectral afaik
SMODS.Keybind({
key = "some_key",
key_pressed = "l", --whatever key
action = whatever_grim_command_function
})
Omg yes thanks :3
What is that
Sorry I don't program so
Oh okay
Im not sure if you guys would know, but would you guys know of a way to try and pull gpu and cpu utilization of the users machine?
I tried doing the ffi approach like I did for my disk and ram variation but it does not seem to be as effective in that the value is incorrect as well as im only pulling from nvidia specific gpus
Id like to be able to pull the info that task manager displays but it doesn't seem to let me read it as I can ram usage and disks installed on the host machine
is there a way to have my mod file have a copy in my balatro mods folder thats always synced to the folder where i edit it in? constantly replacing the mod in my mods folder is a bit annyoing
Cause as I said it was effective for these two, its just not for gpu and cpu usage
symlinks maybe
but i just edit directly on the mods folder
gain money equal to the sum of the digits of your (ipv4) ip address
bepis is torturing me to look for joker localization
where did it go
Lmfao
Perchance
I wanted to use cpu to lower blind requirements by the amount of cpu usage in %
who
Gpu would increase each cards chip value by gpu utilization %
joker localization
time to open like a million calculator instances
Correct!
i need to find it
0% blind size 🔥
The disk joker scores differently depending on the disks you have
If you have 1 disk it scores on every card played, if you have 2-3 its on every hand played, if you have 4+ its end of round
So it'd be neat to do more variation like that
symlinks
damn you @manic rune
Damn you @manic rune
damn you @manic rune
Oh I think I have terrible news for bepis
You know all that work you did on progress bars?
yeah
I am 95% sure that the default UI supports them anyway
Eremel you are very wise would you have the answer to my query perchance
I just need to test it out later
wait since when???
Since ever
😭
well crap, i mean, at least it wont be a finicky approach
i would probably rework the progress bar at one point if it wasnt for that anyways
since, the vertical bar is still weird as hell
lol
-# how is that good news
and the bad news is that the animated sprites wont work in here
I DONT KNOW HOW THE FUCK HE FITS
thats odd, did you put a card in there or just object
its literally the patch that i gave you
yeah it wont work then
set_sprite is exclusive to Card
if its just a sprite then it wont have functions like that
fair fair
dude how the hell he fits
like damn
other sprites are just cornered
but tenna literally fits
hes him
-# but basically, hes bigger than min width and min height of the node box, so the box is coating around him instead
🤔
hmmmm
i have an idea
bevermind
ill keep this as a scrapped project
imma continue working on the update for now
still cant believe a streamer played my mod
murphy will land on it today trust
how to fix cards not being debuffed
hi N
sorry for not saying hi earlier i wondered if anyone could answer my question
hewwo
What was the question?
let me link it real quick #💻・modding-dev message
as youl see the ffi approach works for ram and disk but i cant pull the utilization of cpu and gpu that way reliably
I have no idea
im in shambles
why am i being ghosted
^^
hey @faint yacht, you come recommended to me by ice as being a smarty pants on the technical side so i thought id ping you to ask if youd have an idea for this, apologies if you dont like the random ping but figured id ask
is this just if you have 1 hand left debuff all cards held in hand?
don't use this debuff method. SMODS provides a more robust function for it. I also recommend not storing the debuffed cards on the joker
Lua has no inherent ability to really "see" stats like that... and I doubt LÖVE itself has anything like that.
You'd need an external "app" to interface with to really pull it off.
fwiw, https://love2d.org/wiki/love.system.getProcessorCount could be taken advantage of for an another Joker idea?
see its unfortunate because im able to read ram usage as well as disks installed to the machine, i can somewhat pull nvidia gpu utilization with this
local ffi = require("ffi")
local nvml = nil
local gpu_support = "unknown"
local function try_load_nvml()
local success, lib = pcall(ffi.load, "nvml.dll")
if not success then return false end
nvml = lib
ffi.cdef[[
typedef struct nvmlDevice_st* nvmlDevice_t;
typedef struct nvmlUtilization_st {
unsigned int gpu;
unsigned int memory;
} nvmlUtilization_t;
typedef int nvmlReturn_t;
nvmlReturn_t nvmlInit_v2(void);
nvmlReturn_t nvmlShutdown(void);
nvmlReturn_t nvmlDeviceGetHandleByIndex_v2(unsigned int index, nvmlDevice_t* device);
nvmlReturn_t nvmlDeviceGetUtilizationRates(nvmlDevice_t device, nvmlUtilization_t* utilization);
]]
if nvml.nvmlInit_v2() ~= 0 then return false end
local device_ptr = ffi.new("nvmlDevice_t[1]")
if nvml.nvmlDeviceGetHandleByIndex_v2(0, device_ptr) ~= 0 then return false end
gpu_support = "nvidia"
return true
end
local function get_gpu_usage()
if gpu_support ~= "nvidia" then return 0 end
local device_ptr = ffi.new("nvmlDevice_t[1]")
if nvml.nvmlDeviceGetHandleByIndex_v2(0, device_ptr) ~= 0 then return 0 end
local utilization = ffi.new("nvmlUtilization_t[1]")
if nvml.nvmlDeviceGetUtilizationRates(device_ptr[0], utilization) ~= 0 then return 0 end
return utilization[0].gpu
end
-- Initialize GPU support once
if not try_load_nvml() then
gpu_support = "none"
end
but as i said, with ffi it just isnt accurate to what we are reading through task manager..
i did consider helper scripts but that would require the user to download extra stuff
this will be useful for another idea actually so thank you for this
...I've not used external libraries with Lua, erally, so I'm not useful here much either.
which is?
darn, thank you nonetheless for your assistance!
ill try and see what i can come up with down the line, right now an idea is to just simulate gpu usage for now in a joker
https://love2d.org/wiki/love.system.getPowerInfo & https://love2d.org/wiki/PowerState for battery-related funs.
sorry, should've also given the function, yeah! https://github.com/Steamodded/smods/wiki/Utility It's SMODS.debuff_card
k ty
also why do you not reccomend storing the debuffed cards
The smods function allows you to just tag the cards, so you can just use a key if you wanna debuff them at a later point. Additionally, and I've only recently refactored all my jokers to not store any cards or jokers in their ability myself, it runs the risk of creating issues with other mods, and the references don't get stored between saving and loading
and that function is?
Meaning that if you save the game and quit, then reload, your joker won't know how it's stored
got it
SMODS.debuff_card
yes
Oh, yeah
and how do i get the source of the debuff later
card.ability.debuff_sources
if you're consistent, you always know the source of each debuff. If your joker debuffs with source "mymod_joker_1", you can remove it with "mymod_joker_1" as the source as well
is it a table or just a single string
it's a table
<@&1133519078540185692>

again??
i wonder what the confirmed kill count of each mod is
so i suppose ill have to change the cards to be the ones in the entire player's deck, right?
to remove the debuff
yes
is it G.deck?
why do all destroy all (other) jokers effects make a _first_dissolve variable first?
G.deck.cards is the current deck
the entire deck is G.playing_cards
kk
so only the first dissolve plays a sound
debuff_sources is a table, like i said, but also you dont need to check for it
what does trigger = "before"/"after" in events created by consumables
so i can use table.find for it right
no, it's indexed by the source so debuff_sources[source] will work
but again, you dont need to check for it
SMODS.debuff_card does it for you
wdym
How do i draw step a tag?
nono, the problem is that
it doesnt debuff at all
remove the cardarea check from context.after
gotcha
why does using a text color from a modded rarity not work for me? without mod prefix its just the default text color and with mod prefix (like it should be according to the smods wiki) it just has the nonexistent color option color
can someone show me the line of code for add_card for a random joker taking from a pool of custom rarity
SMODS.add_card { set = "Joker", rarity = "modprefix_key" }?
are you fr
is it that easy
why have i been fucking around with create_card
i swear that didnt work before
did you remember to put regular brackets around the table
i remember trying that like weeks ago and thinking "oh well, i will just use create_card instead" but i can guarantee you it was some typo like that haha
and since then i have been using add_card sparingly because i thought it was broken or something lmao
its worked every time for me so far
you can now go back to using addcard everywhere
thank god because create_card is annoying
i just thought the function was more limited or broken or something
you should have SMODS.add_card( { set = "Joker", rarity = "modprefix_key" } )
yeah i got it working now
or not mod prefix if its vanilla
what is the point of create_card then for creating jokers
is it just back compat
or is because of like playing cards too
why does this not work....
ive tried with and without prefix
neither gives anything
definite it by hooking to the loc_colours function
try printing G.ARGS.LOC_COLOURS
shouldnt it already get created?
idk i don't use that
It should
That's why I said this
Are you trying to access it before it gets defined?
it's the same without the () btw
hi chat can someone explain to me how to make my joker create another joker? i tried snooping around another mod's code and found it uses a format like this:
card:add_to_deck()
G.Jokers:emplace(card)```
but when i did the same the game crashes once my joker triggers
im not a programmer so i have no idea if this code is correct to begin with
SMODS.add_card{key = "j_joker"}
if it crashes on trigger it can be a problem with that joker
SMODS.create_card just creates a card, it doesn’t do any of the extra stuff that’s required for when you’re adding it to your slots, but it’s in essence just a wrapper for vanilla create_card to allow for easier use. SMODS.add_card just feeds your table into the create card variant but puts the card in the correct area and does add to deck functions too
question!
i'd like my tag to add a specific kind of Joker to the shop
code is:
will this be able to create duplicates of this Joker type without Showman?
have i done this correctly?
how and where
debugplus?
there is no print command]
eval G.ARGS.LOC_COLOURS
huh???

