#💻・modding-dev
1 messages · Page 487 of 1
pretty sure thats a playing card yeah
i don't see how that'd help ;u;
itd probably be better to figure out the root cause but did you try just
checking if j is a table first
aka type(j) == "table"
right i'll give that a shot
i mean
this should probably be a temporary fix
but itll hopefully stop crashing until then
is it specified what exactly is the boolean being indexed
G.E_MANAGER:add_event(Event({
func = function()
if not G.playing_cards then return false end
-- code here
return true
end
}))
because a playing card should not be a boolean tmk
alright will try
i mean crossmod is crossmod sometimes people do weird stuff
i dont think its unimaginable that j is a boolean
it shouldnt happen still
no but this happens with my decks too
which don't have custom cards
working on my end, will send it over
question: have you tried using ipairs instead
coming back with hopefully one last finishing touch, im trying to have my joker that creates glass cards on card destruction add it to the deck like marble joker does, because i think its important to be able to see the rank and suit, but the problem is it gets stuck here and never goes into the deck, effectively softlocking the player. in theory i can just add the old code but i much prefer it show what actually gets added if anyone has any expeirnece with this
@long sun
what is the command to check if a played card has a specific enhancement? (for example stone)
oh for the second part?
SMODS.has_enhancement(card, "m_stone")
aight
for G.playing_cards
it is
brain is melting it's nearly 3am sorry ;u;
the reason you might have this might be because there might be a non indexed value the games uses
person says it works now anyway :D
but ya i'll look at this tomorrow
so change to ipairs, then?
gotchagotcha ^^; will try and remember to do that
thanks!
do you have the lua extension installed
uhh i think so? its the one that formats stuff right
should be right click > format document
you can also make it format on save
holy peak ok
Okay so how would I go about making it so that a card is scored while its in the hand?
something like baron?
this is the context for something like that
context.individual and context.cardarea == G.hand and not context.end_of_round
No I want it to be scored like a normal card just you dont have to play it, it just scores while in your hand
Using it for a seal
oh
i wanna say this exact kind of seal is in uhhh handsome devils? you could check that
might be black seal
I don't see anything wrong, so it might be the context that's the problem. How are you triggering this joker for testing?
it's triggered on destroying a card with diamond suit
yes, but how
Ill go check it out
Perhaps you could do SMODS.score_card(card, {cardarea = G.play})
How are you doing it for testing, I mean
yes
im using a hanged man
I think the problem is that the hanged man consumable places itself in G.play as well
oh my god
marble joker does it in setting_blind so it doesn't have to worry about that
yeahhhh ok 😭
same thing will happen with any card that destroys in scoring
Does anyone know where i can find the scale/rotate mods for the legendary jokers' sprites?
whats the real name of this
shop_jokers
shop_jokers???
like i have THESE mods, but it's for the soul itself. if i can get rid of the bounce it does, then we're fine
unless you want something different from what I'm thinking of
Not sure why but my custom joker doesn't create a tarot card when a stone card has played even if i increase the chances...
Am I missing something?
card is the joker, context.other_card is the card played
not playing the money animation for some reason
what's dollar_cost
is that something you added or a cryptid thing or
config = { extra = { fee = 15 } },
loc_vars = function(self, info_queue, card)
return {
vars = { card.ability.extra.fee },
colours = { G.C.MONEY }
}
end,
calculate = function(self, card, context)
if context.starting_shop then
for _, c in ipairs(G.shop_jokers.cards) do
c.ability.couponed = true
c:set_cost()
end
for _, c in ipairs(G.shop_booster.cards) do
c.ability.couponed = true
c:set_cost()
end
for _, c in ipairs(G.shop_vouchers.cards) do
c.ability.couponed = true
c:set_cost()
end
return {
message = localize('k_shop_free'),
colour = G.C.MONEY
}
end
if context.setting_blind and not context.blueprint then
local fee = card.ability.extra.fee
if G.GAME.dollars >= fee then
G.GAME.dollars = G.GAME.dollars - fee
return {
message = localize{type='variable',key='a_dollars_minus',vars={fee}},
colour = G.C.RED,
dollar_cost = fee
}
sorry im on phone this is unreadable
think i found it actually nvm
i dont see why it wouldn't play it tho
it did gets the player's money
its just no animation
on the counter yes
what do i need to do to make it animated
either return { dollars = value } or ease_dollars(value)
i see
and how do i detect the player's spending
what do you mean not directly
it detects any form of manipulation on the money
so rentals would probably count as spending for example
i mean there are many other things that i wouldn't consider spending this would count, like your fee
theres no other reliable way?
and that is
¯_(ツ)_/¯
the smods.sound part looks ok but everything after is really old syntax
what are you trying to do?
init...
hi bepis
play_sound("modprefix_wololo")
Bebus
buuuump
hi
🙄
oh shit nice
i mean that still says 8 but
it was my balatro freezing
lmao?
i remember,,,
New to modding and I got changing text down in my mod. I'm now trying to add some visuals. Any advice on how I could make a png appear [here] in the shop phase?
question, during context.selling_self, would #G.jokers.cards include the joker being sold?
idk
Yes.
how can i prevent any cards in the hand from being moved?
i remember that there's a moveable property to set to false, but i forget where in the card hierarchy it lies
card.states.drag.can = false?
trying not to squeal rnnbkjlfndlslgg
Perkeo has ADHD confirmed
can't focus
you can make him lock tf in finally
You should make it work then
How can I get this to delete ALL discarded cards
bur how
@tight hull how did you get the mod badges working brw
if context.pre_discard then
if SMODS.pseudorandom_probability(card, "seed", 1, card.ability.extra.odds) then
card.ability.extra.active = true
end
end
if context.discard then
if card.ability.extra.active then
if context.other_card == context.full_hand[#context.full_hand] then
card.ability.extra.active = false
end
return {remove = true}
end
end
```?
What is the goal?
making my mod badges has like the gradient from Cryptid
It seems to hook SMODS.create_mod_badges and create the mod badge itself.
Update SMODS
is there documentation on how I could add a setting to the game? or a config option associated with my mod that could be accessed in-game?
That means a LOT more code is gonna need to be updated.
I'm on beta-0614a SMODS.
Yes, that version is old, you need to update.
lovely...
Alright.
Ok, for now, how do I do it in the OLD SMODS?
I'm gonna hold off updating until I get more stuff done.
why would you hold off on updating
theres not that many breaking changes
and people are going to play your mod on the latest
Because I'll hold off until Shenanigans and some more mods get updated
[manifest]
version = "1.0.0"
priority = 0
[[patches]]
[patches.pattern]
target = "game.lua"
pattern = "boot_timer('splash prep', 'end',1)"
position = "after"
payload = "BI.create_pools_tooltips()"
match_indent = true
times = 1
this patch prevents the game from starting whyyyyyyy
patches hate me
What does that line look like in the lovely dump?
I'm gonna try to not patch the game if I can avoid it I decided
alls I need is for this function to run after all the cards in the game have been declared
basically after I click on the game to launch it, at some point all of the cards get defined and I need this function to run after that
Why?
because I need to do stuff with all of them? what matters why lol
Probably because knowing why you're trying to do something can help lead to the solution
Idk why it has to be secretive
Alright, I'm working on the new loc_vars
-# to save myself some headache...
This look good for the new edition or do I need to change something before I proceed to Step 2?
basically I want to add tooltips to every item in the game and to do so I need to mess with their loc_vars. I made a function that is supposed to hook the loc_vars of every card in the game when it runs, adding the necessary code to each of them, but to do so I need the cards to exist already.
I didn't mean to come off difficult or rude, just didn't really know how to explain the situation
I tried hooking Card:init() instead but that has also left me out of luck, it isn't adding tooltips like I need it to
the only other way I've been able to pull this off successfully until now is by taking ownership of cards and adding the tooltips manually, but obviously that's really time consuming and I'd rather have a function that can do it for me
Remove G.GAME.probabilities.normal or
Also other_value doesn't exist.
Documentation has other_value, but ok.
Should be able to make the changes and be on my merry way to updating.
Yes, it is referring to other values you might be returning in loc_vars
ah, ok
so whats the solution
You mean like extra info_queues?
here
local fourthwall_gradient = SMODS.Gradient({
key = "fourthwall",
colours = {
HEX("ff0000"),
HEX("ff6600"),
HEX("ffff00"),
HEX("4bc292"),
HEX("1e9eba"),
HEX("00ffff"),
HEX("0000ff"),
HEX("708b91"),
HEX("ef0098"),
HEX("ff00ff"),
HEX("ff0000"),
HEX("ff6600"),
HEX("ffff00"),
HEX("4bc292"),
HEX("1e9eba"),
HEX("00ffff"),
HEX("0000ff"),
HEX("708b91"),
HEX("ef0098"),
HEX("ff00ff")
},
cycle = 1
})
nxkoo_dies.badge_colour = fourthwall_gradient
nxkoo_dies is global
ok gn
insanely broken lol
tomorrow i figure out why everything triggers twice with everything i do involving jokers
somecom surely youve noticed
do you know how many square root mult workarounds ive had to do
2
and that's 2 too many
Is this a new card or did you take ownership?
i see
no you dont
what's nxkoo_dies
i read that, what is it
it needs to be SMODS.current_mod
ahhh ok then idk why it runs twice lol
oh
yeah i know
you asked that the first time lmfao
with chud
still doesnt work
[[patches]]
[patches.pattern]
target = "functions/common_events.lua"
pattern = 'for _, v in ipairs(info_queue) do'
position = "before"
payload = '''
if conditions then
info_queue[#info_queue+1] = infoqueue
end
'''
match_indent = true
its hard to tell 😦
show me
how.
no wait it was /lh im sorruyohltyjl;j
local variables don't exist outside of where they were created.
nxkoo_dies = {
show_mustard = false,
mustard_timer = 0,
show_image = false,
image_timer = 0,
show_flashbang = false,
flashbang_timer = 0,
current_flashbang = nil,
path = SMODS.current_mod,
flashbangs = {
shop = "shop_flashbang.png",
blind = "blind_flashbang.png",
hand_played = "hand_flashbang.png",
discard = "discard_flashbang.png",
round_start = "round_flashbang.png",
joker_trigger = "joker_flashbang.png"
}
}
not there, in the line where you set the badge colour
oh
alright so inside the payload, info_queue[#info_queue + 1] gets assigned to the code I need to be adding to the cards, correct?
yes
thanks
No, it gets given the localization/center you want the tooltip to be.
write it correctly
the desc updates accordingly btw
It's SMODS.current_mod not SMODS.current.mod
br
yes I understand but the localization is variable, depending on the card that the tooltip is attached to. As an example:
if BI.show_item_pools(card.config.center.set) then
local text = BI.generate_pool_text(card)
info_queue[#info_queue + 1] = {
set = "Other", key = "item_pool", vars = {
text.is_modded,
text.pool,
colours = {
text.colour
}
}
}
end
this is what I have on each of my modded cards right now, and the generate_pool_text function returns the necessary values for the localization
would I be able to patch all of that in?
Yes.
So where do I need to put the local vars?
I already tried putting it at the top of the file, above its respective loc_vars function, and the one in the screenshot
You define them again.
Actually no, you just put in the base numbers.
1, card.ability.extra.odds
So if I understood right:
Yes.
whats the cause for no assigned repetitions again
You're likely returning something without a context check.
Oh thank God, it's working now
mine has context tho
here
calculate = function(self, card, context)
if context.end_of_round and not context.blueprint then
card.ability.extra.xmult = card.ability.extra.xmult + card.ability.extra.xmult_gain
return {
message = localize { type = 'variable', key = 'a_xmult', vars = { card.ability.extra.xmult } },
colour = G.C.MULT
}
end
if context.joker_main then
return {
xmult = card.ability.extra.xmult
}
end
end
}
if context.end_of_round and context.main_eval and not context.blueprint then
thanks
CTRL + C on crash screen
this patch seems to cause a crash whenever I hover over any card with an additional tooltip, such as Stone Joker, which caused this crash. Here's the patch:
[[patches]]
[patches.pattern]
target = "functions/common_events.lua"
pattern = "for _, v in ipairs(info_queue) do"
position = "before"
payload = '''
if BI.show_item_pools(card.config.center.set) then
local text = BI.generate_pool_text(card)
info_queue[#info_queue + 1] = {
set = "Other", key = "item_pool", vars = {
text.is_modded,
text.pool,
colours = {
text.colour
}
}
}
end
'''
match_indent = true
Yes, you need to check if card
unfortunately it doesn't seem to work. Even though the generate_pool_text function works perfectly if I take ownership and manually add this code inside of loc_vars, it doesn't work from where it's being called as a result of this patch
i'm trying to install steamodded but i just can't find the appdata folder
Press the windows key and R and then type %appdata%
it's normally hidden, the easiest way to access it is using the Run program. But long-term you'll want to enable the viewing of hidden files in your directory
(assuming you're the only one that uses your computer, otherwise keep it hidden)
well how do i unhide them
View > Show > Hidden Items in File Explorer
and i just make a folder called Mods, right
are you going to download the files manually or do you know how to use git clone
Trying to make booster packs but this happened
no idea what that is
don't worry about it. Whatever way you use to download them is fine, I just find cloning the repository easiest
but that's only bc I'm tech savvy I suppose
@daring fern is this the only way to add things to the info_queue, or can I edit the loc_vars of cards like I originally tried to do
bc calling the generate_pool_text function doesn't crash anything when I call it from inside of a card's loc_vars
Yes, no you can't.
I think I'll just add it to each card manually then. It's causing alot of problems doing it the other way and the only thing I lose by adding it manually is time (and it might cause cross-compatibility issues but idrc)
thank you anyway
name = "Blank Joker",
key = "blankjoker",
config = {
extra = {
}
},
loc_txt = {
['name'] = 'Blank Joker',
['text'] = {
[1] = 'Copy effect of a random, unknown {C:attention}Joker{}.',
[2] = 'Changes every trigger.'
}
},
pos = {
x = 6,
y = 0
},
cost = 10,
rarity = 3,
blueprint_compat = true,
eternal_compat = true,
unlocked = true,
discovered = true,
atlas = 'CustomJokers',
loc_vars = function(self, info_queue, card)
return {vars = {}}
end,
calculate = function(self, card, context)
local target_joker = nil
target_joker = G.jokers.cards[1]
if target_joker == card then
target_joker = nil
end
return SMODS.blueprint_effect(card, target_joker, context)
end
}```
running into a kinda funny bug, i have a joker which makes a random joker rental at the end of the round, and ive realized that whether or not the rental takes 3 dollars immediately when it's applied is entirely dependent on whether the joker is to the right or left of landlord. is there a context besides end_of_round that would apply just a little bit before rental takes money?
this is what im currently doing and while it's functional it leads to an unexplained strategy where you want your landlord to be the rightmost joker and thats weird and strange
this might be kind of jank but you could do context.after and check if the amount of scored chips is more than the blind requirement
true yeah
damn Mr. Bones and saving people from dying
you could hook the rental sticker and make it apply later perhaps
dunno how that would work
I think that would make it less abusable anyway
also gives you a little warning in advance
If I needed a Joker like that but didn't want rentals, you just sell it before playing the winning hand
No, you would hook end_round()
which isnt really landlord coded but might be more fun to strategize with
probabaly just gonna go w that actually, ty
I forgot if I've asked here, but how do I configure this to destroy ALL cards selected?
Yes, you did ask.
And I provided a solution.
Thanks
is taking ownership of consumables as simple as SMODS.Consumable:take_ownership() like it is for Jokers?
yes, it's the same thing
there shouldn't be an issue with doing hand_chips > mult even with talisman
since they're both turned into bignums
ah shit
thanks tho
Is it possible to check if a card would score anything when doing SMODS.score_card?
eval_card isn't sufficient because it doesn't account for jokers.
im checking to see if the mult is less than a fifth of chips, is this the way
Wouldn't it be if mult < (hand_chips/5)?
love.audio.stop()?
It does also restart the music.
Sooo, I don't quite understand the DeckSkin doc, I also have the Example Mod open, but I don't understand the reason of icon_lc/hc, could someone explain please?
Oooooooh I figured it out, but as a question, would this be possible to do, or do I need to split that up?
did you get it to work?
about my DeckSkin problem this message here seems to be the answer to my problem, I'll try it out now
the icon doesnt need to be saporate (at least I think)
i am so stupid 😭
just curious, can you change the color of the name of a joker?
and how would I do that?
You would do {C:colour}
can I make it a gradient?
Yes.
.
It's the same as a description I think.
You would do {C:modprefix_gradientkey}
it works that way?
I feel threaten by the ? emoji 😭
SUPER ❓
i msde a joker on joker forge and apparently somethings wrong on line 69 and i dont know what it is
close to if it says
and return too
Which line is line 69?
mod prefix or mod id?
just a code gen error
Mod prefix.
so it kinda doesnt work (it just stays this color)
Code?
name = '{C:Rcm_change}Return By Death{}',
Gradient code?
local color_change = SMODS.Gradient({
key="change",
colours = {
HEX("232329"),
HEX("dd9237")
},
cycle = 5,
interpolation = 'trig'
})
The mod prefix needs to be lowercase I think.
how would i make this conditional? do i need to hook it somehow?
local to_big_old = to_big
function to_big(x)
if CONDITION then
return to_number(x)
else
return to_big_old(x)
end
end```
yeah that
works now
when people are so unfathomably smart that modding dev is dead
Hi, I literally yesterday got into coding and I wanted to do a simple joker. It works that every time you use a planet card it additionally upgrades another random hand. I've got the part on detecting when the planet is used and how to level up hand but the problem is I have no idea how to make it upgrade a random hand
im not sure but would
for _, v in ipairs(G.P_CENTER_POOLS.Planet) do
if v.config and v.config.hand_type then
local hand = G.GAME.hands[v.config.hand_type]
if hand and hand.visible then
hands[#hands + 1] = {
key = v.config.hand_type,
hand = hand,
planet_key = v.key
}
end
end
end
local chosen = pseudorandom_element(hands, "seed").key
work?
No.
it's a slightly modified version of the function i use for most played hand
damn
local hands = {}
for k, v in pairs(G.GAME.hands) do
if SMODS.is_poker_hand_visible(k) then
table.insert(hands, k)
end
end
local hand = pseudorandom_element(hands, "seed")
while hand == context.consumeable.ability.consumeable.hand_type do
hand = pseudorandom_element(hands, "seed")
end
SMODS.smart_level_up_hand(card, hand)
```?
for this effect do i have to just copy paste set_ability everywhere or can i hook something?
when i have {C:color} can I use hex?
you have to define it yourself if you want to use custom colors
thx i will check that later
btw i have the code of the game extracted but where is code for the jokers?
can't find it
Is the goal that "Plant" jokers have a 1 in 2 chance to be negative in the shop?
shop, packs etc
You could hook Card:set_ability and make it negative.
you mean like?
assert(SMODS.load_file("src/tags.lua"))()
oh you need a path for it?
uh. yeah of course
how else would it know what to load
anyway assert (the function) is just a simple way of error checking something lmao
load_file returns nil and assert detects that
bringing an error
and halts program execution
SMODS.load_file is doing most of the work here
huh i thought its a way to load another file from another folder
you need to run it as a function since it returns a function
Ughhh do i put it in the return?
hows that
without the assert line you basically just do SMODS.load_file(file)()
assert just adds an additional error check
oh okay
thanks pookie
mwah
is there anything other than jokers that i should split
from main.lua
Is my mod gonna break if I update steam modded
50/50
is there a way to make a consumable not disappear when used ?
that means you are loading the file that uses wankers before the file that defines wankers
how do you define it
at the top of the file, yeah
well i add that
idk why its yellow under the rarities
shouldnt it be a string
should it?
yes
ah damn
thx
I copied it from the wiki, can someone tell me why this is wrong
The indentation's off?
Also ifs in lua doesnt really use brackets?
Least, thats what i learned of
No.
Well that's what it is in the wiki
Well so where do i put it?
Im really new to this so i kinda don't know
If i remove the brackets it's still not working
Outside of the return.
it is not code
its what variables are available in context in that context
i mean it's a valid lua table but it doesn't run anything
get_weight = function (self, weight, object_type)
if EF and EF.vars.shovel_voucher then
return 0.65
else
return 0
end
end
am i doing something wrong or why don't they appear in the shop
fixed it
forgot to add the pools field
is there a way to add a new button to a consumable ?
Ok so i still kinda don't get it
If i want the consumeable to be a planet then what will it look like
like the whole context
context.using_consumeable and context.consumeable.ability.set == "Planet"
It's working
Thx
how do you create a playing card with SMODS.create_card again
WRONG QUESTION, wheres the code that creates the Ace card in the balatro title screen
https://github.com/SpectralPack/Talisman/blob/main/lovely.toml#L14-L22
That's how talisman applies the gold seal
i see, thanks
@manic rune it crashed
fire
👋
doesnt seem like its related to SMODS.load_file, but more of the content of your files
im confused on which
also haaaaaaaaaiiiiiiiiii
Hi bepis
agreed
the main menu hook it seems
Existing means getting up and figuring out a problem i came across yesterday
hi everyone
Hi N
weird, i load the jokers already
should it not use the joker for the title screen
haaaaaaiiiii
idk i havent read your code
guh
hold
function Card:resize(mod, force_save)
self:hard_set_T(self.T.x, self.T.y, self.T.w * mod, self.T.h * mod)
remove_all(self.children)
self.children = {}
self.children.shadow = Moveable(0, 0, 0, 0)
self:set_sprites(self.config.center, self.base.id and self.config.card)
end
local mainmenuref2 = Game.main_menu
Game.main_menu = function(change_context)
local ret = mainmenuref2(change_context)
local newcard = Card(G.title_top.T.x, G.title_top.T.y, G.CARD_W, G.CARD_H, G.P_CARDS.empty,
G.P_CENTERS.j_tngt_wherethefuck, { bypass_discovery_center = true })
G.title_top.T.w = G.title_top.T.w * 1.7675
G.title_top.T.x = G.title_top.T.x - 0.8
G.title_top:emplace(newcard)
newcard:start_materialize()
newcard:resize(1.1 * 1.2)
newcard.no_ui = true
return ret
end
While im debating getting up do you guys know a way I can check all possible contexts a card could be triggering without allowing it to 'double dip' so to speak
My edition right now works in joker main to deal the bonus effect it has but a large variety of jokers dont trigger in main
Ie lusty joker doesn't trigger in main so my bonus does not apply since it applies its effect while scoring
no idea
Where's pseudorandom defined? Is it a love2d thing or did localthunk make his own random function
i also presume a bunch of context ors is not the wave because dear heavens
i was gonna say post_trigger but it only works on jokers apparently
yea that was the issue i ran into
misc_functions.lua iirc
I despise post triggers
eremel youre a smarty pants do you have any idea of a smooth way i could manage that
They epitomise the dev mindset of “do it quickly to make this specific effect work”
What does the edition do
whatever the card returns it gives it a bonus
ie gros michel give +15 mult, bonus can add 7.5 mult to it resulting in 22.5 mult up to like 37.5
issue is right now with thigns like lusty joker which activate during scoring im not impacting that because its not joker main
i can also provide code if itd be easier
is there a way to add a add button to a consumable ?
I’d hook calc joker
if you mean for me i am doing that
Check for the edition and then change the values
yes hook/patch Card:highlight or G.UIDEF.use_and_sell_buttons
ok thx but how ?
it's UI so it's kinda advanced
dam
this is how i do it
https://github.com/nh6574/JoyousSpring/blob/c0a24f9ba7e75f51d8ec09f22f12329c7a837cca/src/general_ui.lua#L423
crashes the game somehow
i've seen in your code that you use a function to see if a card is a field spell how does you check for that or where is the function defined ?
i think monsters.lua?
it shouldn't be relevant to you i dont think
you can click on a function on github and it'll tell you where it appears
!postcrash
it's beacaus i want to do somthing similar and wanted to see how it was done
is reset_card_picker_selection a thing
for one of my joker yes
it acts like Ancient Joker
did you define it in a file you're loading after this one?
Is there any documentation for custom jokers or templates? The only template i found was for changing existing jokers into a SMOD ones
do i need to put it in the same lua as the joker?
it needs to be defined somewhere and it can't find it
im dumb
i accidentally cropped the definition

am i insane and do things like delayed grat and egg not return dollars or am i simply not checking it correctly
if ret.dollars then
if not self.ability.base_dollars then
self.ability.base_dollars = ret.dollars
end
ret.dollars = self.ability.base_dollars * multiplier
end
trying to print what was changed for delayed grat gives me nothing
Hey so i created an custom rarity, and i want to add it to an card. so for example, if the rarity is called 'Test', should the rarity added to the card look like this?
rarity = Test,
don't rarities have indexes
how do you apply an eternal to a joker for a deck
idk i've never made a rarity
there is a way
Ive decided there is no way
if you can do it with debugplus
fair
then you can't do it in code i'm sorry
that's just how it is
#debugplus
#iveconsumedlargeampuntsofcocaine
Whats an ampunt
let it be clear, you will be shot dead in the parking lot behind a target
5th time this week
i don't know it is my first time even making a rarity 😭
the SMODS.Rarity wiki isn't helping me
yo mb i'll bring a knife instead
It is erroring me that the } should be next to the badge_colour
why is making rarity so confusing 😭
you need commas
Shouldn't you have commas after the key, badge color, etc
yeah
I recommend getting vscode and the lua extension, it will highlight syntax errors
how could i make it so my joker changes the background music ? like Jimball in the cryptid mod
that's not vscode then, you aren't a true vscode unless you go in raw
look at SMODS.Sound in the wiki
oh haven't thought of that thanks
it doesn't help tho... i just made my SMODS.Sound thing
doesn't tell me how to do it
Look at the select_music_track part
Does anyone have examples of SMODS tags I can use?
Oh cool very nice
VanillaRemade my beloved
Also, is there a way to grab the last blind's reward money in the shop or do I have to make a Lovely patch/a fork to keep a global variable updated with that?
Cause from what I've seen with what tags can do it doesn't appear as if I can store it in a local variable for the tag
Those are warnings, not errors
You wanna look for red text
Red underlined text
what is wrong with my synthax ?
the = after returm
x) thanks
does adding the replace = "music1" will make it so that whenever the song is played it replaces the maain music ?
it will make it so your sound plays instead of music1
whenever music1 would've normally played
you want something like this inside of your sound object
select_music_track = function(self)
if next(SMODS.find_card('j_prefix_key')) then
return 100
end
end
how would i check during context.selling_card what type of card the card being sold is?
also your sound key has to start with music_
context.card is the card being sold
got it, thank you
Why is the game still revering to the normal joker image when PearTeto.png is in the folder?
in your joker you have to set atlas = "PearTeto"
had the same problem (took me abt 15 mins to figure it out...)
okay this is a much sillier question, but i havent done the balatro modding stuff in a hot minute and i dont think ive ever done this in particular, but how would i check that a card is a specific type of card (in this instance, checking that the sold card is The Sun (or The Star but the "or" part is easy))
^
ok but where ?
haaaaaa
x)
im not that expereinced with modding balatro excuse my begginer mistakes
context.card.config.center_key == 'c_sun'
hi bepis
so now it works but the song is distoreted... ima look into it don't bother for now other peple might need help
im trying to figure out
why i cant use messages on cards in mod's menu
the print and juice_up do work
but the message doesnt work, i initially tried using SMODS.calculate_effect({message...}) but it doesnt work so i moved to card_eval_status_text
is it because of how i create my cards?
thank you!
calculate_effect just calls card_eval_status_text anyway
Ok I cannot for the life of me figure out what I'm doing wrong with this tag
apply = function(self, tag, context)
if context.type == "entering_shop" then
if #G.jokers.cards < G.jokers.config.card_limit then --and G.GAME.blind.money > 0 then
SMODS.add_card({set = "personajoker", key_append = "spawn"})
local func = function()
--ease_dollars(-1*G.GAME.blind.money)
return true
end
tag:yep("+", G.C.MONEY, func)
tag.triggered = true
end
end
end
Ignore the commented out part because if I can't get the rest to work then it doesn't make sense to investigate that part
I've also tried context.entering_shop
So now it works like it should but the song is sloewed down ingame whereas the file itself is not how could i fix that ?
context.type == 'shop_start'
So tags don't have the same contexts as cards
that's what you're looking for
yeah, so im just guessing card_eval_status_effect doesnt work in mod menus right now
i tried using SMODS.add_card to add the joker to the cardarea instead, the message still doesnt work
im out of ideas
nope
Is that the only thing I'm missing form what you can see?
try card_eval_status_text(card, 'extra', nil, nil, nil, { message = "whatever" })
maybe it doesn't work when an overlay is opened
yeah thats what im thinking too
because it pauses the game (?
they all should pause the game
bump
Ok the tag now kinda works
Except now there's a new issue
Trying to use G.GAME.last_blind.money gives nil
i tried changing it to false, still doesnt seem to work
hm
Thank you, but it seems like the rarity does not work still. I am not sure tho how can i add the custom rarity to the joker
in the rarity = part of said joker you would wanna put rarity = "[ModPrefix]_Teto"
Will I really have to do a lovely patch or a hook for this?
and 4 of default weight is alot imo go check https://github.com/nh6574/VanillaRemade/blob/main/src (then rarity.lua i think) to see what vanillas default wheights are
is there ANY mod that tried making a message popup in the mod's menu
😭
i dont even know where to begin with
weight should be a number
so without '' ?
yes
where'd you get last_blind from
also x) N' always here to help tbh
also I don't know why balatro does this
oh x)
and idk enough about music to help you
ima look into it then no worries
so basically i needed to change the pitch of the song
SMODS defaults it to 0.6 and makes it so that the pitch is the pitch AND the default speed of said music file
so i needed to put pitch = 1 as simple as that
and the song is played forever until it doens't need to
rarity issue
if you close the menu do all the messages happen at once
how do i show the rarity name of the joker
OHHHH
no you are almost right there, it happens behind the UI
🥴
i did set G.SETTINGS.paused to false
so i was wondering why it didnt work
ghhh
how do i, even fix this
just make the scale like 1000
G.GAME.previous_round.dollars i think
oh reward?
nvm
I imagine you can control the layer in some way
im aware, but i never tried manipulating layers before
I'm looking at card_eval_status_text and I can't figure out how to control the layer
is there an example of a mod doing this 🤔
Probably not
attention_text has this, so I was thinking maybe the 3rd number would correspond to z position? but i'm just guessing lol
idk what all the UI stuff means, only the basics
Those would be width and height iirc
pain
Works very well
Does SMODS.add_card not account for rarity?
badge_colour should be HEX('02e364')
does the card have under_overlay as true
I tested a thing 3 times with a custom pool of jokers and 3 times it gave me rares
or something
it does but if you're using a custom objecttype you need to set it up correctly
real quick, how would i iterate over the cards in hand to count the number of face cards in hand before scoring happens?
ah
(idk how)
i dont think so? this is how i create the cards, shouldnt affect anything
sure, one sec
busterb_Infamous
is it just card.under_overlay
i think so
What's vanilla joker rarity weights?
try that
its being forced to false it seems
oh well
confused as to what i'm doing wrong here
update smods
huh, didnt N' make it so you can use pseudorandom_element without randomseed now
yes
ohhh ok
i just changed smods version due to multiplayer update maybe i got an older one now
under_overlay is set to G.under_overlay and only affects how the element is interacted i think
mm
G.under_overlay is also always set to false :3
i just checked
i thought i was onto something but guess not lmfao
that fixed things for me thanks
i've been trying to figure out why nothing i've tried today in regards to pseudorandom was working i guess that makes sense now
yeah you initially needed to use pseudoseed alongside pseudorandom_element
it was something like pseudorandom_element(table, pseudoseed("hi"))
Hey so after trying to add an custom rarity to the card, hovering the card with the mouse jus crashes the game.
the other problem is that the box just doesnt clear so that might be the pause thing
the colour should be HEX('02E364')
yep that did it
something like this?
yeah i think this works well, idk if it would have any side effects
N' im forever in your debt after this
😭
forever squared
because im already in your debt
ghh
dont worry you will repay by me stealing ur stuff
How does one apply an ObjectType rarity to a Joker?
rarity = "(mod prefix)_(rarity key)"
I mean this
Apparently if I generate a random joker through an objecttype I need to redefine rarities to make it respect rarities
idk if this is the issue but the rarity keys are uppercase iirc
or capitalized rather
No that's not the issue
I made the rarities and don't know where to put them
Cause this is not an SMODS.Rarity
Trying to make a deck change the suit of every card after beating a boss blind but it doesn't do so, and it only does so at the beginning of the run on the deck, how do I make this work properly. I did try to use pseudorandom to choose a random rank but that didn't work
in the same place with the other rarities?
i dont understand the question
Should probably pass this through the arguments to not make everything the same layer
of course
Good to know that's how you change layers tho
decks dont have context.main_eval
so this is doing it's job of basically being a higher chance of hitting wheel of fortune but it can seemingly still hit even when all cards have an edition already, causing the game to crash
huh
would removing that make it work properly?
i could try
what page was this
you would need to replace that with not context.individual and not context.repetition iirc
gotcha
i gotta remove the blueprint stuff too
i had the code lying around from a scrapped joker
SMODS.Back
So it would be here?
wheel of fortune doesnt check if there's a valid target because it checks in the can_use function, you would need to
In the rarity field?
Is this fine?
yeah
@red flower the wiki isnt clear enough, what API should i use for spawning negative tag after beating a blind on a deck
if you're using the latest smods you can just use context.beat_boss
so this?
Are you trying to register a new rarity in the objectype or make the vanilla ones work with the objecttype?
would i just put it at the end of my joker like in WoF
I'm trying to make vanilla joker rarities work with SMODS.add_card specifically with a custom set of jokers
yes but jokers dont have that so you would need to add that check to the calculate logic
ah ok
ouh
yeah thats why I said the vanilla ones were capitalized
anyways how would i get the rank of a scored card
for example like how would i add mult equal to the rank of scored cards
you would check for the end of round context and then use add_tag(Tag("tag_negative")) (i think thats the key)
in calculate or apply
no i mean kinda like how raised fist does it
i forgot instancetype is a thing even though i touched ui several times :(
calculate
got it
this is how smods does it for normal jokers
ig
sorry i don't fully understand how you would go about doing this
card:get_id() returns a card's rank, where instead of card you should have the specific card you need
usually context.other_card
that return checks if there's a joker with an edition, you would either need to check that or that elegible_card exists
I can prop up a mockup of a joker like this if by this you mean that the effect of the joker is something like "This joker gains mult equal to the rank of scored cards"
yeah
how can I use custom colors in {C:color}?
calculate = function(self, card, context)
if context.cardarea == G.play and context.individual then
local rank = context.other_card:get_id()
if rank == 11 or rank == 12 or rank == 13 then
rank = 10
end
if rank == 14 then rank = 11 end
card.ability.extra.mult = card.ability.extra.mult + rank
something like this
And then the return message is "upgraded" or whatever it is depending on how you intend your joker to look
i think card.base.nominal works as well
So in that case it would just be card.ability.extra.mult = card.ability.extra.mult + context.other_card.base.nominal?
Well that does look much simpler
But if base.nominal didn't exist, that would probably be how I'd do it
you put them in G.ARGS.LOC_COLOURS
i'm trying to get a custom deck to spawn with a negative joker but it's not working
alright i have no idea what mod that i have enabled is causing the game to crash
"e_negative"
i dont think you can do that through the config
ah
the worst part is that the crash is inconsistent
for crashes when playing i recommend #⚙・modding-general instead
trying to spawn a joker through a deck, this works fine with vanilla jokers but not modded one
what does it do with modded ones
it just spawns this joker
negative eternal
it worked but somehow broke the description?
this is the vanilla one
i could be wrong but i think to get modded jokers to spawn you need j__
2 underscore?
yeah
how are you doing it, i think you replaced all vanilla ones
which joker
nah
ah well, I tried
like this (yeah this might be the case)
read the key
flashbangout?
read it again
typo
yeah you need to add it to it, not replace it
:3
how would I do that?
G.ARGS.LOC_COLOURS.yourkey = colour
although in my mod i do it in a hook so that might crash
The link I sent you earlier added them👀
I didnt understand...
-# yes N' it was your hook but with less colors
Hey so i have created an early description for the joker, how can i create that the joker gains X3 mult when the hand contains Heart Flush?
Or is there an template i can work of? The only template i can find are for adding, none for multiplying the mult
Could've asked.
So the G.C.EF = part is defining a table of colors I use elsewhere in the mod
EF is my mod prefix
Then in the later part
You just assign them
thats the part that I didnt undarstend
oh thats new what the hell
You can just copy paste that and replace/add the line with this ^ format
what happened here
what...
I feel so stupid now
like ur explaining the basics and I still dont get them
I don't think it's basics
In LUA, it is a very important concept to understand that everything is a variable and all variables may be edited in runtime. This includes functions. With modding other peoples' LUA files, like Klei's basegame code, you may find yourself wanting to run your code before or after the original fun...
Tutorial I saw being sent here ^
Ok so here we assign the old function to a local variable and then we override it.
-- https://github.com/nh6574/JoyousSpring/blob/main/src/globals.lua#L71
local loc_colour_ref = loc_colour
function loc_colour(_c, _default)
if not G.ARGS.LOC_COLOURS then
loc_colour_ref()
end
G.ARGS.LOC_COLOURS.ef_plant = G.C.EF.PLANT
return loc_colour_ref(_c, _default)
end
The first if is checking if the colors aren't there we call the old function to assign them
never noticed it but why does the first loc_colour_ref not have the arguments
After that if we assign our own colors. In this case ef_plant is my color I later use as {C:ef_plant}
Bepis
🤔
You can look at the source code but iirc there was an if check in the code and if the arg was nil it assign the colors there
Or something like that
I saw many colors in your code, why do you assign only one? the rest isnt used for now?
Then the return is back to the original function that handles the rest
I don't use those colors in text
It makes sense now
I use them for badges
ohhh
---@diagnostic disable-next-line: lowercase-global whats that for?
The lsp
Just so I don't get a warning
You can treat it as a comment
Lsp (language server protocol) is in simpler terms a program that checks for errors in the code
For example
set_badges = function(self, card, badges)
badges[#badges+1] = create_badge('Idea Credit: plantform', G.C.EF.IDEA_CREDIT, G.C.BLACK, 0.8 )
end,
Ok I have to go now
Gl
thnx for the help
Cus that call is just to ensure the table is instantiated
oh my god this FINALLY WORKS
hi heaven
vol = 1,
pitch = 1,
key = "music_spamton",
path = "music_spamton.ogg",
select_music_track = function()
return (next(SMODS.find_card("j_silly_spambot")) and G.shop and not G.shop.REMOVED and 11) or false
end,
})
how do i make a version of this that plays for regular (small, big) blinds + another version for boss blinds?
this replaces the shop music while you have a specific joker, for context
Check G.GAME.blind.name.
mmk
bump
Is there any easy way to make a joker that when card is scored and it's a queen it changes to king and vice verse
you gotta return stuff in loc_vars
wdym?
use SMODS.change_base
returning stuffs in loc_vars changes #1#, #2#,... to a number/string
else it will always be nil as shown in your image
What's the glass breaking sound called
how do i nab the rarity of a joker
vol = 1,
pitch = 1,
key = "music_spamton1",
path = "music_spamton1.ogg",
select_music_track = function()
return (next(SMODS.find_card("j_silly_spambot")) and string.len(G.GAME.blind.name) > 0 = true
end,
})```
i probably failed here
lol
im new to balatro modding
Remove the first ( and = true at the end.
Why is there an () ?
-# Quite frankly, also new to Lua in general, huh.
vol = 1,
pitch = 1,
key = "music_spamton1",
path = "music_spamton1.ogg",
select_music_track = function()
return (next(SMODS.find_card("j_silly_spambot")) and string.len 'G.GAME.blind.name' > 0
end,
})```
like that?
damn
are we ignoring the NSFW link
<@&1133519078540185692>
anyway im assuming this should run?
Thx
oh and one more thing
how do i detect and refer to a specific card?
vol = 1,
pitch = 1,
key = "music_spamton1",
path = "music_spamton1.ogg",
select_music_track = function()
return (next(SMODS.find_card("j_silly_spambot")) and string.len 'G.GAME.blind.name' > 0
end,
})```
and how could i prevent it from doing it 2 times to the same card
that it changes back from what it was
...you removed the wrong brackets.
mb
return next(SMODS.find_card("j_silly_spambot")) and string.len(G.GAME.blind.name) > 0
