#💻・modding-dev
1 messages · Page 377 of 1
i put it anywhere in the code above, not necessarily the smods.koker?
(what's talisman?)
yes, to_big = to_big or function(x) return x end is to ensure that when talisman is not installed, you wont crash
uhhh
how do you not know of it
😭
The spectral that puts a gold seal on something.
idk im kinda new, started coding just last month :c
yeah but its like the most popular lib mod rn
ahh i dont play mods a lot
anyways, all it does is basically uncapping numbers
by turning them into tables
-# and making modders suffer from adding talisman compat
somethingcom adding talisman compat is ass and you aint telling me otherwise
🥀
and do i have to add to_big on every of my variables?
could i watch a code that has it so i can check how it's done in practice?
to everything thats in a if statement, yeah, just to be sure
Defining it if it doesn't exist, planet and taking ownership of mr. bones, respectively.
its only some variables that actually need to_big, but if you dont really know what you are doing then id suggest just using to_big on everything
</3
we should probably make a full list of vars that need to_big 🤔
my localization file alone is almost as long lel
G.GAME.dollars
G.GAME.hands["hand"].level
G.GAME.chips
G.GAME.blind.chips
hand_chips
mult
``` is all I can remember.
i think mult, hand_chips (the global vars) too?
x)
🤔 not sure
i do this first then?
yes
and then just add to_big(var) to each if containing those types of vars?
Yes, and you to_big the other number aswell when comparing.
alrightyyy doing that
and just in the if condition, it doesnt need to contain the to_big within the if too?
wuh
like
if to_big(blabla) <= to_big(G.GAME.dollars) then
to_big(blabla) ?
end
No.
i can just call it blabla
You only need to to_big it when comparing it with a table.
alright thanks!
do i need for fors?
like here?
ah it's not hands.level
mb
No.
well it seems i had only one occurence of these, gg
hey, how would i go about making custom card skins?
For playing cards or other cards?
Hmm... I really wanted to get the Pikmin Suit Storage working tonight...
Hi, I'm hoping to make an alternate version of blueprint, but unsure where to start. Does anyone have any ideas on what to do?
Alternate as in it copies the joker to the left, I'm assuming?
for playing cards, like the Friends of Jimbo skins
no, something a bit more unique. If it's relevant I'm planning to copy the ability of joker to the right and give it to joker to the left, which I can figure out how to do like baseball card, it's just the blueprint part I'm stuck on
So you want the joker to the left to copy the joker to the right?
No, you would probably use SMODS.blueprint_effect to get the result then use SMODS.calculate_effect to trigger it on the joker on the left?
Yes, the inputs are SMODS.blueprint_effect(copier, copied_card, context)
well, couln't copier be set to G.jokers.cards[i-1]?
Yes.
It doesn't activate the effect for you though.
wdym?
It calculates the joker you give it based on if it is blueprint compatibility then it gives you the result.
context from calculate.
how would i go about making a pokerhand with a modded rank? like how would i check for that rank?
'(mod prefix)_(rank key)'?
how btw
i tried and it doesnt work
welp
i'm out of ideas
How did you try it?
lmaoo dw
'(mod prefix)_(rank key)'
Yes, but where did you check for that.
evaluate = function(parts, hand)
if hand == nil then
return {}
end
if #hand ~= 3 then
return {}
end
local _tick = 0
if hand[1]:get_id()=='idk_G' then
_tick = _tick + 1
end
if hand[2]:get_id()==13 then
_tick = _tick + 1
end
if hand[3]:get_id()=='idk_Y' then
_tick = _tick + 1
end
if _tick == 3 then
return {hand}
end
end
}
Try checking if card.base.value == name
okay ty :)
is there an easy way to make a consumable do that thing that WoF and vouchers do where they get pulled into the center of the screen and send a message
Code didn't work 😦 any ideas?
I meant something like this ```lua
--- my_pos = get joker position
local effect = SMODS.blueprint_effect(G.jokers.cards[my_pos-1], G.jokers.cards[my_pos+1], context)
SMODS.calculate_effect(effect, G.jokers.cards[my_pos-1]
Also use card not self
alr thx
question, in here, is there a way to show the list of c.a.e.hands[context.scoring_name]'s true values in like a toolbox (like the info_queue)?
if context.before and context.main_eval then
card.ability.extra.hands[context.scoring_name] = true
end
Probably.
anyone know how i can figure out which cards are currently in the shop
G.shop_vouchers.cards, G.shop_jokers.cards, G.shop_booster.cards
what is the actualy object that returns?
Every card in those tables is a card in the respective area in the shop?
yeah specifically joker
i wanna make amod that rerolls until specific jokers show up
G.shop_jokers.cards
Yes.
sadge
How does one make a joker move itself?
I looked at handy and it seems I have to move it manually.
"move itself" meaning?
Hi again, how would I go about making a mod that adds new playing card skins?
If I had a blueprint that copied all cards, I would like if it moved to the left of the card it is copying?
man this is the second time in a row where I reference basegame to copy a function call and I forget to replace the "self" with "card" and it just does nothing.
I love how mods are structured completely differently from the normal game
how would i modify the '6 of spades' text?
that'd probably need a lovely patch
my idea is if a card is rankless it just says 'Spades'
idk if there's a proper way but I just take the sort_ids of the held jokers, swap them into the order I want, then reassign the sort_ids and call G.jokers:set_ranks()
actually that's because I'm shuffling while pinned, ignore me. can't remember how the basic version is done
you should add a mask to the draw so it only shows the suit symbol
hm?
i know what draw is but ive never touched it really
oh i see
add a mask to the sprite draw that hides the number value
actually that'd probably be more effort than it's worth
okay so i need to modify the game's code to make this text accessible
woo
okay
isnt a lovely patch just search and replace
so if i can find this text i could patch in an accessible way to get to it
tbh this sounds like something i could push into smods if i do it good enough
Thank you
that's not a bad idea, yeah
i could modify whatever function generates the ui to also accept a string that is displayed
so you could in theory just add in whatever string you wanted to
but id also need to maintain compatibility with the base game
so maybe i make it a hook then? check for the presence of the arg and if its there change the text
im not quite sure how the base game does it though, so i should probably look at that
im gonna guess its either in card.lua or ui_definitions.lua
ill worry abt it later
how do i change the card order in the deck?
hibana does it in aiko mod, but i dont understand how it works
you could probably meddle with G.deck.cards but idk
can you get the value of how many cards have been destroyed this run? do they store that anywhere?
think you have to hook for that if you want "this run" specifically
damn idk how to hook
basically you put a function into a local then you overwrite that function and call local
sorta like this
basically you add your code to the function is what you're doing
Something of spades
how can i extract joker info from the cards in the shop?
i understand its in shop_jokers.cards but i cant figure out what
how can i run code after shop reroll??
the actual joker calculation occurs in the event inside G.FUNCS.reroll_shop so i cant do this:
local _reroll_shop = G.FUNCS.reroll_shop
function G.FUNCS.reroll_shop(e)
_reroll_shop(e)
for k, v in ipairs(G.shop_jokers.cards) do
print(v.edition)
end
end
I'm trying to make a joker (first time doing balatro modding or using lua) that scores based of off the number of cards you play, how would I do that?
I mainly need a way to get the value of the number of cards played
All played cards or scoring ones?
thank you
#context.full_hand
What’s it giving based on that
- mult
it takes the factorial of that number and adds that to the mult
so if u play 5 cards +120 mult
24 if u play 4 cards etc
https://www.youtube.com/watch?v=Zp-4U5TlbxY I used this tutorial and started of the mod with the example it gives
STEAMODDED 1.0.0
A tutorial on how to make a modded Joker.
https://github.com/art-muncher/Example-Mod -- EXAMPLE MOD
https://github.com/Steamopollys/Steamodded -- STEAMODDED
https://github.com/WilsontheWolf/DebugPlus -- DEBUGPLUS
-----------------------------------------------------...
hello , I'm a develloper and I'm interessted into the balatro mod community, is there a documention or something ?
I need to change this I believe
yeah that would be great
o so there's not :c
idk
It is
I only just started too
a okok
you'll need to do the calc and do +Mult from what you said
ty, I didn't do lua for a while , that's so weird to get back on it
?
I doubt it
I did some monstrusity in the past with this language nw
that seems to simple if I've learned anything from other modding I've done
no js mult =
I might make an actual "make your first joker" guide after I've finished calc docs
so then when the joker main happens it'll use the value card.ability.extra.mult has
Here, you can find creating and placing cards in shop in UI function
And yandere-dev mode
anyone knows how to make custom type?
wanna make something similiar to vouchers but in packs
I'd just make them vouchers but get them to not show up in the shop maybe?
simplest way i can think of is to just make it a consumable that changes some stuff globally?
hiii
I'm making my first balatro mod and I've designed some custom jokers , opinions? :3 also pls lmk if these are super similar to any existing cards or seem unbalanced
those are actually super unique rebuffed especially is very cool
- looks good, weak even for common
- meh
- ok look, but weak?
- idk
- good one, actully
???? no?
I did a run with storm and it can actually be very powerful
it requires some set up
Full lucky-based
if u add dice in it could very good
yeah
maybe make it 1/4 idk
i think thats too strong then for every card to have a 25% chance to retrigger 4 times
photograph is common, gives 2x for any face card
your is uncommon, require jacks, and only 1.1x
yeah 1/6 feels reasonable
yeah that one is a little bleh
only the first face card tho
I'll change it to 1.5x, would that be better?
More than enough to be powerful
i'd at least do 1.25
indeed
wait but is this gonna work or not?
1.25 is closer to truth
I also made this but it was more a joke card and I'll probably remove it in the final mod unless others think it's good
thats a X3 if you have 5 cards
that's good
and no retriggers
Is easy to get 5 jacks?
obelisk 2 my beloved!
yeah fairly
definitely needs building towards though
Then why Hit the Road weak?
bc it demands a lot of resources just to reset
i've never found it an optimal use of time during a run but it can be good
you have to do spritesheet for jokers ?
yeah that's what I saw
I preffer individuals
i think I'll go individual for the test
do you have something for update the script without open and close balatro ?
nope
not that im aware of
debugplus is useful though i've heard if you dont have it
haven't used it yet myself
you forgot to clos your function ?
should be after the end here if you dont have one
squiggly bracket to close the calculate function
why you didnt do local tempval ?
nvm lmao
I did b4 thought it might be the problem figured global might not cause problems and so removed it hoped it would fix it
have now put it back lol
so it's was the end ?
Is there a command that closes the game?
wait nvm no this is why I removed it I forgot
why it make the game crash lmao ?
well go back in global ig, but I found that kinda messy
look so long as any tempval is set to 0 in the game its fine
ik SMODS.restart_game() restarts it
without saving?
I am so annoyed
unless you tell it to but the game tends to be good at knowing where you were when you close out
will be a little behind
I was told it was the # of cards played
ah okkk
cuz I remmebered table in lua start by one and not zero
so its the number of cards the full hand has in it
I've only ever coded in python lol
should I add one then
I will try it, thanks
try idk
shouldnt need to
but I remember in lua the default index is one
ill try it out myself
so idk it cause problem
either way that's not the problem
yeah
I have a sneaky suspicious that may need some messy code but I know there's the pinned tag so it should be possible
yeah taking a look at pinned tag would be my suggestion
it shouldn't it would (how my code works) just reduce the number of cards the joker things you played
I am getting increasingly annoyed at this
its saying line 56
but
that's not line 56
what the console sayed ?
whats on line 56?
the return
the start of it?
its still saying this
ye
oh you dont need an end on the return
ahhhh
You better learn lua first, then back to modding. Seriously
nahhh
I have some coding experience just not lua and I've got nothing better to code
maybe watch a short video on it but i've learned what i know from just throwing myself in the deep end, i'd say its fairly effective
lua is really easy , you can learn it with this honnestly I think
agree
the only think that will be tricky would be organising yourself after
it does seem fairly similar to what I know
what language u use ?
I've learned python before
fair enough honnestly
which may explain why the indentation stuff is what I've got wrong
also yes its still broken
Me as JS dev when there's basically nothing in Lua: 
I doesn't know much about python, but I know lua, C,C++ and C#
lua is really really simple and ugly
looking for all the functions xD
I have to learn java next year for school 😭
tis not ugly!
- looks inside
- no functions for anything
- bummer
mmmmh
An on top of that, indexes started from 1
i dont see that as an issue personally
one of my first project was a connect 4 , I doesn't knew how to use table, so I coded every winning condition possible
that was beautiful
I have a screenshot of the code if you want to check it lmao
oml
that sounds stupendous
like you coded every place you could get 4 in row?
like a manual check?
for each
it might not be too bad I had a friend show me a bunch of I think stacked if statments, like 10 sets of 10 if statmentds
Only 10 of 10?
what is the difference between an event with trigger 'after' and trigger 'immediate'? does immediate trigger at the same time as the previous event?
classmate of mine does that in ue5, just a bunch of branch nodes stacked
it could've been a for loop
after can have a delay.
like maybe a double for loop I think
after (in my experience) goes after everything else in the function is done
so instead of like 5 lines it was 50
I should probably try and work out this rather than continue to talk abt stupid code choices
Maybe one day he notice that he's doing code inside table definition
What are you trying to do?
add mult based on number of cards played
Couldn't you do mult = #context.full_hand?
Isn't IDE tells you that you have invalid syntax?
yeah...
No, you need the lua extension.
Same thing
is it a good practice to use #(context.scoring_hand or {}) instead of just #context.scoring_hand
oh lord
since im scared it might be nil
500 lines
this one should I believe but it doesn't say anything
because it need to take the factorial of #context.full_hand
i would say that it's not good practice unless you know it might be nil, but when it comes to contexts they shouldn't be
also should it be mult = rather than mult = mult +
multiply the number by every number less than it up to 1
depends
When I take_ownership a vanilla object, can I make it not appearing in modpage/addition, or make it not show mod badge?
but i think in your case yes
it should be mult = ?
mm i see
mult = tempval yeah
thanks
so it can only be {} if context.scoring_hand got all the cards in it removed?
Since you need this anyway, unzip game executble and just take a look at what is happening inside game
seems accurate
yes, if it isn't then some mod is doing it wrong
ok its still unsurprisingly broken the same way
could you send your whole file? i can take a look
What me?
Yes you
Don’t use… whatever
.
At least lua syntax
I do not have any clue what that means I got the mod file from a tutorial and am adapting it
So you're trying to do smth without understaning what you're doing and how to do it in a first place
Vaguely yeah but that’s how I generally go with this kind of thing and work it out how it works once I get it working
I find it works well for me
That's not how programming works
Yeah I have some basic knowledge of how it works I mean I can kind of understand this already
I can explain what's wrong with your code and why but it will be TL:DR and be better to figure out yourself
bro js tell them the problem 💀
Can you tell me simply how to fix it then I will fix it and work out what I was doing wrong maybe by asking the a question or two
Fine.
calculate = function(self, card, context)
if context.joker_main then
return {
card = card,
mult = 1 + #context.full_hand
}
end
end
oh it was in the return i see
depends on what effect you want code is different
if you have prior programming experience then you can 100% start modding without lua knowledge. i knew 0 lua before starting and i've learned a lot. VanillaRemade is a really good thing to reference if you're just starting out
^^
That’s not what it needs to do tho it needs to add #context.full_hand! (!obviously isn’t a hard coded function in lua tho)
I’m not at my laptop rn
In a moment I’ll see if u changed anything else and that’s what it needs
Or do I need to define a function elsewhere and call that on #context.full_hand
ive got it working decently well on my end just needs some tweaks
1 + #context.full_hand in my book is adding
aka factorial
^?
I can do that myself
what im doing is just multiplying in a for loop and increasing the value
In this case
calculate = function(self, card, context)
if context.joker_main then
local tempval = 1
for i = 1, #context.full_hand do
tempval = tempval * i
end
return {
card = card,
mult = tempval
}
end
end
what does playing_card_joker_effects do?
Could probably have a local function that automatically does the factorial calculation for you.
https://www.lua.org/pil/1.html even has one.
It’s probably simpler this way it’s not too complex
Unless I end up reusing it I’ll keep it like this
i did it this way forgetting the index already does what tally does 💀
calculate = function(self, card, context)
local tally = 1
local val = 1
if context.joker_main then
for i = 1, #context.full_hand do
val = val * tally
tally = tally + 1
end
return {
card = card,
mult = val
}
end
end
it calls the playing_card_added context
or however it's called
yes
cool
I need a mod to spawn in a joker don't I
debugplus
no you can just launch the game in dev mode
i cannot remember how to do that though you'd have to look it up
I have that what do I do I've never used
hold tab?
if its the same as the dev tools
just go into the collection and press 3 on it
yeah but debugplus has more features and supports spawning more stuff
true was js noting you don't need it
holding tab then press 3 does nothing
ah thank you
but does pressing tab bring up the menu?
yes
ok I didn't get the name or the sprite right but I'll work that out
but it works
nice!
you'll prob want a localisation file rather than local text
depending on how big you are planning the mod to be
there is no plan its whatever random math joker I come up with
fair enough
currently trying to get this working but i think context.destroy_card is creating conflicts, not sure how to solve it
What do you mean?
the effect was working before adding in context.destroy_card and now it isn't
i need that for each card to give their chips, would i do them seperately in that case?
No you don’t
this is super cool damn
the tentacles is very different to what I've seen
how does the tentacle one look on another joker
yeah they're not my shaders, just the out of game exporting and animation is mostly mine
it's a project elbe started and me and atrmnn are continuing
ah
unfortunately I uh... dont know the code base well enough to easily switch out the card used for the editions. but it's from betmma's mods if you wanna check in game
I've only been working on this one shader-related file
ive been struggling to make this joker for like an hour im going insane can someone help with the code hh
this wording pains me
I just fixed the description don't worry
this feels like a consumable's job
uhhh you can probably make
well things after sell are hard to do inside the joker i feel
the first way im thinking of doing it is having a function outside of the joker that gives x5 mult as long as a value is true but turns itself false
then setting that value true when selling the joker
uuh ok I think I understand
has to do it next hand though
so check context
then set back to false after context triggers
value also need to set to false after the x5
ye
oh
it's a bit scuffed but it works
I have No Idea how to translate this to code
do the joker part first, easy win
if context.selling_self then
globalvariablenamehere = true
end
shortest calc function ever
uh so I'm trying to change the atlas names from jokers and joker but now its broken again and I can't tell why
anyone know?
ok so how would I handle doing another function like mentioned tho
and making sure the mult applies to the next hand
should the joker key and the atlas be the same?
No
try adding the prefix j_ to the joker sprite
no
ok...
idk if its needed but its good practice for sorting imo
I mean, it's not gonna stop working if they're the same, but it's not needed
kkkk
is it possible to update a G.localization.descriptions.Other dynamically? does someone knows of a mod that does it?
atlas is whatever you set it to in the main lua files
hi srockw
Hi bepis, balatro star rail creator
yggdrasil
i added crafting, inventory and a leveling system that save for the entire profile
damn
I haven't touched Balatro in months, Paperback even did the whole looking for programmers thing cus I stopped working on it
i have this rn but i have 0 idea what to do from here
oh lol, did you take a break?
more like I lost interest in the game itself
oh
fair, im only interested in balatro because of the stuff i can make in it primarily honestly :p
wait so can anyone tell what the problem is? I want to use separate files for each joker sprite if that changes anything
-# and people i can talk to in here
do you have a sprite
yes
probably not the issue, but can you try changing the joker's key
i dont see why it wouldnt
What's the name of your png file
if I had a nickle for every time I was making a mod and it was some issue so tiny not even the people capable of helping me would notice I would be rich
as would the rest of us lol
Is it a PNG
do you have it in both 1x and 2x?
yes
hm
ahh
glad to help
dont worry
we all have dumb oversights like that xD
We all fuck up stupid style anyway
best way to put it
its because the image editor I used does jpg by default
i somehow got the localisation files of my two mods switched around yesterday and was confused as to why my jokers were only getting descriptions when both mods were active
moving on from my other joker cuz im stumped
im trying to make a card that retriggers all 4s and Aces, any idea why this wont work?
that needs some improving
i dont think individual is needed
i have a joker that retriggers lucky cards, it is
if context.repetition and context.cardarea == G.play
and context.other_card.ability.name == 'Lucky Card' then
return {
message = localize('k_again_ex'),
repetitions = reps,
card = context.blueprint_card or card
}
end
and it seems to be lagging the game ton now
some guidelines from the man himself, dont worry about following them all just good to be aware of them #🎨・fan-art message
if context.repetition
and context.cardarea == G.play
and (context.other_card:get_id() == 4
or context.other_card:get_id() == 14) then
return {
message = localize('k_again_ex'),
repetitions = card.ability.extra.repetitions,
card = context.blueprint_card or card
}
end
this should work if im not idiot
idk what context.repetition_only is for though 🧐
idk either !!
also i think the "again" message procs on jokers and not cards, but i may be wrong
(and using localize is better for localization)
(cuz here it'll show "Again!" in the portuguese version too)
context.repetition_only are repetitions produced by the card itself, not by a given Joker.
is there a point of excluding it of contexts?
i hadnt put it on my owns, so i may have forgotten something
but i havent noticed weird interactions so..
... I'm out of free downloads for the day ugh
is there a downside not putting it in?
downloads?
repetition_only in Vanilla is used by the Red Seal for retriggering.
also while im getting help, any idea how i would begin to make this
if you're on pc you can build aseprite from source
but i mean, whats the importance of putting not context.repetitions_only
its fine lol its not that important
ahh i do mine on photoshop cracked 2013
it might be a night of headaches but aseprite is SO much better than anything else for pixel art
Not to mess with card-specific retrigger counting, I suppose?
ive heard about it and friends that do pixel art told me abt it too, but i dont have money lol
someone suggested the idea of setting a flag when the card is sold, using that flag in a separate function to give the X mult and then setting the flag to false when the X5 mult occurs but i have no idea how to make that
you can do this for free
shit, gonna check if there are not mess on my mod..
what are you using??
id highly recommend paint.net if you cba with aseprite
(not the site name just an fyi, its getpaint.net)
tbh i have no clue on how doing that, sorry
weeh,
im rly proud of all my jokers
also i guess the x5 would proc at the very end right?
ummm im not really sure
I guess very end would make sense
end of the next hand yeah
poor solution would be to create a specific joker that can only be created this way, negative, doing x5 and destroying itself upon doing so
truee
but thats doing junk to avoid the issue x)
that would be kinda funny
how would I create a joker when I sell this one
im gonna do that
i have a joker that does that, although it creates an already existing joker
im not sure on how to create a unexisting joker 🧐
or it can recreates itself negative, and the x5 would be negative-conditionned, then destroy self condition can be on negative
im sorry i think like an ork
i'd make a duplicate joker that isnt in the shop/pack pool
i dont know how to do that tho
idk how to do that either
anyone knows how to specify where to look for sounds
or like how to play sounds in general
although having it make a negative joker seems kinda cool
play_sound('sound_name')
2 different jokers, im sure we could figure out how to stop it from showing up in the shop
you can add 2 values for pitch and volume iirc
where should the sound file be
does it just look into my assets folder
just make it a legendary joker gg
just root i'd guess? see what a random mod does
assets\sounds
k thanks ill try rthat
then you get it out of soul xD
...the demonic soul
secret rarity 5
my go to would be that the joker has a x5 in it but conditionned to itself being negative, and self destruct on its mult proccing, and that selling the joker would create a negative copy of self
it's ugly but heh
- might be confusing for player
you need to use in_pool somewhere
my only concern then would be what if you pull it as a base negative
looking into it
then the saviour is in a hurry
its true...
quick quick!!! get saved!!!!
guys... i need some help with something
with what
mainly FX stuff
bit late, but you need to use SMODS.Sound
if yall didnt know im cooking up a tarot variant out of dislike for morefluff's 45 degree rotated tarot cards
😭
and i gotta decide on what cards do what :p
wdym
bepis while you are here if ydm, do you know how i could make destroying effects like madness target a specific joker?
:start_dissolve(), preferably placed in an event
like right now im trying and it gives the error 'resources/sounds/soundname does not exist'
prefix?
thanks ill check it out
how do i get the suit of a card?
thanks
it'll be in the channel somewhere do a search if it doesn't work
what does that return on suitless cards? just nil?
...maybe?
i havent checked that myself, but thats likely the case
either that or smt like Blank, idk
likely nil
yeah, i'm trying to make a joker effect that triggers when you score at least 3 different suits
this is how i've done mine for reference
just to be sure, you saw my reply right gelo :3
i did ty
where should the SMODS.sound be placed? (inside or outside of the joker code)
outside
okay ill try that thanks
thats like importing the sound
im working on a similar thing ill lyk if i figure mine out
likewise
should be simple enough
you will want to do smt like
-# one sec, i will be typing on phone
using a table for tallying so it works with modded suits
is Gelo the mod prefix here?
yeah
local scored_suits = {}
for _,c in ipairs(context.scoring_hand) do
if c.base.suit and not scored_suits[c.base.suit] then scored_suits[c.base.suit] = true end
end
local suitamt = 0
for _,_ in pairs(scored_suits) do
suitamt = suitamt + 1
end
if suitamt >= 3 then
-- effect
end
Da bepis
hi dilly
Hi
hi :3
where are you putting it?
just under the atlas table
Oops! The game crashed:
functions/misc_functions.lua:837: attempt to index field 'replace_sounds' (a nil value)
Additional Context:
Balatro Version: 1.0.1o-FULL
Modded Version: 1.0.0~BETA-0511b-STEAMODDED
LÖVE Version: 11.5.0
Lovely Version: 0.7.1
Platform: Windows
Steamodded Mods:
1: cosomod by coso [ID: cosomod]
2: DebugPlus by WilsontheWolf [ID: DebugPlus, Version: 1.4.2, Uses Lovely]
Lovely Mods:
Stack Traceback
(3) Lua global 'modulate_sound' at file 'functions/misc_functions.lua:837'
Local variables:
dt = number: 0.0200396
desired_track = string: ""
AC = table: 0x16d7a1b0 {ambientFire1:table: 0x16d7a240, ambientFire3:table: 0x16d7a360, ambientFire2:table: 0x16d7a300, ambientOrgan1:table: 0x16d7a2a0}
(*temporary) = nil
(*temporary) = table: 0x16d7a1b0 {ambientFire1:table: 0x16d7a240, ambientFire3:table: 0x16d7a360, ambientFire2:table: 0x16d7a300, ambientOrgan1:table: 0x16d7a2a0}
(*temporary) = number: nan
(*temporary) = string: "ambientFire3"
(*temporary) = table: 0x17342ed8 {volfunc:function: 0x17281a30}
(*temporary) = table: 0x16d7a360 {per:1, vol:0}
(*temporary) = number: 0
(*temporary) = number: 13
(*temporary) = string: "attempt to index field 'replace_sounds' (a nil value)"
(4) Lua upvalue 'gameUpdateRef' at file 'game.lua:2492'
Local variables:
self = table: 0x169d3e30 {F_GUIDE:false, F_CRASH_REPORTS:false, F_QUIT_BUTTON:true, F_ENGLISH_ONLY:false, F_DISCORD:true, STAGE:1, F_MOBILE_UI:false, F_NO_SAVING:false (more...)}
dt = number: 0.0200396
(5) Lua method 'update' at Steamodded file 'src/ui.lua:84'
Local variables:
self = table: 0x169d3e30 {F_GUIDE:false, F_CRASH_REPORTS:false, F_QUIT_BUTTON:true, F_ENGLISH_ONLY:false, F_DISCORD:true, STAGE:1, F_MOBILE_UI:false, F_NO_SAVING:false (more...)}
dt = number: 0.0200396
(6) Lua field 'update' at file 'main.lua:999'
Local variables:
dt = number: 0.0200396
(7) Lua function '?' at file 'main.lua:938' (best guess)
(8) global C function 'xpcall'
(9) LÖVE function at file 'boot.lua:377' (best guess)
Local variables:
func = Lua function '?' (defined at line 909 of chunk main.lua)
inerror = boolean: true
deferErrhand = Lua function '(LÖVE Function)' (defined at line 348 of chunk [love "boot.lua"])
earlyinit = Lua function '(LÖVE Function)' (defined at line 355 of chunk [love "boot.lua"])
woops
didnt think itd copy allthat
hm
Yes the = would replace the sound class and break everything
:3 thought i was gonna be clowned on for a brainfart there when eremel suddenly appeared out of nowhere
Any way to make a joker negative from code
When using create_card
use SMODS.add_card instead
No, you got this!
and also, add edition = "e_negative" in there
I'm patching existing codd
oh
Why
Riff-raff will get a 2% chance for a negative joker
Just take ownership and give it a new calculate function
add_card has a parameter called no_edition
wait what = bc mines working fine
wh
im back with more Not Functioning code
idea: if played hand is a straight and has a 2, give X3 mult
hi
that makes it so every scored 2s give X3 mult, pretty sire
other_card is not always defined, you need a specific context
sure
i wanted to ask a question
i would suggest asking right away instead of asking to ask :p
how do i fix that
Right after create_card
and also, what srockw said
card:set_edition({negative = true}, true)
iirc
you would want to use context.joker_main instead
if you want the joker to give X3 mult when all of those conditions are met
This is my first time modding balatro, but since I have experience with python and lua aint that different.
So I want to make all club lucky ccards have a 1 in 2 chance to be retriggered. I've taken many things from the example mod github and the vanilla mod github. This is my current joker and I wanted to ask how I could use the pseudorandom() function
calculate = function(self, card, context)
if context.cardarea == G.play and context.repetition and not context.repetition_only and
context.other_card:is_suit(card.ability.extra.suit) and SMODS.has_enhancement(context.other_card, 'm_lucky') and
pseudorandom('vremade_bloodstone') < G.GAME.probabilities.normal / card.ability.extra.odds then
return {
message = 'Again!',
repetitions = card.ability.extra.repetitions,
card = context.other_card
}
end
end
alright :3
also what does this mean/how do i fix it
ive never seen this repitition only thing before today, and i'd have 2 nickels
hi guys im trying to implement a joker where on the first discard you can destroy 2 cards from your deck (basically the hanged man tarot card ability) would i just repurpose the tarot card code?
a
look at how trading card does it
god helping on phone is hard sob
yh i literally just had that thought haha, cheers
heres an easier one lol, would this work in theory? (ik the suit thing isnt how it works)
idea is they are all different suits
how what
i wouldn't recommend doing this
immediately becomes not an easier one 💀
Kids always on those dang phones
like, maybe your approach will work for that card specifically since it should only want to check 3 cards at once, but when you need to check in a hand with like 5+ cards then that becomes tedious
my approach is more universal :p
also
dont use "not =="
its ~= you are looking for
ahhh i keep forgetting abt that
now my code just does nothing instead of crash the game
You should just add all of the suits to an array and then iterate through when adding each one to see if it has any duplicates. You could also iterate through it once for each suit and check the amount of times it shows up. Both of these are less performant, but they make the code much less spaghetti. Also, they enable mod compatibility better for additional suits or card selection.
if context.joker_main and next(context.poker_hands["Straight"]) then
for _,v in ipairs(context.scoring_hand ) do
if v:get_id() == 2 then
return {
...
}
end
end
end
smt like this, i think
yeah i did suggest that approach up there
thats their own take :p
a i see
can you take a ss of that with the lines too
?
of what with what lines
yeah, line 118
this also does nothing
(yes i updated the return text)
the first nodes need another {}
ohh
can you try changing Xmult_mod to just xmult
also, remove the card = ... line
you don't need it
y'all really need to stop using _mod fr
fr...
idk what it means im just going off the example jokers,,,,
ok I've set the pseudorandom string to something and now the game ccrashes. how do i use pseudorandom 😭
if context.cardarea == G.play and context.repetition and not context.repetition_only and
context.other_card:is_suit(card.ability.extra.suit) and SMODS.has_enhancement(context.other_card, 'm_lucky') and
pseudorandom('feelinlucky') < G.GAME.probabilities.normal / card.ability.extra.odds then
return {
message = 'Again!',
repetitions = card.ability.extra.repetitions,
card = context.other_card
}
lemme crash it again
some gibberish
(the mod is called reddit because it uses jokers from reddit suggestions)
card.ability.extra.odds is a nil value
SMODS.Joker {
key = 'feelin_lucky',
loc_txt = {
name = 'Feelin' Lucky',
text = {
"{C:green}#1# in #2#{} Chance to",
"retrigger {C:attention}Lucky{}",
"{C:clubs}#3#{} {C:attention}Cards{}"
}
},
config = { extra = { repetitions = 1, suit = 'Clubs', odds = 2 } },
loc_vars = function(self, info_queue, card)
return { vars = { G.GAME.probabilities.normal or 1, card.ability.extra.odds, localize(card.ability.extra.suit, 'suits_singular') } }
end,
rarity = 2,
atlas = 'reddit',
pos = { x = 1, y = 0 },
cost = 6,
calculate = function(self, card, context)
if context.cardarea == G.play and context.repetition and not context.repetition_only and
context.other_card:is_suit(card.ability.extra.suit) and SMODS.has_enhancement(context.other_card, 'm_lucky') and
pseudorandom('reddit_feelinlucky') < G.GAME.probabilities.normal / card.ability.extra.odds then
return {
message = 'Again!',
repetitions = card.ability.extra.repetitions,
card = context.other_card
}
end
end
}
config = { extra = { repetitions = 1, suit = 'Clubs', odds = 2 } },
mm
ok, so
make a new run
or create another joker
im guessing you created the joker before you added in the odds
so the joker currently does not have card.ability.extra.odds
can you explain dat?
i half understand
oh i get it
if you created the joker in game beforehand it wont hold the new values
yea i get it
sorry for disturbing
thank you
am i understanding this right?
first for is putting all the suits in the scored_suits table, next is increases the suitamt by 1 for every suit?
yeah, from what i heard, #table doesnt work if the index is a string
and since the person up there only really wanted to check how many unique suits there r in the scoring hand, i only added suits when they arent already in the table
yeah
so for what i want id want to iterate through the suit of every card highlighted then check in that table if there are any results that are the same i think
i see
instead of setting to true, you want it to increase by 1 instead
and in the table, check if theres any whose value is higher or equal to 2
highlighted_suits[c.base.suit] = highlighted_suits[c.base.suit] +1 like that?
mhm
aight awesome
like if a stone card is selected?
...= (highlighted_suits[c.base.suit] or 0) + 1
i see
no, the nil suit check is already up there
ig this needs to go in the can use not the use
I think we should all remove our nil suit checks collectively
how do you let the player buy a joker even if there are no joker slots (kinda like how negative works)
what are you trying to have allow this?
a joker that adds 1 joker slot
worked first try, thank you
G.jokers.config.card_limit + 1
that adds the card slot but it doesnt let you buy it if theres no room
hm
i put it in an add to deck function
so thats why you cant buy it
but idk a better way
i'll check it out in a bit and lyk if i figure smth out
alr
how do i check what cards get selected/deselected?
G.hand.highlighted
(Malverk) I feel like I'm missing something really obvious here, the localization = { ... } isn't working - "attempt to index nil value", but the moment I put it in the localization file it does
i do have my reasons for wanting them here instead of in the localisation file - does anyone have any ideas?
trying to make a card that triggers every scoring card once for every non-scoring card, but this doesn't do anything
can you try adding "print(card.ability.extra.repetitions)" after both for loops
so i can see the behaviour that happens
oh i didn't know lua had python-esque print statements
yea was also stunned
where does it output? can't find it in lovely
should come in lovely output
did you restart balatro
yeah
how do i add a blind to my mod?
read the docs first
ah so both mod sources i checked just do it really annoyingly
ah
thanks
ok try printing the repetitions before and after the
card.ability.extra.repetitions = 0
just wanna see if it bugs there
hm
oh
i get it
you are changing a joker local var
that isnt set
just create a local variable
(replace card.ability.extra.repetitions by repet or smtn)
ok
wtf did i jsut say
just replace every card.ability.extra.repetitions in the calc function with another variable
(afaik this should work)
ok but if i set it to a local variable like retrigs or something it'll evaluate to the correct number and then reset to 0 before context.repetition executes
you are right
maybe try running the top part in the context?
(im very inexperienced just to say lmfao)
i'd be recalculating it for every scored card but i suppose that's not a big deal
alright im done for the day -w-
paint board is subject to change i just have no ideas rn
oh! i just fixed it by changing the name "repetitions" to something else (i chose "retriggers"). maybe that's already defined in config.extra for whatever reason
k
cool
neat jimbos
You have repetitions and repetitons, that’s why it wasn’t working
are consumable cards sprite size the same size as the jokers (71x95)?
sweet thanks!
i have a question, trying to do a wheel of fortune-like effect except it individually checks for each joker, and i want it to be sequential, so my structure is like
for i = 1, #G.jokers.cards do
EVENT
function
if fortune yes then
EVENT
trigger before
function
set edition
else
card_eval nope!
end
although the edition doesnt have a cd, like a end charge-time so it feels rushed when it's a success when i'd want it on the same pace as nopes'
any ideas?
does G.hand.highlighted work for consumables and jokers aswell?
will support for text styling in names with info queue be coming soon?
no because G.hand is for the hand area, G.jokers.highlighted[1] would be for jokers
ooh yeah, totallyy forgot, tyty
How can I replace a 0 in source code of balatro with a bit of code
Using lovely patches
how can i get the max amount of discards and hands the player has
what is the use case?
at that moment or when entering a blind?
when entering a blind i guess
G.GAME.round_resets.discards and G.GAME.round_resets.hands i believe
and if the player has any discard and hand vouchers it will update right
huh??
yeah
same with jokers
thank you
like
for enhancements is 'SMODS.has_enhancement'
what would be the thing like that but for joker?
to check the highlighted joker key
oh to check highlighted?
G.jokers.highlighted[1].config.center.key == 'j_whateverjoker'
tyy!
is there an non-context version of context.consumeable.beginning_end?
How would i make a joker that increases the maximum selection of tarot and/or spectral cards?
beginning_end?
i have this code in one of my jokers (unrelated to what i'm doing) and i assume context.consumable.beginning_end is what i'm looking for
basically i want a non-context way to detect if a consumable is being used
idk what beginning_end is but what do you need this for exactly
for more context, this incorrectly deducts selection limit when using the tower tarot
and what is this trying to do?
'Stone cards ignore selection limit'
it works fine rn, but if you use the tower it deducts selection limit
also, i'm working with a lovely patch if that helps
I think it's easier and more mod-friendly to just add a field to the card when it increases the selection limit likt self-highlighed[i].increased_stone_selection and then you only decrease the limit if the flag is true
that means if a stone card was turned into one while highlighted nothing should happen
alright, how do i add that field?
where do you do highlighted_limit + 1
just add a line there that says card.increased_stone_selection = true
oh and when you deselect a card i can just check for this flag right?
yes
ok after a couple minutes of being an idiot i got it
but
another problem appeared
when there's more than 5 cards selected the 'play' button becomes inactive
yeah you need to patch the play limit for that BUT there's an SMODS PR for it
