#💻・modding-dev
1 messages · Page 518 of 1
local elapsed = math.max(0, raw_elapsed)```
Try this
In your update
I think your raw_elapsed might be negative that’s why i used math.max here , maybe try math.abs() aswell
oh alright
Love.timer.getTime() may reset everytime you enter the game so you either save the value in your config or do math.abs
where do i put the math.abs
got ot
Idk how love handles time variables
not alot of people in here mess with that tbf
do i need to mess with something else?
No they’re okay
what do you guys usually use when making sound effects for editions?
Lmms is free
aight
try ths
ths?
No problem
(yeah no, i better use lmms since I have a some experience from it)
(Music softwares gives you the feeling of driving a jet)
So many stuff thrown at you
yup
Good luck tho
thx
G.GAME.blind.chip_text = number_format(G.GAME.blind.chips)
how would i make a joker that plays a video after it's effect
look into how yahimod did it
Hi everyone. I have a small problem. Im trying to detect when the current hand would beat the blind, so i have a context.before that sets a variable to the current score and a context.after that checks if the current score - old score is >= the blind requirement. i feel like this is a little unconventional so feel free to correct. me. the main problem is that the context.after triggers before scoring for some reason. can someone help me?
calculate = function(self, card, context)
if context.joker_main then
return {
xmult = card.ability.extra.xmult
}
elseif context.before and not context.blueprint then
print('before')
card.ability.extra.old_chips = to_number(G.GAME.chips)
elseif context.after and context.main_eval then
print(to_number(G.GAME.chips))
print(card.ability.extra.old_chips)
if to_number(G.GAME.chips)-card.ability.extra.old_chips >= to_number(G.GAME.blind.chips) then
I found the problem
Don't you need to recalculate it too?
....huh??
it says that the sound effect doesn't exist meanwhile there's the sound effect in the sounds file
Could be this? G.GAME.chips is incremented in an Ease Event, not instantly, I think.
Maybe try comparing to G.GAME.current_round.current_hand.chip_total instead
Are you sure that’s the supported format
Isn't ogg the preferred type?
yeah, my bad, i just forgot to put the modprefix in the sound command in the SMODS.edition
to_number(G.GAME.current_round.current_hand.chip_total) >= to_number(G.GAME.blind.chips)
That’s what i was gonna point
😅
the image is from the MARIO Creepypasta
(TL;DR spooky SMW romhack)
the in-joke regarding it is more related to a friendgroup (x2download2 is the file name for a sound effect we associate with it for one, and the eyeballs unable to be found line is a common quotable when it’s referenced)
there’s more to it but that’s the gist
🤔 do you need to_number though
since talisman already got functions to compare big nums i think
uh no
its either wrap all around to_big
or wrap around to_number
or hope that the player is using luajit2
what bepis is saying is that if both are bignums already you don't need it
-# still better to be safe than attempt to compare table with number
yeah
is there a context in smods that triggers after each joker individually scores?
context.other_joker triggers before they score appearently
context.post_trigger
it requires enabling an optional feature
i meant this
can we delete talisman
i agree
I made a ui code that should reveal the next drawn 5 cards but they all reveal the first next one, how can I fix this?
this helped a lot tysm
Can you show all the code
It's cut off on the right
it's, literally like this:
You're always fetching the last card
so what can I do to fetch the other next ones?
Replace each G.deck.cards[#G.deck.cards] by the correct number
so it would be G.deck.cards[1] and the next one same but with 2?
yes
aight
oh
the deck goes in reverse order
oh oop
so G.deck.cards[#G.deck.cards - 1]?
yeah
aight
you would start at - 0
thx you both for the help!
Can you call incorrect info help? 😅
well, you still tried and that's what matters!
Hey!
I've been trying to create a joker that copies a random rare joker at the start of the round (and reverts back at the end of the round).
Using set_ability seems to change it to a rare joker permanently, so that isn't helpful. I was thinking of perhaps changing all the center elements (loc_txt, atlas) but seemingly base rare jokers don't store them directly in the center. Any suggestions on how I could implement this joker?
You could put a value into the new card like card.ability.turned_rare and hook calculate to add a check if a card has said value and turn it back into the original
I've tried a similar approach to that, but seemingly if I use set_ability or change the joker's center in card.config.center with the a random rare card's center, the original joker's calculate function gets overriden as well
Not in the joker's calculate itself, do you know what a hook is?
Unfortunately no I don't think I'm familiar with that sorry. I'm fairly new to these mods still - sorry
Hello good people. Does anyone know how to change the chance of rarities appearing in the shop and wherever?
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...
Basically you want to do what's in it for the calculate_joker function
Soon this won't be necessary cuz N added a pr for mod calculate so pog
This sounds useful, thank you!
It's G.GAME[tostring(v.key):lower().."_mod"]
Bump
if it's only one specific joker why don't you put that on the joker
Thank you so much for this suggestion, it works now! Such a good feeling when you make something and it works haha
Nice, yw
Cause the sleeve that im tryna make is if the deck is its counterpart then i turn the joker that the deck creates becomes a negative
I'm pretty sure you can do G.jokers.cards[1]:set_edition("e_negative") since sleeve effect are applied after the deck
2 questions
- how do i check if a card is in collection
- how do i check if the player is in a run
- Check its area in card.area
- Maybe check
G.STAGE == G.STAGES.RUN?
🤔 i thought cards are flagged when they are created in the collection
i dont think they are
bleh
is the cardarea G.collection
or smt
actually, i should just print G.I.CARDAREA and check that for myself probably
no, i think they just don't have an area
the other day someone tested and card.area in the collection is nil
the area should be G.your_collection[i]
will this work then (doesnt run when you are not in a run, and when the card is spawned in collection)
yeah
i think it's better that way because cards can be in other places
for like mod menus and stuff
Ah i see thanks
i assume theres probably a lot of answers for this but i know that theres some sort of pool a lot of mods use for "food jokers" in the context of jokers that give random food jokers for example
is there a simple way to add my jokers into that pool?
i think mods hardcode that. there is no builtin way for mods to define a joker as food
you can do pools = { Food = true } but you need to either add the pool yourself or only load it when cryptid is installed or something
Vanilla food jokers should be in that pool naturally as a part of smods.
question, what does this mean
So, drag is true, and its center pinching kids
😭
The pinch behavior on the sprite basically basically eases the width of the sprite towards 0
And I believe setting drag to the prevents it from being dragged by normal means?
i actually thought that was for this
that'd be self.states.drag.can I think
is probably just makes it appear bigger for a frame, as if it was being dragged, but dunno
im trying to figure out a way to "prevent" popcorn and other food jokers from being destroyed by its own effect
-# by making a copy of itself
i think you can prevent it by setting context.blueprint
wuh
Cus all of them have not context.blueprint on their destroy condition
Yea you can just set context blueprint
I do that as well
Im trying to copy the yahimod explosion gif, i have the whole code for that(or at least i think i have). Problem is I have no idea what should i change/add for it to work in my mod. Can someone give me a step by step explanation 😭
function loadThatFuckingImage(fn)
local full_path = (Yahimod.path
.. "customimages/" .. fn)
local file_data = assert(NFS.newFileData(full_path),("Epic fail"))
local tempimagedata = assert(love.image.newImageData(file_data),("Epic fail 2"))
--print ("LTFNI: Successfully loaded " .. fn)
return (assert(love.graphics.newImage(tempimagedata),("Epic fail 3")))
end
function loadThatFuckingImageSpritesheet(fn,px,py,subimg,orientation)
local full_path = (Yahimod.path
.. "customimages/" .. fn)
local file_data = assert(NFS.newFileData(full_path),("Epic fail"))
local tempimagedata = assert(love.image.newImageData(file_data),("Epic fail 2"))
local tempimg = assert(love.graphics.newImage(tempimagedata),("Epic fail 3"))
local spritesheet = {}
for i = 1, subimg do
if orientation == 0 then -- 0 = downwards spritesheet
table.insert(spritesheet,love.graphics.newQuad(0, (i-1)*py, px, py, tempimg))
end
if orientation == 1 then -- 1 = rightwards spritesheet
table.insert(spritesheet,love.graphics.newQuad((i-1)*px, 0, px, py, tempimg))
end
end
--print ("LTFNIS: Successfully loaded spritesheet " .. fn)
return (spritesheet)
end
G.effectmanager = {}
function playEffect(effect,posx,posy)
if effect == "explosion" then
play_sound("yahimod_snd_explosion")
neweffect =
{
name = "explosion",
duration = 100,
frame = 1,
maxframe = 17,
fps = 20,
tfps = 0, -- ticks per frame per second
xpos = posx,
ypos = posy,
xvel = 0,
yvel = 0,
}end
table.insert(G.effectmanager,{neweffect})
end
-- EFFECT MANAGER!!!
-- this is where on-screen little gifs play
if G.effectmanager then
--print("Effect manager has "..#G.effectmanager)
for i = 1, #G.effectmanager do
local _xscale = love.graphics.getWidth()/1920
local _yscale = love.graphics.getHeight()/1080
--print("G.effectmanager[i].name".. G.effectmanager[i][1].name)
if G.effectmanager[i] ~= nil then
if G.effectmanager[i][1].name == "explosion" then
if Yahimod.imageexplosion == nil then Yahimod.imageexplosion = loadThatFuckingImage("explosiongif.png") end
if Yahimod.imageexplosionsprite == nil then Yahimod.imageexplosionsprite = loadThatFuckingImageSpritesheet("explosiongif.png",200,282,17,0) end
imagetodraw = Yahimod.imageexplosion
quadtodraw = Yahimod.imageexplosionsprite
_imgindex = G.effectmanager[i][1].frame
_xpos = G.effectmanager[i][1].xpos-(200/2)
_ypos = G.effectmanager[i][1].ypos-(282/2)
--print("_imgindex".. _imgindex)
love.graphics.setColor(1, 1, 1, 1)
end
love.graphics.draw(imagetodraw, quadtodraw[_imgindex], _xpos, _ypos, 0 ,_xscale,_yscale)
end
end
end
Rotation of the sprite in radians I believe
mm
That said I know how to do this. Honestly the simplest way is to just use a blueprint effect instead
🤔 how
im trying to figure out how to filter out jokers with those effects specifically
Food jokers are all intentionally written to avoid their own destruction behavior when called with blueprint, so that's the simplest way. You can also do whatever weird metatable bullshit to prevent value scaling (which I've done before)
The game does that with stickers
Similar
At least
i think i might be dumb, i cant figure out what you mean by the former, like i understand i should use SMODS.blueprint_effect but idk how
any idea why this could be the case?
Make the transmutable effect a global variable
That’s how i do it with my flip mechanic
Try printing before to see if it enters the if statement or no
What is your sticker definition
It depends on where the prevention effect comes from
hold on
so this is with the code i sent earlier
gonna record again with card.ability.mul_transmutable = true commented out
Try passing true as the 2nd parameter to add_sticker
im currently relying on hooks idk
huh. that worked
No but I mean. What game mechanic causes it
A joker? A deck? A challenge?
literal hooks, theres no objects or anything handling it
my mod adds extra effects to the jokers, and im using hooks to run calculate on them
Okay so it's for the sake of calculation. You're trying to add a context to prevent food joker destruction?
that could work, yeah
Unfortunately, food jokers aren't, as a whole grouped in the vanilla game. Basically, the best option IMO is create a list of the jokers who you want to prevent decay/destruction effects on for the vanilla jokers, extending the Cryptid model for it, because for mod compatibility other mods are likely to also have added to that same list that cryptid uses. Then, in a hook/patch for Card: calculate_joker, check if the card center being calculated is one of those valid food jokers, and if it doesn't have context.blueprint I contexts added to them, set context.blueprint_card to be that card itself, and set context.blueprint to 1, and then reset those values along with the function's return
Hello, I hope I am not interrupting a chain of thought. I am new to modding/lua in general and was wondering if anyone knew of a good guide/tutorial? I am currently looking to just do a test mod where upon certain game actions (play hand) I write the game state to a file (currently planning on json) and then read that into python. Thanks!
Essentially, you're going to be telling the card to calculate as if it's copying itself
aw so i gotta hard-code it, basically
The only way to not hard code it doesnt necessarily respect non-food jokers in addition and also requires metatable magic
Which is basically the prevent_scale context I have in an open SMODS pr
Make a list of vanilla food jokers, and for the rest just do if self.config.center.pools and self.config.center.pools.Food and trust other modders to add the pool to their food jokers
Which does blanket prevent food jokers from decaying, but also would prevent any modded items that need to decrement values as well
Yep
Is this the janky scaling PR? I forget 😂
Fortunately you can rely on the fact that everyone is painfully reliant on Cryptid compatibility, as much as I dislike it
HEY DONT CALL MY AWFUL SON WITH EVERY DISEASE JANK
Food pool isn't really cryptid compatibility at this point
Many people do stuff with food jokers
It's honestly a mistake on the vanilla game's part to not have given them some grouping in code
they should have used a function to get eaten instead of copy pasting the code on each at least
Yeah lol
Yummy
agreed, maybe we could start a campaign to make thunk do that.....
If they had a shared function you could easily do this exact effect
i dont think that would be bad for smods tbh
Hmmmm strokes chin
yeah, i dont think anyones been patching into that stuff too
so not much patch fuck up either
Want me to just import the Food pool and do all that in a PR?
yes please
Idk if that's considered too unvanilla for SMODS
I don’t think they need a specific function to be removed
but the fact that they are using self = nil AFTER self:remove() is so annoyingdsalfdsfkd
Can we make it so that if a Joker has a pool in its center and that pool doesn't exist, the pool is created. Or would that cause issues
Though I haven’t looked at the code
adding a prevention in :remove() doesnt help when the card is just nil afterwards
sob
Store a reference to the card before they do that
Guys I want to have an extra choice in a specific type of pack but I don't understand how to make it directly in the voucher. Like I know I could write some line in the pack that check if you have the voucher but I was wondering If it was possible to not do this ?
Setting self to nil seems wonky though, classic thunk code 😂
i though about that too but no clue what to do afterwards
my idea was to, uh, run calculate_joker on those vanilla jokers and see if they return messages like k_eaten_ex, k_extinct_ex
:3 its a bad approach i know but im desperate
LIKE, if i were to create a copy of the joker and run that first, then that means i should know if the joker will destroy itself with the same context, right??
so i just add in context.blueprint, boom
;3
what are the odds of a joker being rental?
I check some other mod that have a similar feature but only ortalab have this and the code is kinda weird since I don't find the 'definition' of the line
its what i thought too, wanted to be sure, thanks N' !
Sometimes you must combat jank with jank
no but it works well see..........
But yeah the more comprehensive option I created basically created an empty proxy ability table for every card in the game to which it's valid, saves their original tables for reference, and then has meta methods that run every time a value is changed or set on the ability table
this also means my OTHER destruction prevention code doesnt work for food jokers, bleh
oh is this the scaling one
So it intercepts the value assignments and sends some contexts for jokers to respond to to modify them
im doing this for my own scaling effect :3
It's an extension of a boss blind effect I created for my own mod that prevents scaling, which also has the consequence of preventing food joker degredstion
it doesnt use metatables though shrug
The metatable method is a little heavier but more elegant overall I would say
Does it also prevent counters from changing?
You can whitelist any keys you need, and it provides a set of them already
I.E. like invisible rounds
The more jank thing is blanket preventing UI messages after scaling has been prevented which is far more obtuse
Which it does do, and I think I found a decent solution, but sheeeeesh
Yeah I think that’s my issue with anything like this for something so simple as changing internal values, it just becomes another talisman esque coding problem
what the hell happened in cryptid
also i think scaling modification shouldnt really be a part of smods due to how jank/annoying it can be to manage
-# and we literally had a discussion over this a few hours ago in modding-chat lol
i feel like this is a state of being in cryptid
It's why I made it optional lmao
hi winterrrrrrrrrrrrrrrrrr
Hi dillyyyyyy
should i use SMODS.ObjectType for something like this or make an entirely new class and lovely edit smods
how are you my liege
a new class makes more sense but you dont need to lovely patch smods to do it
you can extend the smods objects
Either way even if the validity for SMODS is questionable, it's a requested enough feature due to scaling being a primary game mechanic that I'd like for people to be able to use it
And the more centralized it is, the less conflicts there are
hi dilly
ah
we have optional features as is, i dont personally see the harm in it existing as that feature
hi bestie westie
i was thinking lovely edits just to ensure other mods could use the class since my mod loads pretty late
just make your mod load earlier
or make another api mod
ugh but the thing is that how do i detect if the joker IS destroying itself though
since theres a counter thats supposed to decrease when that happens
sob
-# i still think the checking message one is goated asf
It really would be nice to have a function responsible for eating jokers that you could just hook
thats what i said!
I'm just agreeing with you, a bit late
im agreeing with you later than rock
also it would be more user friendly if people want to make their own food jokers
i think i might just, add (Doesn't work when most Joker foods are destroyed by their own effect)
sob
i would just say eaten
They expired in your stomach
wtf......
Isn't it extinct tho
Honestly I didn't expect through my modding endeavor that I'd somehow become one of the most knowledgeable people in this server when it comes to Balatro modding. Which probably sounds egotistical but honestly I'm surprised how much I now know off the top of my head to solving common problems
so this probably covers everything better
They go extinct cus you ate them
i have eaten all the bananas
youre very smart
recycling food jokers is a nice effect too.........
Objectively most of it is
sadly it gotta be done manually and not automatically
This is basically my job rn
this is true
you know the mods a bad idea when the rarit lua will be larger than the whole rest of the mod
We're the ones who stuck around after learning to make mods
rarit lua
Basically this shit is going right on my resume once it's done
the last of us
i guess yea
though i do have some take_ownership calls that could get messy with that
i hate take_ownership
Main developer of multiple major Balatro mods, coordinated deployment and Q/A testing, that kinda shebang
also do you guys think stacked is fun to play with :3
aka #1400835837960126474
the only real way to detect food joker self destruction rn is hooks into card:remove which get messy really fast
since
i guess i could only do mod compat code after all mods are loaded
youre going on my resume when ur done
Somehow it's gonna end up being more relevant experience than my past job 😭
card:remove is called "often"
and also
theres no way to determine if its being removed from self destruction
i was attempting to prevent self destruction once
its very janky
What to do when I get home....... work on stupid deck credit jank
after i finish work i will open aseprite and if i dont feel like dying after 30 minuts i might make a new mod
I've managed to pretty much arrange the styling for the boxes in a way that I like, but I'm also gonna have to carry this other into other screens like the view deck UI, and some form of hover behavior on the deck in main gameplay
But ughhhhh the deck selection UI is weirddddddddddd. It makes everything objects at lower levels to be handled by replacing the UIBoxes with the deck name and description individually rather than just recreating the whole panel
Which idk maybe it's cheaper but it being so fragmented sucks to mod
And ultimately no one's going to appreciate the various UI work that went into the mod because it's for really small unintrusive visuals
Like NO that caused me actual physical pain
i will appreciate it
make my mod instead
does your mod have anime
Make my mods boy
N' can you work on bsr....
does bsr have firefly
i love breaking
same
i need to try out firefly e2
my idea for the break mechanic is to
attack a card so hard it fucking debuffs itself for the whole ante
:3
lets goo
but in exchange it gives you significantly more buffs compared to normal attacks though
crazy idea but changing the calculate functions of objects should be smth that can be done through code like
function "[objprefix]_[modprefix]_[obj]" calculate =
[etc code]```
so maybe that makes up for the fact that thinning your deck too much wll potentially cost your run
you can change it by doing G.P_CENTERS.objprefix_modprefix_key.calculate = something assuming it's an smods object
but this is what take_ownership is for
local j_modprefix_key = SMODS.Joker{key = "key"}
j_modprefix_key.calculate = function() end
isnt take_ownership able to be overrode by other mods that load after
i suppose int eh way that everything is anime
yeah but this would be the same
My mod has anime because JoJo
winter's mod has by far the BEST shader ive ever seen imo
I am nothing if not a tgirl programmer weeb stereotype
Wait which one
i have not seen winters shader
Oh yeah that one
aren't we all
and ive legit never seen a better shader till now
HOW IS IT SO BUTTERY SMOOTH THOUGH 😭
where can i see it
no clue, she sent that a while ago
Lemme see if I have a video somewhere
oh yeah i really like that one
yea that is neat
hm
i need to make some form of a neat shader for my boss card at some point
Yeah I didn't have any video saved on my phone
i will save you on my phone in order to make up for it
W
Why that isn't working
when is this releasing
In the current version auras aren't on automatically, instead they "flare" whenever they do return effects and such, with the exception of Tohth and Epitaph, which do it on hover because their deck prediction effects are passive
- copy_card(card)
- add something to the clone to refer to the original card
- run calculate on the clone
- add context.blueprint... to the original card first to prevent it from being killed, let the original card calculate normally
- if Card:remove() runs and its the cloned card, do something with the original card <- aka self-destruction prevented!!!
is this good??
And they play when you hover over them in the collection
v.config.center.key i think
🤔
-# i wonder if vouchers' keys are stored like that too or its inconsistent
Ok I'll try to see
no wait, hm
no i still need to duplicate the card since the calculate function of vanilla jokers arent stored in G.P_CENTERS, fuck
Still can't find a video of the actual current collection behavior lol, they no longer all play at once
But the Killer Queen: Bites the Dust one is a good example of the aura flares on actual card effect
when you played the hand i was thinking "what if kqbtd reverted the order of the scoring at the end"
cant believe its actually the effect
sob
Yeah!!!!!!! I'm actually 90% sure it was Eremel who wrote that? At least according to the Cardsauce credits
ooh
info_queue[#info_queue+1] = {key = "codercredit", set = "Other", vars = { G.csau_team.eremel } }
yeah it has a coder credit
Regardless I was a late addition to Cardsauce so all the canon Stands I've worked on have mostly been bugfixing and visual effects. However, I've made nearly all the Stands for my own mod
Doesn't really work too But I'm wondering can we place a calculate in a booster
Also like...... Soon ish. Though all those canon Stands are already in Cardsauce as of 2.0, https://github.com/BarrierTrio/Cardsauce
this mod is fire
...why would a booster have calculate lmfao
im a fan of jojo too, and i can confirm
None of the spritework on Cardsauce is me, you can thank the massive list of Cardsauce contributor artists
I've made some sparse bits of art for my own mod tho
I want it to check if a specific voucher is redeem like I don't know how to make the voucher work and Normaly I place loop that check if a certain object is here in calculate but where should I place the loop instead
Out of curiosity, put it in the ability table, set it on self before being copied, and then unset it on the original after the copy
cuz when a card is copied it automatically gets calculated too
you would want to check for a variable and then set it to false later
oh wait you set the variable
then idk 💀
That said I'm not 100% sure you need to be creating a copy here
Which would circumvent this entirely
this is what im doing
:3
No yeah I'm just confused based on the effect why you need to run both calculated rather than running it on the original one with the blueprint context preventing its destruction
ugh scrap that, even if it works, the clone's calculate can still mess with the game anyways
i want to check if the original card has successfully prevented its destruction
so that i can drop the counter of the destruction prevention effect by one
Ah I see
so the clone is supposed to help with that
but the clone's calculate can mess with the game, so
im just gonna scrap it and give up, this doesnt seem possible
sob
The clone's calculate doesn't need to mess with the game, I think you can effectively prevent that
really? what if in the calculate they are doing stuff that changes the game's values though
I mean yeah technically not wrong
istg balatro is the ONLY game that even experienced coders like you can have difficulties figuring out when food is being eaten 🥀
i only eat pizza thats the problem
fair
that's why my lib will have object_types and joker_types
which u can just add
and check with :IsJokerType(<type>) or :IsConsumableType(<type>)
it already done
i hate pascal case
what are the args for play_sound again
ik it starts with play_sound(pitch, vol,
but is there more or
sound, percentage, vol
but I want to add the edit card thingy before which u can activate using SMODS.optional_features.edit_cards = true
hm, i see
-# i ask because a joker's sound was playing early for me when it was scoring during joker_main so i gotta tinker lol
then people will be able to edit card atlas values name key rarity etc in-game with edit button
are you doing it in an event
i wasnt but i think that's what i need to be doing
yeah
yeah that was a quick fix, joy
how would i check for rerolling the boss blind?
i tried context.reroll_boss and i'm pretty sure that doesn't work
theres not a context for rerolling boss blinds
😔
hook G.FUNCS.reroll_boss
forgive me i'm new to lua what does hooking 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...
-# it took a while to figure out myself because i had the EXACT same question as you last night but
tl;dr it's a way of adjusting the function so it does something else for you
therefore you could have it trigger smth you could check when you reroll
-# tho in my case i just settled for banning the blind LMAO
local reroll_boss_ref = G.FUNCS.reroll_boss
G.FUNCS.reroll_boss = function(e)
reroll_boss_ref(e)
SMODS.calculate_context{modprefix_reroll = true}
end
and then you can use context.modprefix_reroll
(replace modprefix with your mods prefix)
thinkin about N rn
thinkin about N rn
how'd you do it
It's just having a reference of the original function then setting the function to a new one and calling the original one
basically create a clone lmfao
thanks guys
let's say it's popcorn
won't it copy the +0 mult
and immediately die
oh calculating it with context is a LOT easier than the nonsense i had set up, i may take a page from this 😭
nop
wrong it copied all the 0 mult and destroyed 2 other cards
i shee
making your own contexts is very nice
woah its srock hi srock
hello
how are you doing buddy pal
so it doesn't only prevent destruction from itself
is it bad for me to feel proud of this
50% yes 50% no
i want to be a contrarian
i'm oki
im always proud of bepis but everyone else already said no so i have to say yes
im glad to hear
that's how you get your vote invalidated
but to be honest some food are meant to be destroyed immediately anyways, like
what are you gonna do with a +0 mult popcorn...
look at it
also depends, if its a negative +0 popcorn i still like it
its negative
Is there documentation anywhere on all the hooks in the game?
or if its another edition i have
which reminds me i need to work on the edition im doing rn to not make it a hook
. oh
hooking is a lua feature not a balatro or smods feature
you can hook any function, and there isn't documentation for every function in the game no
guess what
it does, actually
Ah understood, thanks
can it go below 0 mult?
but didn't you just say you changed the values before copying
negative mult my beloved
thats another effect
i have 2 destruction prevention effects
one is "prevent destruction", the other also resets the ability table (food synergies)
what happens if its paired with my fridge
shrug
i will record this rq, one sec
should probably have like, incompatible jokers with certain effects
better api
better bepis
thats rude
what can be better than bepis
everything
if bepis is so good where's bepis 2
actually bepisfever sounds like a sequel
.
N is asking when are you going to have children
there we go
the animation is funny
both of the jokers got eaten
sob
you can see that the first one didnt reset its values, while the second one reseted though
:3
thats cool
oh i see
weird that the eaten message shows twice on the left joker
i should check if this has any side-effects with turtle bean
turtlebean my detested
man i love seeing useless(?) passives on jokers lol
make so it works for calc_dollar_bonus too
thats 4 more dollars
yeah logically that should just give you the money twice
hey, sorry if im interrupting a conversation but i need help to code a joker, its like misprint but givin you random amount of money instead of mult, i tried ti use the smods recreation from the smods vanilla remade repository but i dont understand how works the misprint randomness, i will apricciate any help given
it doesnt
which MEANS
EVERYTHING WORKS PERFECTLY
OH MY FUCKING GOD
lets goooo
what is that mod
is it unfinished
adds random extra effects on jokers
i fucking thought self-destruction prevention was basically impossible
local mult = math.floor(min + pseudorandom() * (max - min))
pseudorandom('vremade_misprint', card.ability.extra.min, card.ability.extra.max) is what does the randomness
the first parameter is the random seed, the second and third are the min and max numbers
dont use math.random
Alright heading home from bowling, time to mod
how i transform that into money?
did you have fun
when do you want to give money, during scoring or at end of round?
to be more easy, during scoring
winter i got the destruction shit to work
one day we will get the 240..
winter do you have your own ball?
I saw!!!!!
Multiple
do they have cool designs
then you can just copy the calculate function and replace mult for dollars (and the seed string for something unique)
i want to see
Technically I currently own eight but at least four of them are nearly a decade old
So I'm probs gonna trash or donate them. Their surfaces aren't super good anymore
in vietnam bowling is like, SUPER uncommon
ive legit never seen a vietnamese talk about bowling in my life
oh yeah here bowling is practically not a thing
same
Also yeah it varies by country. Japan and Mongolia? afaik have fairly big bowling scenes but it's pretty uncommon across most of Asia
like here (the selected stuff) replace r_mult for r_dollars?
i think i can just, ignore the message being weird for now
i dont think its fixable
without making this even more yanky than it should
the fact that im using copy_card is probably illegal enough already :3
no, all the part inside loc_vars is just the description code
you want to change what's in calculate
everything is always fixable
dilly can u fix it for me
(yes the description is longer than the actual effect)
anyways, what effect should i add next
sure as long as u go through my mod and turn all of my needless patches into hooks :3
something unique but also somewhat universal
Oh I already saw, gosh im an idiot, thanks for the help
where is the game seed stored?
G.GAME.pseudorandom.seed? i think
I wanna make a joker that randomly changes the seed
i think that would be impossible to visualize as a player
Also yes, every professional bowling ball has a cool design and is named something unnecessarily edgy
seeds are normally inaccessible until you lose/win a run
whats ur favorite
so, while it does make a difference to everything, you wont know about it
yeah and even if they were the player would have no idea what changed
mhm
what about a joker that tells everything thats going to happen in this seed for next round and changes seed at end of round
you could make an extra tab in the run info that shows how the seed changed, ie showing shop diffs and such
also, hows this for an effect
[Passive]
If Joker is destroyed, creates a Tarot/Spectral card
(Must have room)
:3
that would make more sense yeah
i wonder how you would achieve that (the one that tells "everything")
that would just be a fun curiosity rather than an interesting effect
Idk but it seems like a good idea
very good idea
i see
i mena changing the seed in general is just that
Tarot is 0%, Spectral is 100% :3
there not much to gain unless you can make it a more 'favorable' seed and how youd quantify that is unknown to me
yeah thats why i think it wouldnt be good unless you specifically have prediction effects
me when I get when this joker is destroyed create a copy of it and if joker is destroyed creates a tarot/spectral card on popcorn:
My favorite ball I ever had was probably Motiv Primal Rage Remix from 2015
thats the fun thing about stacked!
you can have some pretty fun combos like that :3
which ball do u have the most strikes with
also i should, probably nerf discards and hands effects
giving +3 hands seems a bit too much lol
My most actually competitive ball ever for that purpose was the Roto Grip New Rules from 2016
true
+2 at most
i have 2 cards, one that lets you roll over all unused hands and one that lets you roll over all unused discards
and then a joker that converts all unused discards to hands if you run out of hands 1 at a time
also the destruction prevention effect is so good when it hits this
:3
i cant believe i actually found it naturally lol
that one would be the passive i sent above
the reset ability one is more suitable for food jokers
but still good nonetheless
wait does that work on selling jokers too?
or is it just useful for ankh
yes
I see
we definitely need pictures
hi eremel!
hi dilly
i hope youre awesome today
Confirming that my thought process is right here:
Are there any syntax/styling recommendations for lua?
1st pic
- Black Widow 3.0 (Hammer, 2024)
- T-Zone Frozen Blizz (Brunswick, 2019)
2nd pic
- Primal Rage Remix (Motiv, 2015)
- No Rules (Roto Grip, 2016)
3rd pic
- Alpha Crux (Storm, 2016)
- White Dot (Columbia 300, 2017)
4th pic
- Fanatic BTU (Brunswick, 2016)
- Tag Cannon (Motiv, 2017)
All are 15 lbs, ~7 kg
(Sorry, collecting release info took me a long time)
omg T-Zone Frozen Blizz is lush
The White Dot also has a specific pattern name but I couldn't find it. Both it and the T-Zone are polyester balls (spare balls), which are a lot simpler engineering wise and so they get sold for longer periods of time. They've been selling WDs since like 2002 or smth with a different pattern assortment every year or couple of years, whereas everything else in this photo except the Widow and the T-Zone (also polyester) has been retired in the years since their initial releases
looks pretty good to me
oooh sick
im a sucker for blue -> pink/purple gradients so T-Zone Frozen Blizz looks so nice for me :3
I picked it up cause tgirl colors
ic
This is the full assortment seemingly
Unrelated to modding I love your profile picture. Soupsie...
These are incredibly badass, I love bowling but I'm bad at it
So are most people, I just happened to end up doing it professionally
Damn. So when you want better work conditions do you. Go on Strike?
Do you go Cold Turkey?
Heh. Heh.
LMAO
what fps do boss blinds animate at?
what does that do
it makes it so you cant overfill your consumable slots by having multiple things that give you consumables at once
How should the function declaration go, just like "function expoert_after_draw()"
like this
is it ok if I dont use it
what Sophe said + it allows other cards to do stuff with consumable count during scoring because the cards dont get added until after scoring (due to events)
you can omit it but it will make some effects be wrong
function original_function_name()
hook()
--do your own stuff
end```
Ah got it thanks
if it has arguments make sure to pass them into the hook as well
ok I wont remove it
Anyone with a little bit of UI knowledge, would you know at all why attempting to call e.UIBox:recalculate() crashes here?
My crash log refers to this line in UIElement:set_values, but I don't know why it would fall into this line since I'm manually setting the UIT off of G.UIT.O in the code
calculate = function(self, card, context)
-- From VanillaRemade (so thx VanillaRemade)
if context.last_scoring_step and context.cardarea == G.hand and context.other_card == card and #G.consumeables.cards + G.GAME.consumeable_buffer < G.consumeables.config.card_limit then
G.GAME.consumeable_buffer = G.GAME.consumeable_buffer + 1
G.E_MANAGER:add_event(Event({
trigger = 'before',
delay = 0.0,
func = function()
if SMODS.pseudorandom_probability(card, 'giga_bluePlus', self.config.extra.odds, self.config.extra.chances, 'bp_prob') then
SMODS.add_card({key = 'c_black_hole'})
else
if G.GAME.hand_played then
local _planet = nil
for k, v in pairs(G.P_CENTER_POOLS.Planet) do
if v.config.hand_type == G.GAME.hand_played then
_planet = v.key
end
end
if _planet then
SMODS.add_card({key = _planet})
end
G.GAME.consumeable_buffer = 0
end
end
return true
end
}))
return { message = localize('k_plus_planet'), colour = G.C.SECONDARY_SET.Planet }
end
end,
I'm not able to make this work
whats the log
i wouldnt mind the the crash logs printed the whole table honestly lol
The issue here is that I need to recalculate for switching to decks that don't have an artist credit, otherwise it doesn't orrectly reset the width/height of the main description element and it leaves this weird gap
But for whatever reason, attempting to recalculate the UIBox just causes a general failure
What is this
oh it's final_scoring_step
youre trying to return a table during context.repetition that doesnt include repetitions
but like that the code and their is no repetition
final_scoring_step also doesnt haave cardarea == G.hand or other_card btw
i dont think that code is causing that warning
oh
unless im missing something
does it always crash or only when you switch to one with an artist/one without
im guessing when switching to one without
Always crashes
hmm
I change to main_scoring and remove other card and now its working fine. Also the log doesnt appear anymore

my vague assumption is that it has something to do with the other nodes here, since it's calling a very top level UIBox returned from G.UIDEF.run_setup_option(). Each of them has an update function that replaces one of the UIBoxes here when the deck selection is changed (and I hate how this is setup, it feels so jank), but the're all running basically simultaneously
My artist credit is added as a third row beneath the name Movable() and the Back:generate_UI() call
hey can i make another question, how i can make a joker alter the consumables, jokers or shop slots? like juggler or the drunk
G.consumeables:change_size(number), G.jokers:change_size(number) and change_shop_size(number) in add_to_deck
and in the config tab?
like config = { extra = { j_size = 1 } } ?
so i dont need to put the modifications to the config tab?
thaks for the help
this might be correct, but i think the hand_chips*mult is from a function arg. where was this file located?
state_events.lua, but consider comparing the blind chips toG.GAME.current_round.current_hand.chip_total, might work
when are we going to butcher talisman?
Is there a place that explains balala shaders well? I wanna try doing something with them but it just looks so intimidatingg
how can i change the enhancement of a card?
can vouchers have calculate?
ikr 😭
yes
card:set_ability("m_key")
cool
if i just put the calculate function does the game automatically understand that i want it after the voucher has been redeemed
how can i check if a card has an enhancement
Hi, me again. This is my first time trying do enhancement, and I don't know why it's not working.
The error message says it's something related to the atlas.
Your enhancement has no atlas
Add
atlas=“modprefix_atlaskey”,
config = {
extra = 2,
choose = 1,
},
loc_vars = function(self, info_queue, card)
return { vars = { card.ability.choose, card.ability.extra } }
end,
weight = 0.9,
cost = 4,
kind = "BTCTPack",
create_card = function(self, card, i)
ease_background_colour(HEX("cc3b49"))
return SMODS.create_card({
set = "Batrocities",
area = G.pack_cards,
skip_materialize = true,
soulable = false,
})
end,
select_card = 'jokers',
in_pool = function() return true end
}
Does anybody know why this booster pack is crashing balatro?
What’s the crash
folks, can i add a string.find(v,'certainPrefix') to a for k,v in pairs(G.P_CENTERS) loop to check if something has a certain prefix in its key?
Without that line, it works, but when I try to add it, I get an error again. I am sending proof that that is the correct prefix and key.
yes but have you considered just checking if the center is from the mod
(also it would be k not v)
thats what im doing but the mod has very nicely labeled out what is and what isnt a certain center type
like it has type1_key and im trying to check if it has type1 or type2 at the start :]
i think it would be better if you add that to the center too
SMODS.Atlas
Its capital A
Lua is case sensetive
Ugh this is weird, this crash also happens when I add a recalculate to the other update functions that vanilla points to. I'm just so confused b/c I'e done something like this before (changing a UIElement to an object type, adding an object, and then calling the UIBox to recalculate), and that one didn't provide any issues
the atlas doesn't need the mod prefix there
Just incase
i did something like that to test it myself and it didnt crash
i think the problem might be something else, like in the UIBox you're adding as an object
im going to assume this isnt a me problem since it doesnt say stack overflow
nope yeah it still crashes on my end for whatever reason
maybe something in the changes I made to Back:generate_UI()
[SMODS modularous "modularous.lua"]:21: Error reading file 'content/extra.lua' for mod with ID 'modularous': Could not open C:\Users\legom\AppData\Roaming\Balatro\Mods/modularous/content/extra.lua in mode r```
why would this crash happen? The file exists, and it doesn't crash if i dont try to load it.
is it because its open in another program (vs code)? It's never had an issue before
try closing any program that might have it open
bump
okay this is the third time the game has crashed out of memory issues when it hasnt done anything like that in ever im assuming its a me problem
have you read the enhancement docs
oops nope im stupit i did not load "extras.lua", which exists, i tried to load "extra.lua" which does not
well what's your current memory usage
ah, no. i really should check the documentation more
hey so can anybody help me my face card textures aren't being loaded
`
local atlas_key = 'mc_atlas'
local atlas_path = 'mc_lc.png' -- Filename for the image in the asset folder
local atlas_path_hc = 'mc_hc.png' -- Filename for the high-contrast version of the texture, if existing
local suits = {'hearts', 'clubs', 'diamonds', 'spades'} -- Which suits to replace
local ranks = {'Jack', 'Queen', 'King'} -- Which ranks to replace
local description = 'The Mechanism' -- English-language description, also used as default
-- Registers the mod icon
SMODS.Atlas { -- modicon
key = 'modicon',
px = 32,
py = 32,
path = 'modicon.png'
}
SMODS.Atlas{
key = atlas_key..'_lc',
px = 71,
py = 95,
path = atlas_path,
prefix_config = {key = false},
}
if atlas_path_hc then
SMODS.Atlas{
key = atlas_key..'_hc',
px = 71,
py = 95,
path = atlas_path_hc,
prefix_config = {key = false},
}
end
for _, suit in ipairs(suits) do
SMODS.DeckSkin{
key = suit.."_skin",
suit = suit:gsub("^%l", string.upper),
ranks = ranks,
lc_atlas = atlas_key..'_lc',
hc_atlas = (atlas_path_hc and atlas_key..'_hc') or atlas_key..'_lc',
loc_txt = {
['en-us'] = description
},
posStyle = 'deck'
}
end
`
i have three windows open??
just restart your pc
yeah best course of action
Happens to me as well, after opening and closing balatro a lot, probably a memory leak somewhere
can you copy the crash and send it here instead of screenshotting it
I did as you said, and when the error messages appeared, I entered what it asked for, and although it no longer crashes, but the image I need does not appear.
all your enhancement should have for atlas is atlas = 'enh'
Try adding the atlas key to the atlas=
the SMODS.Atlas call goes before you define the enhancement
okay yeah I turned off all my mods and added this as an override in SMODS, still crashes
G.FUNCS.RUN_SETUP_check_back = function(e)
if G.GAME.viewed_back.name ~= e.config.id then
--removes the UI from the previously selected back and adds the new one
e.config.object:remove()
e.config.object = UIBox{
definition = G.GAME.viewed_back:generate_UI(),
config = {offset = {x=0,y=0}, align = 'cm', parent = e}
}
e.config.id = G.GAME.viewed_back.name
e.UIBox:recalculate()
end
end```
exact same place
there's nothing that is using the same object you remove right?
I don't understand what you mean.
Nope. But this test here proves it's not smth I'm doing
when you define an atlas, you give it a key, it's like its name. Try putting in your code atlas = 'atlasName'
In this case, replace atlasName with your atlas' name.
Let's go!!! It worked!!
Oh N, btw, out of curiosity, how would I do this
SMODS.Atlas {
key = 'enh',
path = 'enh.png',
px = 71,
py = 95
}
SMODS.Enhancement {
-- stuff
atlas = 'enh',
-- more stuff
}
SMODS.Joker{
...,
modprefix_type = "type1"
}
then G.P_CENTERS[key].modprefix_type
rather flummoxed. befuddled. confused. hoodwinked. bamboozled
Gotcha
Workerd!
I'm very thankful
bump
this is making my joker into a glass card 😭 i tried scored_card like in midas mask but it causes a crash, for some reason
card in calculate is the joker
you need to get the card you want but it depends on your code
is it possible to make this text render correctly? The effects listed in the (currently) bit are picked from the loc vars
no
either use main_end or use key to change descriptions in a localization file
well that would be 9 localizations for the same joker. I suppose I could just make it c:attention and leave it as that
this is it for now
context.other_card
9 localizations for the same joker sounds fine
code is free
what does this text look like in code?
ok i dont know if this helps but I noticed that it crashes when it checks the third children of a node out of four but with cardsleeves enabled it crashes when it checks the fourth children out of five
maybe that helps locate the object lol
huh
well now this makes all cards into glass cards
there are a couple of things wrong with the logic
whats the objective?
for now, im just making stone cards into glass cards, but end goal, just the first scored stone card
Maybe it's all on the wrong nesting level somehow?
if context.individual and context.cardarea == G.play and context.other_card == context.scoring_hand[1] and SMODS.has_enhancement(context.other_card, "m_stone") then
context.other_card:set_ability("m_glass", nil, true)
end
Since one level up, if it was somehow adding there, would be the third child of four, made fourth of five with the added cardsleeve earlier
yeah
But organization wise it seems correct? Because if it added it one level up, the text box would probably end up somewhere around here
Since it'd be a row node added in the third slot, expecting a column
Deck > desck > new added node > stake colum
Folks, anyone know how to handle orbital tag randomizing?
And the topology ultimately looks correct
| UIBox | - ID:1470 w/h:9.9/7.964
| ROOT | - ID:1556 w/h:9.9/7.964
| R | - ID:1514 w/h:9.9/3.8
| R | - ID:1513 w/h:8.8987804878049/3.64
| C | - ID:1512 w/h:8.8987804878049/3.64
| C | - ID:1472 w/h:0.6/3.44
| T | - ID:1471 w/h:0.19/0.415 TEXT:<
| C | - ID:1509 w/h:7.2987804878049/3.44
| R | - ID:1487 w/h:7.2987804878049/3.3
| R | - ID:1486 w/h:7.2987804878049/3.3
| C | - ID:1485 w/h:7.2987804878049/3.077868
| C | - ID:1475 w/h:2.0487804878049/2.777868
| R | - ID:1474 w/h:2.0487804878049/2.7512195121951
| O | - ID:1473 w/h:2.0487804878049/2.7512195121951 OBJ:CardArea -- deck visual
| C | - ID:1482 w/h:4.2/2.777868
| R | - ID:1477 w/h:4/0.45
| O | - ID:1476 w/h:0/0 OBJ:UIBox -- name
| R | - ID:1479 w/h:4/1.12
| O | - ID:1478 w/h:3.57/1.12 OBJ:UIBox -- description
| R | - ID:1481 w/h:4/0.807868
| R | - ID:1480 w/h:4/0.807868 -- this is my node here, made a row node when back has no artist
| C | - ID:1484 w/h:0.45/2.777868
| O | - ID:1483 w/h:0.45/2.7 OBJ:UIBox -- stake column
| R | - ID:1508 w/h:7.2987804878049/0.14
| B | - ID:1488 w/h:0.1/0.1
| B | - ID:1489 w/h:0.1/0.1
| B | - ID:1490 w/h:0.1/0.1
| B | - ID:1491 w/h:0.1/0.1
| B | - ID:1492 w/h:0.1/0.1
| B | - ID:1493 w/h:0.1/0.1
| B | - ID:1494 w/h:0.1/0.1
| B | - ID:1495 w/h:0.1/0.1
| B | - ID:1496 w/h:0.1/0.1
| B | - ID:1497 w/h:0.1/0.1
| B | - ID:1498 w/h:0.1/0.1
| B | - ID:1499 w/h:0.1/0.1
| B | - ID:1500 w/h:0.1/0.1
| B | - ID:1501 w/h:0.1/0.1
| B | - ID:1502 w/h:0.1/0.1
| B | - ID:1503 w/h:0.1/0.1
| B | - ID:1504 w/h:0.1/0.1
| B | - ID:1505 w/h:0.1/0.1
| B | - ID:1506 w/h:0.1/0.1
| B | - ID:1507 w/h:0.1/0.1
| C | - ID:1511 w/h:0.6/3.44
| T | - ID:1510 w/h:0.19/0.415 TEXT:>
| R | - ID:1539 w/h:9.9/2.2
| R | - ID:1538 w/h:8.9/2.2
| O | - ID:1515 w/h:8.9/2.1 OBJ:UIBox
| R | - ID:1541 w/h:9.9/0.9
| O | - ID:1540 w/h:0/0 OBJ:OTHER
| R | - ID:1555 w/h:9.9/1.064
| C | - ID:1550 w/h:2.4/1.064
| C | - ID:1549 w/h:1.91/0.61
| C | - ID:1544 w/h:1.2/0.41
| T | - ID:1542 w/h:1.1/0.2075 TEXT:Seeded Run
| B | - ID:1543 w/h:0.1/0.1
| C | - ID:1548 w/h:0.41/0.41
| C | - ID:1547 w/h:0.41/0.41
| C | - ID:1546 w/h:0.41/0.41
| O | - ID:1545 w/h:0.35/0.35 OBJ:Sprite
| C | - ID:1553 w/h:5/1.064
| R | - ID:1552 w/h:1.408/0.664
| T | - ID:1551 w/h:1.408/0.664 TEXT:PLAY
| C | - ID:1554 w/h:2.5/1.064
Ugh this is a headache
I've tried delaying the recalculate with an event but some issue. Some reference gets fucked up in setting these nested UIBoxes
how do I make it so that a consumable spawns a random joker that has a specific badge?
like I have this irl grass consumable and I want it to summon a random joker that has the "IRL Jimbo" badge when used
Just include the group key in the add_card or create_card
i did some prints and the object that crashes is this one
Guessing the group is a table
which makes sense because its below the cardsleeves selection but idk why it is
What is that, I have no clue. Once I get back from the store I can look at the code
my guess was the stake selection but i removed it entirely and it was still happening
so idk
Oh you're right that would be between it. Because below it is the seeded run text, the toggle, and then the play button
So maybe Stake Selection is occurring strangely later and there's a frame in there where it hasn't been rebuilt?
sorry but how do I get the group key of a badge? the way I added these badges way just by creating a badge individually on each joker
You need to make a global table that contains all the keys for those jokers and call it in create_card or add_card to get a random one
found it, it's this one
oops didnt send the image
<@&1133519078540185692>
ty mods
sneaky
Toggle meaning the actual toggle control or the rows that appear when you hit the toggle?
(also thank you for helping me debug this, I probably would've figured it out on my own but I do appreciate it because I've not been very effective)
the rows appear when you hit the toggle, the toggle itself is not the problem
i just removed it and it stopped crashing
now i dont know how to fix that
So basically, the game is clearing the rows without setting the UIT setting to not be an object when they're not visible
And by default they're not there, so there's an object node that will crash on recalculate because it hasn't been told not to look for an object by just making it a row or column or wharever
Given that, I probably have a decent solution
again?? <@&1133519078540185692>
long day in the spam mines
how do i make joker that gives a specific booster pack?
How would I properly, in loc_vars, put something like "2 of Clubs"? Like if I wanted a random rank/suit combo
check how The Idol behaves in vanillaremade
when is the booster pack given
after the round ends it has a chance to give you a booster pack from mod
so I think I have the table needed for this, but I'm not sure what to do from here
local booster = Card(G.play.T.x + G.play.T.w/2 - G.CARD_W*1.27/2, G.play.T.y + G.play.T.h/2-G.CARD_H*1.27/2, G.CARD_W*1.27, G.CARD_H*1.27, G.P_CARDS.empty, G.P_CENTERS.p_modprefix_key, {bypass_discovery_center = true, bypass_discovery_ui = true})
booster.cost = 0
G.FUNCS.use_card({config = {ref_table = booster}})
booster:start_materialize()
yea that works if you want to open it directly (i think). if you want it in the shop, do this instead
if context.starting_shop then
G.E_MANAGER:add_event(Event({
func = function()
local booster = SMODS.add_booster_to_shop('p_modprefix_boosterkey')
booster.ability.couponed = true -- only use these two lines if you
booster:set_cost() -- want the booster to be free
return true
end
}))
-- this return is also optional, only if you want the joker to give you a message
return {
message = [your message],
colour = [your color]
}
end
do SMODS.add_card { key = 'j_' .. pseudorandom_element(irl_friends, "seed") }, or you can remove the 'j_' .. part if you add it directly to the strings in irl_friends
I tried that and it crashed the game
Update SMODS
Ughh i will be honest i kinda don't understand the code
It creates a booster, then it makes it free, then it opens the booster pack.
Where do I specify what booster it gives?
and i put local in local_vars and the rest before return?
No, you put it where you want to create the booster.
how can i change the rank of a card
You change modprefix to your mod prefix, and you change key to the booster key.
SMODS.change_base(card, nil, "Ace")
Replace Ace with the key of the rank.
Swag
Ok it works but there is a problem
the round end screen goes up and you can't choose cards
Have you tried putting it in an event?
it is
Have you tried putting it in an event in an event?
how should that work?
G.E_MANAGER:add_event(Event({
func = function()
G.E_MANAGER:add_event(Event({
func = function()
local booster = Card(G.play.T.x + G.play.T.w/2 - G.CARD_W*1.27/2, G.play.T.y + G.play.T.h/2-G.CARD_H*1.27/2, G.CARD_W*1.27, G.CARD_H*1.27, G.P_CARDS.empty, G.P_CENTERS.p_modprefix_key, {bypass_discovery_center = true, bypass_discovery_ui = true})
booster.cost = 0
G.FUNCS.use_card({config = {ref_table = booster}})
booster:start_materialize()
return true
end
}))
return true
end
}))
ok so now i can choose card but the end screen still appears, this time behind
When do you want the booster pack to show up then?
after the round end and before the screen if that's possible
like it works now
so if there's no way to do that it's still fine
but it would just look better
chat
Maybe you could set G.STATE_COMPLETE = true outside of the event, then move the code into only 1 event instead of 2 and hook G.FUNCS.end_consumeable and set G.STATE_COMPLETE = false?
where do i put end_consumeable and the second one?
to the event?
The hook would go outside the joker and the code inside the joker would be something like this:
G.STATE_COMPLETE = true
G.E_MANAGER:add_event(Event({
func = function()
local booster = Card(G.play.T.x + G.play.T.w/2 - G.CARD_W*1.27/2, G.play.T.y + G.play.T.h/2-G.CARD_H*1.27/2, G.CARD_W*1.27, G.CARD_H*1.27, G.P_CARDS.empty, G.P_CENTERS.p_modprefix_key, {bypass_discovery_center = true, bypass_discovery_ui = true})
booster.cost = 0
G.FUNCS.use_card({config = {ref_table = booster}})
booster:start_materialize()
return true
end
}))
now it works like the last time, the end screen covers the cards
well i will just go back to this one
it works
but i have other questions
how do i make this booster not appear in shops and can i make that it gives only negative cards?
in_pool = function(self) return false end and in the create_card function you would add edition = "e_negative"
first one: make its in_pool function always return false
Thx
so im a little slow, smods's wiki has an area for repeating joker effects... it's under Calculate Functions
@red flower
This was the fix. Setting the node that contains the seed textbox to be a row when its object is not valid, and then back to an object when its object will become valid. Not doing so in the vanilla code is arguably bad practice
local ref_toggle_seeded = G.FUNCS.toggle_seeded_run
function G.FUNCS.toggle_seeded_run(e)
if e.config.object and not G.run_setup_seed then
e.config.object:remove()
e.config.object = nil
e.UIT = G.UIT.R
e.UIBox:recalculate()
elseif G.run_setup_seed then
e.UIT = G.UIT.O
end
return ref_toggle_seeded(e)
end```
great job
is there an easy way to add random cards between separate pools, like a joker that generates a planet or a tarot, or a joker that generates a tarot or a spectral
🙇♀️ thank you v much
"Tarot_Planet" is its own pool iirc
for other combinations you would have to use pseudorandom_element or another method to oick randomly
is this allowed before i test
youll want to check if it has in_pool first
otherise you could try to call a nil reference
also it would be center:in_pool()
How would I use an image as a rarity badge?
just check if enhancement_center.in_pool before making the function call i think
if enhancement_center.in_pool and enhancement_center:in_pool()
how would i make a certain type of enhancement not show up in a standard pack? make in_pool() always return false?
oh yeah because everything in lua is a variable
yes
unless you want it to show up naturally somewhere else
in_pool = function(self, args)
return false
end
}
yeah exactly that
Bro corrected two typos
I rarely correct one
Silly boi
not really a typo
luckily that is not the case i only want the enhancemet to be created by a joker, thx
So you put everytihng on purpose?
And then changed it to everything for no reason?
no but it was more a misunderstanding than it was a mistyping
Ah
Okay
been a while since i last asked smth here, is it possible to make eternal consumables? if so, how
what exactly is the goal?
a consumable that can't be sold
card.ability.eternal = true
oh dang
you can tell how ancient i am for not knowing a single line of code lol
so i've got some issues
it works as intended mostly, but it fills up every empty slot instead of only creating one card
it also lags the shit out of the game when the boss is rerolled
and will crash it without even showing an error screen if i reroll enough
why are you doing context stuff in there?
that's all under calculate
-# not SMODS.calculate_context, the code below it
what the
please dont hook in calculate
where do i hook then...