#đ»ă»modding-dev
1 messages · Page 132 of 1
use rarity="<your custom rarity key>" (don't put numbers here)
no prefix or anything?
at SMODS.Joker
yes
yes prefix before rarity key
yippee
we do a little trolling
light mode npp.....
there's also C.attention which is the plain orange highlight, and C:inactive which is the light gray text such as the bottom line of the Castle joker
oh believe me i just found that, i'm normal and use dark lmao
the colours for loc txt aren't those ones
oh good god
@tall wharf special for you
#1270746376312979456 message
đ
holy guacomole
it should be uncommon btw...
if its when cavendish goes extinct
I'm making a pair of opposite Consumables, and when one is used, the other is destroyed
for _, consumable in ipairs(G.consumeables.cards) do
if consumable.config.key == "c_fm_voltaic_mote" then
consumable:start_dissolve()
end
end
Unfortunately the other didn't get destroyed, is G.consumeables.cards the correct value to use for checking any existing consumables? Or maybe the config.key line doesn't have the right syntax?
I feel like itâs missing a center somewhere
What will it do
It accesses the data for creating objects of its type
consumable.config.center.key
Also I need edge cases that might tamper with Boss Blind-specific cards that has special mechanics required to progress the Blind
- Cannot be discarded
- Must return to hand after played
- Cannot be cloned by Death, DNA or Cryptid
- Cannot be destroyed by The Hanged Man, Incantation, Familiar or Immolate
no it comes from a special joker
1 in 1000
awwww
but i can change the color to uncommon
uhm
Does other_card work with an enhanced card? I'm trying to have a blueprint like effect with playing cards but it keeps crashing
Damn it Riv, it's [patches.regex] not [patch.regex].
Anyway my patch finally worked.
how to add use button on joker?
how to add use button on joker?
asking for opinions, is this an ok legendary?
-# considering there's the other one
Ill remove the first hand of round condition maybe
YES I MADE IT NOT RENDER FACE
REOL 
đ„đ„đ„đ„đ„đ„
but how to always render face on stone card?
you tell it to
search for logic n stuff and then patch it
also ngl putting face on stone card kinda defeats the purpose of them
Each card have 3 parts: front, center, back. Front - it's rank and suit, Center - enhancement, Back - deck's back.
You choose which card part you need and change it
my hyperstoneia turns stone card to having front
still
yeah this checks out
how to add use button on joker?
Did you implement it yourself?
which part
The faceless part
some patching but yeah
I was gonna say you couldâve used the Steamodded features for Enhancements probably
Not necessarily as an Enhancement, but maybe as one
yeah but you wouldn't be able to upgrade the cards
How so?
I donât see why not
at least i didn't think it was possible
i did try tinkering a bit
Canât you have like a Lucky Letter card?
this was the alternate implementation i tried
didn't work very well
yes
Then you could have the deck start with a Letter and an Enhancement
Then when applying another Enhancement it doesnât override the letter
But it gives back the face
Iâm just giving an example where you can upgrade the cards
it's in its own thing
Since you said you couldnât make it work
yeah but upgrading shouldn't give the face back
I disagree but ok
like
Then you probably do need a patch
i already patched a bunch
Itâs fine. I was just thinking you didnât need to
But if you donât want faces to return
how to add use button on joker?
yeah the current main branch uses that
i think it was too op with Dracula
or
vampire
I'm dumb
Maybe the face could be removed again
how do you spawn a specific card for debugging?
Debug mode
anyway since i already made it not enhancement
Agreed
i just want it to feel a bit like base game where you can upgrade stuff and the fact stays the same
in this case the letter stays the same
I thought the letter stayed the same even if faces came back
it would
how to add use button on joker?
actually try checking the vanilla method
đ€
Which part?
whatever this is
rarity needs to have your mod prefix
i wanted this to be possible
OK it worked
I also change the rarity code to this now:
for some reason my mod's config dosen't seem to load
also the card change (like SMODS.Joker:take_ownership()) takes higher priority but in the hooked code lower priority takes precedence of execution (overwrites higher priority mod's values)
you don't need to have the prefix in the rarity definition
doesn't really matter though, steamodded recognizes that the prefix is already there and won't add it again
it's like lowest priority mods having highest precedence of execution
lowest priority value gets run first
and vice versa (highest priority mods having lowest precedence of execution)
this is via hooking
doesn't really matter what you're doing
mods have their main files loaded and executed in order of lowest to highest priority value
Then why is it saying "ERROR"
and they execute hooked functions and lower priority mod overwrite higher priority mod values
do you have a label for it in your loc files?
I put it in the main file (for now)
you need to either have a loc_txt or define the label in a localization file...?
if you don't give it text to display it'll ERROR
Introspection! :D
noice
Like this?
do you guys think aseprite is good for making jokers?
Yes.
Aseprite is good for making pixelart.
Balatro uses pixelart for its well... art...
i personally use GIMP, bur Aseprite looks fine :D
some mod with lower priority
local hooke = Card.set_edition
function Card:set_edition(edition, immediate, silent, ...)
if self.gerio_forced_edition then
edition = tabledeepcopy(self.gerio_forced_edition)
setmetatable(edition,{
__newindex = function() end
})
end
hooke(self, edition, immediate, silent, ...)
end
```cryptid with higher priority
```lua
local se = Card.set_edition
function Card:set_edition(edition, y, z, force)
if not force then
return se(self, (not self.no_forced_edition and G.GAME.modifiers.cry_force_edition) and { [G.GAME.modifiers.cry_force_edition] = true } or edition, y, z)
end
return se(self, edition, y, z)
end
```because the lower priority code takes later, it has advantage of overwriting higher priority mod's values
it's like fighting for lower priority so the value stays same
HoloLive mentioned
Ah crap, forgot about that...
Well I guess I should say if you want to make an atlas? Cause I'm not sure how big the canvas would need to be or does it not matter.
still love how these are like this
For atlases I just take the size of one card and make multiply that number by 10.
I can now fit like 100 cards in one atlas.
In any case I'll just move to there since I actually have it and I was using a trial of pixelmator pro before.
theres just so many things wrong with the first thing
As I quote: "For Justice!"
(Hence why it's Glass Card build)
all played cards get fisted đ
fix please? i can't seem to put use button on joker
https://github.com/TRRESTGHGYTCFTGBCXSZD/gerio_cards_part_1
https://github.com/TRRESTGHGYTCFTGBCXSZD/gerio_cards_part_2
Gauntlet of the Fister
kid named playing cards:
KID??
(/ref)
I don't think Gigi Murin is really an underage...
But her taste, on the other hand...
holy shit is that x3 mult
rabble distribution :D
i think it's +15
no i think its +15 mult
FUCK
1 in 6 chance to go extinct
spoiled again
what if its a blue java banana....
it's actually gros michel guys it's only +15 mult
why are blueprints in your consumable slots
that's called blueprinter
it's called a mino not a monomino
i was like i haven't eaten a banana in a while
you sound like -15 mult
me?
đ
oops I'm stupid should probably not ping reply
You.
You broke the law
those pieces look rainbow
Anywho hi Myst I got a couple of questions
- Where in the source code is the Blind chip's texture rendered and where does it pull textures
- Also where in the source code is the Blind's chip dissolving animation located
I'm working on a custom blind that changes the Blind's icon as a mechanic
Last time I check, tetrominos has their "offical" color set
and yes, it's a sega color set
guideline color set are different colors
Then why is your T blue instead of purple
i used sega specifically
đ
ALSO pretty sure Tetris colours are copyrighted
wait, sega has a different set?
at least the official colours
trademarked
not the colours
the specific shape with specific colours
You can ping Myst for questions but anyways
I'm too used to Nintendo set
I see
i'm not sure that matters, nintendo'll hardly go after you for using tetris pieces in a balatro mod :}
What about the textures rendering and swapping textures
What about them
hihi
- the blind texture is
G.GAME.blind.children.animatedSpriteand is set duringset_blindi believe - yeah its the 'dissolve' shader
Making a custom blind that has a unique mechanic of changing it blind icon to a different design mid-blind
Is it just the icon or is there more
animatedsprite extends sprite so you can do set_sprite_pos and then reset
Because you could use L Corpâs Multiblind
Basically you need to perform a specific action based on the colour of the Blind icon
hey, a little feedback on some joker text?
Wavedash us
me when im colorblind đ
-# i am not colorblind
i'm making monominos auto-merge if there's 4 monominos here (cuz i didn't found how to add use button on joker)
Introspection (Uncommon): When Blind is selected, creates a Tarot card and changes type to Planets (Must have room)
after creating a Tarot:
Introspection (Uncommon): When Blind is selected, creates a Planet card and changes type to Tarots (Must have room)
I think Thunk uses these start of round texts inconsistently so I try to stick to just one
that sounds alright
mhm, i've read up on that
when blind is selected happens before when round starts
i'm gonna go with the more common wording that Burglar, eg., uses
I might consider a small change like âthen swapâ
Is it? Itâs the same context
I donât think there are different contexts
they aren't iirc
I remember reading the text and the code
one happens before the cards are dealt, the other happens after
And comparing it
well only Certificate uses When round begins
So can I just directly use start_dissolve() on the blind icon?
but cards like Cartomancer create their Tarots while the hand is being dealt
I think so
start_dissolve is a card method
Still, Iâd redo the wording
how so?
For effects that apply after a hand is drawn
why do i keep doing this
wee
okay but this isn't When round starts
it's When Blind is selected
and it'll trigger when Cartomancer would
ah ya
hey guys, do think mod like this would be good? (i only got concept so far)
Red Potion - Add permanent +2 Multi to 3 selected cards
Blue Potion - Add permanent +12 Chips to 3 selected cards
Purple Potion - Add permanent +1 Multi and +6 Chips to 3 selected cards
Green Potion - Add a copy of selected card to hand
Yellow Potion - Gain 1$ for each potion used this run
Pink Potion - Add permanent x0.25 Multi to 2 selected cards
White Potion - Add Green Seal to one selected card
Black Potion - Destroy 1 card and gain 2$
/// Vouchers ///
Potion Merchant - Potion cards appear 2X more frequently in the shop
Potion Crafter - Create a Potion when Blind is selected
/// Jokers ///
Blue Vials (common) - +5 Chips per Potion used this run (Currently +0)
Red Vials(common) - +1 Mult per Potion used this run (Currently +0)
White Vials (uncommon) - Create a Potion when Blind is selected (Must have room)
/// Deck ///
PotionCraft Deck
Start the run with Potion Merchant and Potion Crafter vouchers.```
@long sun I think for yours Iâd just consider using âswapâ instead of change, and see if you can make the âswapâ text shorter
Hearthstone gets away without specifying what it swaps to, maybe thatâs possible here
-# damn potioncraft deck but not potion craft themed
Maybe not
i plan to add Zodiac cards into the mix, so swap wouldn't work for the three types
because that implies two states
I mean Hearthstone has more than 3
(but i didn't say that, so)
ya but this isn't Hearthstone
how do i add stuff to my custom booster packs pool?
Balatro has a template, actually.
no but it uses changes:
Earn $5 for each discarded [rank], rank changes every round
wdym by that
Each played card with [suit] gives X1.5 Mult when scored, suit changes at end of round
Earn $4 if poker hand is a [Poker Hand], poker hand changes at end of round
so
So
well ya but this is consistent
it uses the word changes to denote changing the ability
-# its not an inspiration by it lmao
I gave an opinion
you did, ya, that's not a problem
well, i rename it to potion without the craft
i'm just explaining why i want to stick to the word changing
@grand violet
beat me to it ^^
<@&1133519078540185692>
Weâre just nodding at each other in a loop
Although I might use âchangeâ myself if I stopped to write it while looking at the game
At the moment, for two options, âswapâ reads more natural
I also like it as it sounds less vague
i mean, they're synonyms
There are no true synonyms
Hmmm...
SMODS.Atlas document doesn't include Legendary cases I'm looking for...
Words carry different connotations
What do you mean
Like the effect vanilla has on Perkeo and other Leg. jokers
Combining a background and a secondary layer
Haven't found it in Cryptid code yet...
Thatâs an option for Centers
And itâs undocumented in the wiki
Though it has always been there
just pass the location of the soul on the atlas
ah lemme see if i can find an example
okay so, in the Googol Play Card's code, i found this:
soul_pos = { x = 10, y = 0, extra = { x = 4, y = 0 } },
so i think that answers your question
the x and y i think are the position of the floating image, and the second x and y pair is where its sprite is in the spritesheet
That sounds wrong
Or it has some modded functionality
The soul pos shouldnât have an extra
Normally you just pass the position on the spritesheet
i'm presuming that means that extra is optional, and can be used to reposition it
So I guess like this:
Haven't drawn the sprite, so those lines of code has to stay as notes for a while...
Sadly no
@crisp coral
self.children.animatedSprite:set_sprite_pos({x = 0, y = 2})
Am I able to just do this to swap the sprites, currently it doesn't work because children is currently a nil value. I'm doing this in modify_hand since there are some mechanics that will change the blind's icon on certain conditions, rather than in set_blind where it just initializes and finishes
is it in a SMODS Blind object? because there you need to use G.GAME.blind over self
okay, so i'm implementing Introspection, but the game's throwing an error on this line:
return { vars = { {'{C:tarot}Tarot', '{C:planet}Planet'}[card.ability.extra.chosen_type + 1], {'{C:planet}Planet', '{C:tarot}Tarot'}[card.ability.extra.chosen_type + 1] } }
this here
what'd i miss this time? :}
Holy shit it worked
Couple more things, what's the method used to dissolve the Blind icon and spawn a Blind icon?
I want to dissolve the original blind icon, and then spawn in the new blind icon with an animation
wrap the table like this ({'{C:tarot}Tarot', '{C:planet}Planet'})
at least it works mechanically :D
process_loc_text is used to initialize localizations
ah
what do you mean by this?
err im too lazy to explain sorry lol
all g đ
wrong part but correct text
{C:tarot}Tarot{}
ya, i have that
the text is "When {C:attention}Blind{} is selected,", "creates a #1#{} card and", "changes type to #2#s{}", "{C:inactive}(Must have room){}"
I see
but the formatting applies before the variables are inserted
Srry
all g đ
also, someone suggested that the Persona 5 Joker should be called the Looking Cool, Joker so i think that is amazing and have changed its name :D
how can i add multiple options for soul_set?
ooh i had another joker idea
Blind Joker: +3 hand size, 1 in 2 cards are drawn face-down
nvm arcana packs are fine
you dont get soul for free or anything đ
so much variety
Guys, is there any way to check what kind of card is being sold in context.selling_card?
ooh i can answer that
two seconds
here's the code for selling Planets:
if context.selling_card and context.card.config.center.set == "Planet" then
tarots:
if context.selling_card and context.card.config.center.set == "Tarot" then
etc.
context.card.ability.set
np!!
i love adding unbalanced stuff
question, is .JSON file required?
6 steel in one đ
i meannnn
what if you could spell out enhancements and convert them all to said enhancements.....
i mean why not
do custom seals not work in context.after?
I'm gonna slowly reveal the secret project as I go
this thing :>
That looks nothing like that
carrot top
That's palm tree, you dumb dumb lol
-- repetition_only context is used for red seal retriggers
if not context.repetition_only and context.cardarea == G.play and context.scoring_hand and context.after and card.base.id ~= 14 then
print(card.base.id)
cs_utils.flip_cards({card})
G.E_MANAGER:add_event(Event({trigger = 'after',delay = 0.1,func = function()
local suit_prefix = string.sub(card.base.suit, 1, 1)..'_'
local rank_suffix = card.base.id == 14 and 2 or math.min(card.base.id+1, 14)
if rank_suffix < 10 then rank_suffix = tostring(rank_suffix)
elseif rank_suffix == 10 then rank_suffix = 'T'
elseif rank_suffix == 11 then rank_suffix = 'J'
elseif rank_suffix == 12 then rank_suffix = 'Q'
elseif rank_suffix == 13 then rank_suffix = 'K'
elseif rank_suffix == 14 then rank_suffix = 'A'
end
card:set_base(G.P_CARDS[suit_prefix..rank_suffix])
return true end }))
cs_utils.unflip_cards({card})
end
end,```
Im not getting the print
well context.after doesn't have a repetition_only flag
Blind Joker!! :D
oh hand on it says not
which would be false either way no?
yes
question, how can i color potion to green?
(and how to make currently +X active)
I love that it's in braile
^^"
shame that they can't see the attention to detail
i know that you can use {C:inactive} for the last bit
you mean {C:green} {} ?
what smods version?
ye that works ig
and {C:inactive} {}
will putting a variable inside work?
I removed it but it still doesnt enter
what smods version are you using?
Once you claim the planet for the first time, you'll be unlocking cards based around said planet card
oh I see, is new calc stable now?
its been stable since the day after it released
oh #1# is what would be for joker variable?
two days i think
ill try it
i am about to pass out
if _c.is_null then
full_UI_table.name = {}
localize { key = "aiko_x_akyrs_null", set = "AikoyoriExtraBases", vars = {colours = {specific_vars.colour}}, nodes = full_UI_table.name }
full_UI_table.name = full_UI_table.name[1]
info_queue[#info_queue+1] = { key = "aiko_x_akyrs_null", set = "AikoyoriExtraBases", vars = {colours = {specific_vars.colour}}}
end
if _c.aikoyori_letters_stickers then
info_queue[#info_queue+1] = { key = "letters", set = "AikoyoriExtraBases", vars = {text = _c.aikoyori_letters_stickers}}
end
what the fuck happened here
i have no idea if this would work
greenie
in config you should put 0, or is it retroactive?
Red Vials(common) - +1 Mult per Potion used this run
rarity is so stupid
eh, debatable
you need a global variable for that I think, check fortune teller
how do i create_card that forces a specific rarity without knowing the weights or the rarity beforehand
i can check the orginal code?
oh not towards you sorry
only reading it is fine
tryna do this
card = SMODS.add_card({
set = context.card.ability.set,
rarity = context.card.config.center.rarity or nil,
area = context.card.area,
key_append = "lobc_rudolta",
})
{C:green}text{}
already been said
okay so i've settled on the ability:
+2 hand size, +2 discards, 1 in 2 cards are drawn face-down
but i have no idea how to implement the last bit
ok, mb
found this
wrong ss, mb
this
i really dunno how to continue
check set_consumeable_usage in misc_functions.lua
you should hook your own global variable
and increase it accordingly
where is misc.functions.lua?
functions folder
so i add that function to mine code?
how would i make a joker treat kings and queens the same rank?
i tried looking at pareidolia code and it doesnt really help
I tried something like that too, but there isnt a is_rank() function like is_face() sadly (there is get_id but its not the same thing)
You could make one but then you would have to make it compatible with vanilla jokers etc I dont think its doable
damn
i have no idea if whatever i am adding is right or wrong lmao
wait you arent adding it to the source code are you
ok it doesnt seem like it
nah, i am adding to my code
i know to not alter vanilla code
i only extract that
not alter
im not too familiar with hooks, I had some luck with gpt
after upgrading to new_calc my seal work but... nothing is scoring đ±
something i guess
i am guessing this will be how it works
this is harder than i imagined, ngl
anyone has consumable templates tho?
not G.GAME.consumeable_usage_total.potion == 0
that's (not G.GAME.consumeable_usage_total.potion) == 0 and NOT not (G.GAME.consumeable_usage_total.potion == 0)
is it possible to "hook" calculate_joker with that method of getting the reference to the original function then redefining it? i want to modify the return value every time it's called
just save your modified value somewhere in your joker's config, you don't need to change the function for that
here the heck you see the brackets
there's no brackets
i'm just telling you what this does
not a joker, i want to modify every calculate_joker xmult return value
that is, you're comparing a boolean to a number
i managed to do it with eval_card, but can't wrap my head around calculate_joker since it's a Card function
you could hook out of this part of SMODS.calculate_individual_effect
(lovely patching smods files is still broken)
this would catch every xmult, similar to how exponentia from cryptid scales when any xmult is triggered
hm, alright
can't do vars in tooltip names unfortunately, these don't get parsed by localize in the same way main text boxes do
alright
simple question but i'm kinda new to lua, how can i modify an object (i.e. a SMODS.Consumable) that i've already created?
when do you want to change it? also, globally or for one specific card?
My trick was to create a specific name then check for it and modify
well what i'm trying to do is change a spectral card's description based on a config value
Like modname_hey_change_me
I've added support for variables in names, it just can't work with the names of tooltip boxes đŹ
why i cant find any consumable templates...
Why not?
you can have variables with loc_vars just like in joker descriptions
because localize doesn't parse it in the same way that it does for the name of a main description box, it just returns the plain string stored in the localization entry
Isnât that a matter of changing how localize parses names?
I think the most annoying part would be making names into tables
more so about how tooltips are constructed outside of generate_card_ui using just string data
i guess i could fake-substitute the vars
loc_vars...? its there a documentation page on that
it's sort of covered in https://github.com/Steamodded/smods/wiki/SMODS.Center#all-centers
this page is getting split and reworked soon, gonna cover it more precisely when that happens
ah ok, thank you
btw
is SMODS.Joker gonna be moved outside of Centers? And if not, will methods be put INSIDE a center's section (unless it works on any center or smth)
I'm thinking there should be separate pages for each subclass
each page would have its own methods that don't work on every center
yeah
i feel like that would be good
wrong location
Iâve almost convinced myself that general functions like loc vars should have an entire page just for them, like how thereâll be a calculate page soon
loc_vars could definitely use its own page
esp with the amount of features it now has
there wouldnt be a way to have a card have two card ids, would there? (not really serious)
Bumping this question one more time, I think I've narrowed it down to Game:draw(), but still unsure.
fairly unrelated and much more serious question, im trying to get it to detect kings and queens, but it keeps crashing upon evaluation, anyone have an idea whats wrong?
Scoring hand context doesn't contain an other_card, either do individual, or do something like joker_main or after/before and iterate through the cards in the scoring hand yourself.
Also, scoring hand is passed to several different contexts.
local dsdsds = string.upper(_c.aikoyori_letters_stickers)
if dsdsds == "#" then
dsdsds = "Wild"
end
if G.GAME.letters_enabled then
if G.GAME.letters_mult_enabled then
info_queue[#info_queue+1] = {type = 'descriptions', key = "letters"..dsdsds, set = "AikoyoriExtraBases", nodes = desc_nodes, vars = {colour = G.C.UI.TEXT_LIGHT}}
localize{type = 'descriptions', key = "letters"..dsdsds, set = "AikoyoriExtraBases", nodes = desc_nodes, vars = {colour = G.C.UI.TEXT_LIGHT}}
end
end
what do i do
to put the mult inside the smaller box
Should generate_ui also be but there? It'll be easier to state it's use case when you go fully in-depth on how it works.
question, how to make new consumable set?
cuz game crashes when launching my game even if i just tried adding one consumable that does nothing
i just drop those here cuz i dunno what i done wrong
your loc_vars function doesn't have an end
bwah
still broken
oh wait nvm, i forgor the ","
nevermind once again, still broken
đ
i be going insane by the end of this
what do you use to edit your code?
notepad++
you should really install a lua extension
not having your editor point out syntax errors is quite terrible indeed
dunno how and dont wanna deal with that-
how do i make a custom order for my jokers in my collection without reshuffling around all of my code
?
you don't wanna deal with what-?
installing stuff onto notepad++
you really should use a lang extension when coding
or you'll keep running into syntax errors like this and overlook something dumb instead of just having it highlighted right away
Gonna give this a bump. Iâm trying to track the number or retriggers prior to the second joker hitting joker_main
Lmao
if anyone is knowledgable in this regard please help me
try testing if the issue occurs with walkie talkie as well
or any joker of the sort
It also happens with Scholar so Iâd assume it does for walkie too
Hereâs the full calculate block if that helps
mmmm it's a weird issue then, since scholar does not retrigger the cards nor trigger them again in any way
I agree that itâs weird
does the issue also occur with jokers that do not interact with the cards?
Iâd have to test that. I currently donât have access to my setup so I cannot test it right now unfortunately
yeah I think so. I think it'd help people with creating their first mod too if each different function they can add had it's own page explaining what it is and how it works
almost got a page full
is there a way that i can change the boss blind while im fighting it?
Im not sure where this would go, but modding seems more accurate than anything. I started working on an alternative language for the game, nothing useful, just more fun centered. It's probably been done before but here's my take on olden english Balatro:
Starteth yeth voyageth witheth 26eth Trowelseth andeth 26eth Cardiacseth ineth thyeth assetseth
Id like to prevent aneurisms
Is there any way to run mod code using a separate thread or process to parallelize something?
if there is, then almost no one knows of it yet.
When making custom deck art, should I work on 1x and size it up to 2x or should I start with 2x and downsize to 1x?
âAlmostâ??
running threads is definitely possible, but I don't think it's practical for a lot of use cases
I am thinking about making a skin for the DeckSkinsLite mod
i'm just saying, there's a non-zero chance it's doable.
the game itself uses threads for certain things, i.e. save manager, sounds
My goal is to run probability calculations so threading is less desirable because IO wait is almost nothing
But afaik thereâs no native way do multi core in lua
no
how would you re-enable a boss blind with a joker perchance?
(if it helps, this is the intended effect)
im trying to make an enhancement that works like Blueprint, but i cant get other_card to work i think? for now im just using the effect of walkie talkie, but every time i try to play it with something i get a attempt to index field 'other_card' [a nil value] crash, can anyone help?
SMODS.Enhancement {
key = 'e_chaos',
config = { extra = { chips = 10, mult = 4 } },
--no_rank = true,
any_suit = true,
always_scores = true,
replace_base_card = true,
loc_txt = {
name = 'Chaos Card',
text = {
"{C:dark_edition}Copies ability of Card to the right{}",
}
},
atlas = 'chaos',
in_pool = function(self)
return false
end,
--overrides_base_rank = true,
pos = { x = 0, y = 0 },
calculate = function(self, card, context, effect, info_queue)
if context.cardarea == G.play then
local other_card = nil
for i = 0, #context.scoring_hand do
if context.scoring_hand[i] == card then other_card = context.scoring_hand[i+1] end --makes it look to its right
end
if other_card and other_card ~= card then
if context.other_card:get_id() == 10 then
return {
chips = card.ability.extra.chips,
mult = card.ability.extra.mult,
card = context.other_card
}
end
end
end
end
}
You probably need to narrow down your context. Something like if context.individual might work. context.cardarea == G.play is called for multiple different contexts
https://github.com/Steamodded/smods/issues/401 huh this one's interesting
like jokers, tag loc_vars are defined elsewhere
For jokers, we can't be doing anything about it because that would be fucking unmaintainable
i think i can come up with some trickery to redirect these to generate_card_ui though
bump
can i also bump mine?
i've had this issue but i don't remember how i fixed it
the curse of the green squares
Does balatro have an "offical" color pallete for its art?
yes, theres also a lot of design tips for arting in fan art
There's been a ton of compiled ones in fan-art
was quite easy for tags, let's see if I can make this happen for jokers too
(though note the full palette is like >256 colors)
The modding threads have like 3 as well
Starting to try modding but the text file isn't becoming a lua, any fixes?
totally unmodded
rename the file?
What would be modded about this? You just got really lucky hermit rolls
lmao
hi, is there an event for when a blind is selected? or just a way to check if one has been selected
G.GAME.blind i think
not sure
anyone know how i can go about making a joker that retriggers all other joker's effects?
thank you !
that fixed the crash, thanks, but i cant get an effect to trigger
bump
You're likely to have to move your code around... or move each Joker to its' own .lua script that you call from the main one and rearrange the order of those. đ€·
Can someone help me learn some modding in this game?
you can look at the example mods steamodded provides
and at the base game code
Cant even make a lua file so far
its just a text file with .lua as an extention
It still says Text Document instead of changing into Lua Source File
are you sure you are modifying the extension and not just renaming the file?
hey can i get some help on this? (reply also has an image tied to it)
anyone has template for consumables, vouchers and pack? (i got for joker, seal and deck so just need those 3)
How would I check?
do you have show file extensions enabled
KoLGames, do your other files have extensions shown? (.png, .txt, .exe)
Fixed it, itâs good now. I forgot to enable it
how would i make a deck spawn my custom jokers with higher odds?
like the vine deck
in the cardsauce mod
im looking at its code and can't really figure it out
that some complicate math shit
it is?
what project was it on?
makeing stuff with more odds when conditions happen in general is
anyway, once again i am asking if theres any consumable templates
reminds me of minecrafts pirate language mode lmao
the cat language in minecraft
rate? :D (2/7)
gemies!
gemies :D
love the left one, right one might need some work still? doesn't feel very shiny/gemstone-y to me if that makes sense
anyone know if the functionality of spectral cards is somewhere other than it seems? I tried using a lovely patch on the bit in card.lua that seems to describe incantation/grim/familiar, but even if I literally delete the entire code block the functionality is unchanged
thanks! đ€
Do I need the Lua program for coding or am I asking stupid questions?
Yr asking stupid questions get vs code
k
hey I was just making a very basic alteration to the game (rearranging the jokers in the collection to an order that makes more sense) and the thought occurred to me that when I'm done I probably should put it up in case someone else was interested
but I don't know how to go from messing around in the game files to making a shareable modification
AMAZING
you shouldnt directly modify the source code
yeah i think thats what lovely patches are for from what ive heard
yes I love lovely patches
3/7!
looks nice, what does it do?
oooooooohhhh ii like it
You know how the Smear card makes suits act like another suit, how could i make something similar?
i haven't made the abilities yet, but i wanted to make Legendaries from the spells in Professor Layton vs. Ace Attorney
card:is_suit
i'm using my own upscales of the sprites as reference
so, here's Goldor's upscaled sprite, for example
thanks
no way my favorite ace attorney entry
here's Ignaize and Dimere
do you have a thread?
i can make one for my mods!
by the amount of how much i never got response to consumable, vouchers and packs templates, i assume there arent
Is cards_destroyed always a random table? Trying to get the first card that's destroyed and it appears to be random every time?
check the Steamodded examples?
not art assests
also i did, but its missing those (or i am blind)
i remember there's an example Spectral?
i have no idea what im doing. I found this under cards.lua, but i dont know how to convert it over to the joker function
if next(find_joker('Smeared Joker')) and (self.base.suit == 'Hearts' or self.base.suit == 'Diamonds') == (suit == 'Hearts' or suit == 'Diamonds') then
return true
i dont see it
front = possibilities[i],
_center = pseudorandom_element(G.P_CENTER_POOLS["Enhanced"], pseudoseed('draft_highvaluegoods'))
}, G.deck, nil, i ~= 1, { G.C.SECONDARY_SET.Parcel })```
does anyone know why this would produce a regular, unenhanced playing card?
Check SealExample
well, it be 1/8 cards i wanna make then
I can't see it
is this the part of the code thats ran when the joker calcuation is ran?
calculate = function(self, card, context)
if context.joker_main then
return {
mult_mod = card.ability.extra.mult,
message = localize { type = 'variable', key = 'a_mult', vars = { card.ability.extra.mult } }
}
end
end
}
he didnt made it yet
just said he will make one
you were proved wrong above
nuh uh
i replayed to message to the one where he havent made yet
if youre using new_calc you dont need the message part also
Appearing to be random...
What is wrong with my code?
what is happening in this video
I looked into modding video and it isn't working
Task Manager, on last discard, destroys all discarded cards. The WIP Joker to the left is intended to make a copy of the first destroyed card X times, where X is the amount of cards destroyed.
could be the order in which you select the cards matters?
Add
calculate = function(self, card, context)
if context.joker_main then
return {
xmult = card.ability.extra.Xmult,
}
end
end
and change
loc_vars = function(self, info_queue, card)
return {vars = card.ability.extra.Xmult }
end
Selected from 6 down to 2.
ah yes, function(slef)
missing comma
youre also missing some commas like on line 29
Let's try again
in the context of final_scoring_step, what variable stores the final score? i'm helping out with a friend's mod and she referenced args which doesn't exist in the scope of calculate
would the WIP joker also work with hanged man?
Still isn't working
Intended to be compatible with such, yeah.
You don't have a calculate function at all.
is that in your main file?
No
then you would need to import it
What, you mean the mod file itself?
Not like the place where you keeps mods but the mod itself
How would I make a mod that adds a new enhancement or edition
I wanna have one called Magnetic where the card is always drawn into your hand
i think there is a section somewhere on the steamodded wiki about enhancement/editions gimme mo
pokermon is great to see how to do make them
Of course if such an enhancement already exists in another mod, I don't need to do anything lmao
Pokermon?
https://github.com/Steamodded/smods/wiki/SMODS.Edition
https://github.com/Steamodded/smods/wiki/SMODS.Enhancement-[wip]
another mod
Gotcha
so for some reason when i import my mod into the game to test it out its throwing up a json error according to debug plus, and im at my wits end?? theres literally nothign that should be causing this??
does it copy correctly with hanged man?
this is the .json file
"id": "sinful_jokers",
"name": "Sinful Jokers",
"display_name": "Sinful Jokers",
"author": ["Peachfroggg"],
"description": "Adds four new suit based jokers.",
"prefix": "sinf",
"main_file": "sinfuljokers.lua",
"priority": -21,
"badge_colour": "fda0a5",
"badge_text_colour": "a61a1f",
"version": "1.0.0",
"dependencies": [
"Steamodded(=1.0.0~ALPHA-1309c)",
"Lovely (>=0.6)",
"Balatro (==1.0.0)"
],
"dump_loc": false
}```
also depends on how youre getting the first destroyed card
Hanged Man makes the last selected card to be the first destroyed. When destroying via the Task Manager Joker, though, it goes from left to right as expected.
if context.remove_playing_cards then
for i = 1, #context.removed do
local _card = copy_card(context.removed[1], nil, nil, G.playing_card)
...
Also, the WIP joker catches any playing cards being removed via CTRL+R too.
Do you need the dependency definition?
I want to make an edition which turns a random card in hand to that edition if there is any in your full deck
is there any way of doing it?
for the joker that destroys cards on last hand are you using context.pre_discard or context.discard
if context.discard and not context.blueprint then
if G.GAME.current_round.discards_left == 1 then
return {
delay = 0.45,
remove = true,
card = context.other_card
}
end
end
what if you tried with context.pre_discard? then you could pass G.hand.highlighted to be destroyed (which is probably correctly ordered) instead of it checking one by one
but idk if that would give error when trying to discard a destroyed hand
I used the Trading Card return base... and then there's Immolate that I have to test out potentially.
maybe? i have no idea what im doing wrong here
Just remove that part for the time being then.
mkay!
This is so bare bones, how does this not appear in-game?
I checked collection, it just doesn't exist.
...are spaces even allowed in key?
You need to make a call to joker:register in order for Steamodded to add it to the game I think
That isn't necessary.
Can you just type in the code for that since I have two braincells trying to make my first joker.
Then why isn't it working?
SMODS.Joker:new()
...that's not needed either?
What?
It's just SMODS.Joker(table).
for _, v in pairs(jokers) do
local joker = SMODS.Joker:new(
v.name,
v.slug,
v.config,
v.pos,
{name = v.name, text = v.desc},
v.rarity,
v.cost,
v.unlocked,
v.discovered,
v.blueprint_compat,
v.eternal_compat,
nil,
'new_jokers',
nil
)
joker.loc_def = v.loc_def
joker:register()
joker.calculate = v.calculate
end
end```
it seems you've learned off an old version of steamodded
T_T
and I'm talking like 9 months old
Well I just started learning Balatro modding and I've just been using other mods as examples.
you're not specifying the atlas, so it'll just show up as jimbo in-game. seems alright otherwise
then you're using the wrong mods
It's not showing up at all, not even in collection
does your mod show up in the mods menu?
Nope
Hmm. Does this mean I have an older version of Steamodded installed too? Because my mod actually works just fine đ
do you have a different mod with id ODDITIES that you copied this header from and is also being loaded?
Nope, only this one
No, there's a compatibility layer to keep supporting older mods
anything in the logs?
Wdym?
Balatro\Mods\lovely\log
Nothing there
in a joker, is there anything that i can refer to in the calculate() function that refers to the totalled score within the context.final_scoring_step?
basically i'm trying to make a joker that modifies the final score
hand_chips and mult are exposed globals for current scored chips and mult respectively.
G.GAME.chips is the current amount of score already put in iirc.
and that's for the current scored hand right
not the score for the whole round
Currently scored chips and mult. I have a Joker that swaps the two values around when it triggers on a card being scored, so the values can differ from one copy of the joker to the other due to their positioning in the hand.
roger that
Anybody able to help me rework this Joker?
does anyone have a list or some way of finding out every jokers name and id? im too scared to tamper with the source code
It's currently extremely overpowered and needs a nerf but I don't know how to code my new idea
I still want it to create negative Jokers, but instead of being everytime you leave a shop, it will be a 1 in 4 chance whenever a Joker is triggered
And needs to not be able to copy itself
I used ModdedVanilla.lua to scalp the probability code from Gros Michel, but I don't know how to stop it from copying itself.
Add an odds to your config for the max chance, first.
What's your mod prefix?
The "prefix" defined in .json or the legacy header.
oh thank you
mvan
Though, maybe pseudoseed would've fit better, but I just use math.random instinctively.
extra = { odds = 4 } -- 1 in 4. For 1 in 5, it'd be 5 instead.
...
-- Find a random Joker that's not ourselves or a copy of us.
if context.other_joker and context.other_joker ~= card then
local selectedjoker
if #G.jokers.cards > 1 then
selectedjoker = pseudorandom_element(G.jokers.cards, pseudoseed('j_mvan_wokeworm'))
while selectedjoker.config.center.key == 'j_mvan_wokeworm' do
selectedjoker = pseudorandom_element(G.jokers.cards, pseudoseed('j_mvan_wokeworm'))
end
else selectedjoker = nil end
-- If we have a valid Joker, roll the chance.
if pseudorandom('j_mvan_wokeworm') < G.GAME.probabilities.normal/card.ability.extra.odds and selectedjoker then
G.E_MANAGER:add_event(Event({func = function()
local card = copy_card(pseudorandom_element(G.jokers.cards, pseudoseed('wokeworm')), nil)
card:set_edition('e_negative', true)
card:add_to_deck()
G.jokers:emplace(card)
return true
end
}))
card_eval_status_text(context.blueprint_card or card, 'extra', nil, nil, nil, { message = localize('k_duplicated_ex') })
end
end
pseudoseed is 100% better
If I have a card that returns a negative value in calc_dollar_bonus is that a problem?
please don't use math.random
What do I do then đ
Use the code Ali just wrote!
But math.random
I never grasped pseudoseed in places like such, but it should slot in instead of math.random.
psuedorandom
psuedorandom_i_range
also I'm very silly and don't know which part I replace with the Ali code
I know, I'm obtuse
nvm this isnt a thing
pseudorandom_element(G.jokers.cards, pseudoseed('j_mvan_wokeworm')), in this instance?
G.jokers.cards[pseudorandom('j_mvan_wokeworm', 1, #G.jokers.cards)]?
pseudorandom_element is more appropriate in this case
pseudorandom_element(G.jokers.cards, pseudoseed('j_mvan_wokeworm')) then?
This is what I have right now? I'm just getting more confused
Please re-look at the code I've sent earlier... there are edits to it I've done.
also you need to add a context check otherwise this will just crash the game
Oh yeah, the if context.other_joker block in this case.
They wanted to change that to a 1 in 4 chance whenever an another Joker is triggered.
Well, at least I tossed my two cents in on this as I had to make my own "not self" Joker finder routine... as well as limiting it so that I don't end up freezing the game in the while loop.
Can we pass pitch alongside sound now?
I appreciate the help either way I'm just trying to get it workin
how to check card's center
I keep getting crashes with no log
idk what could be causing it
oh wait
nvm
idk why it's crashing
I'm just trying to find how many unique ranks are in the deck
for one that wouldnt do the trick since youd have duplicate ranks
ya I was gonna filter them out after it fills an array with em
because I don't think Lua has a function to check for duplicates
better way to do it is
local a = {}
for i, v in pairs(G.playing_cards) do
if v:get_id() > 0 then --stone cards have <0 ranks
a[v:get_id()) = true
end
end
print(#a)
how to check card's center
this way just crashes without a log, I assume because memory issues
idk how to make it so it only updates when the deck changes
card.config.center
old steamodded?
ik eval_card used to result in a stack overflow (which can sometimes just not error and produce a crash)
not eval_card
I just updated it before working on this mod
get_id()
this would be helpful if i knew when you started working on the mod
2 hours ago
maybe like 1
sorry not trying to be snarkly
should've specified that
a couple but nothing that should be cuasing it
putting it in the context.joker_main makes it work
is there any documentation of what the next() function does?
well not crash, not work
anything not in a context check in a calculate function will stack overflow
local monominos = {count=0,minos={}}
for _,h in pairs(card.area.cards) do
if h.config.center == G.P_CENTERS["j_gerioc2_gerio_monomino"] then
monominos.minos[monominos.count+1]=h
monominos.count = monominos.count + 1
end
end
```made this counting thingy
is this fire
Wallet: Contains 4 random non-playing cards, will summon one at random when Poker Hand is played (must have room)
anyone know how i can check if all the cards in your played hand are a specific suit?
poker hand is a placeholder for one of the random (currently unlocked) hands in a run, changes whenever you activate it
any reason this wouldn't make the first card in an arcana pack a spectral card
fair enough
how would I make it so a value actively updates like Cloud Nine does
loc_vars
well yeah
you update it both in calculate and in loc_vars
such that whenever you would be able to tell what the value is its updated
hi nice pfp ok bye
true
should I just put it under when a consumable is used and before other joker calcultions
I know
so you wouldnt need to do the first thing
but there's other jokers that can modify the deck so it should update there as well
and also that makes sure it's correct before calculating
sorry, whats the effect?
if SMODS has taken ownership of something but I want to edit it further, what's the best approach? can I simply take_ownership again?
it's meant to see how many ranks you have in the deck and reduce it's very high xmult per rank you have
does pseudorandom return between 0 exclusive and 1 inclusive?
so if you have a deck made of 1 rank it's super strong but it does nothing when you have a normal 52 card deck
it seems to work with this set up, does anyone know if there's a get_id() for suits because there's is_suit() but that wouldn't really work if there's any modded suits
yeah that's a check that should be done within the calculate context
this is really weird, the patch certainly applies, but nothing put on the payload does anything
are you using steamodded?
o tetrimino producing square jokers are bit weird
I figured it out, SMODS takes ownership of those spectrals so editing vanilla doesn't do anything
Just tested this and it does
Well then
Did you have to take ownership yourself to get around it?
this is the code i used to make the first card of every spectral pack be trance
SMODS.Booster:take_ownership_by_kind('Spectral', {
create_card = function(self, card, i)
if i == 1 then
return {set = "Spectral", area = G.pack_cards, skip_materialize = true, soulable = true, key = 'c_trance', key_append = "spe"}
else
return {set = "Spectral", area = G.pack_cards, skip_materialize = true, soulable = true, key_append = "spe"}
end
end,
}, true)
any idea what 6 other tetriminos do? (I gains x6 mult if the poker hand is flush five, five of a kind, straight flush, four of a kind, flush or straight, as this is straightforward, T is full of twists)
Next project lol, maybe do the cat one too
does it replace this part of the code? wouldn't it give a pattern not found in the log in that case?
it basically just puts a bunch of new code at the start of the booster pack code that means the vanilla code doesn't actually ever run
ohhhh
why do you have a blueprint in your consumable slot
yeah
is there a way around it?
that's called blueprinter
...do I need to say again!?
yeah, you can use SMODS.Booster:take_ownership_by_kind
i posted an example a little bit up in the chat
I think they could also patch Steamodded's patch
Or see if Steamodded provides somewhere to hook
Is someone able to help me fix this Joker? I was having help with it earlier but no one officially told me what to do, people were kind of disagreeing with each other and I never figured it out
oh my bad, i didn't see it
It's supposed to have a 1 in 4 chance to clone a Joker (with negative) whenever the Joker is triggered, but shouldn't be able to clone itself
ok interesting issue with this implimentation, #card.ability.extra.c_rank is returning the first false value i.e. if you remove all 4s from the deck it returns 4
it does whatever the lowest false value is
is there a good way to find the fancy text the game does? e.g., the word "negative", or the words "The Fool" have fancy colors when used in descriptions -- but where would I look for an example of how to copy that into my own text?
anyways whats card.ability.extra.c_rank
I guess there's no reason it shouldn't be a local variable other then I wanted it to work in set_ability and calculate
??
the white background
looks good to me
ya me too but it's just not?
are you trying to count the number of Stone cards?
anyone know what juice_up does?
opposite
number of unique ranks in deck
that is an issue thank you
I mean you can count Stone cards then remove it from the total
Because the game does that for Stone Joker, if you need a reference
no point in doing that though
but the main issue is that it's just not counting the length of the array correctly
you can just check non-stone cards
shakes cards
what are u talking about
Mods can implement more ranks or cards without ranks
?? yeah duh what do u think get_id() is for
negative values indicate non-ranked cards
which is why you check whether theyre positive
Does that work for modded Enhancements using Steamodded's built-in feature
it either works or wasnt intended to work