#💻・modding-dev
1 messages · Page 591 of 1
lmfao
hijacked account lol
anyways
other boss disabling joker i know is yahimods mucho texto (if boss blind has more than two lines of text, its disabled)
mass confusion
didnt work, the jokers must be destroyed
ok you've misunderstood
context.debuff_card runs once on every individual card, and in fact context.debuff_card is a reference to each card. it acts similar to context.individual, only in this case there's no context.other_card because context.debuff_card is already a reference to the card
you need to switch your checks to check if context.debuff_card.config.center_key == "joker key" then, and then return { debuff = true } if the check passes
Yaihamice reference?
thats a whole new can of worms
i guess?
you need to check context.debuff_card and all the other stuff
I just saw "yahimod"
check that context.debuff_card exists before checking if context.debuff_card.config.center_key is anything
it didnt return anything, chicot disabled it before it could do anything
Balatro hates me lmao
lua hates me too lol
game logic hates me
code hates all
I'm trying to get the second suit using max but SOMEHOW, max(-5000,11,12,13) = 11
chicot be damned
@frosty rampart
Must be illogical overflow logic...?
You think?
context.debuff_card isn't calculated during context.setting_blind, it has to be separate
Any other explanations?
My shitty lua coding?
How you broke a max function even I can't figure!
and I'm arguably just as bad!
I prefer powershell ise
I'm the kinda person who'd get stuck making a psuedorandom function
I prefer scratch myself
boom
Istg if balatro is gonna continue taking the piss with my max function, I'm gonna mod minecraft instead
Nvm it's written in java
🥀
Like how Chicot's crossed out, like a "don't sell to" sign.
exactly
"you can't disable me if I disable you first!"
W h y a m I g e t t I n g f u c k I n g d I a m o n d s
you already switch to Minecraft?
Hang on, show us the code\
are u using math.max?
Yea
sometimes two idiots and a village of masters is better than one
???
Three idiots, including my computer
idk what is going on
My code says otherwise
show code
did someone attempt to hook the math.max function 🥀
yeah i would like to see the code as well
FYI, it's an abomination
It's a mess...
if you don't post the code we can't help you
casually debuffs chicot
just post it
just show it so that we can try to help
Give me a sec
I have a Joker that eats playing cards and spits them out when the Joker is sold or destroyed, but I have a problem
I'm using GUID to know which of these Jokers ate what card if there are multiple of it
It's working perfectly normally, HOWEVER, when you quit the game, and load it, all the eaten cards are forgotten, I'm assuming because the GUID changed
What do you think the easiest way to solve this would be? (The remove_from_deck function for reference)
if not (G.cs_stack and G.cs_stack.cards and #G.cs_stack.cards > 0) then
return
end
local owner = card.GUID or tostring(card)
local to_return = {}
for _, c in ipairs(G.cs_stack.cards) do
if c.cs_eaten_saved and c.stp_beast_owner == owner then
table.insert(to_return, c)
end
end
if #to_return == 0 then
return
end
for _, c in ipairs(to_return) do
c.cs_eaten_saved = nil
c.stp_beast_owner = nil
c.cs_eaten = nil
if c.area == G.cs_stack then
G.cs_stack:remove_card(c)
end
c:add_to_deck()
G.deck.config.card_limit = G.deck.config.card_limit + 1
table.insert(G.playing_cards, c)
playing_card_joker_effects({c})
if G.hand.cards[1] then
c.states.visible = nil
G.hand:emplace(c)
G.E_MANAGER:add_event(Event({
func = function()
c:start_materialize();
return true
end
}))
else
G.deck:emplace(c)
end
end
SMODS.calculate_effect({
message = 'Regurgitated',
colour = G.C.PURPLE
}, card)
end```
Ima just send the .lua file, its the joker with the key szymii
@lean urchin you should look this joker over too!
if cs_stack.cards contains Card objects
then i kinda see why it resets on load
it's generally not good practice to store cards to G
He will prob cringe lmao
at least afaik
Eh, they thought my joker design was 'literally perfect'
there, its just below the region comment
Where should I store them? I also heard it was bad to store them in abilities.extra
A THOUSAND LINES FOR ONE JOKER!?
Oh. I'm pretty sure you could've just done the joker by itself
unfortunately
theres not a good way to store cards directly as far as im aware
me?
I fix code in notepad! I'm either the last person to ask, or low on the list!
alr i guess i can paste ts in my vscode
You could send messages as files, you know
Thank you for the info, that's really unfortunate
@gusty compass the intent is to retrigger the most common suit, correct
Second most common suit
oh
SECOND most common
🥀
much harder
illiterate
@gusty compass here's my loose take on the same joker
well wouldnt that just look at the second suit in the table
Currently, just as good as yours!
scoring or all played
in the deck
in full deck
no effect
just skip it if there's a tie for second place
what is the area for the shop's main selling area with SMODS.create_card()?
I can't recall using the fuction before, but if I wanted a joker to have the ability to add a specific card in the shop, I assume this'd be it, right?
is there a way to sort suits by number of cards
Uh... welp. Killed another channel.
the area is G.shop_jokers but it's a bit more complicated than that because it doesn't add the shop UI
not in the api, you would need to code the logic yourself
is the table there?
cards in deck separated by suits
Well then, a table for the cards in deck, a function to count the suits, and then another function to sort the sums
the cards in the full deck are in G.playing_cards
there's no function for the other two things, it's 2 simple loops
if it doesnt work then i have a diff algorithm u may want to try
lemme try this first..
wait i just realized you can modify a table while looping thru it (to some extent) in lua
😭
...Tomato, what did you do.
the good news is that my algorithm looks a lot simpler than that
(context: yet to try it, Balatro didn't open for other reasons)
I clicked on it, it didn't open
you opened balatro and it didnt open?
are you sure you didnt single click the app?
Yeah, but it's unrelated to your joker
i didnt do anything 😭
gimme a sec...
line 172?
That's my cut of code. Your joker's right after.
hold on
missing } again
Yeah. It's not your fault
oh, I see, lol dsfnh sdfnsdkj
so, how would I accomplish this then?
Uh-oh. another one of "} by end, but not anywhere near end."
} by 172 is expected, but I put one there and now <eof> is expected there
What, szymii?
SMODS.Joker {
key = "pop_can",
blueprint_compat = true,
rarity = 2,
cost = 7,
pos = { x = 2, y = 1 },
config = { extra = { dollars = 4 } },
loc_vars = function(self, info_queue, card)
return { vars = { card.ability.extra.dollars } }
end,
calculate = function(self, card, context)
if context.individual and context.cardarea == G.play and context.other_card == context.scoring_hand[1] and context.other_card:is_suit("Diamonds") then
G.GAME.dollar_buffer = (G.GAME.dollar_buffer or 0) + card.ability.extra.dollars
return {
dollars = card.ability.extra.dollars,
func = function()
G.E_MANAGER:add_event(Event({
func = function()
G.GAME.dollar_buffer = 0
return true
end
}))
end
}
end
end,```
here's the code for that, if you'd like
(I named it Pop Can, since Pop Art...)
you can keep it, its yours
kk
😭 since u figured it out before i did it doesnt matter
but here
also the file is wack cuz i copied it into an empty file in my mod
this is what i came up with while u were tryna fix the issue lmao
That... might be simplier
yea at this point idrk
also
earlier i mentioned why does balatro crash when modded consumables have an edition
T, I'mma credit you in my mod, the best way I know how!
np
gg
Making you a Joker!
just credit me as ThunderEdge if you do
gg
do you have any mods installed that mess with how consumables are displayed or represented?
no as far as i can tell
yeah my balatro isnt crashing with my modded consumable types
yea idk what happens with my mod
since my spectral i made crashes once i click on it when it has negative
does your mod in any way mess with the functionality of shaders
whats the crash message when that happens
pretty sure its this
Saturn issue
do i disable it?
yeah
Nah it’s just an old broken Saturn build, I’m 95% sure there’s a fixed version somewhere
Say, does anyone know how to ban every OG joker?
It's for a challenge idea I have, trust
i would look at how the rare and uncommon tags do it
mmmmh, true, thank you, yeah, that could help I think
Apparently Corrupted DNA is broken...
(it was the only joker I had at the moment)
Here's just that joker
I think it's because of the -1,0,1 table and the D,H,S,C table
ok, so, this sadly doesn't appear to work dbnfksndbfkjsd
any idea what I messed up?
no crash is happening, but the card doesn't appear in shop
btw, for further reference, before I commented out the "add_booster" part, it WAS doing that part
What about for me?
the tables seemingly are busted (a number's needed in that spot, to my figuring)
yes the first argument is the table and the second the seed
seed should be a string
oh.
it gets converted into a number internally
that's why the error is there because you didn't pass a valid string to convert or a valid pseudoseed
ok, so, uhm, changed both these, and uhm... this is... progress
I have never seen something like this before lmao
it's like the slots were filled with Nothing instead of Something lol
things moved, but no selection is happening lol
can i see the code
oh wait you're setting it to invisible lmao
remove the visible false line
here it is
oh 😭 wonder why the uncommon tag has that in there lmao
because it does an animation where it sets it to visible later
ahhh i see
ok, it works now, thanks for ur help so far!
now just to make it spawn the right card lol, time to swap the uncommon joker out for a Fool card
ive patched immolate to work on macos if any of you guys would want it I can share the source
ill put it on github if people would use it
i patched all the opencl over to metal
im trying to get it to work with brainstorm so all the macos users of the world can auto reroll
is "context.remove_playing_cards" able to detect destruction due to hanged man or any external card destruction effects that maybe don't return remove or something?
yes as long as they call the appropriate context, hanged man does
define appropriate context, you mean so long as it returns { remove = true}?
If they don't use { remove = true } or SMODS.destroy_cards, they need to call the remove_playing_cards context manually
Hey, at least this looks cool.
Hm. My Corrupted DNA code does seem to change the value of cards, but not the suit. Also, it doubles cards twice.
loc_vars = function(self, info_queue, card) --defines variables to use in the UI. you can use #1# for example to show the chips variable
vars = {card.ability.extra.chips, card.ability.extra.mult, card.ability.extra.x_mult, card.ability.extra.dollars}
local action = G.GAME.current_round.ameliorates_octosquish
local actionMSG = ''
if action == 0 then
return {
actionMSG = '{C:inactive}Currently does nothing'
}
elseif action == 1 then
return {
actionMSG = '{C:inactive}Currently {C:chips}+#1# {C:inactive}Chips'
}
elseif action == 2 then
return {
actionMSG = '{C:inactive}Currently {C:mult}+#2# {C:inactive}Mult'
}
elseif action == 3 then
return {
actionMSG = '{C:inactive}Currently {X:mult, C:white}X#3# {C:inactive}Mult'
}
elseif action == 4 then
return {
actionMSG = '{C:inactive}Currently earns {C:money}$#4#'
}
end
main_end = {
n = G.UIT.T,
text = actionMSG
}
return {vars = {card.ability.extra.chips, card.ability.extra.mult, card.ability.extra.x_mult, card.ability.extra.dollars}, main_end, key = self.key }
end
Anyone able to make main_end show properly? RN It doesn't.
Hey everyone, does anybody know how can i make a joker or spectral card to replace the background music, bc when i try it, it only overlaps, and also i cant stop it from playing
Where is the mistake here that's leading to local card = nil?
just making sure, but if i want to implement emult i need some sort of addon right?
How in the world am I getting repetitions? This is DNA, not Hanging Chad!
ok, so, random tarot worked, but trying to make it specifically call for a Fool card failed lol dnfksdn
😭 I'm tired and wanna go to beddddddd gah
Hey, railgun
hi
Mind if I ask for some help?
uhm, sure but idk if I can be much help lol sfdsf
Well, it shouldn't need much lol sfdsf
It's about a joker of mine. It's supposed to be like an altered version of DNA, which incorrectly copies the first card of a hand. The current issue is two-fold: it's running a repetition check when it shouldn't, and the cards aren't updating to their actual values.
Would you like code to fine-tune it?
hmmmm, interesting
I don't get what's happening in the code tbh lol, assuming this is the same one lol
I don't know why it'd be retriggering sadly :<
I'm not sure if this is my lack of knowledge, tiredness, or a combo of both lol sdnhfsdj
I could link to a page called VanillaRemade which should include the original DNA code if that'd help, but u may've already been in there idk dnfskjndks
Do you know anyone on who might know of a fix?
hmm, there's a couple people I know which may know how they'd fix something like this, but I am tired rn lol dfnskdf I can't think tbh sdnfkjsdn
if I were you, I'd recommend coming back to this tommorow perhaps? Assuming ur on around the same timezone as me, which could be quite false, it is quite late rn lol
if you are at the same timezone around-so, then it might do good to have a "fresh mind" so to speak, also, maybe more peo- sorry I'm so tired I can't even finish this thought I don't know what half this message even says 😭
Mine's New York time, so yeah.
shpuld probably give up for the night
No, you need to check for context.individual
By what part?
In the if
ah.
so the if line should look like
if context.individual and context.scoring_hand[1] and not context.blueprint then
Uh. It didn't copy
like above?
Well, now the game just up and closes upon playing a single card.
Nevermind. Pardon me for my prior anger
Now, I still have to fix cards taking on the wrong skin.
chat how does stickers work in SMODS.create_card
p sure its a table of keys
like {rental = true, perishable = true} or like {rental, eternal, perishable}
well you want quotes around the keys, but yea the second one
So V is the object color version of C where you use colors directly, is there a "V" version of X?
In localisation?
B
is there a mod that can reroll boosters/vouchers that isnt cryptid
i need one to check out the code
How would one go about making a certain tag unable to be duplicated by double tags without patching double tags? Is it even possible to do this?
im not sure i understand fully, but could i use context.mod_probability and context.identifier to make a joker that only affects certain enhancements?
taking ownership of double tags :)
if you mean affecting the probability of e.g. only a glass card breaking, then yes
😭 so no matter what i have to mess with vanilla double tag
and any other mod with a tag that has a similar effect
man
yea unfortunately
i think so at least, i'm only looking at vanillaremade rn but i'll go dig into the actual vanilla code
ok yea VR is very accurate to the actual code
essentially all double tag does is call add_tag(insert tag here)
are there any examples for how to use context.identifier? i know nothing though i assume the key (like m_glass) is used somewhere
yea and add_tag doesn't get any info about the context or its source or whatever
No, you could hook Tag:apply_to_run and check if _context.type == 'tag_add' and _context.tag.key == 'tag_modprefix_key' and make it so that add_tag does nothing if the key is the tag you want to prevent from double tags.
i believe i wrote something related to glass card probabilities recently, lemme dig up the code
this makes both lucky card rolls always succeed, and glass card rolls always fail. it's using fix_probability instead of mod_probability because i want to forcibly set it to 0 or the max even despite oops all 6s or any other additive probability modifiers or whatever
to find out what a particular identifier is, do this in your joker's code
if context.mod_probability then
print(context.identifier)
end
and then go in-game and make the probability roll you want to modify happen; if you have debugplus it'll pop up in the bottom left corner, if you don't it'll print in the black log window that pops up when you boot the game with mods
you don't want to set it to "mult", you want to set it to G.C.MULT
I meant G.C.MULT
Nvm it works
thx
can anyone explain how to add custom deck skins using steamodded? ive looked at the api documentation pages but it looks like a different language (i am not a programmer)
Alright. Some mod pin this quickly drawn sample skin.
i'm still not sure what i'm doing wrong but thanks for the help
i keep getting this error and im not sure what to do with it
ive never done any form of programming so im not sure what an atlas even is
we cant help without seein the code
what would be the best way to send that ._.
Yo how do yall make something happen when a certain joker is clicked on (such as that joker being destroyed)
youd have to make a lovely patch to call a context on click
or a hook
https://github.com/Yahiamice/yahimod-balatro does this for el wiwi i think
Hook Card:click and check self.config.center.key
wicked card
Sorry im actually a bit confused on the self.config.center.key part how do i check that?
if self.config.center.key == 'j_modprefix_key'
what is wrong with this code?
Its not doing anything
you never loc_vars them
and why you writte the text like that?
idk
do you mean I shouldnt or that i dont
you should
k
The played hands should be 1 not 0
context.game_over isnt calculated so its nil and not false
just the context.end of round should be sufficient tbh
really it should go in calc dollar bonus
K
No, it is calculated and it is false if the game is not over.
huh
The issue is that that’s not how you check a value is false in lua
Should be not context.game_over
It is true when you have lost the blind
Ah gotcha
So I'm making a joker and I want them to increase in Xmult until they reach X5 and then stop and just retrigger the Xmult but every way I've tried to configure it it won't show multiple triggers of the joker for the different instances of X5 which is what I'd like. Also yes I know the coding is terrible, I'm self taught and frankensteining a lot of other code from mods I've played, sorry if it's unreadable. (Will gladly take suggestions for how to have better coding punctuation though).
How can I create a specific card from a rank, suit, edition, seal and enhancement?
SMODS.add_card({set = "Base", rank = 'modprefix_key', suit = 'modprefix_key', edition = 'e_modprefix_key', seal = 'modprefix_key', enhancement = 'm_modprefix_key'})
Thank you!
return {
xmult = card.ability.extra.xmult,
extra = {
message = "Go again!",
colour = G.C.MULT,
extra = {
xmult = card.ability.extra.xmult
}
}
}
Oh I didn’t know that the messages when under the effects themselves thanks
SMODS.add_card is creating a card with random suit and rank for me, the edition/seal/enhancement are correct, it's just the rank and suit that's incorrect, despite the print writing the correct rank and suit in the console:
set = "Base",
rank = snap.id,
suit = snap.suit,
edition = snap.edition,
seal = snap.seal,
enhancement = snap.enhancement
})```
This is where I get the snap from:
```function _G.STP.pack_playing_card(c)
print(c:get_id())
print(c.base.suit)
return {
id = c:get_id(),
suit = c.base.suit,
enhancement = (c.config and c.config.center and c.config.center.key) or 'c_base',
seal = c.seal or nil,
edition = c.edition and copy_table(c.edition) or nil
}
end```
rank should be the rank key, not the id
Also edition should be c.edition and c.edition.key or nil
It does the same when I try c.rank
The edition worked this way too. And the prints give the correct id and suit (e.g.: 12 for a Queen)
No, the rank key is not the id.
Also you should still do c.edition and c.edition.key or nil for the edition.
Okay, changed the edition
But I don't get how ranks work, shouldn't Queen be id 12 and rank 12?
The rank key for Queen would be "Queen"
It's located at card.base.value
Thank you so much, it's working now!
Somehow it also solved the suit issue
for some further info, back before I had commented out the booster, that part DID work
oh, and this time an actual crash is happening, not just a failure to take effect
c_fool?
Nah
how do i make a global variable
voodoo
variable = value
is that literally it
Yes.
+1 permanent joker slot whenever "j_modprefix_key" is added to your joker deck.
how do i write this?
i mean the context part
the whenever part
Hook Card:add_to_deck
since there isnt a universal context for obtaining jokers
vanillaremade has a very similar hook on the same function in here https://github.com/nh6574/VanillaRemade/wiki#whats-a-hook
local card_add_to_deck_ref = Card.add_to_deck
function Card:add_to_deck(from_debuff)
local ret = card_add_to_deck_ref(self, from_debuff)
end
if next(SMODS.find_mod("j_star_astro")) and
self.ability.set == "Joker" then
return ret
end
if ret then
G.jokers.config.card_limit = lenient_bignum(
G.jokers.config.card_limit + math.min(card.ability.extra.jokerslot, card.ability.immutable.slotlimit))
end```
I haven't tested it yet, just need someone to tell me if i'm doing something wrong.
use G.jokers:change_size(amount)
also card doesnt exist here
youre also using find_mod on a joker, and returning before the actual slot increase
how about this?```lua
if next(SMODS.find_mod("j_star_astro")) then
G.jokers.change_size(math.min(card.ability.extra.jokerslot, card.ability.immutable.slotlimit))
end
this still has the latter three issues
and also do if self.config.center.key == "j_star_astro"
this works with crossmod jokers?
wdym
No, there is, context.card_added
oh
this is for my mod, i'm making busted buffoons astro give +1 permanent joker slot each time a starspace astro is obtained
what question?
you need me to be clearer?
if context.card_added and context.card.config.center.key == "j_modprefix_key" then
G.jokers:change_size((-G.jokers.config.card_limit)+math.min(G.jokers.config.card_limit+card.ability.extra.jokerslot, card.ability.immutable.slotlimit))
end
Yoyo! I'm trying to get a context for when you sell a tarot card, but I can't seem to get it to work correctly
My approach was to use
if context.selling_card and not context.blueprint and context.consumeable.ability.set == "Tarot" then```
but it seems to crash every time i try it. I'm guessing i'm doing something wrong
Any help would be greatly appreciated!
(i'll go get the log)
This is the crash report
It's context.card not context.consumeable
Oh! So, i remove the context.consumeable.ability.set == "Tarot" and replace it with something else?
No, you replace context.consumeable with context.card
Ohhhhhh
I'm unsure on how it didn't work before but, allow me to see if this functions correctly now!
It works! Thank you so much!
If I may ask, how did you know it was context.card instead of consumeable? I've been struggling to find resources for the mods and been mostly using the smods wiki
Ah, makes sense
So it was looking for a card, but it was being given a consumeable, which caused the crash. Is that what I'm getting?
no, the problem is that the only valid fields in that context are selling_card, card and cardarea. any others are nil*
*with some small exceptions like blueprint
oOooooo
Okay this just opened my mind that makes a lot more sense
though finding contexts is still a bit difficult, thank you so much!
i love undocumented features
maybe this helps?
https://github.com/nh6574/VanillaRemade/wiki#whats-a-context
theres also this https://github.com/Steamodded/smods/blob/0df6645af07302bdd3c9b0e845399f713ece724b/lsp_def/utils.lua#L7-L113, it has most contexts but its a bit hard to read due to being meant for an lsp rather than documentation
this looks very useful actually!
OH i already got that one, that's how i was able to make most of the joker by itself lol
Can someone help me understand why this isn't working or if there is a better solution?
I try to increase the chips of the hand level of the hand being played
local hand_name = string.gsub(context.scoring_name, " ", "_") G.GAME.hands[hand_name].chips = G.GAME.hands[hand_name].chips + card.ability.extra.chips
idk why you are replacing spaces with _
the key has spaces
this should work if you change that but it will reset after level up, it requires some extra code
oh
how would i do that?
dunno
alr
where can i see all the game variables available to me?
ty i will look into that
Hello, I'm new to Balatro modding and Im trying to create some simple jokers based of MTG cards (cause I dont know how to draw) and Im kinda going mental. I am trying to create a Joker that at end of round creates a planet card for a random hand played this round, and Im trying to use a table to record the hands played to then randomly select one. However the variable I am creating as a table is always nil when I try to access it. Does anyone know why or what I might have done wrong. I can send the code if it's easier
if you're just making a local variable, it doesn't carry over to surrounding scopes and just gets lost when exiting the function
beyond that, you also need the variable to survive the game being reloaded, which leaves two choices
you can either create the table in card.ability, which will make it specific to that card, or somewhere in G.GAME, in which case it'll be shared between all instances
both approaches are mostly identical but will vary when obtaining your joker in the middle of a round
this what Im already trying to do:
config = {
extra = {
hands_table = {}
}
},
how are you using it then
May I send the calculate code?
please do
calculate = function(self, card, context)
if context.joker_main and not context.blueprint then
if not card.ability.extra.hands_table then
card.ability.extra.hands_table = {}
end
card.ability.extra.hands_table[#card.ability.extra.hands_table] = context.scoring_name
print("Added Hand: " .. card.ability.extra.hands_table[#card.ability.extra.hands_table])
end
if context.end_of_round and context.cardarea == G.jokers then
if G.consumeables.config.card_count < G.consumeables.config.card_limit then
for k, v in pairs(card.ability.extra.hands_table) do
print(k, v)
end
local rnd = math.random(#card.ability.extra.hands_table)
local rand_hand = card.ability.extra.hands_table[rnd]
print("Rnd index = " .. rnd)
--local planet = Get_hand_planet(rand_hand)
return {
-- message = localize('Found ' .. planet.name),
message = "Created planet!",
}
end
end
end
the if not var then var = {} was already desperation
how so?
you use the length of the table as your index
for 0-indexed arrays, that would be the first free index
but with 1-indexed arrays it's merely the last element that already exists
or, in case of an empty table, you're assiging at index 0
which doesn't belong to the array part of the table
so I need to add +1?
yep
Ok Im gonna test it
on another note, this is bad and won't work as expected with game seeds
you should instead do local rand_hand = pseudorandom_element(card.ability.extra.hands_table, "some_seed_string_of_your_choosing")
thank you
can the seed be the game seed?
it should just be some unique string you choose
the game will factor in the game seed behind the scenes
ah ok, thanks :)
for actually creating the planet card, you can look at blue seal's effect in Card:get_end_of_round_effect
and don't forget to reset the table at the end
I had forgotten but when testing realised it :P
thanks I might, I've been using paperback's code as reference but I just dont understand some things there
It's working :D Thank you!
thank you, this worked dbnfsdhbfj forgot I needed to have the prefix... I should really learn what prefixes are what so I have the info for future lol
is there a documentation for gradient
found this problem. am i stupid again?
neither x_chips, xchips and x_mult work
it's in an edition
I just updated Steammodded and now I get the following error whenever the debuff_card function is called:
attempt to index local flags (a nil value)
it says the error occurs here in steammodded:
local debuff_card = Blind.debuff_card
function Blind:debuff_card(card, from_blind)
local flags = SMODS.calculate_context({ debuff_card = card, ignore_debuff = true })
if flags.prevent_debuff then
if card.debuff then card:set_debuff(false) end
return
elseif flags.debuff then
if not card.debuff then card:set_debuff(true) end
return
end
debuff_card(self, card, from_blind)
end
idk what to do
it feels weird because it seems like steammodded crashes when referencing one of its own functions
Do you have x_chips in the config?
PRegalia.config_tab = function()
return {
n = G.UIT.ROOT,
config = { align = "m", r = 0.1, minw = 7, minh = 5, padding = 0.1, colour = G.C.BLACK},
nodes = {
{ n = G.UIT.R, config = { align = "cl", padding = 0, minh = 0.1 }, nodes = {}},
{ n = G.UIT.R, config = {align = "cl", padding =0},
nodes = { create_toggle { col = true, label = "", scale = 1, w = 0, shadow = true, ref_table = PRegalia_config, ref_value = "pip_menu" },
}
},
{ n = G.UIT.C, config = { align = "c", padding = 0 },
nodes = {
{ n = G.UIT.T, config = { text = "Custom Menu", scale = 0.45, colour = G.C.UI.TEXT_LIGHT } },
}
},
}
}
end
So uh, tried doing the Config and while it works it's, well broken, not totally sure what i've done wrong so if i could have some help please '^^
you just made me realize how stupid am i (i had that in the config.extra)
i think you'd need to put them into the row node
Isnt it xmult
Ah well idk
So like this right ?
PRegalia.config_tab = function()
return {
n = G.UIT.ROOT,
config = { align = "m", r = 0.1, minw = 7, minh = 5, padding = 0.1, colour = G.C.BLACK},
nodes = {
{ n = G.UIT.R, config = { align = "cl", padding = 0, minh = 0.1 }, nodes = {
{ n = G.UIT.R, config = {align = "cl", padding =0},
nodes = { create_toggle { col = true, label = "", scale = 1, w = 0, shadow = true, ref_table = PRegalia_config, ref_value = "pip_menu" },
}
},
{ n = G.UIT.C, config = { align = "c", padding = 0 },
nodes = {
{ n = G.UIT.T, config = { text = "Custom Menu", scale = 0.45, colour = G.C.UI.TEXT_LIGHT } },
}
},
}
},
}
}
end ```
that looks correct
Thanks i will give it a try 👍
I think I'm just going to do the only reasonable thing and keep playing with an old version of steammodded and just copy-pasting functions from the current steammodded when needed
I'm a genius
yeah it was that, kinda wish i could set it in the absolute middle but that'll do at least, thanks
does anyone know if its possible to change the text on tooltips dynamically?
i wanna change that 2 to a 1 but i dont wanna mess around with the center's config (card.config.center.config.planets = 1), because that'll just make it be 1 for all future cards
why does G.UIT.C fail
can u do that for default cards?
eugh, okay
and override the loc_vars
You would change the value on that card.
card.ability.consumeable.planets = 1 but that doesn't change the text :/
put a G.UIT.R around G.UIT.T and multiline if it didnt have it already
i mean it does but only after i use it and get another card
that's not rlly what i want
ill see what i can do
💔
whats the code
add a bracket here
its supposed to be a table of nodes, not just one node lol
is it possible to make it so a specific joker cant be duplicated by ankh/invisible joker/ anything else that creates a copy of a joker?
Someone using my mod is getting "A bad lovely patch has resulted in this crash."
They're trying to mod it on Steam Deck, does anyone know if there's a compatibility issue there? Other mods are working they say
They claim to be using latest lovely, latest Steammodded too
where are these texts rendered?
the screen :3
generate_card_ui makes it, or do you mean something else
Specifically next to/under/above the joker
how do you mute the dissolve sound effect in SMODS.destroy_cards?
Wait does the above orientation exist or am I tripping
no
they meant how to make the text stylized
i already answered in #⚙・modding-general though lol
Hi besties
hi dilly- what is that pfp
oh yeah true
Ill be back to normal in November until December hits then I must become Christmas dilly
probably want to do smt to stop the sound from playing here
and in Card:shatter too
oh
so start_dissolve can do silent
but SMODS.destroy_cards cant despite using the exact same function with no changes
cool
silent in question doesnt actually work for the sound in self.skip_destroy_animation specifically lmao
whoever added that probably forgot about it
:pensive
yeah SMODS.localize_box only takes a table of strings
you want to put the entire thing, like
{
"idk",
"stuff"
}
i think
ohhhhh wait
its more than that lmao
my bad 😭
it takes a table of parsed strings
like, if you print something from G.localization.descriptions you will notice that it has a text_parsed table
alright
so u want to pass the text_parsed table in SMODS.localize_box, if you already have your text in G.localization.descriptions then just grab it from there directly
same crash 🥀
can u check if the text_parsed table exists
huh
weird
gimme a sec
oh i see
gotta iterate through the table too 😭
but yeah afterwards it should give u a table of nodes
its 12:37 am rn so i gotta go sleep, i hope u can figure it out, sorry 😭
its 1:37 am here
another instance of not showing the full error and thus not getting full help
i guess the stack traceback could be useful
im gonna try using loc_parse_string
oh nvm i see where i fucked up
awesome
Sorry i was gone for the day, is this what im meant to do?
hey so i'm wanting to make a lovely only mod (language thing) and i put my stuff in ModName/resources but it's not loading? would i be right in assuming that SMODS is the thing that does that and not lovely
or am i just dumb andthat's not how that works
lovely only loads patches from either a lovely folder or a lovely.toml file
love.graphics.newFont oh wait god damn it i probably need to use nfs
this ooc
how do you exclude a card from appearing in a pack?
info_queue[#info_queue + 1] = G.P_CENTERS.e_negative
how to make this show the hand size description instead the joker slot description?
add a check for the card generation source in in_pool (args.source being the key_append from the original create_card call)
info_queue[#info_queue + 1] = { set = "Edition", key = "e_negative_playing_card", config = G.P_CENTERS.e_negative.config }
thx
im not entirely sure if that config works but it should
thanks :D
do keep in mind that that only works for excluding specific packs and not packs in general
though usually packs of the same kind use the same key_append
oh ya das fine
i just need to exclude a Joker from Buffoon Packs
is this alright? i won't be able to test if this works easily
its ability is X2 Mult, expensive and i don't want it to appear in packs, as that negates the expensive downside
this should work tyeah
sick :3
me when
in_pool = function() return false end
that looks pretty
-# Overlay layer mode go brr.
Same with such.
-# I need to re-do Iron and Tin cards... those look too similiar... and I've been hella working on JokerDisplay compat.
cofh
Quite, actually.
Smods needs to add something that sees the most used consumable (in the run), because I wanted to make a telescope but for tarot but I can't
Does anyone know how to do something like this?
Lovely patch or hook whenever a tarot is used to add one to a counter in a table in G.GAME
Then when you find it use pairs to loop through that table and get the highest number
SMODS.current_mod.reset_game_globals = function(run_start)
if run_start then G.GAME.tarot_usage = {} end
end
SMODS.current_mod.calculate = function(self, context)
if context.using_consumeable and context.consumeable.ability.set == "Tarot" then
G.GAME.tarot_usage[context.consumeable.config.center.key] = (G.GAME.tarot_usage[context.consumeable.config.center.key] or 0) + 1
end
end
shouldnt need any hooks i think
i forgot about modcalc
mod calc my beloved
the AllCalcy
why this atlas not working
SMODS.Atlas{
key="leaf_hc",
px=923,
py=95,
path="hc_leaf_suit.png",
}
SMODS.Atlas{
key="leaf_ui",
px=18,
py=17,
path="Leaf Suit_icon.png",
}
SMODS.Suit{
key="Leaf",
card_key="Leaf",
hc_atlas="leaf_hc",
lc_atlas="leaf_hc",
hc_ui_atlas="leaf_ui",
lc_ui_atlas="leaf_ui",
hc_colour=HEX("fbffd1"),
lc_colour=HEX("fbffd1"),
in_pool = function ()
return false
end,
pos={y=1,x=0,},
ui_pos={x=0,y=0,},
}
is there a list of allowed types since variable doesn't work but putting in keyword or misc just didnt appear with anything no crash no error nothing
should be variable
variable returned with ERROR
try type text
im on mobile
Should be in a table i think
like {‘+#1# Discards’}
also should be in v_dictionary
okay... ill try
try type text
v_dictionary?
instead of dictionary
and do i need to change k_gros_discard to something to like gros_discard or v_gros_discard
no
having problems with my game crashing when i play cards
Update Talisman.
mods used:
Brainstorm
CardSleeves-main
DebugPlus-master
DebugPlusPlus-master
ExtraCredit-main
Galdur-master
HandyBalatro-main
Incantation
JenLib
JokerDisplay-main
lovely
smods
Talisman-main
VanillaRedux-main
thx vro
no, dictionary is only single strings
Idk it worked
I can send you the source and you can tell me if there is a better way but give me a moment
hey yall, just a quick question,
how do you make a contextcheck for beating a blind in one hand
@slim ferry
if context.end_of_round and G.GAME.current_round.hands_played == 1 then
what am i meant to be looking at
well it worked idk
bedankt tweeling
np twin
Does anyone know why this error may occur? It's working for me perfectly, and it's someone else who's getting this error with the same lovely and Steammodded version:
for the life of me i cannot figure out how to make this effect only apply on itself and not every card held in hand
nice btw have you played megabonk?
did you unlock calcium?
yeah
cinema
@slim ferry do you not know why that LOC_COLOURS error I sent may happen for someone else with the same code and same Steammodded version? It seems so weird and I can't figure it out, they don't have any mod that has conflict either
okay uh
just do loc_colour() at the top of your main file
also
why are you making that function
theres is already a HEX function that does the exact same
Really? Which one?
HEX(<colour code>)
thats why i said also v_dictionary
smh
Thank you, the issue is solved with this!
I had it probably it imported from another mod that's why I couldn't find it, but now I managed to reproduce it and that indeed fixed it!
i was looking at yahimice's VIBE bosslind earlier to see how to up the gamespeed
is it possible for me to put it to 8x without any other mods or thingies
i think its possible
though i dont think the game likes it when you go into settings with that
and then change the speed
the game speed is just a number though
so it should work mostly fine
what im trying to do
if youve ever played yahimice's mod
is put the gamespeed to 8x
and have it stay at 8
which he does in his vibe bossblind with 0,25x
although when reading this its hard to decipher where he puts the gamespeed to 0,25x
@slim ferry how use it now?
SMODS.current_mod.reset_game_globals = function(run_start)
if run_start then G.GAME.tarot_usage = {} end
end
SMODS.current_mod.calculate = function(self, context)
if context.using_consumeable and context.consumeable.ability.set == "Tarot" then
G.GAME.tarot_usage[context.consumeable.config.center.key] = (G.GAME.tarot_usage[context.consumeable.config.center.key] or 0) + 1
end
end
it creates a table of tarot card keys with their usage count
so you can loop over it and get the one with the highest value
Yes, but like, how put a joker or some other thing to create the most used tarot?
loop over the table and get the one with the highest value
just like getting the most played hand or whatever
Ok
is there a way to make sure that a joker card can only get a certain edition similar to how in vanilla balatro you cannot get a negative playing card
try looking at paperback
negative playing cards work differently, poll_edition specifcally has a parameter for no negatives thats used for playing cards
is there a table of poker hands that can be looked up in game?
all i have to do is change e_paperback_dichrome to the editions i don't want playing cards to get (i think laminated and iridence is fine for playing cards, and gamma for playing cars maybe techincally works, but will be completely busted)
G.GAME.poker_hands
sweet!!
like this?
that probably works
im assuming it takes advantage of that for dichrome
laminated works out of the box but i guess i need to add some edition context for iridescent
i think i make a seperate context or do two contexts like (context.post_joker) or (X) and then
context.individual and context.cardarea == G.play
along with or replace individual
sorry for the background video listening to emkay in the background
replace
its done 😈
anyone know how to add/remove a suit&rank from jokers so that it wont crash (for obvious reasons) when played as a playing card
are you sure?
pretty sure
it done a crash
fair enough, thanks!
hey, so, curious here, basic question, but what does ease_discard() do?
adds or removes discards with the proper animation
positive number for adding negative number for removing
Is it possible to force player keep playing hands even after blind's score was met?
im not sure why you would want to do that?
ahh, I see, thank you, this is good info
Yes, there is also a mod about that.
Get extra value from scaling jokers
which is it?
holy shit its old
👀
wait
can I do it easier
and just every time score is met/overflows, joker sets current score to 'required score - 1'
hmmm
made some placeholders
yo im trying to figure how to check the most played hand
and i aint getting anywhere
wow ok of course that exact issue is there
oh right i meant thanks hee hee
i lowkey might be stupid... scratches head in confusion
ignore the pronouns
i'm trying to like. make it add x1 mult for each unique planet card used
is there a mod that adds a completely new shop you can acess?
did you look at the code for Satellite?
I know this may be a stupid beginner question, but do I need to list Smods as a dependency? The base I downloaded listed an outdated version as a dependency and I replaced it, yet I get an error when I boot it up even though Smods is in the mods file.
is there something I'm missing?
"Steamodded (>=VERSION)"
you can do "Steamodded (>=1.0.0~BETA-0827b)" since that's the latest version
not the most original tag designs but what do you think?
i think these can work at least for alpha
How do you get the target score for joker scoring?
wdym
This
G.GAME.blind.chips iirc
how do i make it so that you have to defeat another blind after defeating a blind
going to bed soon, but thought I'd ask a question for future me lol (awake me) -
how would one make an enhancement additionally count as a suit, a-la smeared joker?
basically, I'm imagining two different jokers rn, right?
their effects are like this
- Mult cards count as Spades and give +[number] chips
- Mult cards count as Hearts and give +[number] mult
how would I do this? I'm looking at smeared's code rn but it's a little confusing to me tbh lol heh sdfsdfs
reference the Endless Entropy blinds from Entropy
hook the card:is_suit() function, check the card's enhancement, and then if it's mult, check if the player has the relevant joker. so e.g. in your hook you'd have
if SMODS.has_enhancement(self, "mult") then
if next(SMODS.find_card("j_modprefix_jokerkey1")) and suit == "Spades" then
return true
end
if next(SMODS.find_card("j_modprefix_jokerkey2")) and suit == "Hearts" then
return true
end
end
How do you make it so Jokers always trigger after scoring?
like after all jokers are triggered
context.final_scoring_step instead of context.joker_main, but what's your goal?
Was considering making a joker that triggers if Chips X Mult is under the target score, but thinking about it now maybe half the target score?
Actually I might make it an econ joker idk
Now that I think about it i'll revise the effect.
ah i see
yes. this is how it looks
i originally did literally just the loc_vars section here but with Xmult instead of dollars
and then i realized
"wait if the player hasn't used a singular planet card after picking this up wouldn't it be x0 mult"
we call that a skill issue and leave it in :3
that would be funny...
but Nah Sorry i don't really want somebody's run to be fucked over because they somehow can't find planet cards and are stuck with a x0 mult joker
eh screw it i'm going all in
couldn't sleep ndfjksdnkf :<
anyways, lol, uhm, how would I make a hook?
I think I've done it before, but don't really recall what it is at the top of my head dfsdfsd
mmmm I see I see, not sure if I get it entirely, but might be able to frankenstein something together with this sfsdfsd lol
yea the key is that lua treats functions as variables
so you save a copy of the function you're hooking, overwrite the function to do the custom behavior you want to do, and then once you've checked and it's not in any of your custom behavior you call the old copy of the function from before you overwrote it
mmm that's really cool actually!
(honestly, from the little I've learned from modding this game, lua seems insane lmao heheh)
it's fun
now if only they'd implement full custom operator overloading so talisman doesn't have to be complicated as shit [grumble grumble]
okey, so, I thought it may've messed something up here lol dnsfksdnfjk caused crash, know what I did wrong here? lol sbfjhsd
- first line of non-comment code needs to be
local card_is_suit_ref = Card.is_suit - second line of non-comment code needs to be
function Card:is_suit(suit, bypass_debuff, flush_calc). then you need to pass those arguments after self when you call the ref function, not just(self, from_debuff)
(note the capital C in "Card" in the function definition, it's case sensitive)
ahh ok, thank you, I'll change this up rq, thanks!
also the enhancement would be m_mult
oops right, that's my bad
ahh, thank you!
it works now! :3
im trying to make it so that the card plays the sfx "guraohno"/add chips/send msg before scoring, then once the cards are scored play "a"/send msg/destroy themselves but the card plays both sfx at the start and dont destroy themselves
how do I give one card 2 different activations for 2 effects/ control the timing (e.g. leave the player on a msg for 3s)
i've tried and but it doesnt seem to work
thats not how you use context.destroy card or play_sound
ah
if you return a table with the key "sound" set to a sound key, it'll play it
tbh ive been trying sound/play sound and all that just hoping something works
i.e. ```lua
return {
message = "goodbye",
sound = "guraohno",
chips = card.ability.extra.chips
}
and for the final scoring step one try
return {
message = "a",
sound = "a",
func = function()
SMODS.destroy_cards({card});
end
}```
replace the sound values with your sound key
add ur mod's prefix before the sound keys
Cinema
yeah i think im doing it wrong lol
Lmfao
local click_ref = Card.click
function Card:click()
-- do your check here
click_ref(self)
end```
I may be stupid but what am i doing wrong
and i completley forgot the key part lol
Below the joker
ah lol i tried that at first and thought it didn't work because it had to be in it
I'm trying to make a joker that does a DNA type effect but I'm coding this on a Steam deck so I can't access the games actual files and I've no idea how the joker is coded, how would I program literally a one to one of DNA as a baseline? Also sorry if this isn't specific enough I'm not quite sure how to ask about this
Thank you a bunch was trying to work it out myself for a bit too long
Can someone help me understand ? I've literally set the code in my main.lua as
if JokerDisplay then
SMODS.load_file("joker_def.lua")()
end
and this errors still happens
also the priority is set at 999
how to make an edition not appear for playing cards?
How to get the last used spectral card?
I just realised and missread it but it's the joker_def that apparently can't index JokerDisplay despite the mod being loaded (presumably since it loads the joker_def file), so not sure actually what i did wrong
look at the top link, it tells you how to check if a mod is loaded
I just changed it to apply it to it in my main.lua
if next(SMODS.find_mod("JokerDisplay")) then
SMODS.load_file("joker_def.lua")()
end
that's why i'm confused
look at the second link
Well apparently all i had to do was put the joker_def in the root folder with the main.lua for it to work
thanks for help !
what is the size of a seal sprite?
The full sprite should be 71x95 but the seal itself should be 27x27
ok thx
That’s false a seal can grow up to more than 1.7 meters
I have a question about the line "copy_card.states.visible = _" I want the joker to create a copy of a card and send them into the deck as opposed to the hand like many other jokers but this line of text either makes the cards invisible and intangible, or when I set the value to true they became face down. I was curious if there was a way I could establish these cards as being face up without the materilize event because that is only used to visualize adding them to the hand. Okay sorry a lot of words to explain this but I'm basically asking how do I make "copy_card.states.visible" equal to visible (EDIT: I figured out a solution, now worries about responding)
Hey folks, I'm very confused right now. I will send 2 snippets of code for an Atlas. The first is the one I was using, the second is the one on the SMods example jokers page, to which I have changed my variables to in the first snippet. The first snippet returns a "attempt to call field 'Atlas' (a nil value)", the second runs no problem, despite looking like the same code to me.
My Atlas
SMODS.Altas {
key = "ModdedVanilla",
path = "ModdedVanilla.png",
px = 71,
py = 95
}
Their Atlas
--Creates an atlas for cards to use
SMODS.Atlas {
-- Key for code to find it with
key = "ModdedVanilla",
-- The name of the file, for the code to pull the atlas from
path = "ModdedVanilla.png",
-- Width of each sprite in 1x size
px = 71,
-- Height of each sprite in 1x size
py = 95
}
your code calls SMODS.Altas and not SMODS.Atlas
you have the t and l swapped
you should probably also change the key and file path
Banging my head against the wall rn
Thank you
Yes, that was for testing purposes to see if it was a variable name issue, these will be back to their original names
While you can use ease_discard() or ease_money() to add either respective thing, how do you add hands?
Just to make sure I'm not being stupid, does "other_card:is_suit("Diamonds")" work for checking if a card is a diamond suit?
Holy Xmult
Maybe the people saying modded balatro is unbalanced have some relevancy
You'd need to get that many unique enhancements first.
Of course, if you add enhancements from other mods, it can be pushed higher.
You'd have to actively seek out unique ones.
For example, getting this enhancement requires you to get 3 Copper, 1 Silver and 1 Redstone cards drawn in order to alloy them.
...yes, this is inspired from https://teamcofh.com/docs/1.12/thermal-foundation/signalum-blend/ 😛
...or get lucky with this.
alloy smelter
-# Correct.
thats enderio
It is, yeah.
calculate = function(self, card, context)
if not card.debuff then
if context.individual and context.cardarea == G.play then
local diamonds = 0
for _, other_card in ipairs(G.play.cards) do
if other_card:is_suit("Diamonds") then
diamonds = diamonds + 1
end
end
if context.joker_main and diamonds >= 2 then
ease_hands_played(1)
end
end
end
Sorry forgot you can't enter to indent on discord
I want this to check if there are two or more diamonds in the played hand and then give one hand if there is during scoring but instead it either gives nothing or it gives per card scored and I'm not sure which part to change
context.individual and context.joker_main don't happen at the same time, that's why it gives nothing
context.individual already loops through the played hands so that's why sometimes it gives multiple
you want to do that loop in context.joker_main
also not card.debuff does nothing because calculate doesn't run if the card is debuffed
@red flower Actually, whilst you're here, mind lending a hand about why the main value doesn't count the retriggers?
calc_function = function(card)
local text, _, scoring_hand = JokerDisplay.evaluate_hand()
local hand = JokerDisplay.current_hand
local totalxmult, percard = 1, 1
if text ~= "Unknown" then
local usuits, usuitscount = {}, 0
for _, ccard in pairs(hand) do
if ccard and not usuits[ccard.base.suit] then usuits[ccard.base.suit] = true; usuitscount = usuitscount + 1 end
end
if usuitscount >= 2 then
local suitbonus = usuitscount - 1
local cumuxmult = 1+card.ability.extra.persuit*suitbonus
percard = cumuxmult
for _, scoring_card in pairs(scoring_hand) do
local retriggers = JokerDisplay.calculate_card_triggers(scoring_card, scoring_hand)
totalxmult = cumuxmult ^ retriggers
end
end
end
card.joker_display_values.x_mult = totalxmult
card.joker_display_values.percardxm = percard
end
This counts fine tho.
totalxmult is not accumulating, is that intended?
Also sorry I know you are respondng to the other fellow but I'd love clafication on where the arrangement is I feel a little lost
basically just replace context.individual and context.cardarea == G.play for context.joker_main
Hi, sorry, the one coding cards in lovely again.
For some reason my code is making the balance occur BEFORE the chips are scoring,
totalxmult = totalxmult * (cumuxmult ^ retriggers) was it.
btw thank you a bunch it finally worked the way I envisioned
hm
so an odd thing occured where it doesn't give hands if the cards a debuffed
thermal foundation mention??
for _, other_card in ipairs(G.play.cards) do
if other_card:is_suit("Diamonds") then
diamonds = diamonds + 1
end
Again like a moron I forget you can't indent
Is there a way I can make this only check scored cards?
(I'm curious mostly because I can't think of how to resolve the issue where it doesn't work when the diamond cards are debuffed and I can just make this a feature if i just push it a little)
other_card:is_suit("Diamonds", true) as Card:is_suit(suit, bypass_debuff, flush_calc)
um sorry I'm foolish but how should I write that into the code?
loop over context.scoring_hand
instead of G.play.cards
other_card:is_suit("Diamonds") > other_card:is_suit("Diamonds", true), simply.
Thanks a bunch everybody it is perfecto
Hello again folks, I'm trying to make my first Joker for a friend and I've ran into another issue. Did some digging in the server but it seems to be a pretty wide range of issues.
Written effect: If scoring hand contains 2 or more Aces (an upside down W), gain x0.23 Mult (Currently x1)
Additional effects: Plays FlightReacts saying LeBron and displaying "CHAT IS THIS REAL?" text
Issue: "attempt to perform arithmetic on field 'ace_count' (a nil value)" when scoring hand has an ace.
config = {extra = {Xmult = 1, Xmult_gain = 0.23, ace_count = 0}},
loc_vars = function(self, info_queue, card)
return { vars = {card.ability.extra.Xmult, card.ability.extra.Xmult_gain, card.ability.extra.ace_count}}
end,
calculate = function(self, card, context)
if context.joker_main then
return {
print("Contexting"),
message = localize { type = 'variable', key = 'a_xmult', vars = { card.ability.extra.Xmult } },
Xmult_mod = card.ability.extra.Xmult
}
end
if not card.debuff then
if
context.cardarea == G.play
and context.individual
and context.other_card:get_id() == 14
and not context.blueprint
then
card.ability.extra.ace_count = card.ability.extra.ace_count + 1
print("In play, individual card, Aces: " + card.ability.extra.ace_count)
end
if context.joker_main and card.ability.extra.ace_count >= 2 then
print ("More than 2 aces, W")
card.ability.extra.mult = card.ability.extra.Xmult + card.ability.extra.Xmult_gain
return {
print("returning it"),
message = "CHAT IS THIS REAL?",
play_sound('LeBronScream'),
colour = G.C.MULT,
card = card
}
end
if context.end_of_round then
card.ability.extra.ace_count = 0
end
end
end
My first thought was that config wasn't adding it to the extras in card.ability but to assume the Steamodded code is broken rather than mine is daft
next(context.poker_hands['Royal Flush'])
how to check for Royal Flush?
looking at the vanillaremade implementation of the tags, what do these things mean?
whats the locks thing, and what does the yep function do?
yep
ok nvm i found the docs for the yep function
still confused about the lock variables though
You've got it man
You just put it in an if
yeah but it crashes it says nil
That will very unlikely be the issue
no
royal flush isnt actually a hand
its just a different name for straight flush code-wise
Ah right, didn't notice that too
you need to check it differently
welp time to add the hand my self then
G.GAME.current_round.current_hand.handname == localize("Royal Flush", "poker_hands")
this works
cryptid does it like this
oh ok thx
only works if it is a royal flush but like
i cant think of a situation where a hand contains one but isnt a royal flush
SMODS.Voucher {
key = 'slide',
loc_txt= {
name = 'Slide',
text = {
"Gain {C:money}#1#${} per skip",
"{s:0.8,C:inactive}(By itself, it feels incomplete.){}",
}
},
atlas = 'slider',
pos = { x = 0, y = 0 },
config = { extra = { dollar = 5 } },
loc_vars = function(self, info_queue, card)
return { vars = { card.ability.extra.dollar} }
end,
redeem = function(self, card)
check_for_unlock({ 'slide_redeemed' })
end,
calculate = function(self, card,context)
if context.skip_blind and not context.blueprint then
dollars = card.ability.extra.dollar
end
end
}
My voucher won't give me any money when skipping blind, not sure why
Gonna try throw in a pcall cause I'm not sure what the specific way to solve this in, then go from there
return {dollars = card.ability.extra.dollar}
damit no wonder, thanks
your issue is that you arent defining card.ability.extra.ace_count before adding to it
also, you should use a local variable for that
Does config not do that by default? Or did I misunderstand the description of it?
Also where would this be hypothetically? I'm not familiar with how calculate loops for example
just do local ace_count = 0 at the start of the calculate
and then use that to count the aces
how do i make SMODS.add_card give a perishable joker? i tried stickers = {perishable = true} but that doesnt seem to add the sticker
You would do this inside the smods.add_card thing ( i think)
stickers = { "perishable" },
force_stickers = true
safe to assume that there's no check for when a seal is triggered right?
not without manually adding compat for every seal, no
So I'm having an issue with this joker that isn't triggering at all and I am very confused because out of curiousity I gutted it and replaced the code with a joker from the vanilla remade jokers and it still didn't trigger so I was curious if there was anything obviously wrong with the code
config = { extra = {mult = 10, chips = 30, money = 3, type = 'Three of a Kind' } },
loc_vars = function(self, info_queue, card)
return { vars = { card.ability.extra.mult, card.ability.extra.chips, card.ability.extra.money, localize(card.ability.extra.type, 'poker_hands') } }
end,
calculate = function(self, card, context)
if context.joker_main and next(context.poker_hands[card.ability.extra.type]) then
return {
mult = card.ability.extra.mult,
chips = card.ability.extra.chips,
money = card.ability.extra.money,
}
end
end,
}
please smods give me post_trigger for non-jokers and my life is yours