#💻・modding-dev
1 messages · Page 354 of 1
Yep. Plus the fact the the Love2d shader chain requires us to pipe into dissolve shader is also weird. plus how variables get optimized away? Also wierd.
I think that's a Balatro quirk not a Love2d quirk
not exactly a tutorial but you can look at how I did it
https://github.com/chaseoqueso/Powerful_Balatro
Variables getting optimized away I can understand, but it's annoying when it demands we use a variable named after the file
I agree again!
You can also check my mod
You're the best Yes Fox
someone posted the function in my main.lua and I just copied it lol
deadass, its crashing and i got no idea why
ill send the shader, my code, and the crash log
do you use a variable named after the shader
yes
do you actually use it or is it just there
I used it
hmmm
give me a sec and ill send the code
oh
wait
i have the shader key as TheHiss
let me see if that fixes it
it was the key..
This is normal.
I don't know
I don't know
But make sure you use your shader name in your shader.
It's a weird quirk. if you look at negative or holo, you'll see it has an extern at the top that matches the file name. That variable also must be referenced within the shader itself
I mean I was just listening to I~ya I~ya I~ya
Also just a general tip, use watch shader <yourShader.fs> from debug plus which will keep the game from crashing most of he time. You can even change the shader and it will reload in real time!!!!
it is amazing. WilsonTheWolf did a good job
IIRC it didn't replicate every shader feature
It's better than a kick in the nose, that's for sure
truthfully though one or two of my shaders look weird when i use it's shader watcher. I reported it to them, it's a hard problem to solve. They actually use another love2d shader watch library and the weirdness comes from in there
hmmm
what's the weirdness
Different size of rendered circles! It's weird. In their shader preview, it looks really good, but in game actually runnning in the engine, they result is diferent. I can't think of what's doing it
how do you compute the size of the circles?
so... ngl shaders are one thing ai can kinda do, and i don't care at all if people use it for that
just a random tangent
only after 50 tries, i am now watching the file (i forgot to include the shader folder)
is there a way to completely nullify mult? (including the base operation)
like
chips are the only way to add to score
how would i force it to stay at 1
Oh yeah I remember what it ended up being! The circles were different size on built in jokers, versus modded jokers. Any modded joker looked different.
Then we discovered that it wasn't with the shader watch after all. Sorry I remembered that wrong
hook the vanilla function that changes Mult; or just do it last
Jonh DebugPkus is goated af
Chips and Mult both have functions to manipulate their values before they're added
ignore this :3c
watch shader Mods/Mist/assets/shaders/hiss.fs
if card.edition
thanks
I'm using a smooth_step function which results in rendering circles thanks to...math stuff I am not 100% on!
that didn't answer my question tho
what exactly are they?
I'm pretty sure there's a patch on mod_chips, that's not normally what it looks like is it?
I might be misremembering but I thought they both just returned
This is what it looks like in vanilla
I don't remember if any challenge in the final game uses chips_dollar_cap
So it's possible that if never evaluates to true
sounds incredibly difficult
what?
i am not smart enough for this
hook mod_mult to contain something like if condition then return 1 end
If it's not in vanilla, maybe that's why
I did decide not to use it as a Showdown mechanic
Instead I just modified base chips
im not familliar with hooking
you save a reference to the original function and overwrite the function, but using the reference inside
local original_func = mod_mult
mod_mult = function(mult)
--do stuff, then call the original
return original_func(mult)
end
specifically you'll either want the condition return before that so you can ignore the original return, or you'll want to call it first then manipulate it after
They hijack the original function and make a replacement
i understand that part
vortex is cooking up a storm vortex
i only have about a month of experience in coding
im pretty sure i get whats happening
i just dont know how to actually implement it
what part did you not understand? the part where they got the functions?
one of the worst feelings
firstly,
i dont understand exactly what this is doing
i mean i sorta do
@rough furnace my first eketch of the thing from yesterda
but each component i dont get
read down to here for full contexrt
first, they store the original function in a variable (in case it is useful to run) then they redefine the original function to do whatever they want (which was run the original function, but usually other stuff are done)
the "local" part im assuming goes in my variables, right?
does the rest go in the same place
stupid question but
i am so lost
the local is so the other files can't run this random function named 'original_function' (its purpose is solely to remember the previous version)
what I wrote for you is the template for all hooks. You write that anywhere directly in your main mod file
alright
the first line creates a variable for us to hang on to the original function (so we can call it later, otherwise we would be completely erasing the original function)
so inside of this hook, i can check for conditions, and do return 1 end then?
alright
then we write a new function, but store it in the original function's variable to replace it
ACE!
me?
Yeah local keeps that variable in the scope of your block (this would be the current file, function, if statement, loop, etc. Its in. ) its prevents other blocks from accessign it which prevents issues with named being the same, and also helps with performance a bit.
let me try this
i think so, i was making a joke about how long you are typing
so does this work or have i completely misunderstood
yeah
you probably want some nil checks but yeah
I think i can refactor the way i'm doing it to combine the additional entries first like i want, finish it, turn it into real lua, and iron out the specifics myself, I mostly wanna know if the approach would generally work, and if ther's anything else i need to keep in mind
nil checks?
is this to merge duplicate jokers?
why doesn't holographic show up in my info queue?
info_queue[#info_queue + 1] = G.P_CENTERS.e_holographic
e_holo im psure
ah
anyone here code from roblox luau?
normal lua feels familiar yet not
so used to typing local
Normal Lua has local?
i've never coded in lua before balatro modding
same
interesting!
that may make it eaisier though because then i don't get messed up from previous experience
yeah
I mean your code should probably use locals but accessing thunks stuff is globals
they're taboo here too (unless you have a strong reason to create one)
global variables are bad practice in most programming languages
i see
i legit don't use globals normally except from the game itself
a long time ago, localthunk banished globalthunk
which is why lua is terrifying because there is no data encapsulation
Yeah DebugPlus has like 1 global I think
you can't say something that funny while I'm at work
long before time had a name, the first...
making a card effect that's basically just baron but for 7s and 2s, but the effect is also activating at the end of a round after you clear the score rerquirement, if anyone knows how to fix it i would like the help
What do you mean?
yes, specifically for purposes of the stats screen
ah
Hiding implementation details from the people using your API basically
technically more general but whatev
Yes but why doesnt Lua have this?
i hope someone makes something like that for ingame
i have an excuse to use this 🙂 https://github.com/nh6574/VanillaRemade/blob/46a1c466de9ca37089199737963a5857769e9f94/src/jokers.lua#L2046
in my usage it's ones that are literally the same but have just had their keys or prefix changed over the months
pro tip: if you want something that's technically a global, but with an incredibly hard to spell name, you can put local my_globals = _G[SMODS.current_mod] at the top of each of your files (make sure to initialize it first).
you can just use banner to ban all but one
every value is exposed
No its not
just add "not context.end_of_round" in the if statement
Try getting the console open state from DebugPlus
challenge accepted
to merge jokers in the joker card area?
or as a hack
awesome this works perfectly thanks for your patience yall
gl
if you combine with other mods, set yours to a high priority so your set definitions gets run last
because everything is tables and there is no way to hide keys, you can change the value of any key to be anything you want
Local variables
i was thinking about that. is locking metatables a thing?
oh nvm, i thought you meant different jokers that did the same thing
Yes
Also metatables
like keep them from both appearing
I guess but you can't have a global table with some local properties
it's all or nothing
que es
uh oh
(lua noob)
when metatable binary operators
Lua is surprisingly capable of doing stuff, it's just that as a language meant for embedding and small stuff you have to implement what other languages have by default yourself.
^
you're good
I don't understand
every langyage can do anything in theory, or it wouldn't be turing complete
'what that'
OK solve the halting problem in lua
problem.halting == 'solved'
'You know how to code? Alright. Solve the halting problem in every language."
that's not considered computable for the purpose of the defintioon of turing complete, no?
isn't it kinda defintional
lua is the only language where NP = P
You said it could do anything
i meant anything other languages could, lol
but fair, pedant
Write a Lua program that creates a rock so heavy even Lua itself can't lift it
Lua can make me a waffle.
no it cant
Propaganda.
interfacing with the right hardware, asbolutely
^
Big Waffle doesn't want you to know
LuaJIT is really powerful cause FFI
so...Python classes?
that is very neat
Idk I don't yse Python
you can use them to implement them
lotta metamethods
that's neat
i remember when // wasnt a thing
what about Julia
still isn't
for the version Balatro uses
i remember that^
cool language
I don't understand how to use Type Unions correctly
convert(Julia, dylan)
(function()
local i = 1
while true do
local k, v = debug.getupvalue(require 'debugplus.console'.doConsoleRender, i)
if k == 'consoleOpen' then
return v, i
end
i = i + 1
end
end)()
prove it with this:
(function(x)
x(x)
end)(function(self)
print((function()
local i = 1
while true do
local k, v = debug.getupvalue(require 'debugplus.console'.doConsoleRender, i)
if k == 'consoleOpen' then
return v, i
end
i = i + 1
end
end)())
G.E_MANAGER:add_event(Event {
func = self
})
end)
How could I edit my shader to have the card fit to the shader, if thats even able to be done?
what do you mean
you can make the shader warp the card
Whoa. This didn't cross my mind. We have access to debug utilities.
which is what they mean i think
Shoot I forgot about that
but idk how
:P
I think it's possible at least
maybe use a shader to do the warping instead of warping it manually. that might also work
i mean glsl is a lnaguage so it is, i mean without modifying the card draw code
i think so
basically you need to act on more than just the color values, which shaders can def too
i think is the point
I think there's something you can set in the edition to tell it to not do thst
that's another thing
Balatro renders multiple layers of the same card
you can pass a value to SMODS to ask it not to do that
will it flatten?
for shaders with transparency
Flatten?
or shape, just read it
like merge all the layers into one then render that
No
set this to true
@worthy stirrup
Because there are two answers
sorry wrong reply
and one is easier than the other
can you disable base shader for non-edition shader application? I presume you can too, this is tangential i know that's not the disctinvtion you asked about
idk
I mean... do we know if they aren't already? because i think this is how it'd look with the base shader on, saying it says to disable it if changing shape
is there like a plugin somewhere that adds the vanilla balatro variables and such to a code editor? ive decided i want to try and start making a balatro mod and i was wondering if there was smoething like that to make coding SLIGHTLY easier. i can probably just try and figure stuff out from other mods and vanilla code either way, but i remember reading something about some addon that adds definitions
yes please i would like that
oh thanks
It looks to be within the bounds of the card, so I thought they had just changed the colors to make it look like it had moved
just load the dump with your ide?
you could add the smods repo to your workspace, then maybe just maybe ctrl+click could work
wait how are people making these. like what program are they using. i am like. NEW new
oh defintions
sorry
yes it is a good idea
vs code
i use the dump from lovely
the SMODS lsp might help too
visual studio right. i had a hunch
visual studio code, not full vs
full vs is way overkill i think
You can tell the lua ls to look at balatris souce and it figures out most stuff
what is lsp
lumpy space princess
from adventure time?
i don't use either but i'm very nre to actually ytying to start modding, lol
when i first got into balatro modding i tried coding with notepad, switched to vscode in 5 minutes
i hate her
visual studio is for microsoft languages (i.e. not Lua)
language server something right? like basically how the studio interprets different kinds of coding languages
yeah this...just be aware that when you have other mods in the same workspace or folder, vscode gets confused because many mods redefine functions
it seems to support a lot more than that? including lua
iirc full vs is egregiously bloated
I have a bit if a weird setup but you can copy my notes
https://github.com/WilsontheWolf/DebugPlus/blob/master/.luarc.json
https://github.com/WilsontheWolf/DebugPlus/blob/master/dev/luals.md
but what do i know
^
did you take a look at my thing?
oh that's sick, that should fix vscode getting confused for me, thanks for sharing
yes
i remember installing it once and it took like a full hour
No
fair, take your time
why
I'm at work
thanks, ill take a look
oh then yeah dw about it anytime soon
i dont like her character
adventure time is goated though best show ever, watched it whole way through a few months ago for the first time
designwise? personality wise?
everything.
AT is one of if not my favorite show
it's not my thing at all ngl
the one CN show from that time I liked was Regular Show
alright, setting up VS Code. i am deeply new to this, not super good at code, kinda thinking i'm gonna be in over my head
but i have ideas. WOW do i have ideas. if anyone wants to take a look at the google doc im making compiling my ideas i can send it over to ya- i don't anticipate making even a tenth of them anytime soon but i just want to develop the skill to be able to do it yk
like. i have jokers that have to be recharged with actions. i have jokers that can evolve when other jokers are present. i have a LOT of stuff but i am fully aware I will have to pour myself deep into coding to make like half of em
it was a tough watch at first but the show just gets exponentially better every season
I enjoyed Regular Show for a little bit but I found it too repetitive. Adventure Time is both funny and deep
i believe in you
(if anyone wants to know WHAT the mod is- homestar runner. just a ton of homestar runner content)
awesome to see you starting coding! excited to see what you make with it
The beginning is very silly. I don't think that's bad, but some people dislike that. However, most of it is still plot relevant
yeah, definetely
it's a more cringy type of humor to me
its definetely like that at first but as the show matures its humor does as well
LSP is a self-centered teenager except she accidentally committed murder once
PB is Big Brother
uhhh tell me another AT character I can oversimplify until my description becomes detached from reality
lemongrab
Hi it's fun. im in over my head too and its worth it just to see how the code works and try to make a few jokers like that
i love pb i dont get why people hate her
speaking of in over your head i need help making a booster pack
Misogyny usually. God forbid women do anything
god permit
war crimes, covert dictatorship, manipulating people
jake the dog is that guy- you know the guy im talking about? i think his names chester stone. like the guy who did the video about the clock, and the one where he beats up the giant teddy bear
based
I mean, I think that's what people who dislike her would say
yeah, i began coding about a month ago and i'd say i'm extremely ambitious
god forbid a woman have hobbies /j
god permit
Yo how often does in_pool run? Like, say I'm trying to prevent a joker from spawning if another one is present.
every time it would be generated randomly
like i will NOT discard an idea unless i have exhausted everything
ive made some insane shit already
Oh sweet, that's what I was hopin. Thank ya
stopped modding for like 2 weeks and i come back and can't get a joker in game ;-;
this was my second ever functioning joker
gg
But I mean her handling of FP and the Flame Kingdom is dubious, as is her creation of the Candy People and how she controls them; both are explained by her backstory, though YMMV if it's justified
a typo, classic
yeah fair, but i love complex/morally grey characters
I mean people can enjoy the character in fiction and hate her as a person
mhm
is there a way to see all the contexts? (context.enteringshop, jokermain, endofround, etc...)
to broaden my knowledge
The wiki can help
ugh ive been going through the smods github and trying to go thru the files on the example joker mod to figure out where to start but i keep forgetting that github has that crazy secondary rate limit and i have to wait for like 5 minutes to be able to check it
yeah, i noticed though that some weren't when I was trying to make a joker. should I look in the calculate function itself?
i have a massive list of them in one of my jokers
this isnt exhaustive though i think
which ones weren't
anything helps honestly
I think it tends to come down to a difference of perspective, like for example I don't typically reserve a judgement of a character "as a person" because they're inherently not real people
i know enter shop wasnt
this happens when i "discover" it in the menu
If I like the character, I like the character. That's kinda the end of it for me, aside from what large amount of thematic depth I would want to yap about
I don't think it's a vanilla context
So unless someone added it to SMODS but not to the wiki
you made it up
i think the closest thing to entering shop is ending round maybe
wrote this for the wiki server:
These should be all the other ones not on the wiki aside from starting_shop AFAIK
- context.ending_booster
{
booster = booster_obj
}
- context.modify_scoring_hand
{
other_card = G.play.cards[i],
full_hand = G.play.cards,
scoring_hand = scoring_hand
}
return {
add_to_hand = true,
remove_from_hand = true
}
Blind calc
-
context.blind_disabled
-
context.blind_defeated
-
context.press_play
-
context.debuff_card
{
ignore_debuff = true
}
- context.debuff_hand
{
full_hand = cards,
scoring_hand = final_scoring_hand,
poker_hands = hand,
scoring_name = handname,
check = check
}
- context.stay_flipped
{
to_area = to_area,
from_area = from_area,
other_card = card
}
- context.modify_hand
{
poker_hands = poker_hands,
scoring_name = text,
scoring_hand = scoring_hand,
full_hand = cards
}
ah, yeah i was looking at jen's almanac
There are other factors at play; some people will tend to express an opinion if they find the rest of the fandom doesn't express it enough.
thanks a lot
Maybe they added it themselves
shrug maybe. I do actively go out of my way to try to write about and care about characters who are women since fandoms in general don't do that and prioritize men instead. Get that M/M shipfic outta here, it's womens' turn. Anyway I'm getting off topic lmao
JOSEI!
I feel like PB committing war crimes is part of her thematic depth, and I don't think there's many other ways to discuss it besides criticizing her
- Victin, 2025
and this kind of discussion is caring about PB
||i thought PB was pubblegum brincess :(||
No but yeah that's what I mean I don't really criticize characters like I would a person. I would talk about the thematic depth, but I can't really be critical of actions that don't materially exist. I'd be more likely to critique the choices of the author
PB is bubblegum yes
phew
like, I do imagine there are fans who hate her because she's a woman or whatever, but also criticizing her actions is respecting her character
LSP
i asked what lsp was
god i need an adventure time joker
I have more to say about this general consequence of prejudice but that is even more off-topic
I have Baby's Building a Tower into Space
every single one of finn's swords
AWESOMEEE
maaaaybe ;3
ok new question. i'm trying to get the lua LSP that is mentioned on the lsp_definitions branch info page of steamodded. it doesn't really say which it is, and i think it's a specific one because it doesn't say "a lua LSP" it just says "lua LSP"
in general im kinda confused by how this is worded. is there a more in-depth tutorial about this? like another github rep or a yt video or something about how i'd install something like the smods lsp into a visual studio project? visual studio feels a bit intimidating to me ive only really used it for like bare-simple ren'py VN stuff
Mmm yeah regardless I don't think I could carry on the discussion further. I'm at a point where the idea of criticizing a characters actions is like... complete nonsense to me tbh. Not that I have too much experience with the AT fandom anyway, I've been basically a RWBY fandom girlie for the past decade as my only consistent one
I have mostly not mingled with fandom except with specific small communities which bring news of the larger fandom to me
i found rwby interesting but a bit odd, probably because i was really young
For AT I haven't really interacted with any group of fans really
i couldn't get a grasp on the narrative and how it unfolded
Hmm... very specific
wee synergy
also, how easy is it to mess with ui elements? i'd like to completely get rid of the mult box for this specific boss blind, but if its too much of a pain ill just keep it
i like wee
I'd keep it
put a rectangle on top of it maybe? i've never messed with ui so i dont know how hard that is
im looking in that too
seems like a hassle
im a big fan
well ideally id have it centered lol
ill probably keep it though
nvm i got it
if joey likes it, it must be a w
so proud of myself
👍
now to actually make the effect lmao
For both Visual Studio (bulky and slow) and VSCode (recommended), it's a matter of installing a Lua extension that provides a Lua Language Server, then including SMODS in your workspace.
There are a number of Lua extensions, but this is the most commonly-used one for VSCode
I'm good mate, how are you?
It's good to see the ship slowly turning away from rolling releases and towards more stable occasional feature releases, for sure
what is the "max" for in the boss parameter for blinds
is it just the max ante a boss can appear in
Doing good thankfully thank you
AFAIK yes
does it get used
no lol
so, min 1 and max 10 would mean it can appear at ante 1 and later, but no further than ante 10?
supposedly but the docs say it doesn't work
ah
you would need to use in_pool
oh hey sumneko's the one i'm using that's convenient
so to include smods in your workspace do you just use the folder that has all the smods stuff in it, or just the LSP?
i think once i get that figured out and get, like, the joker lua, lovely and smods hooked up, i'll be set to start makin' stuff
min works
Yeah boss.max is never used in vanilla.
But loads of vanilla bosses still have it set to 10.
did he plan the game to end at 10 lol
does undiscoveredsprite include the question mark icon part? as in, the moving question mark used in other undiscovered sprites
I wonder if it was ever used during the demo
oh btw i have a dev question too
Is there any easy example of sprite manipulation similar to vanilla in a mod? I need to fix half joker, wee, etc for the vanilla recreation but I've never done that
yes
also hologram but that's probably applying a shader which i have done
hologram is a shader and special floating_sprite
Take a look at Champion's Belt or Humbleing Bundle or Paranoia from my mod
i will thank you
you can replicate it by passing a custom draw function inside soul_pos
you can pass draw in soul_pos????
did i really copy the movement of the soul all for nothing lmao
Either is fine, VSCode will read every folder recursively in the workspace anyway. Personally i've included the full SMODS directory along with the vanilla source, it's just easier to be able to reference everything that way
how does that custom draw func operate?
you tell the game how to draw the soul_sprite
specifically, you can think of it as just a callback
you can use it to render the soul_sprite
but you can do anything there
shoot, i just realized i think i put LOVE into the exe of the game that i extracted to get to the source. theres a ton of VS errors about LOVE being an undefined variable
I use it to render additional sprites
for mine i just referenced how cryptid does their gateway sprites, which just was defining a custom DrawStep and setting a specific floating_sprite on a specific consumable
i'll have to see how you can define a draw func in soul_pos
I think DrawSteps are a side-and-downgrade
damn, didn't know
version.dll overwrites the exe when lovely is installed right? because if so i might need to do some stuff
i'll have to check how you do it but i definitely like how you've done floating sprites
I personally wouldn't use a DrawStep just for one card
seems like an efficiency waste
yeah true
I didn't use DrawStep except for a single card
because that one required a DrawStep
That's the "side" of "side-and-downgrade"
I do use it for a shader that can draw over any card in my mod
I used it for a Joker that requires ||drawing behind the card||
hmmm i do need to draw behind cards too
for the xyz monsters
me when my voucher.lua is still empty because every time i make a voucher idea it ends up being better as a joker instead
how do i make VOUCHER IDEAS
joker, but permanent
take a look at chaseoqueso's frog
and the one good voucher idea i DID have (rerolling boosters) apparently already exists in another mod
i'd make a thread for my homestar mod, but i feel like i dont have enough in my repertoire to get people's hopes up. like its just an ideas doc. i could make a gc or something? and get some interested people in?
just make your idea anyways, who cares if another mod has it
I've seen threads done for less
you can make one and share your ideas
i think people might be interested especially if it's for something based on another piece of media
i should probably make a thread for astronomica too here i suppose
oh that looks very cool
top 10 coolest Jokers
im still waiting for the blood on the clocktower mod
Idk anything about Blood on the Clocktower but I know a YouTube channel that makes content about it
well i have an idea doc that is just. its just HUNDREDS of jokers i am rapidly eclipsing base game
there is a TON of stuff in there and most of it is super ambitious
the first jokers i made were the legendaries LOL
but ykw i'll make a thread and post it since im actively planning to start coding this anyway
it's pretty cool i wish i had friends to play it with irl
Idk anything about it but I'd play it with you if I was IRL
the plan for astronomica is essentially for it to be to cryptid what cryptid is to vanilla
as long as it doesn't have more jokers than my mod it's ok /j
finally someone is gonna add TREE to Balatro
you're not irl are you virtual?
it's like reverse solipsism where only you are real
definetely not tree, i do have this though
tee hee
that's so true
oh and btw if anyone has time someday and wants to add other things besides jokers to this i would appreciate it :3
Maybe sometime that's not 4 AM
play gorgeous ping
omg this is absolutely amazing
i would help but unfortunately im the target audience for this kind of resource
perhaps sometime i migh try something though
dont worry about it
once you get good enough you can try adding the other stuff : )
though i dont have great modding habits so
yeahh
ive actually remade judgement though
maybe i could add it
it would need to be cleaned up a lot though
the code i mean
well actually how many does yours have?
because. i think i have like hundreds in my idea doc im just not sure how many are gonna make it in the first build
i mean. i just raelized id have to count. but i posted my idea doc in my mod thread so you can see how many in there and also actually see what they do
ok i gave up counting at 100
i think having blinds using blind calc instead of the functions would be cool
I love this
is there a better way to do nested text colour than having the outside colour each side of the inside colour?
can you elaborate?
like this
i never know what to put in these things
no then
you can get rid of the ending {} but there's no other way to do colors inside each other
aight ty
after writing 300 descriptions i just have vscode snippets set up for stuff
what are snippets
my files are too complicated for me as is 😭
description arent that much of a pain for me yet
i recently separated my localization file into 40 lol
i still haven't started localization...
that will be a pain to retroactively add in
You could write a function to help you but there's no built in way
probably gonna try to get started coding 2morrow tbh
tonight i am feeling. a bit woozy idk why
but hey if yall wanna help im open
im excited to get this stuff on the road
most of the people in here are more than happy to help, we all learn from each other so just ask whenever you have a question
(joke will be on me when you say this is your 5th mod)
oh no yeah its my first, i havent even touched lua stuff before now lol
i was moreso thinking like making a GC with people who would want to actively contribute but i will definitely come here if i have a general question, for sure
i have this rlly cool set of cheat commandos jokers in particular im super excited to code- i have like a gunshots edition and everything and one of the jokers can be evolved when in the presence of another, and one of them actually does something with wild cards, and i have another joker that also makes wild cards count as the rank before and after them and i have a ton of legendaries and stuff and. wow i love just sharing these ideas
all sounds very cool
combine = func(temp_profile, key1, key2}
combined = temp-profile.joker_usage[key1]
doner = temp-profile.joker_usage[key2]
orig_order=key1.order
for e, r in in pairs(doner) do
if type(e) == "number" then combined[e] = combined[e] + r
end
for e,r n pairs doner) do
if type(e) == "table" then
if not combined[e] then combined[e] = r
end
else
if combined[e] ~= r then
for k, v in pairs(e) do
if type(r) == "table' then
for t, y in in pairs(r) do
if type(t) == "number" then combined.r[t] = combined.r[t] + y
end
end
end
end
end
combined.order=orig_order
G.PROFILES[1] = temp-profile
end
```
@rough furnace whenever you're free and up for it, i actually completely overhwaulted the thing, and simplified it to only take 2 keyes, because honestly it doesn't ened to take any more
I think this is everything, still not proper lua most likely but a lot closer in that aspect too
sure there's about 50 reasons why I'm trying to do it all wrong, but maybe i'll clean it up, make it real lua and see how if works in game anyway, lol
what's the worset that could happen?
the other issue is, idk how to execute an actual scrpit like this in game
i'm sure debugplus can do it ofc, i just dk how to go about it
with their not being any cursor in the deubplus console that i can figure out how to move, trying it in the eval option seems hopeless
nor do i think my clipboard would real there
hmm if it's not that many things i would say it's a common yeah
maybe if the amount was higher
was thinking of maybe doubling it
idk if that would be too much though
30 on ante 5 roughly
i sometimes play like 10 rounds to in the first 8 antes, so idk how useful it'd be for me
why are you skipping that much ;-;
Thowback's my boyye
also love style meter
and a lot of other skip-related stuff
but that's because i love to skip, not the other way around ig
i dont think ive picked up abstract more than a handful of times
i think that he's (all jokers are persons to me, lol) on there from modded runs
lot more jokers to add to it
ah ok
makes sense in that case
i tend to only play with a few small mods at a time
i play with a lot of mods at once and sometimes my joker amount gets balls to the wall insane even though i don't do cryptid or anything actually op
just having a lot of mods will do that
not to mention sandbox deck/sleeve from sdm's stuff, so i often have 7 or even 9 slots in the first place
I need to... play the heckin game though, i barely have since i came back
like 2 months ago
(I've been in the modding scene on and off since april 2024)
and rarely play the game when i'm not also in the modding community participating
i came back to the community and the participation, less so the playing so far
uh
how do you handle factorial in the code
Gamma function for non-integers?
I use direct computation for small numbers, and stirlings approximation for numbers in the e's
lmao
there we go
this is how everything works
how can i affect the pixel size without making it skew weirdly?
want it to be able to have stickers
I feel like it's skewing the same as any joker?
it kinda is but like it's intensified
it feels squashed vertically
whats the pixel height stuff you set it to
I think that's just the perspective on all cards
you should just be setting the pixel size to how big the sprite is
ah yeah
0.2 * 71 💔
close enough to 15 tbh
in this case, it's 17 x 22, if you include the single-pixel border of transparency
i was toying with it
also it was aligned wrong on the sheet by like 1 pixel
it's fixed
thats how they did it on cryptid cube
Is there a code that checks if a certain joker has triggered, like would it be something like G.Joker
cryptid is full of weird shit tbf
uh, I'm assuming context.forcetrigger is from demicolon
nice
that was a recent addition
i absolutely love demicolon
although it requires very heavy reimplementations of vanilla jokers
yeah
do I have to include context.forcetrigger in my next mod 💀
probably
since I intend it to contain endgame contents, powerful enough to urge people to install Talisman
IT'S SO CUTE
wdym by that
I implemented ^mult without talisman dependency
it's still balanced enough tho
I mean, the rarity is called obscure and it's equivalent to Cryptid's epic
there's a lot of reason to do that it seems, though mostly because people don't know that talisman compat isn't needed if you keep it on vanillia
what i mean is for it not to crash
mods don't need to do that "to_big" nonsense
if you play with talkisman on vanillia
i actually implemented direct score addition/multiplication/exponentiation in my mod
which has either not been done before or only been done by one or two obscure mods probably
what isn't doubling and when?
well bait is supposed to double shop prices
vouchers are 10 dollars and 10*2^5 = 320
it's close but it's trying it's best
could anyone direct me to an example of how to change a cards rank? tried searching in here but couldnt find much
ty
SMODS.change_base
or SMODS.modify_rank
they do anything different?
ah ok so if i was changing to a specific number then i'd change base but for smth like strength id do modify rank
awesome
yeah
and a new problem arises
When using "context.individual and context.cardarea == G.hand", how can i prevent the cards from activating at the end of round. i.e. only cards in hand when playing a hand (like shoot the moon)
so, in a table of variables, can you add a new entrey just by saying like butts[big] = "no lie"? or do you have to insert it in another way?
unless i misunderstand, can't you just exclude context.end_of_round?
assumingthere is no big entry yet
hmm i thought end_of_round and individual were mutually exclusive but maybe i was wrong
Well, wouldn't hurt to try
asking in relation to this, which does such things a lot
yeah totally trying rn
yep that totally did it, thanks
of course!
how do i disallow a flush from being played in my challenge?
try looking at cryptid's code, it has a boss blind that disallows flushes from being played
yeah. what is it again?
the temp_profile doesn't do anything as it's a reference (though storing as a vatible is probably nice for convience), and doesn't need to be re set.
Nostalgic flint
wym, like changing it changes the underlying table as it is?
tables are more like a map leading you to where the table info is stored
oh yeah fair
rather than being the table themselves
is there a simply way to like... copy it as a new table?
simply no
context.after would be the best context to use for after playing a hand right?
(if i dont ask stupid questions i will continue to be stupid)
well I'll have to live with that limitation
depends on when you want the card to trigger
this is the same behavipur with like any language with a key value data struicture
it's kinda strange that you can only refer to them with a variable not store them
but whatever
after the hand is done scoring
I think so let me double check
maybe??? idk it's not very clear
well
a. tables can be massive and copying them can be really resource intensive
b. there size is dynamic which makes it hard to store copies of them somewhere.
c. tables in tables would be really confusing then
The ease_dollars function is not easing dollars but hey, the concept works!
DefaultLogger my beloved
if your using it to change the score then you wanna use final_scoring_step otherwise after is the right one I think
so besides the keys needing to be passed as strings which i just learned, what else is wrong?
hmm actually it's not changing discards either...
it doesn't it was just for peace of mind and making it less likely to have to restart the game
:[
my goal is to take two keys from that section of the profile and fuck them together, to combine jokers for stats purposes which are the same joker but have had their keys or prefixes changed
just run G:load_profile(1) to re load your profile form disc
i presume to save changes i need to do something similar
uhh that snippet from earlier for the unlock all has the code you need
how would i implement rerolling booster packs
but yeah
you don't do anything special to commit it, you just change the P_CENTERS table directly
oh that one
G:save_progress()
G.FILE_HANDLER.force = true```
so yeah the bottom 2 commands?
save it
this is for sure a dumb question but how do i change the color of my custom jokers description to the spades color?
{C:spades}{}
yknow i probably shoudlve assumed that but thank you
what's the function i can hook to remove jokers and consumables from the shop?
is there smth already for random rank or would i have to make my own table and use pseudorandom
you'd use local pseudorandom and change the rank to that
i think
ok i decided im gonna be trying to add like ONE joker tonight. it's gonna be the one that just adds +25 chips.
so im just gonna overview what i think i need.
so im assuming i need a json file that allows the mod to be loaded, then i would need an atlas to call for the images, and then after that i'd need to actually code the thang ding
but those are the required parts right
im free tonight i can help you if you need it
how do i check if a certain voucher has been redeemed
trying to make a joker that destroys a random joker and then gives xmult, but im getting an error on line 119 that says "attempt to call a table value"
for another voucher?
no for a function
i think
i have no idea what im doing
probably would be in pool
why no ipairs
im looking
im trying to modify the code of a small mod that lets you reroll booster packs so that its apart of a voucher, instead of just being always active
idk how to put it in a calculate function so i figured id just make it check if the voucher was redeemed?
took some code from someone else's solution, I assume i just remove the g.jokers.cards and replace it with ipairs then?
sorry i know this is late, i've been coding other things. choosing the face card works fine, but the suit shows up as table: 0x1b5f1460
if thats what you wanted i get this instead
this seems to be quite egregiously incorrect
would this set the rank of a card matching randold to randnew?
alright that'd be great, cheers!
right now i'm making the json. im gonna be copying formatting from the example mods in smods but im gonna make the files themselves individual.
i am just mad excited about making this honestly. id love to introduce the balatro comm to homestar runner if they havent already seen it
for k, v in ipairs(G.jokers.cards)
absolutely no idea how "for" even works in lua
thanks, that worked
.
^ that explain alr?
i still barely understand them but that helped me a lot
Is this meant to reroll booster packs if the voucher has been redeemed? If so, check if said voucher is redeemed and execute the reroll if that's the case.
that's what i was thinking i had to do, but everything i do to this thing makes it crash
i dont know how to work with this kind of code i think
Does that actually execute on its' own?
it does, it's the entire code in this mod
What's the key of the voucher?
just 'test' for now
so the numbers above 10 obvs break this, is there an easy way to amend the ranks here?
Assuming rero is the prefix, due to usage of legacy file header and, if not defined, defaults to first 4 letters of MOD_ID, this is the check.
if G.GAME.used_vouchers['v_rero_test'] == true then
-- do reroll pack stuff here.
end
I just realized something
all retrigger joker calculations for emult (JokerDisplay) in Cryptid is broken
would the entire function go inside here?
-- From Cryptid's exponential mult Jokers
{
ref_table = "card.joker_display_values",
ref_value = "e_mult",
retrigger_type = function (base_number, triggers)
local num = base_number
for i=1, triggers-1 do
num = num ^ base_number
end
return num
end
}
this crap right here would work if it's applied directly to mult in the score, not the display 💀
i
The "hook" is outside of the if check, but the actual booster pack rerolling stuff goes in there, yes.
this seems to be breaking no matter what i do,
Ah, right, should be if G and G.GAME and G.GAME.used_vouchers['v_rero_test'] == true then so that it doesn't trigger crash.
...uh, the whole
if G and G.GAME and G.GAME.used_vouchers['v_rero_test'] == true then
...
end
should be in the hooking function, just after the original one executes. 💀
is there a way to make this NOT happen?
not context.end_of_round
alr, my bad, im still learning the basics of coding
where in there do I put that
Next to the conditions where you define where to trigger the X1.5 Mult.
oki
At least mention how, where and when.
self.debuff.hand?
i took it from the source code
What is the crash log?
blind.lua:542 config (nil)
I'm up to a full page of jokers :)
randold and randnew are rank tables
oh i
changed how it works i can just
give the variables the pseudorandom_elements
ty lol
i mean you'd just do randold.id for the rank id
this will work fine no?
no, the result of pseudorandom_element is a table with a lot of info about the rank itself
ah
you can try printing it in the console to see what it has
But you're probably most interested in .id and .key
...wouldn't adding .id to the end of the pseudorandom_element() work as well?
yeah that'd be ideal, you don't want to store the entire rank object in the ability
true true
trying to make a joker that is basically just baseball card for commons right now, but this ends up happening.
show your whole joker
also I should know this by now but how do I check if a card has a certain enhancement
SMODS.has_enhancement(card, 'm_prefix_key')
card.ability.extra is a table.
in your localize, you need to pass in card.ability.extra.chips
ooh right thanks
Also you should replace Xmult_mod with chips I think?
that seems like probably the intended effect
...usually, doesn't mean it 100% is. 😛
based on their config declaration, it is
In their case, it is, yes.
ok, all I did was change the chips to xmult and its still having the issue, I'm not too sure how I would make extra not be a table
it's fine that extra is a table
^
do this
chips = card.ability.extra.chips works on its' own.
the reason your message is a weird table string is because you're passing it a table (extra) instead of the value you want to show (extra.chips)
The messages are usually automatically handled for +Chips, +Mult and XMult.
oh true
ok i think i get it now
yeah probably just remove the message line
any obvious reason this wouldnt be working that im being oblivious to?
lil stamp
my new consumables
very cute
my fav is pin currently
Does the condition set even pass? Also, assert(SMODS.change_base())...
How does one make it so editions happen on trigger instead of at the end of scoring?
ok, so I am back right away but this one should be a lot quicker, I just want this to target a specific joker instead of the rarities it was before
joker keys follow the pattern "j_modprefix_key"
context.other_joker.config.center.key and that ^
tbh I don't even know how editions work normally
thanks, that works.
how could I target a specific joker with the context? cause I have 3 Jokers to make (so far) with this idea
You would check if context.other_card.config.center.key is equal to the key.
context.post_trigger... which is an optional feature to be enabled.
alrighty
Which I just found out... Windows 7 would have had a different function, oh well.
...I think context.post_trigger also could work here.
how do i add this additional info?
info_queue
Yes, but how would I call the edition?
i see i see i see
im assuming the card here is wrong, what would i need instead?
Are you changing order of calculations on editions or is this for a custom edition?
This is for a custom seal.
context.other_card
should I remove card = context.other_card from it then
card = isn't necessary.
or keep just in case
i was just putting other_card im so dumb 😭
Sounds like changing the calculation order... not too sure about that.
hm
i got this working, but now the game crashes outside of the challenge. what's wrong?
just a guess (since no crash log was provided) but try G.GAME.modifiers and G.GAME.modifiers.no_flush
here's crash
i'll try that
So, it shows up, but does nothing
Change .id to .key?
You need to check context.post_trigger and also the key needs to be a string also it needs to be like "j_modprefix_doc1"
oh true bc the face cards and aces are giving number still so that would make sense
SMODS.current_mod.optional_features = function()
return { post_trigger = true }
end
?
nope
same crash
What is the crash log?
.
...that's a snippet.
I do have the post trigger context at the very end with an and
Yes, but it does not happen during context.individual
here's more of it
where in there do I set this
Anywhere but outside of everything.
It is supposed to be outside any definitions on its' own, like so. togabalatro is my SMODS.current_mod.
Oh oki
would one theoretically be able to expand the atlas sheet if one wants to later on? like, keep the atlas images the same but just expand the borders to add more around the sides
Yes.
function combine(key1, key2)
local combined = temp_profile.joker_usage[key1]
local doner = temp_profile.joker_usage[key2]
local orig_order = combined.order
for e, r in pairs(doner) do
if type(e) == "number" then
if not combined[e] then combined[e] = 0 end
combined[e] = combined[e] + r
end
end
for e,r in pairs (doner) do
if type(e) == "table" then
if not combined[e] then combined[e] = r
end
if combined[e] ~= r then
for t, y in pairs(e) do
if not combined.e[t] then combined.e[t] = 0 end
if type(t) == "number" then combined.e[t] = combined.e[t] + y
end
end
end
end
end
combined.order = orig_order
return combined
end
combine("j_mf_couponcatalogue", "j_mf_coupon_catalogue")
@rough furnace so after a lot more twaking, here's what i have now, it actually evals just fine in debug plus, but i get no change when i check
is it because i'm checking the profile directly?
or does it just not work yet
so what context should I change it to
like, context global?
context.post_trigger
oh
i mean directly as in eval print(G;PROFILES[1].whatever)
the contexts are definitely working but nothing happens
also did it with just the assert to make sure, same result
should you be returning something you aren't?
that seems to be the primary cause if functions that should work fine but aren't doing anything
and it is still doing nothing
It was giving a crash when I had the values in the change_base wrong so I assume it would have to be being called in that case
Remove the context.cardarea check.
and also the key needs to be a string also it needs to be like
"j_modprefix_doc1"
well that's what i mean, in the problem i'm talking about the function is being called and running
unless you knew what i meant and i misunderstood
basically from what i understand if you don't return the right things, the function runs but then output goes nowhere
Ah hm
I’ve been assessing what other people have done with change base and I don’t think anything needs returning?
Ig I’ll try returning true
¯_(ツ)_/¯
joker is supposed to generate one hash brown joker at the end of round, it instead generates ~10 of them without regard for the max joker size.
context.end_of_round and context.main_eval
thanks
norp
it might be because I have them sorted to or and not and?
Current code?
re: your bio:i I wonder sometimes if people think I'm actually ofline so don't wanna ping me
i'm just always on invisible
looks like a bit of a mess lol
Your key comparisons don't look right to me
how so
this works, but it still doesnt take the max joker size into account, so it will just generate over the max size
The key needs to be a string.
Is doc1 a variable or is it the key of a joker?
As it's written, you're treating it like a variable
So use "j_modprefix_doc1" instead
Also the way you're doing this seems cumbersome
You're checking every single doctor key, aren't you
maybe...
What if you just gave all doctor jokers a special variable in their config that you check for
Then just context.other_card.ability.extra.is_doctor or something like that
this would also enable cross-mod easier down the road if you or anyone else was ever interested
true!
how could I add that variable in
like, Variable = is_doctor

