#💻・modding-dev
1 messages · Page 551 of 1
I mean I was just invoking them as the foremost specialist on seals
i mean idk why this requires a seal specialist
I'm just curious
How do I make my soundtrack only play in the main menu?
also, sorry but i'm. still not entirely sure how to specify said original function. in my defense i haven't touched modding in actual months but like. What do. i assume i have to add something to the local line?
function Card:set_seal()
if not context.playing_card_added then
SMODS.calculate_context({setting_seal = true })
end
end```
as this just gives that "expecting a ( near :" error on the function line
is it possible to make a consumable not destroy itself when you press use?
you save a reference to the original function
then you overwrite the original function but call the reference inside
G.STATE == 11 is the main menu
yes
how would I do that
SMODS.Consumable.keep_on_use
okay, um. how. do i do that?? ^^;
copy the function
save the original function in a local variable
Thank youuu >W<
oh you can use local variables for that? i should probably start doing that huh
alrighty, tysm
Of course!
oh, that's an... alarming? bug? it somehow crashed something in the basegame, like it's getting tripped up by the arguments within. i've tried having local set to Card:set_seal(_seal, silent, immediate), Card:set_seal() and even just Card:set_seal, and it errors like this. the first two do this exact error, the latter gives a simple "expected arguments" error
function Card:set_seal()
if not context.playing_card_added then --actually tell the game setting_seal exists
SMODS.calculate_context({setting_seal = true })
end
set_seal_ref(self)
end```
its just set_seal_ref = Card:set_seal
also you still need to keep any arguments the original Card:set_seal had
i mean, i try that, but it crashes for wanting arguments
yes because the hook doesnt have any arguments
and set_seal_ref is called without any arguments too (besides the self)
the line function Card:set_seal() needs to be function Card:set_seal(_seal, silent, immediate) and then you need to call set_seal_ref(self, _seal, silent, immediate) at the end
question-- is there any way to check if an ante has been beat besides checking if the boss blind's been beat?
yes https://github.com/Steamodded/smods/discussions/919 ctrl+f "ante_change"
shouldn't it be Card.set_seal
uhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh
idk its whichever one vscode wont scream at you for
IIRC Card.set_seal is the method set_seal of the Card class
Card:set_seal is syntactic sugar either for defining a class method that uses self as the first argument, or for calling that method automatically passing self
game freaks out at both : and . but for different reasons? periods crash for this reason on trying to load the title screen, presumably since the title screen card... has a seal, thanks to talisman
function Card.set_seal(_seal, silent, immediate)
if not context.playing_card_added then --actually tell the game setting_seal exists
SMODS.calculate_context({setting_seal = true })
end
set_seal_ref(self, _seal, silent, immediate)
end```
it should be function Card:set_seal(...)
as someone who has no experience with languages with oop principles this was wild to me
i remember having a rlly hard time trying to understand classes
l o l
classes and objecs
I've mainly used OOB languages so Idk any FOP or whatever else exists
Is there a way to enable a certain spectral card to spawn in shop?
in_pool
so if in_pool's true it can also spawn in shop?
if in_pool is true it can spawn, if in_pool is false it cant spawn
im trying to make the +5 message blue but its not:
if #context.full_hand == 4 then
card.ability.extra.chips = card.ability.extra.chips + card.ability.extra.chip_gain
returns[#returns + 1] = {
message = "+"..number_format(card.ability.extra.chip_gain),
color = G.C.BLUE, -- Make sure this is G.C.BLUE
chip = card.ability.extra.chip_gain,
card = card,
}
end
Which one?
it doesnt help with this
🫡
SMODS.add_to_pool but it doesnt let you manipulate which pools spawn
SMODS.add_to_pool
so that wouldn't really work
also it is kinda broken because im bad at coding
can't you add to the Shop pool?
no, the shop is not a pool in the code
because you arent returning, youre just making a table called returns
it has a roll for which pool spawns depending on that pool's rate
I know ghost deck uses spectral_rate
yes
yeah
you would probably need to make something like an objecttype with your card and patch it into create_card_for_shop
tysm 🙏
okay, that much works, i just need to figure out editions, which i imagine would be similar, just with terms swapped out... and also, for some reason, if you use Cryptid on a playing card, it activates this six times. even with the attempts to be like "doesn't count if a card was added"
if context.setting_ability or context.setting_seal and not context.playing_card_added and not context.remove_playing_cards and not context.blueprint then
card.ability.extra.Emult = card.ability.extra.Emult + card.ability.extra.scaler
return { message = "+^" .. tostring(card.ability.extra.scaler) .. " Mult" }
end```
hmmmm
Quantum Enhancements make multiple set_ability calls
I wonder if another effect would also make extra calls
i feel like the fix would be to just like. maybe check "if not because of a card's creation" before even checking for setting_ability
heres the whole file. i have the returns at the end im pretty sure
why are you making a table for your returns
jjust return in each context individually
if im reading the code correctly, setting_ability doesnt run on card creation
because this is my first time modding and i didnt know about that lol
it also doesnt run in the shop? weird
oh this context just doesnt properly work with my mod, great
okay. weird. i tried adding the edition check, and now creating new cards via cryptid activates it ten times.
cryptid might be creating the card and then enhancing it
i think SMODS.add_card does that
but it's hard to catch that
this is with cryptid disabled, though, which is what's confusing me? :o
it's also a bit confused by death, activiating thrice (should probably only activate once)
i'm gonna go take a break rq bc i'm just generally feeling weird atm but i have. no idea why it's trying to proc for card creations even after telling it not to. like. am i just doing it wrong by using and not context.playing_card_added?
yes, i said before that doesnt do anything
ah. that'd do it. uh. what should i be using then? :o
dunno
It has quantum everything.
does anyone know how to make a joker show its stored values in its text box? i have the text showing up from the localisation file but its not showing the stored values. do i use the #1# and #2# method?
do you have a loc_vars function
yeah i do
loc_vars = function(self, info_queue, center)
local chips = center and center.ability and center.ability.extra and center.ability.extra.chips or self.config.extra.chips
local mult = center and center.ability and center.ability.extra and center.ability.extra.mult or self.config.extra.mult
return {
vars = {
number_format(chips),
number_format(mult),
}
}
end,
i just got it to work the #1# method did it
dont forget to set up loc_vars then spend 10 mins wondering why its not tracking the value ive made that mistake more times than ill admit
how should i detect what location in the joker hand a joker is? fairly new to modding balatro and still getting used to lua and smod shenanigans
What variable in shaders tells how the joker is tilted? im looking at the polychrome shader and i see the variables at the bottom like mouse_screen_pos and such, but they dont seem to be actually used anywhere
TFW you have to rework a joker and find this in your comments: -- not sure if this is needed since I am using main_eval, but this is finally working and I refuse to debug working code
is there a way to make seals not appear in the pool?
like in the booster packs/magic trick?
Yes, hook get_current_pool
oh wait sorry, i need to be more specific
is there a way to make certain seals not appear in the pool
Yes, in_pool = function(self) return false end
Seals have that method?
Yes.
and it's not documented..........
done with my break, uh, anyone have any pointers for a. Better. way to be like "not when a playing card is added to the deck"
alright thank you
What is the goal?
is there a way to align sized text to the bottom instead of the top
context.card_added
NO!!!!!!!!!!!!!!!!!!!!!!!!!
context.setting_ability is called when the card is created, not when its added to your deck. idk what you could do about it, my best guess is context.old_card maybe not existing because the card just got created
so you could check if context.old_card exists
if context.setting_ability or context.setting_seal or context.setting_edition and not context.playing_card_added and not context.remove_playing_cards and not context.blueprint then
basically:
- trying to check if the enhancement changes
- if the seal changes (a custom context)
- if the edition changes (a custom context)
- but NOT if a playing card is added (Current problem child)
- and NOT if a playing card is deleted (this might not actually need to be here but i'm crossing that bridge when i get to it)
- and NOT if blueprint is calling this (this is determining a scaling ability)
if context.setting_ability is on card creation, i do wonder if the play would be to like. hook into whatever handles enhancements changing.
I would wrap those or statements with brackets just to make sure the code is checking your and statements
context.playing_card_added and context.remove_playing_cards don't get called with the other ones so those checks are unnecessary.
If nobody else has replied, the vertex shader position() function handles the card tilt, as well as the three external variables passed into it
It applies some transformations based on the mouse position if the card is currently being hovered, as well as offsets shaders relative to the center of the screen so that cards and their shadows show depth
if ((context.setting_ability and context.old) or context.setting_seal or context.setting_edition) and not context.blueprint?
nope, still activates a bunch when cryptid is used. (though, it's down from 10 to 8...?)
The actual specific resulting tilt value is, unfortunately, not intuitive. The vec4 matrix returned from the position function has an x and y coordinate and then two values after, with the fourth one being something along the lines of "percentage transformation from local space to world space?" I think? Matrix math is weird
Yes, you have to patch copy_card
And so Balatro's shaders use the fourth one to do...... something. I wish I had a better explanation but it's not easily explainable even after trying to research it for my own shader work
uhhh. how
so how does foil for example use it to change which rings are brighter? im still a little confused on how im meant to actually use it
[[patches]]
[patches.pattern]
target = "functions/common_events.lua"
pattern = '''local new_card = new_card or Card(other.T.x, other.T.y, G.CARD_W*(card_scale or 1), G.CARD_H*(card_scale or 1), G.P_CARDS.empty, G.P_CENTERS.c_base, {playing_card = playing_card, bypass_back = G.GAME.selected_back.pos})'''
position = "after"
payload = 'new_card.modprefix_from_copy = true'
match_indent = true
[[patches]]
[patches.pattern]
target = "functions/common_events.lua"
pattern = '''
if other.params then
new_card.params = other.params
new_card.params.playing_card = playing_card
end
new_card.debuff = other.debuff
new_card.pinned = other.pinned
'''
position = "after"
payload = 'new_card.modprefix_from_copy = nil'
match_indent = true
do i just like, put that in the main lua file?
No, you have to put it in either a lovely.toml or a toml file in a lovely folder.
the lovely.toml file goes in the root folder of the mod, right?
i should add the valid paths here too
That's all done in the effect function (pixel shader) afaik. But without documentation I don't know solid math on how the sheen effect specifically works, other than it's essentially just mathematically making a transparent pattern that overlays the texture beneath
Admittedly, the best I can recommend for shader work is Stealing From People Who Know What They're Doing and then trial and erroring your way into porting it to love 2D. I've stolen a lot from GodotShaders and older GLSL shader examples I've found online
yknow what. i think i might just. not do this shine shader after all. the card being big is enough for me
If you want you could steal an existing shader, if that would be good enough?
I think the Foil shader has two layers, maybe
The Voucher and Negative Shine shaders both do something like that
Negative has two layers ("negative" and "negative shine")
the shader i wanted was just like, a strip of shine that moves depending on how the card is tilted, i feel like the voucher shader might be too excessive
true but that's not what I was thinking of
However foil is the only vanilla card shader that specifically draws a transparent texture rather than redrawing fully opaque pixels mixed from the base texture
I think that's it
Hmmmmm if you're willing to be patient, I might be able to fiddle with the vanilla ones to create this effect for tou
btw. really annoys me that the rest of the shaders don't use transparency. i have a card texture that kinda requires a shader to look as intended but having any edition breaks it
There's an example shader doing this IIRC
Oh yeah there's the example shaders too as options
What do you mean exactly
I've had to solve this problem for some specific cards. For example I have one card that redraws all editions in a custom function so that its animation effect doesn't get lost beneath the flat shader draw
i have a deltarune prophecy joker that uses a shader to achieve the animated effect, but applying any edition other than foil applies a new opaque shader that pulls from the original sprite instead of the shadered one
Maybe a custom draw or DrawStep would help
i quite frankly cannot be asked to figure out how that shit works so i've just left the joker behind for now lmao
I have something similar working. I think it was only missing compatibility with custom Edition.draw methods. Then again, SMODS is inconsistent with supporting custom Edition.draw methods
Logically you could modify the shader effect to draw overtop the edition shader and simply cover the specific sections you want, while the rest of the black part of the card maintains the edition?
One solution is to split the Joker into layers
have the one with the custom shader in a layer without the Edition layer
and possibly manually apply the Edition shader if you want
which is what I'm doing here
it, ah. Did not like that
Oh yeah I'll probably steal from the example shaders and just fudge some math for the edition I need to add
is it not meant to be literally just, lovely.toml in the base of the folder
Hamon Edition......
You're missing a little block of metadata at the top of the file according to the error
Put this at the top:
[manifest]
version = "1.0.0"
dump_lua = true
priority = 1
...adding the patch didn't change much, using cryptid still pings the effect 8 times
.base.suit
if ((context.setting_ability and context.old) or context.setting_seal or context.setting_edition) and not context.blueprint then
like... what am i missing here, if patching copy_card isn't it?
More card art
Actually I'm not sure what I have it set up to do now
It would give mult for every scoring card according to my code
🙏
And I prefer that for the synergy so I should probably make that more obvious and modify the description slightly
Since you can argue splashed cards are each "high cards" since the game acts like they all are, but it's still a little ehhhhhh wording wise
"When you play a High Card, each scoring card gives Mult equal to its Rank"
It's just strange wording itself because it implies that there is more than one scoring card in a High Card by default
well you could argue that the splash high card just has five "high cards"
I mean yeah that's technically true, I'm just wondering if that's intuitive or not
just rephrase it to "If played hand is a high card, each card gives mult equal to their rank"
or smth like that
*each scored
oh eah
No yeah it's the "each" part that gives me pause because high cards typically have only one scoring card. "Each card" is grammatically singular, it can refer to only a single valid card, but smth about it bugs me
My eternal struggle as a writer. "this is correct but it bugs me"
sorry to nag, but still not sure of how to handle this. how can we stop this from activating anytime a card is created or duplicated, since the toml patch didn't do anything?
No, you need to check and not context.other_card.modprefix_from_copy
it... now crashes if i use cryptid to duplicate cards. line 213 is
if ((context.setting_ability and context.old) or context.setting_seal or context.setting_edition) and not context.other_card.stla_from_copy and not context.blueprint then
Check for context.other_card existing.
i have no idea how to do that alongside the and not context.other_card.stla_from_copy check, admittedly. still errors out with roughly the same error. ^^;
if ((context.setting_ability and context.old) or context.setting_seal or context.setting_edition) and not (context.other_card.stla_from_copy and context.other_card) and not context.blueprint then
Question from a non-coder: does anyone know how to fix the fact that mika's mod collection consistently gives +20 mult for lucky cards (even if they dont trigger), or even if you can just point me to where i should be looking in the .lua file
Mika’s mod ?
Yup
Never heard of it
You should be asking mika
Fun fact i never heard of someone named mika in dev chat
Mika is long gone, hence why I'm trying to manually edit the lua file locally
Every time a lucky card is played
With certain joker or always ?
It might be something to do with taking ownership or lovely patches
Its as though it's programmed to always give +20 mult (the probability check seems to be intact as jokers that rely on lucky card triggers still work as they ought to)
The lucky card still has a 1 in 5 chance to trigger jokers, but always gives +20 mult separately from that
if ((context.setting_ability and context.old and not context.other_card.stla_from_copy) or context.setting_seal or context.setting_edition) and not context.blueprint
You need to add the card as an input to the other contexts.
Is there a way I can ctrl-F the lua file (i can understand most of the coding logic - it seems like a relatively simple coding language, but I don't actually know how to code in lua or know what i should be looking for) to get close to what im trying to find?
Lua is pretty simple
If you want to start understanding you can check the pinned message in #⚙・modding-general
That should give you and idea on how everything works
Also please read the wiki
N also made a repo containing a wiki basically recreating the whole vanilla objects and has a wiki explaining everything
Okay, ty - I guess this is my sign to get back into coding
lua is very simple, except for the fact that its pretty different to other languages, even other interpretive languages.
...okay, now it's back to proccing ten times if i use cryptid.
it also, for some reason, now procs twice if a seal is added.
is... that not what that block of code does?? :o
--check if a playing card changed somewhere
if ((context.setting_ability and context.old and not context.other_card.stla_from_copy) or context.setting_seal or context.setting_edition) and not context.blueprint then
card.ability.extra.Emult = card.ability.extra.Emult + card.ability.extra.scaler
return { message = "+^" .. tostring(card.ability.extra.scaler) .. " Mult" }
end```
Yes, you need to change where you're calling the contexts.
...how, and where, exactly? for reference, this is the full block of code for the joker
How do I add color in the middle of text on a ui element? I'm trying to make the name Cynder purple colored but this doesn't even make it the attention color.
Where you're calling SMODS.calculate_context
...there is no SMODS.calculate_context, unless you mean putting it under calculate = function(self, card, context), but like... it already is?
No, outside the joker.
oh, in the modded contexts
...dang it, what now. i assume i set up the "check to make sure this isn't from a copied card" wrong, as this once again crashes the title screen since the logo has a seal with talisman on
function Card:set_seal(_seal, silent, immediate)
if (context.setting_ability and context.old and not context.other_card.stla_from_copy) then
SMODS.calculate_context({setting_seal = true })
end
set_seal_ref(self, _seal, silent, immediate)
end```
No, the problem is that context doesn't exist in Card:set_seal()
local oldsetseal = Card.set_seal
function Card:set_seal(_seal, silent, immediate)
SMODS.calculate_context({setting_seal = true, other_card = self})
return oldsetseal(self, _seal, silent, immediate)
end
Is there a context for after a card is scored but for individual cards?
okay, seals no longer proc twice, but cryptid still procs the joker 8 times
Yes, you have to add other_card = self to where you're calling context.setting_edition
No.
i have other_card = self in both the hook creating setting_seal and setting_edition. the call for both of these is presently:
if ((context.setting_ability and context.old and not context.other_card.stla_from_copy) or context.setting_seal or context.setting_edition) and not context.blueprint then
am i missing an other_card = self check in this somewhere?
tried making a challenge and this was the crash message, what went wrong?
sorry to pester. still stuck on this. ^^;
if ((context.setting_ability and context.old) or context.setting_seal or context.setting_edition) and not context.other_card.stla_from_copy and not context.blueprint then
what's the code for destroying a scored/played queen card?
i have a joker named igor which destroys played queens
if context.destroy_card and context.destroy_card:get_id() == 12 and context.cardarea == G.play then
return {remove = true}
end
still proccing 8 times on card creation. (incidentally, in trying to test this, i've discovered that anytime a joker or playing card appears in the shop, it also activates, so clearly something's not right there)
i believe you can guess what i'm trying to do with this.
calculate = function(self, card, context)
if context.destroy_card and context.destroy_card:get_id() == 12 and context.cardarea == G.play then
card.ability.extra.EEMTOTAL = (card.ability.extra.EEMTOTAL) + card.ability.extra.EEM
return {remove = true}
end
if context.cardarea == G.jokers and context.joker_main then
return {
ee_mult = card.ability.extra.EEMTOTAL
}
end
end
What does the lovely patch look like?
version = "1.0.0"
dump_lua = true
priority = 1
[[patches]]
[patches.pattern]
target = "functions/common_events.lua"
pattern = '''local new_card = new_card or Card(other.T.x, other.T.y, G.CARD_W*(card_scale or 1), G.CARD_H*(card_scale or 1), G.P_CARDS.empty, G.P_CENTERS.c_base, {playing_card = playing_card, bypass_back = G.GAME.selected_back.pos})'''
position = "after"
payload = 'new_card.modprefix_from_copy = true'
match_indent = true
[[patches]]
[patches.pattern]
target = "functions/common_events.lua"
pattern = '''
if other.params then
new_card.params = other.params
new_card.params.playing_card = playing_card
end
new_card.debuff = other.debuff
new_card.pinned = other.pinned
'''
position = "after"
payload = 'new_card.modprefix_from_copy = nil'
match_indent = true```
You need to change modprefix to your mod prefix.
okay, it's at least not excessively proccing when it shouldn't, but it still procs once for every card duped, and also one for every joker obtained... or seen in a shop
frankly, not entirely sure what to make of the behavior here
if ((context.setting_ability and context.old and not context.unchanged and G.P_CENTERS[context.new].set == "Enhanced") or context.setting_seal or context.setting_edition) and not context.other_card.stla_from_copy and not context.blueprint then
this at least fixed the behavior of duplicating cards activating entirely, but seeing jokers in the shop, as well as some methods of creating jokers (like judgement) still proc it somehow
The partner is free and not in any cardarea.
still struggling with this. (also, quite shockingly, playing cards in the shop doesn't activate it. literally it's just jokers doing this.) ^^;
hi
would kinda need to see the code responsible for the challenge, as it's erroring out in the middle of card.lua, a file in the basegame
thanks clyde for saying cam doesn't exist
DUDE
since discord hates me
@grim remnant ^
It's j_wee
I'm trying to make a deck that gives extra money for discards, but I cannot for the life of me figure out what I need to put as my vars
https://github.com/nh6574/VanillaRemade/blob/main/src/backs.lua
search up green deck on here
THANK YOU!!!
hey is anyone down to help me figure out the logic behind a rather unique joker im making for my gfs birthday? im very inexperienced with programming and struggling lol
what do you want to make?
like what effect
so, shes a speedrunner, so the idea is the joker starts with a certain set amount of xmult gain, but the longer you take to pick your hand/discard, it goes down fast, plateaus a bit, then when it crosses over into the negative(losing xmult) it begins to speed up again, think the shape of a parabola.
discarding/playing a hand would take the amount of xmult gained/lost and be added onto it, then being applied to the scoring hand/starting again if discarded hand, idea is high risk high reward wherein taking too long can lose all the built xmult on the joker
i think i explained that correctly, just got off of work so im still getting my brain on straight lol
not even sure if this is feasible which is why im asking around
so hold on
like starts with 5x, after 5 secs decreases to x1.5, plateaus for 2 secs, then slowly decreases
and after going below 1x the decrease becomes faster
i think im reading that right
timer based mechanics are def possible
basically
yeah
and when you play a hand it'lll add the final value to its new initial value
correct?
yep, and then rinse repeat so you can scale it by playing fast and against the timer
basically the shape of a parabola, starts with giving a certain x amount, but no limit on the negative side, so if you take waaay long you can lose all your built xmult, obviously the values themselves will take tweaking to balance but i think its a more unique joker concept and fits her perfectly
i dont think i can explain delta time here in a reasonable time frame so imma have to work some magic here then
cuz events probably cant handle what you want
if you're willing to assist me with this im definitely willing to vc and learn a thing or two while doing so, also doesn't have to be today or anything, right now im just getting an idea of if this is even feasible to implement
we can work this out in dms if you want
also it is definitely feasible if you're comfortable with some more advanced math
if the decrease is parabolic then the math shouldnt be too funky
yeah a parabolic shape should work perfectly and be tweakable enough to balance well
but in reality its whatever would work best, that's just what came to mind
actually ya know what we may not need the funky stuff in the first place
piecewise functions go brr
yeah i'll dm ya tmr when I figure out exactly what kinda math we need cuz i gotta head to bed
np!
still trying to figure out how to exclude jokers from this, since for whatever reason, created jokers (from judgement/soul) and. Seeing jokers in the shop. procs this for some reason?
card.ability.extra.Emult = card.ability.extra.Emult + card.ability.extra.scaler
return { message = "+^" .. tostring(card.ability.extra.scaler) .. " Mult" }
end```
In your hooks you need to check that _seal and edition exist.
...extremely dumb question, how would i go about that?
function Card:set_seal(_seal, silent, immediate)
SMODS.calculate_context({setting_seal = true, other_card = self})
return set_seal_ref(self, _seal, silent, immediate)
end```
like, i assume the idea is to give the calculate_context line an (in shitty pseudocode) `if playing_card(_seal) == true then`, but like. How though
context.other_card.seal and/or context.other_card.ability.seal
Is there a way to change the rarity of a Joker using a hook or patch?
didn't like that
function Card:set_seal(_seal, silent, immediate)
if context.other_card.seal == true then
SMODS.calculate_context({setting_seal = true, other_card = self})
end
return set_seal_ref(self, _seal, silent, immediate)
end```
I had a concept in mind but no idea where to start making the effects
i figured out a hacky solution, tho it probably breaks cryptid a bit seeing as jokers can be sealed in that mod. ah well. in the context it's appearing in it's meant to be playing card-exclusive anyway
function Card:set_seal(_seal, silent, immediate)
if self.ability.set ~= "Joker" then --this is such a hacky solution and probably breaks cryptid a tiny bit since you can actually seal jokers in that mod. too bad!
SMODS.calculate_context({setting_seal = true, other_card = self})
end
return set_seal_ref(self, _seal, silent, immediate)
end```
is Xchips a base game thing or a cryptid thing?
if _seal
Yes.
talisman, actually
Previously Talisman, now a part of SMODS.
does the github guide show how to use it or is it stright forward like xmult
Yes.
ty ty
also, question. i'm trying to make a consumable that, when used, just spawns. Any random consumable, of any kind. i already have most of the stuff for it as i've made similar cards before, but nothing that just takes. The Entire Breadth Of Consumable Types. what can i do for that?
G.GAME.consumeable_buffer = G.GAME.consumeable_buffer + 1
G.E_MANAGER:add_event(Event({
trigger = "after",
delay = 0.4,
func = function()
play_sound("timpani")
SMODS.add_card{
set = "Tarot" --need to replace this
}
-- card:juice_up(0.3, 0.5)
G.GAME.consumeable_buffer = 0
return true
end,
}))
delay(0.6)
end,```
I can at least try to give you some of the pieces.
To debuff a card, you would use card:set_debuff(true)
To undebuff a card, you would use card:set_debuff(false)
To check if a card is debuffed, you would use context.other_card.debuff
(card and other card are dependent on the enviorment)
thanks
No, you would use SMODS.debuff_card to debuff.
but would it even be possible to check if a joker would trigger when it's debuffed?
Yes, but you would have to have it calculate but not trigger the effects, which would probably require a patch.
Also it still might trigger.
I can barely scrape together joker effects from vanilla code atp I'd just pay money for someone to make it
any pointers for how to just grab any consumable category for SMODS.add_card? since uh. set = "Tarot, Planet, Spectral" did not work, and also this would skip any categories added by other mods
set = "Consumeables"
well that didn't work
I'm trying to make a joker that has a chance to apply an edition when a card is scored, but the only problem is that if i set it as a event manager event, it wont score the edition on retriggers, but if i don't to make it count the edition on retriggers, it will do it before the card is scored which visually doesn't make sense
I dont understand why the apply alway goes on the else statement when the condition should be true and it just doesnt work the condition is false
literally nothing is different between this and another consumable we have to summon from a category of consumables, EXCEPT the category being Consumables. what is happening???
G.GAME.consumeable_buffer = G.GAME.consumeable_buffer + 1
G.E_MANAGER:add_event(Event({ --make a spectral card!
trigger = "after",
delay = 0.4,
func = function()
play_sound("timpani")
SMODS.add_card{
set = "Consumeables"
}
-- card:juice_up(0.3, 0.5)
G.GAME.consumeable_buffer = 0
return true
end,
}))
delay(0.6)
end,```
set = "Consumeables", area = G.consumeables
local current_card = context.other_card
if context.other_card:get_edition() == nil and not current_card.bonus_joker_mark and SMODS.pseudorandom_probability(card, 'bonus_joker', 1, card.ability.extra.odds, 'bonus_joker') then
local edition = poll_edition('bonus_joker', nil, true, true, { 'e_holo', 'e_foil' })
current_card.bonus_joker_mark = true
local target_card = current_card
local chosen_edition = edition
G.E_MANAGER:add_event(Event {
trigger = 'after',
delay = 0,
func = function()
target_card:set_edition(edition, true)
card:juice_up(0.3, 0.5)
target_card.bonus_joker_mark = nil
return true
end
})
end
end```
This is my current code for it.
I forgot to use current_edition
Remove the event and change it to target_card:set_edition(edition, true, nil, true)
And this wouldnt make it visually happen immediately as the hand is played?
Perhaps.
Hey everyone, i was just wondering, is there any way to change what the base/vanilla jokers do?
Thank you very much🔥🔥🙏
Can someone tell me what is the atlas key for replacining the balatro logo.png?
balatro
It doesn't.
i hate gemstones and similar reflective things 😭
Oh, a surprising amount of unused content in these files.
slowly improving my sprite art though
I think the gem looks very pretty.
its 1 of the 4, they synergize with the basic suit jokers to make them somewhat more useful
making them all lil gemstones :D
do i need to install lua in visual studio?
No.
theres a lua extension thats nice to have but i forgot the creator
literally one of the first recommended vsc extensions though
sumneko
or smt
Is it possible to choose what card is showing on the title screen?
I wrote the code for the joker and nothing happened
Ah lovely, what would the code like that look like?
[[patches]]
[patches.pattern]
target = "card_character.lua"
pattern = 'self.children.card.states.visible = false'
position = "before"
payload = "SMODS.change_base(self.children.card, 'suit', 'rank')"
match_indent = true
Ah thank you very much, is it only possible to use regular cards then or can we define a tarot card?
You want a tarot card to be the main card on the main menu?
probably would be easier to hook Game:main_menu to do that rather than patching it
Mhm
I replaced the tarot with character cards so I wanted to put Blitzo's card on there.
[[patches]]
[patches.pattern]
target = "card_character.lua"
pattern = 'self.children.card.states.visible = false'
position = "before"
payload = "self.children.card:set_ability('c_modprefix_key')"
match_indent = true
Thank you very much I'll give that a try~
Oh hm, I'm getting an unexpected symbol error on the first line
Did you put it in a lovely file?
It's in the main lua.
No, it needs to be in a lovely file.
Oh that's a different thing.
Sorry I don't do much coding.
Hmm, I made a file called mainmenu.lovely and put it in there but it's not doing anything.
lovely files are .toml
Ah
also i think itll still work but its usually best practice to put them in their own 'lovely' folder
I'll do that
Still no change.
I'm guessing I need to add something into the main lua to actually call the toml file?
you shouldn't have to
Third or so tries the time or something like that xD
yeah pretty much
Hm I tried to do the card one as well but no dice
Any clue what I'm doing wrong?
Is it just not loading?
The game is loading but the card on the menu is the same as standard.
version = "1.0.0"
dump_lua = true
priority = 0
[[patches]]
[patches.pattern]
target = "card_character.lua"
pattern = 'self.children.card.states.visible = false'
position = "before"
payload = "self.children.card:set_ability('c_hbp_chariot')"
match_indent = true```
I have this in a mainmenu.toml
Why is the lovely folder 3 folders away from the Mods folder?
No, mods don't work like that.
what are you trying to do
Oh I'm trying to replace the card showing on the main menu with a tarot card.
jonklers :D
(placeholder art for the first 4 for suit themed jokers bc i cba to do that many sprites today)
<@&1133519078540185692>
i forget, is card_character.lua actually in the game's root, or is it in a folder?
I have no idea where that is I assume it's a part of the main game?
It's in the games root folder.
okay, so that's not the problem then
version = "1.0.0"
dump_lua = true
priority = 0
[[patches]]
[patches.pattern]
target = "card_character.lua"
pattern = 'self.children.card.states.visible = false'
position = "before"
payload = "SMODS.change_base(self.children.card, 'hearts', 'a')"
match_indent = true```
Am I missing something from the toml? This is trying it with the regular cards.
look in your Mods/lovely/dump/card_character.lua and see if the patch is actually being applied or not
Will do
It's Hearts and Ace
Changing that and doing again
I'm not seeing it in the card_character.lua
So the patch isn't being read
Does the line self.children.card.states.visible = false exist?
No, unless it's not in a lovely folder.
It is so that's not it.
I tried to change the value to true with my patch but no change.
Is there maybe a setting somewhere that needs to be enabled to use patches?
So I have this chain of return messages but Is it possible to have a function happen after it's done?
The wi in will is capitalized in the last message.
I don't know what this mod is but it sounds interesting from this xD
the entire will is capped
yeah lol
Nevermind
It's a meme lmao
Subversion of expectation as they say
Time for a deep and engaging narrative
However funny that would be I think this should just be a 1 off lmao
Yes, in the last extra do func = function()
Also put what's in the function in an event.
love.system.openURL("https://github.com/VRArt1/Helluva-Boss-Balatro")
end```
Not sure if it'd be helpful but here's a function I have for a button.
I mean this is for a ui button but yeah
xDD
I'm hoping these are replaceable by malverk as well
Would be good for consistency
Or if not the atlas feature
Yeah not listed on malverk so I'll try atlas
Althought c_base isn't listed either so hmm
func = function()
G.E_MANAGER:add_event(Event({
func = function()
return true
end
}))
end
You need to keep the return true
Don't change a thing it's perfect
screw it, vineboom
What would the atlas for this be? I have the following but it's not changing it.SMODS.Atlas{ key = 'ui_assets', px = 72, py = 36, path = "ui_assets.png", prefix_config = {key = false}, }
Or maybe there's an atlas list somewhere...?
Yes, ui_1 and ui_2
game.lua
Humanity greatest fear
hello, this is a cry for help, this keeps happening, i did nothing but update my lovely injector and smods can you guys pls help ? (ping me)
set_ability = function(self, card, initial, delay_sprites)
card:set_eternal(true)
end,
I'm trying to make my consumable eternal at all times but it becomes eternal only when pressed (not used). How exactly can I make this work?
how would i detect if a joker is in the rightmost joker slot vs. any other for two separate effects depending on the location?
the rightmost joker is G.jokers.cards[#G.jokers.cards]
thanks!
what does the # mean in this context? still learning lua syntax and programming as a whole
LOL
gotcha
so its basically just saying, joker position at length of table(furthest slot)
apologies for very basic questions, just picking up all the knowledge i can on my way lol
yeah it is
sick!
also
is there anywhere i can find all colors availabe for the text using {X:x,C:x}
since id presume i cant just throw in hex
havent tried tbf
tyyy, shouldve checked documentation, but presumed this wouldve been written off as common knowledge so i didnt think so lol
I wanna make a custom poker hand called 3 Musketeers (3 Steel Aces) but how do I do that
you can also make new colours for text styling if you cant find something you need
do you have the example mods the docs provide?
iirc there was something in them that explain custom hands
I want to make my consumable jiggle(juice up) similarly to the Loyalty Card or Trading Card as long as a certain condition is met. I tried using juice_card_until but i'm kinda just clueless.. Can someone help me out?
i completely forgot about variable text colours tbh, i was more referring just defining new set colours (like here)
wait this reminds me
ive been forgetting text motion modifiers
E:1 for wavy text (like "Legendary" on the soul), E:2 for text that does little hops ig kinda (card names have this by default, and used for "self destructs")
oh E:1 is also used on the "you win" text at the end of a run
hey eris, another question, so if the joker is on the rightmost slot i want it to return the xmult to be used(obviously), but then i want to half it from what the current xmult was after its used, how would i order that to occur after returning the xmult? (sorry for obvious questions im learning 😭)
would i just add a , after the return then do the division there
why "ERROR"?
missing badge
what i need to do?
for example
returning ends a function, you would instead of returning do SMODS.calculate_effect({ <what would be the return table> }, card)
also since the new smods version theres now an SMODS.scale_card function. its optional but allows cards to be affected and detected by calc_scaling (scaling manipulation)
would this actually update the visual of the xmult on the card as well?
if you have card.ability.extra.xmult in your loc_vars then yes
(i have loc vars set up and all of that already, just clarifying since im likely asking stupid questions)
alright
sick
also the second very useful text styling info
time to see if this explodes or not
if this works first prototype
ill be very happy
Oh boy what did I break
want to assist in the troubleshooting 😔
dunno, that started immediately and softlocked the game
LOL
after giving myself the joker
you have something firing in context.repetition
but without returning anything meaningful that would cause something to repeat
yeah but nothing in this joker uses context.repetition
which is worrisome
that means your context checks are probably bad
something is firing in context.repetition when it shouldn't
it's also probably too harsh of smods to spam you like this I guess
here's the noobie code, what did i fuck up
the upgrade is outside of a context
ah
that fires in every context other than joker_main
also btw the upgrade message is k_upgrade_ex (with underscores)
yeah i shouldnt be working on this while sleep deprived
p sure i fixed it
god that was such a blaring mistake
haha
works
fantastic, thanks for the help eris lol
hell yeah!
just copy code from vanilla remade
you replied to yourself vro
🔥
Answering your own questions is still useful
do you have your seal label in misc.labels
💡
in context of game design and gameplay though, does this seem too niche for use in regular runs? or is it a neat joker idea as just an average run of the mill xmult gain
i feels very wordy
no, what is it?
in your localization file
yeah i can compress it, mostly talking about the actual gameplay use of it though
wait actually do you use a localization file or a loc_txt
file
then in misc > labels you should have the label for your seal under <key in lowercase>_seal
thanks
Morning modders
wait, other or misc?
misc
alr, this should be clearer yeah?
that seems fine yeah
:D
idk why i didnt start making mods sooner
this is quite enjoyable
(programming is intimidating but cs50x is getting me out of my shell lol)
hey! you still active?
i am
mod balancing in a nutshell:
feels right
:(
shh its such a unique idea its never been done before you have no proof
I'm looking for something exactly this.....
-# But I think I'll go with Writing it at the Bottom of the Description for now x'3
If you want the code you can just take it
I'm about to be airborne with no Internet though so you might have to wait like two hours
I would love that and I can wait no worries!~ ^w^
yea, it's already been a month
when used correctly, yours should do an X6 at final hand of round before going down to X3
then X9 -> X4.5 next round
sounds balanced enough for an Uncommon
another thing, if you win the round without using it, it becomes an insurance joker for when a boss blind heavily breaks your build
once again, balanced for an Uncommon
yeah, my idea right now more or less is just vanilla+ cards that could basically fit the base game
good practice and im bringing some neat ideas i had to life
can i return dollars in context.money_altered without it creating an infinite loop?
Does anyone know how I could make it so when a blind is selected you'd get a random boss effect added on top?
Make a flag to prevent that after the first time
I already have the whole "when the blind is selected" part down, but I don't exactly know how to handle the 2nd portion lol
Not easy but i think someone made something similar
I totally forgot who
Ailoyori has blind icon thing
wdym make a flag? how would i even do that, context.money_altered is a base smods thing
Is this thing tied to a card's calculate?
yeah
if context.money_aletered and not card.ability.dollars_given then
card.ability.dollars_given = true
return dollars
Here's a rough idea
hm yeah i see
You'd have to remove the flag with an else
I'll try to look around, thank you
is it possible to have an unlock similar to that of legendary jokers on a modded rarity (like that you can get them regardless of if they are unlocked, and they become unlocked when you create them)
I'm pretty sure jokers are automatically unlocked when you obtain them.
hm i see
does anyone know how to make a joker look for a specific joker and then destroy it?
SMODS.destroy_cards(SMODS.find_card('j_modprefix_key'))
and where would i put it?
when you want to destroy the joker??? where else
my bad
How would one draw a seal on the chips and mult?
Love.draw ?
i mean the mod also has quantum cards
Or, at least draw a seal at a specific position on the screen.
Considering we can change the text and icon of the window...
Love.draw
QUESTION FOR A FRIEND:
how to make pseudo-random effects?
Asked by @pastel kernel
What the fuck
wtf does that mean lol
Read the wiki please
How?
what wiki
How to do the 1 out of 6 random effects I believe
love.graphics.draw(sprite, spriteX, spriteY)
From the love2d wiki
I'm tapping my foot
My friend needs his answer
SMODS.pseudorandom_probability?
The...
Vanilla remade or smods wiki
Huh?
assuming you want it affected by oops
That wasn’t for you lol
Yahimod Shulker Box
i dont
No he wants it to be like Yahimod's Shul-
Ywah, what he said
oh oops
theres plenty of pseudorandom functions
there's now a parameter in SMODS.pseudorandom_probability to ignore oops
Well how do we make it like Yahimod's Shulker Box?
smh
dude i dont play yahimod
idfk
what does it even do
Fixed chance is now real
it has 6 effects stored
and every round it chooses one of them to do
how do we make it like dat
also what the hell is that shulker box
use pseudorandom_element to get a random element from a table
or yk just
look at the yahimod code
takes a long drag on cigarette
You don’t just demand for an answer like that
What would sprite be?
?
Does Yahimod still work?
sprite = love.graphics.newImage("player.png")
Again from the love2d wiki
pondering
probably a dumb solution
Why are you so good at this
i dont think this is good
Joyous spring tarot
thats reimu
If you're willing to be an early adopter and put up with reporting some bugs, an API I made allows this generically. Doing this was very much A Lot so I wouldn't recommend doing it yourself unless you've got a lot of time and patience
What should i do to have a caculate function trigger only on the first hand or a round
have you looked at DNA's code
oh ye. my mistake
how to check if poker hand is unlocked?
if SMODS.is_poker_hand_visible('modprefix_key')
I'll probably decline since I want this mod to be a little more standalone in that regard, but that's still pretty cool to see :)
Cool
sry if this isnt the right channel but can you guys help me make a mod work that isnt mine?
I would recommend asking #⚙・modding-general they have more experience with mod issues
alright thanks for the tip
where's the code for the chocolate die
Yahimod's shulker box uses fucking math.random
wh
why the fuck does it use math.random that makes like zero sense
even outside of the fact that its not pseudorandom
cryptid/items/spooky.lua i think?
oh yeah, the 1 of 8 effects of auzzy's Neo Metal Sonic proposal are as follows:
Creates 5 random Negative Consumables.
Retriggers leftmost and rightmost jokers 2 times.
Retrigger all played cards once.
Doubles your Money, no limits.
Applies Eternal to all current jokers.
Squares all of your current chips and mult (Triggers After Scoring).
Gains 1.5XMult if a Soul is used, or a Legendary joker is to Neo Metal Sonic's right.
Create 7 random Negative Perishable jokers.
And yet another plug, part of my API Mod
https://github.com/Kekulism/Arrow
Back:
local ref_back_ui = Back.generate_UI
function Back:generate_UI(other, ui_scale, min_dims, challenge, ...)
if self.effect.center.artist and not Galdur then
local ret = ref_back_ui(self, other, ui_scale, min_dims, challenge, ...)
ret.config.minh = 1.12
ret.nodes[1].config.padding = 0.035
ret.nodes[1].config.minh = 1.12
ret.nodes[1].nodes[1].config.padding = nil
return ret
else
return ref_back_ui(self, other, ui_scale, min_dims, challenge, ...)
end
end
UI_definitions:
---------------------------
--------------------------- Deck crediting
---------------------------
local ref_run_setup = G.UIDEF.run_setup_option
function G.UIDEF.run_setup_option(...)
local ret = ref_run_setup(...)
if G.GAME.viewed_back then
local args = {...}
local credit = {
n = G.UIT.R,
config = {align = "cm"},
nodes = {{
n = G.UIT.O,
config = {
id = nil,
func = 'RUN_SETUP_check_artist',
object = Moveable()
}
}}
}
if args[1] == 'Continue' and V(G.SAVED_GAME.GAME.smods_version or '0.0.0') == V(SMODS.version) then
local back_desc_nodes = ret.nodes[1].nodes[1].nodes[1].nodes[2].nodes
back_desc_nodes[#back_desc_nodes+1] = credit
elseif args[1] == 'New Run' then
local back_desc_nodes = ret.nodes[1].nodes[1].nodes[1].nodes[2].nodes[1].nodes[1].nodes[1].nodes[2].nodes
back_desc_nodes[#back_desc_nodes+1] = credit
end
end
return ret
end
function G.UIDEF.deck_credit(back)
-- set the artists
local vars = {}
local mod = back.original_mod or back.mod
if type(back.artist) == 'table' then
for i, v in ipairs(back.artist) do
vars[i] = ArrowAPI.credits[mod.id][v]
end
else
vars[1] = ArrowAPI.credits[ mod.id][back.artist]
end
local name_nodes = localize{type = 'name', key = "artistcredit_"..#vars, set = 'Other', scale = 0.6}
local desc_nodes = {}
localize{type = 'descriptions', key = "artistcredit_"..#vars, set = "Other", vars = vars, nodes = desc_nodes, scale = 0.7}
local credit = {
n = G.UIT.ROOT,
config = {id = back.name, align = "cm", minw = 4, r = 0, colour = G.C.CLEAR },
nodes = {
name_from_rows(name_nodes, nil),
desc_from_rows(desc_nodes, nil),
}
}
-- customized measurements
credit.nodes[1].config.padding = 0.035
credit.nodes[2].config.padding = 0.03
credit.nodes[2].config.minh = 0.15
credit.nodes[2].config.minw = 4
credit.nodes[2].config.r = 0.005
return credit
end
button_callbacks:
---------------------------
--------------------------- Deck crediting
---------------------------
G.FUNCS.RUN_SETUP_check_artist = function(e)
if G.GAME.viewed_back.name ~= e.config.id then
--removes the UI from the previously selected back and adds the new one
if G.GAME.viewed_back.effect.center.artist then
if e.config.object then e.config.object:remove() end
e.UIT = G.UIT.O
e.config.object = UIBox{
definition = G.UIDEF.deck_credit(G.GAME.viewed_back.effect.center),
config = {offset = {x=0,y=0}, align = 'cm', parent = e}
}
e.config.minh = nil
e.config.maxh = nil
if e.parent.parent.children[1] then
e.parent.parent.children[1].config.minh = 0.45
e.parent.parent.children[2].config.minh = 0.9
end
else
if e.config.object then e.config.object:remove() end
e.UIT = G.UIT.R
e.config.minh = 0
e.config.maxh = 0
if e.parent.parent.children[1] then
e.parent.parent.children[1].config.minh = 0.6
e.parent.parent.children[2].config.minh = 1.7
end
end
e.config.id = G.GAME.viewed_back.name
e.UIBox:recalculate()
end
end
Localization:
return {
descriptions = {
other = {
artistcredit_1 = {
name = "Artist",
text = {
"{E:1}#1#{}"
},
},
artistcredit_2 = {
name = "Artists",
text = {
"{E:1}#1#{}",
"{E:1}#2#{}"
},
},
artistcredit_3 = {
name = "Artists",
text = {
"{E:1}#1#{}",
"{E:1}#2#{}",
"{E:1}#3#{}",
}
}
}
}
}
the only hiccup is you'll have to do something to define the values for your credited artists somewhere. In my API they're defined under a section dedicated to credits, a table indexed by the id of the mod, but you can change those references to whatever you want:
ArrowAPI.credits = {
--- Table containing display names for all mod contributors, indexed by shortened key
ArrowAPI = {
['gote'] = "BarrierTrio/Gote",
['keku'] = "Keku",
['cejai'] = "SagaciousCejai",
['eremel'] = "Eremel",
['yunkie'] = "yunkie101",
['joey'] = "Joey",
['winter'] = "TheWinterComet"
},
add_credits = function(mod, args)
ArrowAPI['credits'][mod.id] = args
end
}
Then, on the Back center object definition, just do artist = 'key' or artist = { 'key1, 'key2', ...}
Additionally you could just... use my API mod
How do I check what cards are in this area right now?
G.hand.cards
is there a way to make wee joker retexture to a new texture instead of just a resized basic joker
G.hand is the area, G.hand.cards is the table of cards in the area
G.deck is the remaining cards in deck
And full deck?
G.playing_cards
it's not a card area tho, just iterate G.playing_cards directly instead of like G.decks.cards
Wait, is there a context that is before the cards are played? Because context.before is right after the cards are played but before they start scoring and that's too late
Yes
Which one is it?
I Forgot
context.press_play?
I reread the message, apparently it’s “2” of 8.
According to auzzy
they said before the cards are played, though
Not 1 in 6.
so G.play.cards should be empty, which is correct
That works :3
does returning ["chips"] = <number> act the same as returning chips = <number>?
Yes.
How to make joker perishable?
stickers = {“perishable”} I believe
thats only when creating the card
Oh
And how do I get the suit of a card?
playing_card:is_suit("Hearts")
card.base.suit
respects enhancements
How do you make it so that all jokers lose all their stickers?
silly question about my hooks from yesterday. is it possible to make it so the return call happens before my if statement (the obvious move of just, moving the return line, didn't work)?
function Card:set_seal(_seal, silent, immediate)
if self.ability.set ~= "Joker" then --this is such a hacky solution and probably breaks cryptid a tiny bit since you can actually seal jokers in that mod. too bad!
SMODS.calculate_context({setting_seal = true, other_card = self})
end
return set_seal_ref(self, _seal, silent, immediate)
end```
good afternoon
"Squares all of your current chips and mult (Triggers After Scoring)."
What?
Good afternoon 
hii!
i'm struggling to do something that feels simple here
if context.skipping_booster and not context.blueprint then
local spawn_input = {
function() FANATIC_UTIL.spawn_fart_card(context, card, true) end,
function() FANATIC_UTIL.spawn_pee_card(context, card, true) end,
function() FANATIC_UTIL.spawn_poo_card(context, card, true) end
}
local random_spawn = pseudorandom_element(spawn_input, pseudoseed('artistic_dice'))
if SMODS.pseudorandom_probability(card, 'artistic_dice', 1, card.ability.extra.denominator) then
--
end
end
end
i'd like to set the spawned card to a negative edition, how could i do that?
SMODS.add_card
Takes argument for cards and edition also enhancements
There’s pool_enhancement for random enhancement aswell
you can save the result of the function you are running in your return in a local variable (eg. to_return) before your if statement and then return that after your if statement
So, nobody knows?
Make or add ?
anyone know why an event created in post-trigger is being resolved before the event created in the evaluation that triggered post-trigger?
i'm so rusty at this
for i = 1, 5 do SMODS.add_card{ set = "Consumeables", edition = "e_negative" } end
if context.joker_main then
return {
chips = card.ability.extra.chips
}
end
end
would this be correct
yes
My code is doing what I want, the animations are just playing in reverse order
Mhm
then reverse them in the code, so they double reverse

because the return of the other calculate is not processed before your post trigger, try putting that event in a return func
i forgot, do i need an extra{}?
key = "covetous_ring1",
atlas = 'covetous_ring',
pos = { x = 0, y = 0 },
rarity = 1,
discovered = true,
blueprint_compat = true,
eternal_compat = true,
perishable_compat = true,
cost = 5,
here, for the chips i mean
local set_seal_ref = Card.set_seal --add setting_seal context
function Card:set_seal(_seal, silent, immediate)
local ret = set_seal_ref(self, _seal, silent, immediate)
if self.ability.set ~= "Joker" then --this is such a hacky solution and probably breaks cryptid a tiny bit since you can actually seal jokers in that mod. too bad!
SMODS.calculate_context({setting_seal = true, other_card = self})
end
return ret
end
in case u havent figured it out
u need a config and extra in it, yes
In config
the post-trigger event?
replacing what i was using before with like
function()
SMODS.add_card {
set = 'Silly',
}
G.GAME.consumeable_buffer = 0
return true
end,
--etc
i would run
random_spawn:set_edition("e_negative", true)?
yeah
config = {extra = {chips = 10}} for instance
is it possible to do xchips?
you can put edition = "e_negative" in add_card
yes
Yes
card.ability.extra.xchips?
i'm asking if i can write it like this so it's dependent on random chance
xchips = card.ability.extra.xchips
Please read the docs man 
yes
Obg chat :3
thank you!
No
Chips is the value stored in your extra
modding-dev is surprisingly active today
i did :) i'm just not good at programming
is G.C.JOKER_GREY the default colour used in joker descriptions?
You would do xchips=card.ability.extra.chips in your return
ah, yes
It should be simple really
G.C.UI.TEXT_DARK
unless you mean something else
ok
if randomeffect == 1 then
for i = 1, self.config.extra.randomitems do
local neoitems = pseudorandom_element(G.P_CENTER_POOLS.Consumeables, pseudoseed('neo1')).key
SMODS.add_card({ key = neoitems, edition = 'e_negative' })
end
end
no, default is black, but you can specify this with {} when styling your text and it'll reset all text to the default style
dont use self, use card
also you dont need to use pseudoseed('neo1')).key lol
ah i forget
wha
just either pseudoseed('neo1') or 'neo1' (newer smods releases support the latter now)
no thats correct
yeah but im doing wierd shit with loc_vars so in this case i do need it. also the text colour default is defintiely not G.C.BLACK
config = { extra =
then what? i haven't done any chip jokers lol. i also kinda forgot some of this stuff
🤔 wait what
.
OH
i thought its taking the key from pseudoseed-
Chips=value and close it
yeah
"1. Creates {c:attention}#1#{} random {C:dark_edition}Negative{} consumables.",
but you can just use a string instead of pseudoseed now
i think this is done
although my set = "Consumeables" was shorter
next one
"2. Retriggers leftmost and rightmost jokers {C:attention}#3#{} times.",
if in the chips = i put 1.5, in the return does it multiply the chips by 1.5?
Yes
yes
set_ability is called on card creation, right?
yes
this is tricky, now i need to make it so that both leftmost and rightmost jokers are retriggered 2 times
goddamn it
whats the code
it looks like you are doing extra.chips there
🤔
or idk
Can i see the full code
if context.retrigger_joker_check and context.other_card == (just the position here) then
return{
repetitions = 2
}
end
i could be that, yes
is it different for chips?
key = "covetous_ring1",
atlas = 'covetous_ring',
pos = { x = 0, y = 0 },
rarity = 1,
discovered = true,
blueprint_compat = true,
eternal_compat = true,
perishable_compat = true,
cost = 5,
config = { extra {chips = 1.2}},
calculate = function(self, card, context)
if context.joker_main then
return {
xchips=card.ability.extra.chips
}
end
end
}
my wifi died for a sec, my bad
I think it’s extra= in config
config = { extra = {chips = 1.2}}
local leftmost = G.jokers[1]
local rightmost = G.jokers[#G.jokers]
you are missing a =
G.jokers.cards
Smart bepis
G.jokers.cards refers to the cards inside the cardarea, G.jokers is the entire cardarea
yes
config == ?
or statement
its fine lmao
context.other_card == leftmost or context.other_card == rightmost?
I wish i can relate
like this?```lua
repetitions = math.min(card.ability.extra.leftmostrightmostjokers, self.config.immutable.totalretriggerlimit)
I mean I can still use card.ability?
For me, it's quite the opposite.
apply = function(self, back)
Pokerleven.ina_manager_area.config.card_limit = self.config.managers
G.GAME.round_resets.hands = G.GAME.round_resets.hands - 1
G.GAME.round_resets.discards = G.GAME.round_resets.discards + 1
end,
Shouldn't this set hands ands discards for a deck?
for a different joker of a different mod made by someone else, they asked me how to fix their random edition problem not being "random", i only told them "pseudorandom", is that a good answer?
not being "random"?
they keep getting the same edition
they have a joker that applies a random edition, seal, and enhancement
well if its the same seed then yes
Sorry to interrupt, anyone happen to know why this would work while the joker is in the collection but return nil once I have it in my slots?
local copy_name = "None"
return { vars = {copy_name} }
This is in loc_vars in my joker
does this actually double your money?
G.GAME.dollars = G.GAME.dollars * card.ability.extra.doublemoney
ease_dollars(math.min(card.ability.extra.doublemoney, card.ability.immutable.moneymultceiling) * G.GAME.dollars)
well no, ease_dollars adds to your money, it doesn't set it
effect #4 explicitly states: "Multiplies your Money by X#2#, no limits."
this do "your money" + "your money"
just do ease_dollars(G.GAME.dollars*(card.ability.extra.m_multiplier-1) )
i'm so fucking lost but sure
Try returning the string directly
ease_dollars add to your money
not yet
i need to add an actual limit though, i don't want the game to fucking crash that's why i made a hidden immutable value to serve as the max limit
Dope
Not so great art
true
use math.min
ease_dollars(math.min(card.ability.extra.doublemoney, card.ability.immutable.moneymultceiling) * G.GAME.dollars))
if card.ability.extra.doublemoney is equal to 2 that will instead triple your money
ease_dollars(math.min(limit, G.GAME.dollars))
cooked in the drawing
well it should be math.min(limit - G.GAME.dollars, G.GAME.dollars)
This reminds me of dark souls
very cool art
because the limit for the total amount of money
if the limit is 20 for example and G.GAME.dollars is 30 for example it will remove 10 dollars instead so your math ain't mathing
moneymultceiling = 1e100
question. how do i make a smeared-esque joker that pairs Hearts and Spades? i did see the code from moddedvanilla but i'm stuck on what the heck SMODS.smeared_check does, and literally every result for it is. Other people asking what it is.
function Card:is_suit(suit, bypass_debuff, flush_calc)
local ret = card_is_suit_ref(self, suit, bypass_debuff, flush_calc)
if not ret and not SMODS.has_no_suit(self) and next(SMODS.find_card("j_stla_sacredHeart")) then
return SMODS.smeared_check(self, suit)
end
return ret
end```
if it's a limit on how much money can be added then yea it's just limit in the math.min. but i took it as a limit on the total amount of money you can have
I would just do this to double money with limit
yes
what, double money with moneymultceiling?
The question is, do you need a limit on the money added or on the resulting money?
How do I get the level (and with that the chips & mult) of a poker hand?
It still had the issue, I think it has to do with the compatible tag which I just stole from blueprint in the vanilla remade thing, but i don't really understand how all that works tbh so not sure why it would cause that. But it only returns nil when the compatible tag is there.
on the money added
wdym, idk what is moneymultceiling
moneymultceiling = 1e100
doublemoney = 2
but the ceiling is immutable
so when you try to increase doublemoney using oil lamp
you dont need "doublemoney", you can just add your money to your money (i think so)
oh
yeah, you just. add money to money, right?
it multiplies money by X"doublemoney"
I don't know much about Cryptid and what oil lamp do
oil lamp increases joker values
specfically the joker to the right
by x1.2
this allows some jokers to give unholy mult
And how does she do it?
they have a whole function for it
in a separate file
but from what i can gather, they check for any values in the joker that is a number
and then increase it accordingly
they can't affect immutable values
moneymultceiling is immutable
ease_dollars(math.min(card.ability.immutable.moneymultceiling, G.GAME.dollars))
