#đ»ă»modding-dev
1 messages · Page 449 of 1
bingo
Draw cards to consumable slots lol
now how can i draw a specific card to hand
like if i looped through the cards
and have the card object
how do i draw that specific card
back from dinner, can i get help with this?
i did
No??? Highest is the highest ranked card, lowest is the lowest. They need to start with these values so they'll use the first card.
and it still doesn't work đ
not dependent on seed
You can set them to 0 đ
Nothing will be less than 0
Crash message ? (Sorry not on pc canât open the txt)
I dont think it works like that
Thats why
You can find the highest ranking card easily, just by going through cards with for and having. A variable that you compare with
starts
Oops! The game crashed:
functions/misc_functions.lua:265: bad argument #1 to 'randomseed' (number expected, got string)
Missing parameters
which ones
It looks fine
But game crash said youâre missing parameters
Is your file saved?
Do you actually get what I'm doing? I need both the highest and the lowest so I can compare them. My effect uses the difference of the highest and lowest card.
as in my mod file? yes
đ€·
Still getting nil with number. Does comparing with math.huge normally cause this error?
Listen
Use config values
Variables *
Set high and low to the first card index
Card.ability.extra.highest=context.scoring_hand[1].base.nominal
Same with lowest
Donât use math.huge đ thats wrong
Do both of these before the for
And use card.ability.extra.highest instead of âhighestâ
For your return do
Mult =card.ability.extra.highest-card.ability.extra.lowest}```
morning folks
local other_joker = nil
local other_other_joker = nil
for i = 1, #G.jokers.cards do
if G.jokers.cards[i] == card then other_other_joker = G.jokers.cards[i - 1] end
end
for i = 1, #G.jokers.cards do
if G.jokers.cards[i] == card then other_joker = G.jokers.cards[i + 1] end
end
local x = SMODS.blueprint_effect(card, other_other_joker, context)
x.extra = SMODS.blueprint_effect(card, other_joker, context)
return x
end```
i'm trying to make a blueprint that has the ability of both the joker to the left and right, but the game crashes on the `x.extra = SMODS.blueprint_effect(card, other_joker, context)` line with "attempt to index local 'x' (a nil value)
why is x nil here?
Morning father
father?
oh
Lmao
haha
Ahahaha
didnt expect someone here to play genshin tbh
dont know what did i do wrong but the pack is not showing the non-mod cards
Does it show ingame ?
the mod spectral cards show correctly, butthe original spectrals dont instead i see jumbo joker
we have a Balatro: Star Rail mod
granted it's in hiatus
Ok, how do I reset them while I'm doing that? It seems to not like me putting this code after the localize line
It resets automatically
star rail mod?? texture or playing mod?
playing mod
in all examples i have there is no pack example...
Donât set it to 0
though all mods are probably presumed 'playing mod"
tbh i want a genshin texture pack for jokers
I removed the line since you say it resets automatically
:]
i even have a somewhat ready list of each joker what to be
what's the error?
classic talisman
i know
Obelisk
but i dont do art
Learn
exactly
Iâm shit at art
tried
Youâre not doing it the right way :3
dont have time to do art with other stuff
Gotta grind for top 1% skirl
Skirk*
wdym?
Functionally it works now
again
The text is broken so it still says +0 mult, but it does give mult
Congrats:3
Donât return values
it was double too, lost then got it in the same 10 pull
Just use text like raised fist
The gacha gods đ
Don't return?
In loc_vars
Return and dont use them in text
Donât do #1#
đđyou can do no loc_vars
Its optional
after i lost at first spent a few minutes praying as hard as i can to get a double for the first time ever
so....
What about the text on the joker?
messed around with it a bit, the code functions if i comment out "x.extra = y", even if it only copies 1 joker
not sure why it says that x is a nil value when i define it, unless .extra isn't what i'm supposed to be doing?
I feel like I'm doing localization wrong, shouldn't the "message" and "saved" both refer to my localization file? Why is it not using these?
This joker gives mult equal to the highest scoring card-lowest scoring card
dont know what did i do wrong but the pack is not showing the non-mod cards
gonna repeat this until someone gives me a sol
Canât really do loc_text here with vars without avoiding lag since youâd have to do the calc whenever a card is highlighted
Which isnât as laggy but , the max you can get is 9 mult to doing the math in your head would be more efficient
to know better where issue is, seperate lines
after the first then new line
after the second one a new line
and each end in a seperate line
:3
the main problem is that i didnt get that error
it was someone
oh
I took out loc_vars and it's still saying +0 mult
doing everything in one line is bad practice so...
This is the localize line
message = localize { type = 'variable', key = 'a_mult', vars = { (card.ability.extra.highest - card.ability.extra.highest) * 2 } },
i usually do that on hooks
idk why
tell him to fix that first
okay yeah i found the problem, i just didn't update steamodded
i mean, he's playing my mod
Oh it must be that I'm subtracting highest from itself
@daring fern u there?
trying to create a joker which retriggers a certain rank twice and changes each round but the retriggers arent working for some reason?
im wondering if it's having trouble reading the rank variable for some reason
Which one are you using ?
The id method ?
i think so?
Yeah, made it subtract lowest from highest and it works perfectly
@formal parrot Thanks!
its pretty much identical to what mail in rebate uses since that deals with ranks too
Oh
Ace is
Id is a number
hm ok
when i set it to that it came up as ERROR in the description, how would i localize it?
great now this isn't working
function SMODS.current_mod.reset_game_globals(run_start)
reset_kls_magenta_rank()
end
it's only triggering at run start
according to vremade it should be for every round (despite the name)
Np :> please remember card references to joker and avoid context.individual if you donât understand it
I think you can do card rank by id or something
Or just type ace
The joker is now working perfectly. Text fix and art are up next.
I've never had this issue and I hadn't edited this joker at all?
What's the problem?
Can it just not find the picture
Yes
do any of u know how to reach someone on github
is it named correctly
You can do mult calculations with highlighted card context i feel like
I recommend just not doing it
For 2x what should I be naming it
these atlas dimensions are weird as hell
Double resolution
Alright
I was gonna point it but đ€·
I followed the first youtube video I found man idk
What's wrong with the dimensions
got it working! tysm
it really should be 71 95 as that's what vanilla uses
Is there a 1px border of transparent pixels around the joker
I copied the dimensions straight from the sprite sheet
dont know what did i do wrong but the pack is not showing the non-mod cards
What am i doing wrong?? trying to have a joker that's ceremonial dagger but it adds 2 to Xmult everytime it destroys a joker, the Joker dissolves, the message shows the correct number but it doesnt actually apply the Xmult!
Idk why it wouldn't be working
Maybe take the addition out of the function?
For some reason?
the function is returning card.ability.extra.Xmult, but your loc vars etc is using card.ability.extra.xmult
chat died
My mod is still failing to find the picture for my joker
Even though I have everything right
Seemingly
Hey all, I'm trying to make rigged probabilities but it's crashing every time I enter the shop. Anyone have any ideas on how I can help fix this?
local old_pseudorandom = pseudorandom
function pseudorandom(seed, min, max)
if #find_joker('j_mymod_Hakari') > 0 then
return 0
end
return old_pseudorandom(seed, min, max)
end
remove the beginning of the key
so key = "jammy_seven"
What does that do
The j_ is added automatically by SMOD iirc
I really do not understand why it's doing this
Should my atlas things be in my localization instead
the part where you write SMODS.Joker{}
So was it able to find the atlas before?
Yes
Do you have a git repo that you can compare what you changed with?
Don't think so
bumping this because im hoping to figure it out before bed đ trying to keep the streak of 5 jokers a day going
I was toying with localization trying to figure out how it works and then this issue started
Not too familiar with gamedev so a lot of this is pretty new to me
Sorry, I don't know :(
Deleted the little bit of localization I had and it still bricks
Weird
I only had like two things in there so it's not a big deal
For science
I guess I'll sleep on it
For anyone seeing this later here's my issue. Would love any thoughts as to why this is happening
i'm trying to make a joker that gives x4 mult if the played hand matches the last played hand, but the last played hand updates when you play the hand
e.g. i intend for pair after HC to give x1 mult, since pair and HC don't match, but the last played hand is updated before scoring, so it matches pair with itself to give x4
can someone help me to make calculation for this one?
oh yeah i forgot, i am new for modding so im still learning the basic and confused to make multieffect joker abilities
are you using talisman with xchips
yeah but i dont know how to code that thing
ok so
can you show me your current code
like. for your entire joker
wait
right so you need a calculate function
so in your context it should be
calculate = function(self, card, context)
if context.individual and context.cardarea == G.play then
return {
Xmult = card.ability.extra.Xmult,
Xchips = card.ability.extra.Xchips,
dollars = card.ability.extra.dollar
}
end
end
or something like that
SMODS.Joker {
key = "mint",
loc_txt = {
name = "Mint",
text = {
"{X:mult,C:white}X#1#{} Mult if",
"{C:attention}played hand{} is the same as {C:attention}last played hand{}",
"{C:inactive}(Currently {C:attention}#2#{}){}"
}
},
config = { extra = { xmult = 4, last_played = 'High Card' } },
rarity = 3,
atlas = "Jokers",
blueprint_compat = true,
pos = { x = 4, y = 2 },
cost = 7,
loc_vars = function(self, info_queue, card)
return { vars = { card.ability.extra.xmult, card.ability.extra.last_played } }
end,
calculate = function(self, card, context)
if context.joker_main and next(context.poker_hands[card.ability.extra.last_played]) then
return {
xmult = card.ability.extra.xmult
}
end
card.ability.extra.last_played = G.GAME.last_hand_played
end
}
the display is working properly, but it still gives x4 mult regardless
oh yeah im trying this one and it worked but the Xchips didnt, any help?
i honestly don't know
i don't use xchips
ahh okay tysm man
@dire marlin you can find documentation on how to return xchips in the steammodded wiki
Iirc
Does anyone have any documentation on the different phases of scoring a regular hand? I'm trying to implement a rather intrusive change to scoring for a joker, and I need to touch a lot of little things, so knowing how scoring works in detail from start to finish would be very useful.
can u send me the link, i cant find it anywhere
Hello
What are you looking for ?
Return{
xchips=your value}
If for xchips
This is the page I was thinking about, but it doesn't mention xchips
https://github.com/Steamodded/smods/wiki/Calculate-Functions
Its xchips =đđ
if context.individual and context.cardarea == G.play then
return {
Xchips = 3,
Xmult = card.ability.extra.Xmult,
dollars = card.ability.extra.dollar
}
end
end```
like that?
oh okay lemme try
Np ;)
How do I say in description that Lucky cards' scoring effect (1 in 5 for +20 mult and 1 in 15 for $20) will also trigger when held in hand, with no ambiguity?
I'd imagine it'd start with "Lucky cards held in hand ..."
Lucky cards will trigger if scored or held in hand
Did you do this by taking ownership ?
I'm going to.
It's still in planning step.
I'm mostly afraid if this is going to mess up other mods' ownership on lucky enhancement.
(Will definitely happen)
Wait.
I forgot I can just... have the joker give the mult and money instead.
Thats
Better
And will 100% work
You can change message display to trick them i to thinking it was the card triggering
One problem
(Wonât work with mime or red seals )
hi, does anyone know why my repetition doesn't work? I'm pretty new to modding and I'm not sure where I'm going wrong since I'm using the sock and musket as reference in the vanilla remade mod. I know that the .seal == "gold" thing works sice i've used it for other code so I'm not sure what I'm missing
Yes.
You typo'ed context.repitition.
That doesnât helpđ
....sounds about right. Okay thank you lol
Typo :>
Well, you just need to keep in mind that repetition comes from the word repeat.
Trying to figure out how I can make a function that converts from three of a kind to four of a kind.
How exactly
kinda like four fingers except if you have the joker it would try to convert your three of a kind into a four of a kind.
So it would duplicate one of the cards?
Well not really but actually the joker would count as part of the kind of card you chose for a 3 of a kind.
dont know what did i do wrong but the pack is not showing the non-mod cards
hopfully someone will answer this time
like if you have three of a kind the joker itself would counted as a playing card and rank you choose for the thre of a kind.
@daring fern can u help?
You can change the 3 of a kind behavior to count as 4 of a kind when add to deck
but
Idk how
LOL
You sure your keys are correct
I think the first letter of each is uppercase
Oh
Are you sure your keys are correct ? Did you checked the gameâs code
yeah, i copy pasted from game code
All the keys should be lowercase.
did that too
now what...
??
Accept defeat
...
i should
Here's what I'd thought I can get it to work.
but overall I was thinking like maybe when you are abotu to play the three of a kind
it switches to four of a kind.
and of course makes the joker to be counted as the said playing card
I made this to change the sprite of a seal if you have joker. would it work? lua if G.GAME and G.jokers and #G.jokers.cards > 0 then for key,playing_card in ipairs(G.jokers.cards) do if playing_card.config.center.key == "j_joker" then card.config.center.pos = { x = 1 , y = 0 } break else card.config.center.pos = { x = 0 , y = 0 } end end end
thats placed inside the calculate part of the seal
i would test it myself but my game isnt doing the seal's code for some reason
local jleft, jright
if card.area and card.area == G.jokers then
for i = 1, #G.jokers.cards do
if G.jokers.cards[i] == card then
jleft = G.jokers.cards[i - 1]
jright = G.jokers.cards[i + 1]
end
end
end
local left_cost = (jleft and jleft.sell_cost) or 0
local right_cost = (jright and jright.sell_cost) or 0
card.ability.extra.dollars = math.ceil((left_cost + right_cost) / 2)
this code is intended for a joker to give $ equal to the avg sell value of the jokers left and right of it. if i put four of this joker in my slots (sell value $3), it returns 0, 3, 3, 0, but it should return 2, 3, 3, 2
how do i change the png title to my own?
does anyone know how i can fix this? i added a event thingy but now it doesnt show at all after the round ends
turns out... it's actually hard coded with the actual game
is there a way to recreate this?
i wanna make a joker that adds seals on played cards
how do i go about that
I think thereâs a seal_poll
Or Pool
Forgot
Nope
Its poll_seal
i see
SMODS.poll_seal({ guaranteed = true, type_key = '' })
Key can be anything
This adds a random seal
I think you can set seal for cards right?
SMODS.poll_seal({ guaranteed = true, type_key = '' })
Idk if this would work
hmm will try it
oh
New_card:set_seal(card.ability.extra.seal, nil, true)
new card??
i see
Change the card.ability.extra.seal
To this
For random seal
Should theoretically work
Or have a seal key in config if you want a specific one
[I recommend doing all of this in an event ]
ok
why's this partner not working?
Add print
ok
Are you sure thats how partner work (i mean idk never done one )
idk tbh
ill go check
doesnt print anything
what does the secondary colour of a consumable type change?
@snow vale
dw i fixed it
No idea
can you try to trick the game to think it's a four of a kind? or not?
how to make the calculate context for this?
You definitely can
how is that?
Check cryptid coding
@dire marlin
Use https://github.com/nh6574/VanillaRemade/blob/fbfeb4d2e14111c9c47706f71cc25c7b50e021c9/src/jokers.lua#L2614 for lucky card trigger context and
https://github.com/nh6574/VanillaRemade/blob/fbfeb4d2e14111c9c47706f71cc25c7b50e021c9/src/jokers.lua#L3259 for triggers
Use
WHILE for repetition
-- your return
end```
now which joker does that?
Do you have cryptid installed ?
Just look around thereâs 150+ jokers and more stuff , could be a pain to find it tbh
I'm actually looking for the code itself in lua
no I have not installed onto balatro mod
Tell me if you figured it out
am I playing myself for some mind games?
just kidding. Just I don't even know where I can find it but I'm looking
the joker is "lucky joker" if you are still looking for it
^
didnt he want to make it stop retriggering when the card triggered?
Thats not the guy asking đ
oh
I gave him the solution donât worry :)
lmao
I actually meant that changed the poker hand
but now I found out about the ://Exploit
Start materializing at context.end_of_round
Are you sure main eval is correct?
im still can't figure it out
Chat remind me to make a tutorial on the 4th
the entire for this joker?
SMODS.Atlas{
key = "mining",
path = 'mining.png',
px = 71,
py = 95
}
SMODS.Joker{
key = 'mining',
loc_txt = {
name = 'Gambilng Addict',
text = {
'{C:attention}Retrigger{} lucky card until',
'lucky card ability is triggered',
'{C:inactive}``99% gambler quit before big win``{}'
}
},
atlas = 'mining',
pos = {x = 0, y = 0},
rarity = 3,
cost = 10,
config = { extra = { repetitions = 1 } },
calculate = function (self, card, context)
if context.individual and context.cardarea == G.play and context.other_card.lucky_trigger and not context.blueprint then
end
}```
sure
yeah i used it before
Can't find where cry_exploit_override is located
key = 'mining',
loc_txt = {
name = 'Gambilng Addict',
text = {
'{C:attention}Retrigger{} lucky card until',
'lucky card ability is triggered',
'{C:inactive}``99% gambler quit before big win``{}'
}
},
atlas = 'mining',
pos = {x = 0, y = 0},
rarity = 3,
cost = 10,
calculate = function (self, card, context)
if context.individual and context.repetition and context.cardarea==G.play then
While not context.other_card.lucky_trigger do
Return{repetition=1}
End
End
End
}```
ahh
This theoretically should work
lemme try
how the heck am I going to do this?
@formal parrot the joker worked
Good job
Hereâs a cookie đȘ
I did found the code where it messes the code but I have no idea how I can get it to work without having to crash
blushes
now to the next one
i want to trigger seal effects one more time
not the card, just seal effects
whether in hand, played or discarded
key = 'mining',
loc_txt = {
name = 'Gambilng Addict',
text = {
'{C:attention}Retrigger{} lucky card until',
'lucky card ability is triggered',
'{C:inactive}``99% gambler quit before big win``{}'
}
},
atlas = 'mining',
pos = {x = 0, y = 0},
rarity = 3,
cost = 10,
calculate = function (self, card, context)
if context.individual and context.repetition and context.cardarea == G.play and not context.blueprint then
while not context.other_card.lucky_trigger do
return {
repetion = 1
}
end
end
end```
still not working
u typed repetition wrong
heaven did I do this right?
@formal parrot
I don't know if what I'm doing is right
I did use the code from the ://Exploit but I don't know if it would work
i just fixed the typo but sadly still didnt work as we expected
Iâm not sure if this is the correct way to do it
Can you screenshot the code
You might need to ask somethingcom or ice
Iâm not sure how to do hand swa
Swap
yeah, cause I know that now Exploit is a code card for Cryptid yet I have not see any one joker that can like, change hand type
alright
I think ice is online right?
Exploit is a consumable no ?
Should be
alright might as well.
@hushed field do you happen to know how to make a joker to replace the hand type?
like
from Three of a Kind to FOur of a kind.
I'd hook the hand evaluation function
I haven't tried to do anything like that myself, though
I though he can edit the 4 of a kind to act like 3 of a kind
let me read up on the context, haha
He wants to make a joker that lets you play 4 of a kind with 3 of a kind
(I think 4 fingers joker in vanilla remade has something like this )
Ah, in that case, I'd find whatever function does the evaluation, and lovely patch a bool check in that that joker would set on add_to_deck
cause this is the idea where I got it from:
now how would that be?
Wait lemme check
let me check how the code handles that, and I can give you a more detailed idea of how I'd handle it, at least, haha
how do i retrigger a seal
The code that handles it is called from highlight_card in I think cardarea.lua, I was there earlier tonight
Repetitions on playing card retrigger seals
Not red seal tho
yeah, okay, there's a function called evaluate_poker_hand, which you'd want to patch into. The function that checks for xoak is called get_X_same. In this case, you could even just hook get_X_same and make it so that when the test is set to 4, it starts at 1 higher
thats not what i want, i want to retrigger seals every where, played,in hand or discarded
and red seals included
Youâll have to take ownership of them i think and edit the context
So... how do I trick it? I mean you can do something with the cards right? or how you can make the joker to count as a playing card.
of course I mysefl have tried to look into the source code again and apperently it was very hard coded
gonna think about it tomorrow,im getting tired and want to rest
wanted to like make a function like get_four_of_a_kind so that it would work.
see u all later
have you used lovely patches before, tarkan?
not really.
how does that work?
It allows you to insert code into the source code
Bye bye <3
Check the lovely GitHub
didn't I already have that?
it is
yeah, but it has an explanation of how the patches work on the page
Youâre missing an s
ohhhh
You might want to be get a little familiar with it
đ
So what I need to do is copy the source code from there and make a folder of patches where now you can just change the thing and then eventually get it to work with using [patches].
am I understanding this correctly?
Lovely patches are so interesting, I might wanna learn it when i have time i wanna add custom stuff
Actually I wanna learn that too now.
Si
You can find people using it in their mods
.toml
not entirely. You don't copy the source code. You find basically a unique line in the code, and decide whether your new code is placed before it, after it, or replaces it. It allows you to do a whole bunch of more complicated mechanics
tbh I need a tutorial about on how it works cause.
Reading the wiki explains the wiki
:P
@formal parrot
just realized this context wotn work because its after
where the heck is the wiki?
also I've statrted and yet I don't know exactly what I2m doing with this.
my brain is trying to process this.
what are you trying to do
connect a function up to when the game wants to draw cards to hand, i want to have my event happen before the actual cards get drawn to hand
@hushed field I think I might be starting and eventhough I'm new to this but I think thisi s what you meant by right?
you might want to create your own context for that then
gulp, is that hard?
in this case probably not
if you don't need it at a very specific place in the functiob
just hook to it
Iâm afraid the while didnât work
Add some prints
i think so
To find the issue
i just need to run a function before cards get drawn, when cards should get drawn
Print (â1â)before the while and print (â2â) inside
local ref = functionhere
function functionhere()
SMODS.calculate_context({context_name_here = true})
ref()
end
i forgot the name of the function regarding drawing cards to hand
but yeah adding custom contexts is as simple as this
if context.individual and context.repetition and context.cardarea == G.play and not context.blueprint then
Print (â1â) while not context.other_card.lucky_trigger do print (â2â)
return {
repetitions = 1
}
end
end
end``` like this?
Good luckđ
wait
Yeah , i think you need a comma at the end
oh my god I just fricking found it.
okay
HOLY
should i screenshot the crash log?
I looked in the github
further
and came across this
I don't know if this is what I'm looking for
but now I just need to figure out how do I even replace
so replace functionhere with whatever function regards to drawing cards
Preferably
is there any way to have my function run before drawing cards, and when its completed resume the og game hand draw
Shoutout to N
there's a new one that's before cards get drawn, what do you need it for?
Ooooh.
hii
drawing a card before others
Btw*
idk im not following the convo
searching the deck for cards that have enhancements and drawing those first
Is this code correct ?
try context.drawing_cards
how can i "pause" the actual drawing until my function finishes?
individual and repetition don't happen at the same time
Mmmm
well you see I'm trying to make a joker that actually replaces three of a kind to four of a kind if help with the joker cause I want the joker to act like a playing card
So i need to split it ?
that function is before the cards are drawn so you dont need to do that
To 2 ifs ?
unless you mess up the events
ok, 2 things, how can i draw a specific card to hand, and how can i refer to all cards in deck (so i can for loop check)
you would only need repetition but reading the effect I don't think it's possible to do without hooking the internal calculation functions
second is G.deck.cards
first idk there are mods with enhancements that do that
trying to make it so that when mult is added to my joker it pops up with the +mult effect (idk how to explain it properly but like when you refresh the shop with trading card) and i cant figure out how, can anyone help?
like it adds the mult i just want the visual indicator iykwim
wdym
Basically i wanna do repetitions on lucky cards until they trigger
can i search the games source code and see if theres a function similar to whats going on with "top card"
N, if you have a moment, how does the replacing for patches work for whole codes and everything?
it's probably one of the draw_cards functions
maybe even "top card" will serve my purpose?
like I want to replace the entirey of evaluate_poker_hand with new stuff
yeah i saw people trying to do that before, I think smoethingcom had an idea
@daring fern
promising?
Offline :<
oh wow i just butchered the name
like having to replace the three of a kind with a four of a kind with a spesific joker
My idea is using a while
you can't use a while because you can only return once
While not [context for lucky card triggers]
Really ?
why not a hook, dumb idea but yknow, maybe
What a shame
How exactly
yeah you need to hook SMODS.calculate_repetitions or something like that but no idea
when a lucky card gets scored, check if it got set off, if it didnt, do a repetition
Yeah but
How many times
If you want to replace the whole function then you wouldn't use a patch, but are you sure that's what you need to do?
Wait
@red flower draw_card(G.deck,G.hand, i*100/card_count,nil, nil , nil, 0.07) does this look promising?
i guess, don't know without testing it
Well that's what Ice brought up about cause I want to like modify the evaluate_poker_hand with a mod
1 time, because itll do the check again when getting scored
turned out id had it right the whole time i just wasnt testing it properly... sigh
to just have a function that can have a joker a spesific joker to replace a three of akind poker hand to a four of a kind.
so what should i do
Well, modifying the whole thing is not the same as modifying part of it
what exactly do you want to know
how do i make a joker act like gros michel but gives 120 chips instead of 15 mult?
I mean then how ca nyou make the joker to like, trick the game that three of a kind as a four of a kind?
or something like that?
key = 'mining',
loc_txt = {
name = 'Gambilng Addict',
text = {
'{C:attention}Retrigger{} lucky card until',
'lucky card ability is triggered',
'{C:inactive}``99% gambler quit before big win``{}'
}
},
atlas = 'mining',
pos = {x = 0, y = 0},
rarity = 3,
cost = 10,
calculate = function (self, card, context)
if context.played_hand and context.repetition and context.cardarea == G.play and not context.blueprint then
For _,v in inpairs(context.played_hand) do
If not v.lucky_trigger do
return {
repetion = 1
}
end
end
end```
Is this correct?
I THINK I AHVE IT
Yeah, cause I have 0 experience on how patches work.
from = G.deck
to = G.hand
percent = ??
dir = ???
sort = ???
card = for check card
it's context.full_hand but this will retrigger all cards once as long as you played any card that didn't trigger the lucky effect (even if it is not lucky)
3 arguments i gotta figure out what they do
I give up
(>_<)
yeah it's not a simple effect
honestly I kinda agree.
I mean Cryptid had pull something about replacing a hand type and yet I figure out how that actually works or functional
honestly there could be a context for that
how do i make a joker act like gros michel but gives 120 chips instead of 15 mult?
i will see if i can do it once i get back home later today
copy gros michel but return 120 chips instead of 15 mult
how do i check if a card has an enhancement again
any or a specific one
spec
so no answer for today? đ
SMODS.has_enhancement(card, "enhancement_key") for specific
next(SMODS.get_enhancements(card)) for checking if the card has any enhancement i think đ€
hopefully if hey can elaborate on how or where how it works.
SMODS.has_enhancement(card, "m_modprefix_key")
thank yoy
like I did try to use the code but somehow it's a code card
??
lets pray this works
that lucky card thing
or the poker hand
pitch, face up/down (i think), whether should automatically sort after drawn
oh, i already said you can't do it in calculate you need to hook one of the smods functions
i saw in the code they just call nil for everything so i just called nil for everything as well
ahh i see
definitely crashes
Now what about the evaluate pokerhand to trick the game into a differnt hand type.
Thank you!
evaluate_poker_hand returns the hand name, it might be as easy as replacing one for the other but idk
my dumbass forgor
any explanation how to do that?
you would also need to change card
i dont think it is
but
what would it be
oh maybe it is
raising my fist as i shout "god damn you smods"
damit
yeah i dont see it in the code
what is bro checking for đ
are you looking at the dump?
looking at source yeah
its in the wiki
in the lovely/dump?
im looking at the log it gave me, and looking in the source code at where the log tells me i did an oopsies
idk wtf is G.UIT.I, first time seeing that
with source you mean you extracted the .exe?
the smods wiki truly is a sacred place
yes
happy april fools!
look at the lovely/sump in your mods folder
sump
now im not correcting it
lmao
where would i check
not in there
?
the same place the crash log tells you
oh there we go
if it has the .txt its the dump
whats the function
eval_card
weird
am i not defining card correctly?
prob draw_card, everything there looks fine
:3 never used draw_card before, good luckkk
draw_card(G.deck, G.hand, i*100/#allnotifcards, 'up', true, G.deck.cards[i])
YES
nils work fine
now
Now exit the run and re-enter to check if it stays.
finding out theres a sort option
i can remake one of my older cards
that i didnt want to have sort
but first
this
main menu > continue and its still here
Good.
alr now to remake that one card
oh i also have to
i gotta make the chance effect too
but lemme fix the other card with my newfound power
true test
oh no, a bug
just realized its here too
i have to somehow edit the drawing of the cards to fill the space again
nice i fixed the old card
i have gained a newfound power
elaborate?
its always trying to draw 8 cards, i need to draw the beaming cards first then recheck how many spots it needs to fill
i also need to do my own checks as well
well if you return cards_to_draw = amount in that context it modifies the cards to draw
context.amount is the original amount it was about to draw
cards_to_draw is a global?
which hook
oh then you cant do what i said
sad
you would need to patch where the serpent is
you can maybe do something with ret there but idk
ok what if
i just straight up handle card drawing myself
is there a way to prevent cards from getting drawn from drawing_cards so i can do it myself
just patch lmao
patching is scary
it's easier than whatever youre suggesting
like, a mile away
it sounds scary
sob
its literally just:
- oh i want to patch into this file
- oh i want to patch before/at/after section of code
here's a patch i do for the serpent thing (i still need to change it to the new context)
https://github.com/nh6574/JoyousSpring/blob/bfe4f9bfc4d38135c652aeed94b0942ad0a1f736/lovely/effects.toml#L14
ok well yall are gonna have to give me a How to patch in a Balatro mod Walkthrough part 73
haha
what is sperpent again
...actually, if you are to draw those specific cards first, you need to hook CardArea:shuffle and perform said shuffling there to ensure that those cards end up on top of deck.
Or you could just force-draw those cards regardless, like I do with my Notification cards.
so with patching, will my card draw setup thing migrate to a patch or stay a hook
the only part of the payload you care about is the hand_space part
but its this card if you want to parse the effect
wait is this replcing the code? or?
(just wondering)
was this just adding?
thats adding code before the line if G.GAME.blind.name == 'The Serpent' and
position = 'at'
I'm still a bit confused about the new probability calc
if context.mod_probability then
context.numerator = context.numerator + 1
end
does this code add 1 to all probabilities
so how do i "start" a patch
i think you need to return numerator
wdym
no you just put it in the code and it does it
return numerator alone or inside a table
whats the [[patches]] and [patches.pattern
return { numerator = amount }
I see
if context.mod_probability then
return { numerator = context.numerator + 1 }
end
like this?
maybe? i havent used it yet
this is what oops does

alright I think I finally got something in pogress
since Oops uses the new context, how do additive probabilities work along side
ÂŻ_(ă)_/ÂŻ
use apostrophe ('), not backtick (`)
left to right i suppose
revolution to probability manipulation, damn
im still thinking about what to do with jokerdisplay
SMODS.get_probability_vars returns 2 values: numerator and denominator
SMODS.pseudorandom_probability grabs the 2 said values and returns pseudorandom(seed) < numerator/denominator
I'm gonna assume we use the first function to grab the values for loc_vars, and the second in calculate
gosh this is driving me nuts
afaik yes
yeah but the problem is , i have more objectives that isnt exactly when in a blind like getting 3 jokers in an ante or during a blind , so yeah , theres different objectives in different situations(example in ss)
amazing joker idea
I can't really tell the difference between additive and fixed probability
at least code-wise
600 chips seems easy
it probably scales
It scales with ante
do i do this in a separate file?
put your patches inside lovely.toml
or alternatively, any name with .toml extension inside lovely folder
so that's why it's formatted differently
honestly i have no idea
so what do i even patch
but there is a typo
@wintry solar
numberator is tough
first i gotta find out where to patch right
i already know i want to patch before
so what would be the spot i patch
the same spot i sent you?
that'll work?
what's pattern
lemme guess pattern is the search part
and payload is the replace
yes
the pattern is the one i sent
the payload shold be something similar to what you did in the context
but modify hand_space so that it doesnt draw extra cards
@red flower Good news I think I managed to get the ovely patches to work however I think somehow it's not activating the four of a kind.
trying to make a joker with a different mult effect depending on poker hand
and so im trying to make a way for the joker to reference which value corresponds to which poker hand
my idea was to create a meta-table of subtables in the joker's config which have the information i need (since i cant make a string as a config variable name) like this:
{'High Card', 1},
{'Pair', 2},
{'Two Pair', 4}
{'Three of a Kind', 6},
{'Straight', 8},
{'Flush', 7},
{'Full House', 10},
{'Four of a Kind', 12},
{'Straight Flush', 14},
{'Five of a Kind', 18},
{'Flush House', 22},
{'Flush Five', 26}
},```
but my problem now is if i get say a global variable with a specific poker hand (ex `example_hand = 'Three of a Kind'`) how would i tell things such as my `loc_vars` function which subtable to get the values it needs from?
theres probably a simple answer to this but i cant think of it
but i'm not checking for the serpent?
you want this to happen in the same function the serpent does
the serpent part doesnt matter thats just what the line says
this would probably be better so you can do mult_ref[handname]
mult_ref = {
['High Card'] = 1,
['Pair'] = 2
-- etc
}
so this will be
<code>
if G.GAME.blind.name == 'The Serpent' and
oooh i see
i think ive seen smth like that in the vanilla code
so i could just use mult_ref['Pair']?
it has to be called lovely.toml or be in a lovely folder
yes
oh right
neat, thank you
now i just replace payload, would it be similar to what im doing with the hook
this wouldnt work right
youre missing the manifest yeah
dont put the context there, just the loop
that guy is in the nubert facility discord too
anyway, now you can modify hand_space to do that
hand_space is global?
no, it's local to that function youre injecting into
wait, what exactly does hand space represent, how many cards to draw?
yes
oh, so basically is a global, just is local on the inside
treat it like a global
for that function only
quick followup, for a modded poker hand should i still use its name or key instead
modprefix_key
so your setup works, but as i said it lags/crashes my game whenever it tries to get used. did i set it up wrong?
so make hand_space equal to hand size - 1 for every beaming card in hand (ill make beaming overdraw fix later)
whats the hand size global again
no, you also need to take into account the cards already in hand
