#💻・modding-dev
1 messages · Page 272 of 1
settings localization moment
my loc file is too big
soon it will surpass vanilla :))
If only I was able to art 
my mod uses official yugioh art so that allows me to do 500 jokers an update
is this the correct way to do an effect on cards held in hand at the end of a round?
cause its not working
I never did jokers btw
context.end_of_round
is end of round not the literally round end screen?
End of round it's when rental stickers trigger for example
so context.end_of_round instead of after if i drop in would work?
with the g.hand check?
wtf is wrong with githu
idk if u can even make out the text
this still dont work 😭
do some print debugging
there's no context.scoring_hand in end_of_round
also you don't need the loop because it runs for each card
oh also is this for a joker?
because playing cards have another context for end of round i think
oh my god
it was supposed to be G.hand lol
context.playing_card_end_of_round
how do you make shaders
i love trying to read the balatro sorce code to figure out how to do somthing
me but unironically
that is not a thing according to my print statement
still trying to figure out that title card thing
how does this look chat
amaiznf
literally just got done playing letter deck for the first time
this
tried that and the game crashed
yeah that is the play
where are you doing this
they want it to have it there permanently like cryptid does
oh, didn't catch up to that
G.title_top is the title screen
damn, apparently the movie database I'm pulling info from attracts a very specific crowd, because the actors that don't meet my popularity threshold to get selected as metadata is surprising
Helen Mirren didn't even get read in
for some reason this consumable never stops adding money after i press use
you never return true in the event
since i saw talk of the title screen, do we know of a way to replace the title screen music
i think you could turn down the volume of your game and just stream a song on Tidal
the area doesn't exist at that point
well i have music for blinds, so changing it for the title would be neat
so how do i only get it to run after the game loads
hook Game:main_menu
what does that mean
In LUA, it is a very important concept to understand that everything is a variable and all variables may be edited in runtime. This includes functions. With modding other peoples' LUA files, like Klei's basegame code, you may find yourself wanting to run your code before or after the original fun...
Hooking is very nice and I need to do it more (instead of patching 😭)
just got a new monitor 🗣️
oo cool
wait
guys i added a sound in assets/sounds/petrify.wav and it can't find it
did you create an SMODS.Sound?
⚙️
why does it say ogg
modprefix_key
her astra
hi aiko
did i cook
But yeah show where you're actually playing the sound
.ogg is preferred for sounds and what not for excellent quality/space ratio, fwiw.
idk did you
horror
i made math deck real
fair
what's the context for when a Joker gets destroyed (e.g. by madness joker or ceremonial dagger)?
weirdly, i made it an ogg and it still shows the same error
seems there isn't one
I'll just hook into somewhere
Show where you're playing the sound
perhaps through update()?
not doing that shit
oh believe me i've done it... im like
I'm just gonna find a method that gets called and then SMODS.calculate_context
the key should be modprefix_petrify
Like ali said lol
Should've been more clear about that. 😅
You could use context.destroyed but it's not specific to madness or dagger
can i see an enhancement made by one of you guys? i would like an example
that one doesn't seem to have documentation, where is the calculate_context for that called from?
what if i eated the pretty colors
Ah nvm, the thing I was thinking of was just for playing cards
im just gonna hook into Card:remove
help
and make a custom context
everybody wants a freakin medusa
at least the person who made this knows how to fucking sprite 😭
I'm gonna make one too
for now
I have Stheno
enjoy the sound design
Oops! All Medusa!
vro I have one too but it's only for face cards
😭
oops!
I did have the Curse of the Gorgon a long time ago
i have a hand that is specificlaly made from stone cards so thats why medusa exists for me
what did you call the hand..
I mean it has great synergy with cards like Vampire as well
help
this is true
ive tried to keep things relatively balanced
stoner and like 7 other hands are all secret hands
Who needs a Medusa when you have a Rock Slide
Is it possible to edit another mods code with a toml and if yes then how?
its gonna be x1.5 mult added permanently
what if i just consumed you as a person
be cursed
it was easy 🙂
If played hand is 5 Big Booms, add 5 random big booms to the deck.
can someone send an example of an enhancement?
ok I have this now ```lua
local _remove = Card.remove
function Card:remove()
SMODS.calculate_context({
destroyed = true,
card_area = self.area,
other_card = self,
})
_remove(self)
end
stheno
I sent one above
i have three scaling jokers and have no idea what to do with them
scale the sprite so it's bigger
In need to edit another mods lua code with a toml so I can make it compatible with another mod I don't know if it's possible to do that.
https://github.com/search?q=SMODS.edition&type=code
just, search github my guy
Any help?
im gonna make a fat joker that scales by 10% each time it is triggered (it does nothing but get fatter)
interesting but seems a bit niche
It is
looking dapper my friend
a friend of mine has made all my art
who do i respect forever
ok this will be wack but hear me out
G.CONTROLLER.locks.selling_card
Here's a less niche one. Very happy with how I got this one to work
all i had to do is bribe her with mcdonalds
its peak.
Isn't this all hands except high card
O THATS SO COOL
could just have the second part
you can also tell which cards arent quite done yet lmao
Nope, High Card included because funny
oh the art looks really cool
super placehold
is that another red hand
high card only contains high card
so it's not included
if youre talkin about the 2 hand ones its 6 and 7 fingers, lets you select 6 and 7 cards respectively
no
bottom left
rename 7 fingers to stub my toes
both 6 and 7 are rare, and 7 doesnt show up in shop unless you own 6
oh thats called sold soul, saves you if you would lose the run but destroys all jokers and spawns 2 rares in their stead
wait this is amazing imagine the stone joker potential
Yep
ah I ask because I do have a Red Hand, although I need to port it to 1.0
Stone builds will always be niche but this makes them more doable
what the red hand do
hiyaaaaaaa what did i do wronggggggg :>
What is the problem?
WTF this joker looks so cool visually!
the joker returns a message as expected, but no cards get destroyed or added
i'm guessing context.other_card doesn't exist? no idea why that'd be
line break:
eventually, descs are the last thing to change
making the rest of the mod takes precedence
i dont even know what other spectrals would matter to add
ah -w- thanks
christmas past presente and future
ah weird, but it works in this Joker
or
or
ur true
im going to cry
in sync
ok then. i see how it is
I think the one you use depends on card area
nah sorry, didn't work
local a = {'the morgue', 'shovel'}
print(pseudorandom_element(a, pseudoseed('or')))
please execute this.
right fairfair
somebody write out the output
crying

I'm gonna flip a coin
heads shovel tails morgue
lands perfectly on its side
go
My shopping list
exactly
it's not heads or tails it's cara
yup

dude
How do I force stickers on Jokers? (For example give eternal to popcorn), is there a way to do so?
apply or set I think
ah lemme try something
When I apply it doesn't apply if it normaly can't have it
They get eternal except some like Popcorn, Bean, Ice Cream etc
sounds incorrect
i mean they likely dont have eternal compat to start since they destroy themselves
What do you mean?
perfecto ✨ got it working
try card:add_sticker("eternal", true)
here's the definition for that function ```lua
function Card:add_sticker(sticker, bypass_check)
local sticker = SMODS.Stickers[sticker]
if bypass_check or (sticker and sticker.should_apply and type(sticker.should_apply) == 'function' and sticker:should_apply(self, self.config.center, self.area, true)) then
sticker:apply(self, true)
end
end
Help, my balatro has started to halucinate tables and shit.
what is the name of the playing cards file?
Uuuuh thanks mate
to be clear, don't put that in your code
it's in SMODS utils.lua file
I understand
but this should work
Thanks I really appreciate it
got the visual done
That seems very strong lol
what if its on a face card
Dumb question: if i wanted my mod to load after EVERY other mod, do i need to do something specific?
Well, you don’t have an extra field
It’s just card.ability.mult
put a very high priority
oop
like 9999999999999999999999999999999999999999999999999999?
Surely there is a max int size
yeah, i dont know what the limit is exactly
i think cryptid was using max int tho
What happens if two mods have the same priority
i think it's alphabetical
One more question: is there a way for me to do branching ranks with Strength?
That makes sense
What do you mean
like one goes up and the other down?
Like I want one to have the default 2-10JQKA, but a different one be a different set of faces for example
I still do not understand
@frosty dock hey quick question about quantum enhancements, I got a joker rn that applies quantum enhancements and it works nicely but i wanna make sure those quantum enhancements go away when the card is removed, is there a way to do that outside of calculate?
oh that's a question for aure lol
SMODS.Rank supports branching "next ranks" if that's what you mean?
wanna put it in remove_from_deck
Okay lemme show with physical cards
What on earth is a quantum enhancement
multiple enhancements on a single card basically
Ah
Estate Playing Cards: Instead of 10JQKA it's 10, Man, Woman, Ace
im watching a tutorial on how to make mods for balatro and there is a thing where the guy makes a folder called main.lua and its type is lua source file and i think i installed lua correctly but i cant make a lua source file (i am a stupid person so maybe i did a stupid)
just make a text file and name it main.lua
I want to have it so that if I have one deck, it'll go to man instead of jack, and then for Every Deck (where you may have both), it'll choose at random
Can you not just use a deck skin?
Because it's new ranks
you might have file extensions hidden
how would i change that
Plus I got other stuff like 11s, Mahjong cards where I need to loop back to 1 with strength, etc
in the explorer is something like View > Show > File Extensions
i turned it on but still no cigar
You would probably need to patch the strength function, for one
wait i did somthing
is this the thing
the holy lua file?
do i need to install lua code studio?
ok
thank you guys for the help im sure ill be back here again
i got told that i can get into a course early to leave school but i needed like 5 thigns for a portfolio and i though that making balatro mode would be good enough since a friend got in with a peglin mod in his portfolio
hiya!! sometimes, my Yoyle Deck spawns Jokers with editions — how can i prevent this?
just gonna make sure this is all correct?
Try using SMODS.add_card instead of create_card. iirc edition pooling is toggleable with that
Yep
is there a way to define what stickers my sticker is compatible with?
also, what pool is for playing cards?
is it default?
Hmm I need to hide the use button of a consumable
As well as the Buy and Use button in the shop
hook card:highlight and create_shop_card_ui
How would I go about making a certain joker appear in the shop more often, just manually shoving it into the shop like a tag joker?
yes, I don't think there's another way other than giving it a custom rarity
(i just implemented a whole weighted rarity system to do just that lol)
I wanna make a deck that makes my own jokers appear in the shop more often, as well as starting you with a rare joker from my mod
the second one you can do with objecttypes
the first you can also do it with object types but you will need to modify the shop functions
I can also just make a table and pick a random rare joker and use SMODS.add_card
oh you can just use G.GAME[object_type..'_rate']
yeah
Also, the SMODS docs haven't been updated to reflect blinds having calculate support now. Can you also give a config table for blinds, and does it similarly apply it to the blind as part of the ability table?
Does anyone happen to know if the SMODS universal card highlight limit was implemented? Asking so I can move some stuff over to using that for compat reasons
This should happen automatically, but if you want to explicitly limit the lifetime you can just put SMODS.enh_cache:clear() anywhere
iirc this has been discussed but not added yet
thanks :D
sorry i actually got told that apparently quantum enhancements arent permenantly applied to cards after i sent that
thats true, right?
Gotcha. I just remember a few contributers talking about doing it within a week and ig they never got to it lol
U got it
yes, there's no need to unapply them
gotcha
however maybe there should be an additional cache clear when a card gets removed, that isn't actually present
which I guess is fine under the premise of cards not being removed mid-scoring, but it's still safer to have
hey dudes, is there a context window for 'card selected' ? I want to do something when the user changes the number of cards they have selected for their hand
@red flower progress
what area did you give it
Huh, for some reason this error log is telling me that my blind is still listed as "true" instead of a number based on how many times it's been used when it tries to check it
Ok I wanna try to fix this very long-standing issue by the time I'm ready to release 1.0.0 of Maximus, but no clue where to start. Zombie and Bootleg both have blueprint-like functionality whereby they copy the abilities of other cards, but they are not position dependent. My current solution is by storing a card table in a global variable (because all Bootlegs/Zombies should always be copying the same card), but I've been told that stored tables get deleted on game restart. I've thought about storing joker keys instead but that would lead to some issues because ideally they'd be targeting the exact card, not potentially a card of the same type. Any ideas on how to tackle this?
new to modding, but i know lua, can anyone explain how make a deck with a custom back and effect?
How would I detect that the shop has been entered to shove a joker into it like a tag but from a deck back?
ive got no clue if this would remotely work or solve the issue but it's something id try, could you store it in the cards config?
I think it'd lead to the same issue of tables not being saved
fair
calculate = function(self, card, context)
if context.individual and context.cardarea == G.play and not context.blueprint then
local upgraded_elend = 0
for k, v in ipairs(context.scoring_hand) do
if v:is_face() then
if pseudorandom('elend') < G.GAME.probabilities.normal/card.ability.extra.odds then
upgraded_elend = upgraded_elend + 1
end
end
if upgraded_elend > 0 then
card.ability.extra.mult = card.ability.extra.mult + (card.ability.extra.mult_mod * upgraded_elend)
return {
message = 'Upgraded!',
color = G.C.MULT
}
end
end
end
if context.joker_main and card.ability.extra.mult > 0 then
return {
mult = card.ability.extra.mult
}
end
end
I am trying to upgrade a joker based on some probabilities to gain mult. Currently the upgrade message shows on the card, I want it to show on the joker. What should I change?
i think it's worth a shot just in case
damn you letter m
From what I've seen cards stored in configs don't reference the cards correctly after reloading a run
Exactly
It saves the parameters of the card, but doesn't actually point to the card in your deck / jokers
you got the
error 😭
🥀
local game_main_menu_ref = Game.main_menu
function Game:main_menu(change_context)
local ret = game_main_menu_ref(self, change_context)
SMODS.add_card({key='j_perkeo', edition='e_negative',area = G.title_top })
return ret
end
title top
lua only works as well as you can type things correctly
Is that why cyrptid is all about letter M
hmm weird
would maybe storing the key and finding it in the joker area work
That's exactly what I said I'm trying to avoid doing lol
im going to try stealing code from balatro multiplayer mod
oh 💀
that stole its code from cryptid
reading comprehension is lacking my bad 💀
m
i did this too much I just started restarting the game manually
While I'd love to just store keys, it could do some weird stuff if more than one card of the same type are being held
30% of mod coding is stealing code from people who you directly ask for help, 50% of mod coding is stealing code from source code or other mods, 20% of mod coding is actually writing code
glad im not the only one to do that
maybe store the card and store the index on save?
Working as intended
my other idea would be getting the current position of the card being copied and then updating it whenever they're rearranged but ive got no idea if that's possible
shoul i just leave it
that will SURELY make the code run 4^m times more efficient!
and 40% of it is refusing to read lua docs
Am I the only person that actually goes to the lua website?
yea i just guess shit until i find the right function
-# Oh god
works 2% of the time
Also bump
Does SMODS.has_enhancement(context.other_card, nil) work or is there a better method for finding cards with no enhancement
why so small 😭
wee perkeo
bump, how do i move the message from card to joker
context.other_card.config.center == G.P_CENTERS.c_base
Check out hallunications hook
I could see myself getting this to work but how exactly would I get that index?
That's for opening a booster, which isn't what I'm looking for
like using a rare tag but from a deck effect basically?
is that what youre looking for
(just clarifying so i can watch the chat more intensely)
looks like i need to scale the soul value too lol
return card=card i think?
with the message
someone told me this was redundant code but let me try
very much might be im great at writing redundant code
same
message_card = card i think
thank you!
ahhh
This should get the card pos in your jokers I think
for k,v in pairs(G.jokers.cards) do
if card == v then
break
end
card.ability.extra.pos = card.ability.extra.pos + 1
end```
lmao i actaully asked virtaulized
Yes
I wanna make my own jokers appear in the shop more often if you're using my custom deck specifically for testing out my jokers
Oh god I'd have to constantly check for that position won't I 
only on save
then on load you get the card again
And you keep track of where it is on your joker that needs to reference it, and then just set the reference to G.jokers.cards[i] on load
And replace card == v with whateveryourreferencevariableisidk == v
My concern with keeping it on the joker is if there are multiple of them
You could make it a table that stores all the indexes, and then just iterate through that table on load
surely this won't break anything
Wuh oh
💥💥💥💥
N why does my smods say 'distributing nuclear launch codes' all of a sudden?
🙂
also it's an individually weighted rarity system for jokers, which might be useful for you too
Why did a physical card just appear on my table you made the add_card function too functional
tweaking out earlier i spent an hour figuring out my shit wasn't working because i wrote colour with a U instead of color
I think I'd have used that earlier, but the way my legendaries are implemented now is working pretty well for me. But it's a neat feature to have in the pocket, haha
consumeable
Wait, there's certain parts of the code that use colour without the U?
speling 
not balala just in general
was doing web dev
i added some legendaries now but i gave them a chance to show up in the shop
Every reference of color I've seen is spelled "colour"
the CORRECT spelling
i did spend ages using color instead of colour at the start of modding tho cuz i assumed it wouldn't be spelt with a u
Still trying to find a way to do this, there's no starting_shop context
I will definitely look into how you approached it, just to compare. My legendaries also show up in the shop, but I just rarity shift them based on how many of their requirements you meet
Ok I have a process in mind as to how I want to handle this now. I'd assume I'd need to hook into the save function? If so, what exactly is that function so I can find it?
Card:save()
I'm gonna be handling this outside of a card scope
function save_run() then
Gotcha, thanks
Yw
i hope no one develops with my mod in their folder lol
lol, any ideas for how to fix this?
i think its only for the collection but still
:/
is there a way of setting a card as polychrome without playing the sound?
Card:set_edition(edition, immediate, silent)
edition, nil removes edition, key of edition as a string
immediate, boolean
silent, boolean Use this function to set the edition of a card
try either the immediate or silent flags
awesome, thanks :D
This should be reproccing cards of a certain hand type. Anyone see whats wrong? They are not retriggering
if context.poker_hands ~= nil and context.cardarea == G.play and next(context.poker_hands["Fox_cosmocanyon"]) and context.repetition then
return {
message = "Awooo",
repetitions = card.ability.extra,
card = card
}
end
whats the code, usually nil means something is undefined
getting this error:
info_queue[#info_queue+1] = {key = 'tag_handy', set = 'Tag'}
just adding an info box to the loc_vars area. it displays actual numbers in game, but in the collection it freaks out a little bit
i changed my set_edition code to context.full_hand[1]:set_edition({edition='e_polychrome', immediate=true, silent=true})
im not too worried about it though lol, but if i can fix it that's be nice
do i need to add SMODS. to the start?
ahh, i wouldn’t know how to fix that then
you need to pass a config i think
yeah. the config for handy tag doesnt have anything that i can easily patch. i wonder if takeover works with tags
i havent used it yet
What do I put instead of back.ability.extra? I tried back.config.extra and it still just dies
change ability to config
no, I mean add the config to the info_queue table
oh
"I tried back.config.extra and it still just dies"
That is the second part of my message
ah -w- missed that
let me do some research on that, thanks bro
what's line 1824?
That line with the add_card
try vars = {1,1}
is this correct?
It gets just as confused with config
i don't see that in the screenshots =w=
ah no wait
found it
I accidentally used config for the second one, but that's not really relevant, it still dies on back.ability
what is that line trying to do ..back.ability.extra.etc....
(bump, btw)
It's grabbing a table and picking a random value from a table inside that table
config = { vars = {1,1} },
i may have misunderstood what you wanted me to try, but its still the same in the collection
without the config
let me see what the wiki says about info queues, just heard about them a minute ago
ok
I have never seen "assertion failed!" before, so I wouldn't even know where to start
whats the code
check your item's file, looks like it was bombing on that BFTP file
mm?
Ok this method ALMOST works. The only weirdness that I've come across is if the Zombie/Blueprint is before the copied card in the joker order. My guess is because those later cards are not yet loaded in when the Zombie/Blueprint loads in. Any ways around that?
to clarify, this is all i changed from a working version
full code looks like this now
Custom VS Code colors woah
f a n c y
how would i do some sort of chance thing?
your screenshot is very pretty
you can do the same thing as with save and hook the end of start_run
thanks ^^" didn't expect to receive compliments for my VS Code theme
it came with VS Code :} i think it's called Atom, or Acid, or something starting with A
i wish there were more resources on info queues in the wiki
set_edition doesn't take a table i dont think
ah
Gotcha
i got a different error when i tried without the curlies, lemme grab that in case it's unrelated
ya
on startup
thats a syntax error
i thought it meant i needed to pass it in as a table, but i'm not sure what it's expecting
yes
sadly that makes things much harder to read but that's okay if it works 😭
Lua is truly a terrible language 😭😭😭
thanks :>
function Tag:get_uibox_table(tag_sprite)
tag_sprite = tag_sprite or self.tag_sprite
local name_to_check, loc_vars = self.name, {}
...
elseif name_to_check == 'Handy Tag' then loc_vars = {self.config.dollars_per_hand, self.config.dollars_per_hand*(G.GAME.hands_played or 0)}
i think this is my culprit
well that's why smods makes everything tables but thats a vanilla function
ahhhh gotcha
does anyone know how to override / edit vanilla functions?

yes, lovely patch it
did vars not work?
no
perfect! as a bonus, the code works :D
Or just do it the dumb way and copy the code to remake the function yourself [=
please don't
I have no idea how to do this otherwise
what's that doing?
'ppreciate it
Allowing a joker to replaces the chips, mult, play count, and visibility of the played poker hand
how do i make a joker negative?
i think there's a context for that now
your_card:set_edition{negative = true}
thanks
dont do that
Is there a variable for a joker's rarity in the deck?
npnp
your_card:set_edition('e_negative')
your_joker.rarity should do it
1-4 is Common-Legendary
I tried finding one for a good while and couldn't, the before context happens too late to replace the chips and mult of the played hand
well, anyway the best way to do it is to hook it or patch it, no overwrite it
Not the joker that you define, an instance of one
Like in here
what's your Joker's ability?
Supposed to give 1X Mult per Rare Joker you have
ah gotcha
just do a for loop
ya so you'd write a function that loops over everything in G.jokers.cards
and check if the joker in G.jokers.cards
and for each, check if its rarity = 3
has a rarity of 3
and then add it into a table of rare jokers
then just go down the table and add mult for each one
ah i'd just increment a value, and return that
I have done both of these things, rarity is undefined
fai
their ability only needs how many
r
That's the problem
better for this situation
Does pseudorandom not work in the back:apply() function?
This is rarity being printed
I am definitely doing something wrong with this hook (continued runs start new) but I have no clue what it might be
ya but can i see your code?
how would i make a random chance of things happening?
joker.config.center.rarity is what you want
alright
Thanks, that works 👍
when are you setting up G.GAME.last_bought?
It's alright you tried to help and that's what matters
JOB IS DONE
init_game_object hook
I CAN NOW REST FROM BEING A DEVELOPER BY MAKING A MOD
you might need to check then if it exists or not
This pseudorandom is just always giving the same value every time
That's not the issue, the issue is that with the start_run hook I made, continued runs aren't continued
it takes a self?
Hey why does this say "nanpas" (it should just say "nanpa") (Using Steammodded)
how does pseudorandom work?
Give it a unique identifier, it'll make a random number between 0 and 1, it'll be the same if on the same seed, and it won't conflict with other random elements
thumbs up
Cryptid, probably
how does juice up work again
All othr mods are disabled
just call card:juice_up()
got it
Should this card also restore sold cards too? (Still nets you gold from it)
Saying this here because it seems like the best spot for it
awesome, it all works
so I've been trying to make a joker that changes Kings into Queens when played, and i've been fiddling with it for a while but it doesn't even seem to see the King when I play it? probably something silly I missed and I'm probably using the smod function here wrong but
context.after doesn't have other_card
oh
you need to do it in individual
If you want it to happen after they're played then do final_scoring_step and iterate through the G.play.cards table to find the Kings
doesn't really super matter when it happens as long as it works
I'm trying to hook it, but whenever it runs it gives me this
Hey guys, I'm trying to pick up coding to make my first mod. What coding software would you reccomend?
Visual Studio Code
okay. any videos or tutorials i could watch to learn?
yes but like ones specifically for balatro
or do they not exist
I literally just use the default settings
does it always do it or only when new_poker_hand is true
okay thanks guys
Only when G.GAME.new_poker_value is set to a poker hand
I'm not even setting the value when it crashes, so it should just skip right past it
It should just return the original function with zero changes, but it gets confused with hand_chips
And I've used this exact same setup for other hooks and it works perfectly
wdym
G.GAME.new_poker_hand is false, so it shouldn't even run the hook code, it should just run the original function
That did it. Thank you so much for helping me with this literal months old bug lmao
Okay, rephrase, I didn't change the variable G.GAME.new_poker_hand and it still gets confused with hand_chips
nil == false, so it shouldn't run the if statement
In my replacement function it worked just fine, so something is going wrong with the hooking functionality specifically
this works
okay so i downloaded it, which language do i choose
lua
i recommend this https://marketplace.visualstudio.com/items?itemName=sumneko.lua
just pick whatever there
Lua is an external extension so it isn't built into VS Code by default
okay
Those are just the officially supported languages
ah okay
Reimplementing an effect. It's still missing some safeguards and calculation integration, but so far this went faster than expected.
This is no longer running the hooked code, even when G.GAME.new_poker_hand is set
have you tried a test print?
is there any way to keep track of sold jokers?
also it gets overwritten by whatever you return so you also need to return your modified values
it's good that you switched to a hook tho because you were entirely deleting the smods hook of that function lol
what for
for a consumable that allows you to bring back a previously sold joker
okay do i now make a new file to start
alright well now the game crashes on playing the king because it says suit=nil and rank=Queen are invalid, am I even using the function right?
I don't think there's a vanilla way to get that, I think there's only one for all jokers that you got
in some code is see G.
can somone explain what the g is cause im crashing and the error text says somthing like G is missing argument
G is the global table for the game that contains all data
If I recall both are a number
Queen i Believe is 11
isn't G the Game object?
my error message is fuction arguments expected near "G"
yes
gimme a sec
the code helps too, especially with the line numbers
I remember when I started I got confused betweem G and G_
48's syntax is wrong
context.other_card instead of card
i goofy goober
oh yeah that'll do it
also you can use the utility function SMODS.add_card instead of create_card; it creates the card and emplaces it for you
there's also a SMODS.create_card that just creates the card
ok now it works thank you :D
with that would i then delete lines 48 and 49?
and overwrite 47
💀
sht school bell rang
SMODS.add_card also creates the card, so you don't need 47, 48, and 49, but you do need a line that contains SMODS.add_card, and it makes the most sense to overwrite 47 instead of just deleting it
I had the same issue a few minutes ago lol v_v
lol
v_v
im learning modding, i just downloaded virtual studio code. is this where i get the lua extention?
if not can someone link me to it
You can find the extension inside vscode
ok
what a nice mod name, surely this wont backfire later when typing it in code
ok i have it, made a new file, now what lol
how would you delay code?
can u send a example of the code if possible
an event
I have this from a couple of Jokers that create a Consumeable
read the thread i sent earlier
k
that hatsune miku is moving
why yes
so would i write somthing like
SMODS.add_card{
G.Joker
}
well, if you're trying to create a specific Joker you would need to pass its key. If you want to let the game decide which Joker to create, you don't need to specify a key. You can find all options in the wiki
but no, you need to write something like {key = value}
and what is the area called
G.jokers but if you tell it to create a Joker it'll automatically assume you want to put it there
ahh ok
But it doesn't automatically try to create a Joker if you tell it area = G.jokers IIRC
where in the wiki sorry
good morning everyone
good morning bepis did you sleep enough
maybeeeeeee
god, i did x = {+-1} for my test instead when it should've been x = +-1
i want to die 💔
for some reason all of these cards trigger even if theyre not played
can someone help?
thank you so much
if context.individual and context.cardarea == G.play then
if context.other_card == card then...
probably?
im on phone rn so i cant write indented code
o
im guessing card refers to the card the enhancement is on
im not sure tho, never made an enhancement before
is it only when they have red seals that they trigger in hand?
SMODS.Joker {
key = 'bonusbonus',
loc_txt = {
name = 'Bonus Bonus',
text = {
"Creates a random consumable whenever a {X:chips}Bonus{} card is scored."
}
},
config = {},
loc_vars = function(self, info_queue, card)
return { vars = {} }
end,
rarity = 2,
atlas = 'ash',
pos = { x = 0, y = 0 }, -- very top left
cost = 5,
}
im at this point in making my joker but im not sure how to actually make it do stuff can someone help
look at the "Enter blind => random tarot" joker and use if context.individual and context.cardarea == G.play for that one
-# i forgot the joker name
well now it doesnt do anything!
guess card refers to the enhancement, not the card its on then
hmmm
hmm
hm
it works! rejoice!
yes
where do i put that this is new territory for me
uhh how do i make my own badge colors
i found it but idk what to do with it
this prints my print but doesnt seem to swap sticker
I think I figured out why my attempt at hooking Card:remove() has produced a crash
the start animation has the card dissolving, which means it probably calls Card:remove(), probably before everything has finished initializing...
and also G.hand would probably be null when not in-game anyway
which SMODS.calculate_context for some reason uses without checking if it's nil
the way i did my hooks was adding an extra parameter, if true, call my version of the function
I'm doing it this way ```lua
local _remove = Card.remove
function Card:remove()
if self.area == G.jokers then
SMODS.calculate_context({
destroyed = true,
cardarea = G.jokers,
other_card = self
}, nil)
end
_remove(self)
end
Hey does anybody know how to get the texture of the perkeo face to be scaled up as well
ah
oh u wanna hook it for any time its called huh
yeah
wee perkeo
cuz I want to establish a custom context for when a card is destroyed
(obviously this is also called when a card is sold but that's not important right now)
for playing cards yes, jokers no
yes
can u send error
I already know where it's crashing and why
check if that thing is nil then
....
if not nil, do ur code
oh god I have to check a lot of things it seems
because SMODS.calculate_context just uses everything like G.hand, G.deck, G.discard without checking them for nil
oh its crashing in calculate_context
no I'm just gonna check them all in my hook
alright that works too
perhaps
this is something u can submit a feature request or PR for?
cause it seems like it could be annoying in other contexts too, idk
I mean joker destroyed context is already planned anyway
and its an smods thing so
put the code in your Joker's calculate function, and the context should be smt like
if context.individual and context.cardarea == G.play
use SMODS.has_enhancement(x,y) to check if context.other_card is a bonus card
at least I think so
im sure it will be added
so that wouldn't do much
im in class rn so i cant help much :(
what am i missing?
how would i go about making my own badge?
check stickers
thumbhg uhp
great, now its not working in game too
ok it doesnt even print sus2
and the tag descriptor works in the collection and everything else..
why does this for loop not work to check cards in hand
idk why im getting nil on handy tag
I'm gonna use G.CONTROLLER.locks.selling_card to check if we're selling a card 
G.hand.cards
because Card:remove() also gets called when a card is sold
im dumb
yea that is weird
uhm
oh ur using info_queue stuff
im unfamiliar
sorry
no worries
pls help :<
try doing it in an event
context.selling_card also gets called before removing the card so you can give it a field there to check on your hook
im stupid so can you elaborate
it no work :<
how do you make a badge color?
yea but like does it crash?
SMODS.add_card{set = 'Joker', skip_materialize = 'false', key = 'j_ice_cream'}
G.E_MANAGER:add_event(Event {
func = function ()
SMODS.add_card {
key = "j_joker",
edition = "e_negative"
}
return true
end
})
``` This is what a Joker of mine does to add a card
format is like this
yes
whats the exact error
you dont use bracket, just the curlies
you'll have to edit the key obviously
ill try this
you might not need the event
that's just a preference
skip_materialize has to be a boolean not a string, and you dont need a set if youre passing a key
why would you need the event tho
surely better to not have to use it if you dont need to
i see
i thought it was strictly curly brackets
I think I tried it without an event and it didn't work but I could be wrong
h
I like ({}) more than just {}
their context looks alright so I'm not sure why it'd not work
just {} works??
yeah
what kind of weird syntax craziness
yes
lua moment
syntax sugar :)
syntax salt
but you have to take into account that if you have multiple arguments then you need to use ({})
yea that makes sense
i made so many dumb mistakes in my math test, still got 9/10 tho :3
kind of how : passes self automatically
lets go!!!
ah so that's what that is
congrats
thanks yall :D
did it work?
what's the full code for the joker look like?
no wonder my lucky potions werent scoring
💔
why isn't it giving a syntax error for that
that's so stupid
im just guesstimating
unless there is an error that we were not told about...
we need to delete whatever tutorial names card as center
true....
that definitely should give a syntax error
thats the one
oh my lord it does
is there any reason why this code runs twice? it all works well but I see tagged show up twice which again is technically fine but is still a visual bug that i dont want
it would be good information to know that there is an error that we can reference
I thought it was like working but the card was not being added
yes it's once for individual and once for repetition iirc, you need to check for the other context
(this is in the docs)
oh
you need to add another end after the if statement
like this
remove the return true
also get a formatter extension for your code please 🙏
o shit it lauchers
what is that
it formats your code so that it looks nice
how would one get one of those formats