#💻・modding-dev
1 messages · Page 603 of 1
This code is supposed to trigger when 5 seals are scored in the same hand. But it does not trigger at all. And I do not understand why, I've been tinkering with the code and yet it doesnt work.
code?
this is the code for "night vision" (reworked)
key = "nightvision",
config = {
extra = {
amogus = 0,
index = 0
}
},}
loc_txt = {
['name'] = 'Night Vision',
['text'] = {
[1] = 'Copies ability of',
[2] = 'a random {C:attention}Joker{}',
[3] = 'every round',
[4] = '{C:inactive}(Currently #1#){}'
},
['unlock'] = {
[1] = ''
}
},
pos = {
x = 0,
y = 0
},
display_size = {
w = 71 * 1,
h = 95 * 1
},
cost = 4,
rarity = 3,
blueprint_compat = false,
eternal_compat = true,
perishable_compat = true,
unlocked = true,
discovered = true,
atlas = 'Joker',
loc_vars = function(self, info_queue, card)
return {vars = {card.ability.extra.amogus}}
end,
calculate = function(self, card, context)
if (context.selling_card and context.card.sort_id == card.ability.extra.target or context.setting_blind) and not context.blueprint then
local compatible = {}
for _, c in ipairs(G.jokers.cards) do
if c.config.center.blueprint_compat then
compatible[#compatible+1] = c
end
end
local new_target = pseudorandom_element(compatible, "seed")
if new_target then card.ability.extra.target = c.sort_id end
end
for _, c in ipairs(G.jokers.cards) do
if c.sort_id == card.ability.extra.target then
return SMODS.blueprint_effect(c, context)
end
end
end
no that bracket just shouldnt be there
oh odd
the lua does not care about spaces
it goes green whenever i close it
wdym green
its a comment
i must be getting mixed up with javascript i think
but also
youre supposed to close the joker like. after all of the joker stuff
put the closing bracket after the end of calculate
done!!!!!
thank youuu
lets test
did it after alias joker
NOOO ITS STILL BROKEN
what happens now
idk, but i think i know how to fix it
ok the code rn is ```SMODS.Joker{ --Night Vision
key = "nightvision",
config = {
extra = {
}
},
loc_txt = {
['name'] = 'Night Vision',
['text'] = {
[1] = 'Copies ability of',
[2] = 'a random {C:attention}Joker{}',
[3] = 'every round',
[4] = '{C:inactive}(Currently #1#){}'
},
['unlock'] = {
[1] = ''
}
},
pos = {
x = 0,
y = 0
},
display_size = {
w = 71 * 1,
h = 95 * 1
},
cost = 4,
rarity = 3,
blueprint_compat = false,
eternal_compat = true,
perishable_compat = true,
unlocked = true,
discovered = true,
atlas = 'Joker',
loc_vars = function(self, info_queue, card)
return {vars = {}}
end
calculate = function(self, card, context)
if (context.selling_card and context.card.sort_id == card.ability.extra.target or context.setting_blind) and not context.blueprint then
local compatible = {}
for _, c in ipairs(G.jokers.cards) do
if c.config.center.blueprint_compat then
compatible[#compatible+1] = c
end
end
local new_target = pseudorandom_element(compatible, "seed")
if new_target then card.ability.extra.target = c.sort_id end
end
for _, c in ipairs(G.jokers.cards) do
if c.sort_id == card.ability.extra.target then
return SMODS.blueprint_effect(c, context)
end
end
end
}```
missing , after the loc_vars
hmm
me thunk>??????
unexpected = on line 36
oh it opens now
i just got rid of loc vars
time for more testing
you probably will need loc_vars if you want the joker to be displayed in the description
eventually
anyway im doing a wild guess that the loc_vars is line 36 and you did not put the comma after the end of loc vars
attempted to index field "atlas" (a null value)
oh i did that and it had the same error
okay this means the atlas doesnt exist (for some reason)
idk how that happens but uhhhhh
i launched it and for some reason "Night Vision" had the same art as another joker
okay then open the image file and correct the pos in the joker
the top-left sprite being { x= 0, y = 0 }
Hello everyone
Is anyone able to explain why
When I enable or disable pixel art smoothing, the changes caused by this code are reverted?
I'm trying to change the color of the cards from white to black
comment
yes, i thought that was the problem but not rly
odd
if im inside a game with 1x texture and click on "pixel art smoothing" the texture goes white
but if i leave run and go to the main menu, i'll se the 2x texture being applied
does my explanation make sense?
it is! thanks anyways
new error
attempt to globalise c, im guessing c is meant to be local
do i wrote "local c"
for local c in ipairs?
no
oh wait
it presumes c is a null value
. indexes a table
variable that has a bunch of other values in it
new_target.sort_id gets the value sort_id in table new_target
they are also a bit funny in how they work
yes
new error
how would i check if a card has retriggered during a hand
i’d implement a retrigger context (unless that’s in newest smods idk) and set a value on the card when it retriggers
set a flag in context.individual
or that
and if its already set when it triggers then set a different flag to destroy it
yeah nvm thats better
how do I hide an entire consumable set in the collection
I don't want it to have a button in the consumables section
SMODS.ConsumableType can have a no_collection
Is it possible to have multiple sounds play sequentially in a joker return? I want to use multiple of the "voice" sound files that jimbo uses to imitate the joker talking during scoring
a single voice file is like one syllable
first time using sound and I couldnt find anything on multiple files on the smods github* unless I missed something
Bump
is there a way to check if a card isn't already in existence, or is able to exist multiple times?
this is for a call to create_card
or if there's a way to let SMODS select a card from a table to create, that'd work too
if I set a card to be hidden can it still be spawned by effect like "creates a spectral card"
no
ok
if in_pool is false then no
hi, how do I make a joker apply debuffs to certain cards? I've been using jokerforge so far to create my mod but the program can't do everything, so I'm trying to get better at actually coding (tho im very beginner)
Hi lads, I'm trying to import a deck into my mod, but it's giving me this error. Would anyone know what the problem might be?
how do i get the # of chips a playing card scores for, including things like enhancements & perm bonuses (like from hiker)
Card:get_chip_bonus()
trying to make a joker that tracks retriggers
i made a retrigger counting flag but idk how to like
acc implement it LOL
the random joker night vision thing isnt working so i changed its effect to something more simple
maybe that wont work either
hmmm
i need to give night vision a good effect 😭
how do you make custom shop slots?
For a SMODS.DeckSkin, how would I use the table-style pos_style? I'm not sure how the using-rank-as-key thing works
https://github.com/Steamodded/smods/wiki/SMODS.DeckSkin
Is there a way to go about having a joker make a card count for more than one enhancement?
quantum enhancements
Anyone know how to make a joker trigger other playing cards if a certain playing card is triggered?
SMODS.score_card(card, contex) scores a card with the given context table
I assume thats what youre looking for
I'm getting this error on boot, any clue how to fix this? I assume something is wrong with my atlas in my main .lua file but I can't seem to find it.
my assets are in mod>assets>x2 (and x1)> WebsJokers.PNG
nvm fixed it
I was missing
atlas_table = "ASSET_ATLAS"
create_card() has a soulable parameter; hidden cards can only be created if it's true
right
hidden cards still count as hidden even for the set they actually count as
yes
(that's why the soul and black hole are still rarer than other spectral cards in spectral packs)
i guess they can also be created if their key is passed directly but that's not what anyone was asking about :v
Is there a method or context that can change rarity weights
i think it's just a variable in G or G.GAME that you can change
like one variable for each rarity
lemme check in-game real quick
Trying to play a sound in joker scoring, any help would be extremely appreciated 😭
its just bigmoney.ogg you dont need to add assets/sounds/
by altering the value of G.GAME.raritykey_mod, where raritykey is the full key of the rarity (common/uncommon/rare for vanilla rarities), it changes the rates that that rarity will spawn at. all the rarity_mod values start at 1 for the default value i think, increasing it above one makes them more common and decreasing it below one makes them less common
🫡
So if i wanted to increase higher rarities chances to appear id have to add +1?
or more if you're still not satisfied with how much the chance increases, but yes that's the idea
here's the wiki link explaining how to do that
https://github.com/nh6574/VanillaRemade/wiki#quantum_enhancements
though keep in mind that quantum enhancements can be a bit laggy at times
Is there a context for entering the shop
starting_shop
hey so for scale_card on context.individual, I don't like how it shows the message before the card scores, is there a way to do it so the message shows afteR?
How do you score a card in hand? Not like Steel cards that do something when held in hand but like score them?
is there a context I can check for to make sure a consumable can only be used in a blind? like not during a shop or something similar?
oh would it be hand_drawn?
that makes sense nvm lol
there's no context in can_use but for this you can return G.GAME.blind.in_blind
ohhhhh wonderful, thank you very much :)
@jolly shadow I figured out the issue. It has to do with the order that events were entered into the event queue. To get the ordering properly, you actually need to nest events. This was, eventually, the completely correct code.
https://www.youtube.com/watch?v=PkhVr0IWNfY
Thank you for your help. 😄
oh my god
yeah, it's pretty cursed
@umbral zodiac, here's the basic structure of what I'm doing:
-- the variable
local active_message = localize {
type = 'variable',
key = 'k_lapsems_when_ready',
vars = {
localize('k_active_ex')
}
}
-- the localization file
return {
misc {
dictionary {
k_lapsems_when_ready = "Displays \"#1#\" when ready",
}
}
}
ya try putting the loc entry into descriptions.Other rather than misc.dictionary
what does your localization file look like
yeah im just gonna say sorry i completely misunderstood the problem from the beginning because i was heavy multitasking and only half reading
is it just me or did smods change the animation on wee joker
The timing for stuff like Gros Michel is also a touch off, now that you bring it up.
Did you make sure that the function add_to_deck is running as you expect?
because I'm not seeing where it explicitly gets run
and I don't think it's implicitly getting run from the emplace though I could be wrong
@sage crater
it was at one point
it's probably not any more, since iirc I swapped where the parentB and parentA were-- or something like that-- but yeah, I don't see why it wouldn't work
but then again, it mustn't be working, because the pseudorandom isn't triggering properly
oh also, I fixed the mult issue
that was because I put a var2 instead of mult var in the calculate's return
would this work?
what?
oh, that's not one line
yes, sorry
that should work yeah.
ok cool, just checking
but when does add_to_deck get called?
so given there's no random changes to the numbers and also all the numbers are exactly the same, I'm inclined to believe it must be that the add_to_deck is not being properly called
it should be when the joker is emplaced
... I think
the lovely patched emplace method reads as follows:
function CardArea:emplace(card, location, stay_flipped)
if self == G.jokers then
Cartomancer.handle_joker_added(card)
end
self:handle_card_limit(card.ability.card_limit, card.ability.extra_slots_used)
if location == 'front' or self.config.type == 'deck' then
table.insert(self.cards, 1, card)
else
self.cards[#self.cards+1] = card
end
if card.facing == 'back' and self.config.type ~= 'discard' and self.config.type ~= 'deck' and not stay_flipped then
card:flip()
end
if self == G.hand and stay_flipped then
card.ability.wheel_flipped = true
end
if #self.cards > self.config.card_limit then
if self == G.deck then
self.config.card_limit = #self.cards
end
end
card:set_card_area(self)
self:set_ranks()
self:align_cards()
if self == G.jokers then
local joker_tally = 0
for i = 1, #G.jokers.cards do
if G.jokers.cards[i].ability.set == 'Joker' then joker_tally = joker_tally + 1 end
end
if joker_tally > G.GAME.max_jokers then G.GAME.max_jokers = joker_tally end
check_for_unlock({type = 'modify_jokers'})
end
if self == G.deck then check_for_unlock({type = 'modify_deck', deck = self}) end
end
add to deck is not called automatically from this function
or just use SMODS.add_card, but i imagine you're not using that for a specific reason
oh, wacky
not intentionally. Might be beneficial, but idk what the benefits would be
if you dont know the benefits then you wouldn't benefit from not using it
at least i have to imagine
function SMODS.add_card(t)
local card = SMODS.create_card(t)
if t.set == "Base" or t.set == "Enhanced" then
G.playing_card = (G.playing_card and G.playing_card + 1) or 1
card.playing_card = G.playing_card
table.insert(G.playing_cards, card)
end
card:add_to_deck()
local area = t.area or G.jokers
area:emplace(card)
return card
end
add_card is literally just a wrapper that calls create_card, calls the card's add_to_deck, adds the card to G.playing_cards if it's a playing card, and then emplaces the card where it should go
it's probably what you wanted to do
the only reason you need to be using something else is in very special cases (e.g. putting a joker on the title screen, where not even create_card works properly and you need to manually create a new Card object)
i just use create_card for the title screen
oh right maybe it does work properly and it just didn't work in my use case because i was trying to create a random joker from a pool
and either the random part or the pool part didn't work on the title screen
currently trying to modify played cards before they're calculated/scored but context.before doesn't seem to be right for that, any other applicable contexts?
context.press_play?
press play works for me it should work for you
to be clear, do you want this modification to happen once before the hand scores, or once every time an individual card scores
and is this coming from the card being scored or an external source
oh i tried that before, there wasn't context.scoring_hand in that context but that should be easy to replace
is it gonna be like SMODS.add_card(parentA) within the event?
essentially i have a joker that has a chance to modify cards before they're calculated, it can randomly change the rank, suit, enhancement, or seal
like this?
it should be G.hand.highlighted
no, for copy_card you need to emplace and add to deck yourself manually
works perfectly, thanks
add_card creates a new card
ah ok
okay i feel like a complete dope for asking this but is there any particular reason this displays as nil? i don't know what i'm doing wrong in particular, but i know i'm missing something big here
key = "jumptime",
pos = { x = 1, y = 0 },
rarity = 2,
blueprint_compat = false,
cost = 6,
discovered = true,
config = { extra = { h_size = 2, }, { every = 2, }, {jump_remaining = 2 } },
loc_txt = {
name = "Ourgughrgggh",
text = {
"{C:attention}#1#{} hand size every {C:attention}#2#{} rounds",
"{C:inactive}(#3# hands remaining)",
},```
is this looking correct?
- you need a loc_vars function
- why are your variables in 3 separate tables, it should just all be in one big table
- oh true
- i initially had it in one table but changed it because i didnt know what i was doing wrong 😭
yea put it back to one table, and then check the loc_vars section of this documentation https://github.com/Steamodded/smods/wiki/Localization (you don't need to bother with any info_queue stuff, you just need to look at the return)
OH WAIT i had one but i didnt include it in the snippet i sent . my mistake
after what i sent prior:
return {
vars = {
card.ability.extra.h_size,
card.ability.extra.every + 1,
localize { type = 'variable', key = (card.ability.extra.jump_remaining == 0 and 'jump_active' or 'jump_inactive'), vars = { card.ability.extra.jump_remaining } }
}
}
end,```
ill read the localisation documentation and come back to this
lowkey i just took it from loyalty card but i Know i fucked up LOL
hm that seems fine
but alas...
this should be the solution
SMODS.Joker {
key = "jumptime",
pos = { x = 1, y = 0 },
rarity = 2,
blueprint_compat = false,
cost = 6,
discovered = true,
config = { extra = { h_size = 2, every = 2, jump_remaining = 2 } }, -- copy this line
loc_txt = {
name = "Ourgughrgggh",
text = {
"{C:attention}#1#{} hand size every {C:attention}#2#{} rounds",
"{C:inactive}(#3# hands remaining)",
},
ur config table as u showed would have been
{
extra = {h_size = 2},
[1] = {every = 2},
[2] = {jump_remaining = 2}
}
bless your soul
which is wrong
still new to this (obviously) so i appreciate it a ton
that makes a lot of sense
okay im convinced they just hate me LOL
WAIT I FIGURED IT OUT NVM
i put loc_txt after loc_vars and it works now
...oh, wait
huh
i dont think the order is supposed to matter
ur loc vars is screwed up
this one is due to the localize call you make inside the loc_vars function, i figure since you're using loc_txt you don't have a central localization file and therefore you never defined jump_active or jump_inactive
will this work?
I'm getting an error and I'm kinda thinking it's either this or another thing in my code
bad argument #1 to 'lg' (number expected, got nil)
so where exactly would i define these in a localisation file? by this i imagine you mean files such as en-us.lua, correct me if i'm wrong
I think I figured it out
i also think a big issue is how i worded this
not necessarily in how its programmed but i just realised i worded it COMPLETELY wrong LOL
is it possible to have an effect on "scoring" a debuffed card
@loud summit does the following work?
if context.individual and context.cardarea == G.play and context.other_card.debuff and not context.end_of_round then
how do I check if any jokers had gone off in joker_main, in a joker that will add effects (based on used jokers amount) with post_joker
so are you checking if a card is debuffed?
i've failed to do that without any patch and opted to store played debuffed cards and then give the effect on context.joker_main but if you figure it out lmk
sadly the game doesn't count debuffed cards as scoring so no
is there a way to detect a card being selected? as in just hovered over or clicked on without playing
cause this code is currently triggering nada...
Hook Card:click
thx once more!
soooo, why is this still not doing anything? i have tried 3 variations of the activation hook and it's returns...
on_activate doesn't exist.
bruh, then i have been gaslit by my friend... should it just be a calculate function then?
Is there a simple guide to getting started with balatro modding?
Oh thanks
How do i make custom variables
what do you mean
present variable?
what do i call instaed of assert(SMODS.enhance_card(v, 'm_napoli_garbage')) to add an enhancement
v:set_ability('m_napoli_garbage')
whats the code
key = "carta",
dollars = 5,
mult = 2,
atlas = "blinds",
pos = { y = 0 },
boss = { min = 1 },
boss_colour = HEX("2d5b4f"),
calculate = function (self, blind, context)
if blind.disabled then
return
end
if context.before then
use_consumable_animation(nil, context.scoring_hand[1], function()
for k, v in pairs(context.scoring_hand[1]) do
v:set_ability('m_napoli_garbage')
end
end)
end
end
}```
yeah i want just the first card to transform
i'm lazy and i copied from another blind i made that converts all cards
thought it'd still work
it works without the for loop
Present points
ofc
you can just set any value in G.GAME if you want it to be saved with the run
not aaaany value
*excludes functions and gameobjects
they get hit with the MANUAL_REPLACE special
it doesn't let you save functions? weird
when i enhance the card in context.before it doesn't act like that enhancement, do i need to recalc?
functions arent serializable
so they cant be saved
blehg
you need to do stuff
i don't think the upvalues are guaranteed to still be there
Not really, but depends on what the enhancement is intended to do - Midas Mask converts cards to Gold before scoring...
like you can also save cards if you do :save_card
so idk how it'd work
regardless you don't ever need to save a function in G.GAME so it's understandable that thunk didn't implement the behavior for it
how do i refresh the card for the game?
No, you need to do it outside of an event.
But it also depends on the enhancement itself if it does anything specific.
like not having chips
also it's not inside an event
key = "cazzimma",
dollars = 5,
mult = 2,
atlas = "blinds",
pos = { y = 1 },
boss = { min = 2 },
boss_colour = HEX("73231e"),
calculate = function(self, blind, context)
if blind.disabled then
return
end
if context.before then
use_consumable_animation(nil, context.full_hand, function()
for k, v in pairs(context.full_hand) do
v:set_ability('m_napoli_cazzimma')
SMODS.recalc_debuff(v)
end
end)
end
end
}```
What is use_consumable_animation?
-- If it's not a list, make it one
if cards_to_flip and not cards_to_flip[1] then
cards_to_flip = { cards_to_flip }
end
if card then
G.E_MANAGER:add_event(Event {
trigger = 'after',
delay = 0.4,
func = function()
play_sound(sound or 'tarot1')
card:juice_up(0.3, 0.5)
return true
end
})
end
if cards_to_flip then
for i = 1, #cards_to_flip do
local c = cards_to_flip[i]
local percent = 1.15 - (i - 0.999) / (#cards_to_flip - 0.998) * 0.3
G.E_MANAGER:add_event(Event {
trigger = 'after',
delay = 0.15,
func = function()
c:flip()
play_sound('card1', percent)
c:juice_up(0.3, 0.3)
return true
end
})
end
delay(0.2)
end
G.E_MANAGER:add_event(Event {
trigger = 'after',
delay = 0.1,
func = function()
if action and type(action) == "function" then
action()
end
return true
end
})
if cards_to_flip then
for i = 1, #cards_to_flip do
local c = cards_to_flip[i]
local percent = 0.85 + (i - 0.999) / (#cards_to_flip - 0.998) * 0.3
G.E_MANAGER:add_event(Event {
trigger = 'after',
delay = 0.15,
func = function()
c:flip()
play_sound('tarot2', percent, 0.6)
c:juice_up(0.3, 0.3)
-- Update the sprites of cards
if c.config and c.config.center then
c:set_sprites(c.config.center)
end
if c.ability then
c.front_hidden = c:should_hide_front()
end
return true
end
})
end
end
G.E_MANAGER:add_event(Event {
trigger = 'after',
delay = 0.2,
func = function()
G.hand:unhighlight_all()
return true
end
})
if cards_to_flip then
delay(0.5)
end
end```
No, it is in an event.
so? how would i make it work
Do it outside of an event.
i need the event to flip the card
Yes, you keep that in an event but change the card outside of an event.
oh so i put end before the enh change not after
No, you move it out of the function() you're inputting.
end)
for k, v in pairs(context.full_hand) do
v:set_ability('m_napoli_cazzimma')
SMODS.recalc_debuff(v)
end```
this triggers the change before the animations
Add nil, true to the inputs of set_ability
before the enhancement key?
after
why is this crashing? it crashes with could not find enhancement "Red", and printing enh_options reveals that its a list of seals instead of enhancements for some reason
Wait so i just use G.GAME.present_points for the custom variable?
yeah
thought usually if you add custom variables in G.GAME you should add your mod prefix or smth to them
Where do i put it
Like where do i declare/initialize it
does anybody know how to code a boss blind in the game? I've just started my modding journey and am quite inexperienced
Why do some of my things arent discover even if I play with them several time
discovery doesnt really exist for decks, enhancements and seals
the mod additions tab still shows discovered total for them for some reason though
so how do I correct that so its showing the right way
but like I want to show like this in my repo so people see how much stuff my mod have
just add discovered = true
oh I think I just have unlocked = true
it was just discoverd omg
galdur error implies you don't have any localization
that's weird
your key says sliver, not silver
minor spelling mistake
that's how they get ya
ruby
i have no idea why this ain't workin':
SMODS.Atlas{
key = 'ShiningMask',
path = 'ShiningMask.png',
px = 71,
py = 95
}
SMODS.Joker{
key = 'jj_shiningmask',
atlas = 'ShiningMask',
pos = { x = 0, y = 0 },
rarity = 3,
unlocked = true,
discovered = true,
loc_txt = {
name = "Shining Mask",
text = {
"All {C:attention}face cards{} in the",
"played hand gain the {C:attention}Foil{} enhancement"
}
},
calculate = function(self, card, context)
-- this matches how Midas Mask works
if context.scoring_hand and not context.blueprint then
local faces = {}
for _, v in ipairs(context.scoring_hand) do
if v:is_face() then
if not (v.edition and v.edition.foil) then
faces[#faces+1] = v
G.E_MANAGER:add_event(Event{
func = function()
v:set_edition({foil = true})
if v.juice_up then v:juice_up() end
return true
end
})
end
end
end
if #faces > 0 then
return {
message = 'Foiled!',
colour = G.C.GREEN,
card = self
}
end
end
end
}
its v:set_edition("e_foil")
which one do you prefer? (attention is what the other stake stickers use)
right
i tried to select a face card while i had the joker and it crashed?
Oops! The game crashed:
functions/common_events.lua:1259: attempt to call method 'juice_up' (a nil value)
Additional Context:
Balatro Version: 1.0.1o-FULL
Modded Version: 1.0.0~BETA-1016c-STEAMODDED
LÖVE Version: 11.5.0
Lovely Version: 0.8.0
Platform: Windows
Steamodded Mods:
1: ZokersModMenu by Zoker [ID: ZokersModMenu, Version: 2.1.1]
2: DebugPlus by WilsontheWolf [ID: DebugPlus, Version: 1.5.2~dev, Uses Lovely]
3: Jarz Mod by Jarz [ID: JarzMod, Version: 1.0.0]
Lovely Mods:
It's card not self
oh mb, thanks.
(This is supposed to be *like * Midas Mask) I think it applies the Foil a lil' early? How can I make it apply later
SMODS.Atlas{
key = 'ShiningMask',
path = 'ShiningMask.png',
px = 71,
py = 95
}
SMODS.Joker{
key = 'jj_shiningmask',
atlas = 'ShiningMask',
pos = { x = 0, y = 0 },
rarity = 3,
unlocked = true,
discovered = true,
loc_txt = {
name = "Shining Mask",
text = {
"When a hand is {C:attention}played{},",
"all {C:attention}face cards{} gain the",
"{C:attention}Foil{} enhancement"
}
},
calculate = function(self, card, context)
if context.before and context.scoring_hand and not context.blueprint then
local faces = {}
for _, v in ipairs(context.scoring_hand) do
if v:is_face() and not (v.edition and v.edition.foil) then
faces[#faces+1] = v
v:set_edition('e_foil')
end
end
if #faces > 0 then
return {
message = "Foiled!",
colour = G.C.GREEN,
card = card
}
end
end
end
}
talisman changes g.game.dollars to a table it looks like. how can i change it back to a number to compare it?
what about this idea
thanks
What's the easiest way to make Legendary Jokers appear in the normal joker pool?
that's neat
no responses ;-;
haha are u italian
sto mettendo le carte napoletane in balatro
i'm doing it right now
You could just use a debug mod or something to start with it
like ZokersModMenu
press c to open the menu thingy
does zokersmodmenu even work
works for me
also i assume this is for an actual effect and not just testing
prol
since otherwise the debugplus console always works
that has joker spawning stuff?
yes?
oh
what do i do to remove enhancements from cards?
i frgot;-;
press 3 on a joker in the collection to spawn
2 to discover, 1 to unlock
o cool
Card:set_ability("c_base")
works for any card except boosters iirc, and also works with boss blinds and tags iirc
You mean download the debug mod and see how it's handled in that code? I'm a bit confused
bro anyone ?🥀
No, you just have to be in the shop.
ive tried it in the shop and it said that there is no area for the booster
so i just eval SMODS.add_booster_to_shop
No, you press 3 instead of CTRL+C
not sure if i word it right
idrk man
maybs 'negates' instead of 'costs'?
why negates
that's worse
negates?
what does negating $1 even mean
nobody skips blinds anyways
its the verb of 'negative' isn't it?
yeah i dont have much ideas for stakes
removes a dollar
i know but
it means it cancels something out by doing the opposite usually
it cancels out one of your dollars by giving you -$1 

well ig
"costs" is prol fine then
maybe ill come back to stakes later but i think ruby is fine
Why does the foil enhancement apply to the card before it even says (on the joker) "Foiled!"?
SMODS.Atlas{
key = 'ShiningMask',
path = 'ShiningMask.png',
px = 71,
py = 95
}
SMODS.Joker{
key = 'jj_shiningmask',
atlas = 'ShiningMask',
pos = { x = 0, y = 0 },
rarity = 3,
unlocked = true,
discovered = true,
loc_txt = {
name = "Shining Mask",
text = {
"All {C:attention}face cards{} in the",
"played hand gain the {C:attention}Foil{} enhancement"
}
},
calculate = function(self, card, context)
if context.joker_main and not context.blueprint then
local faces = {}
for _, v in ipairs(context.scoring_hand or {}) do
if v:is_face() and not (v.edition and v.edition.foil) then
table.insert(faces, v)
v:set_edition('e_foil')
end
end
if #faces > 0 then
return {
message = 'Foiled!',
colour = G.C.GREEN,
card = card
}
end
end
end
}
needs to be in an event
what?
check vanillaremade wiki for events
im not the most qualified to explain it
yeah
What's wrong ? It crashes the game
it's in SMODS.Back, I want to show a tooltip of my custom tag
You don't use info_queue on decks.
You use T: in the description.
Also it would've been G.P_TAGS
code to make blind debuff enhanced cards?
if context.debuff_card and next(SMODS.get_enhancements(context.debuff_card)) then
return {debuff = true}
end
is it possible to make a joker that sets all boss blinds to be a specific one?
thanks a lot
hook get_new_boss to always return a specific key while you have the joker
I'm trying to make a joker that makes 3oak's appear more often but I'm unsure about how should I make this joker that whenever you draw cards, draw 3 cards of the selected randomRank...
You need a context check.
a context check?
Yes.
What type of context check I need and for what purpose?
context.hand_drawn
You always need a context check.
but how can I draw 3 cards with selected randomRank?
(also I should check if there are exactly 3 or more cards in the full deck, if not then it selects the randomRank again)
Honestly i'm lost do i have to do this?
return {"bl_napoli_allerta"}
end```
how does the mod prefix work and how do I use it correctly
the mod prefix automatically gets added to all objects you create, resulting in <class prefix>_<mod prefix>_<key>
local cards = {}
for k, v in pairs(G.deck.cards) do
if v:get_id() == randomRank then
table.insert(cards, v)
end
end
for i=1, 3 do
local card_to_draw, ii = pseudorandom_element(cards, 'seed')
table.remove(cards, ii)
draw_card(G.deck,G.hand, i*100/3,'up', true, card_to_draw)
end
so whenever you're referencing the object outside of the initial creation you use this full key, excluding atlases
i didn't really understand what to do tbh
No, it would also exclude consumable types and object types.
so the first "for" makes it so whenever it finds a card of said "randomRank", it puts it in a table and in the second "for" it makes it that it draws 3 random cards of said rank and removes them from the table, right?
Yes.
local new_boss_ref = get_new_boss --save original function
function get_new_boss()
if next(SMODS.find_card("j_modprefix_key")) then --check for the joker
return "<boss key>"
end
return new_boss_ref() --use original function if you dont have the joker
end
tnx
Hey, what sort of code do i have to use to change the main menu logo?
SMODS.Atlas{
key = 'balatro',
raw_key = true,
path = 'newlogo.png',
px = 333,
py = 216
}
Thx
tried avoiding this but i've got a joker that's meant to cost $1, but due to applying an edition to itself it ends up costing $6, not sure how to fix this
i've tried manually setting its cost in a few areas but i think i'm missing something
Hook Card:set_cost()
ok I just tested it and for some reason... the base queue starts to... increase? that at some point I cannot play hands or discards
You're missing return true
oh 😅
ok now it works.... kinda
it bypasses the hand limit
Yes.
I'm getting an Error: attempt to index field 'atlas' (a nil value), but I have no clue how to interpret that
I'm trying to code a blind
The atlas needs to be an ANIMATION_ATLAS
oh
thx!
now it says
attempt to perform arithmetic on field "frames" (a nil value)
can i ask why (other than making things easier for myself later down the line)? i just changed :set_cost() to .set_cost() and this seems to work (i will need to fix the sell value but that's relatively easy)
if i were to hook all i'd really write in the hook would be to .set_cost and some other shit so it's just globalising the solution that i only really needed here
what does this mean
best result I've had all day, thanks everybody for your help! (it's my own boss, just need to actually customise it)
i'm not sure!
i just found .set_cost used somewhere else
and it works?
i can't explain why
sorry i dont have the entire context, what are you changing
can I just use strings for add_card's rarity or does it have to be numbers
you can use strings
that makes me happy
the cost of a card that forces itself to have an edition
originally it was forcing itself to be like $6 even though it listed itself as $1 in the shop, even allowing money to go into the negatives
it's fixed i think but i'm just really confused on if i'm doing something weird
no, i read that part
i mean where in the code are you changing : to .
thats not how the function works
card:set_edition('e_negative', true, true)
card.set_cost(1)
end,```
that should crash
i can assure you it will
it hasn't
so if it doesnt then its not running
Also is it "Three Of A Kind" or "Three of a Kind"
maybe you didnt save?
latter
no.. it's doing both
it's fixing the cost
and
originally it would always cost $6
well idk maybe you did some other change
what
hold on
yeah it did just crash what the fuck
how did i fix this
what
uuhhhh hold on
hold on
OH
what do I need for jokers? the blind is displaying correctly now, but my joker (which worked up until now) crashes the game If I try to access the page to display it)
IM STUPID
card:set_cost() is just a function that calculates the cost, it only takes the card and no other value. card:set_cost(1) will ignore the 1. card.set_cost(1) will treat 1 as the card and crash
Log?
NO I KNOW I FIGURED IT OUT sorry uhh
i had it saved
as card.cost=1
which works
but for some reason
i rewrote it
to be card.set_cost=1
and i was reading that
that will work but only until another card calls set_cost on it
so not permanently
as soon as i click on the jokers section of my mod's additions
I had the same issue with the blind
but now it's fixed
redeeming clearance sale will reset the cost for example iirc
If I don't include the blind in the game the joker works
anyone know why i'm getting this crash when using SMODS.destroy_cards on some cards
full crash?
i would like to not show that if I can help it but I'm mostly concerned because I'm using the vanillaremade hanged man code for this
it seems fine? i'm mainly doing this just to patch the cost increase from it turning negative
it's identical except I changed the max destroyed cards (but no value makes it not crash)
hm
do you know what line 2538 is at least
oh also the vanilla remade is very useful for figuring things out just wanted to thank you while you're here
❤️
it's the return true at the end of the SMODS.destroy_cards function
function SMODS.destroy_cards(cards, bypass_eternal, immediate)
if not cards[1] then
cards = {cards}
end
local glass_shattered = {}
local playing_cards = {}
for _, card in ipairs(cards) do
if bypass_eternal or not SMODS.is_eternal(card, {destroy_cards = true}) then
card.getting_sliced = true
if SMODS.shatters(card) then
card.shattered = true
glass_shattered[#glass_shattered + 1] = card
else
card.destroyed = true
end
if card.base.name then
playing_cards[#playing_cards + 1] = card
end
end
end
check_for_unlock{type = 'shatter', shattered = glass_shattered}
if next(playing_cards) then SMODS.calculate_context({scoring_hand = cards, remove_playing_cards = true, removed = playing_cards}) end
for i = 1, #cards do
if immediate then
if cards[i].shattered then
cards[i]:shatter()
elseif cards[i].destroyed then
cards[i]:start_dissolve()
end
else
G.E_MANAGER:add_event(Event({
func = function()
if cards[i].shattered then
cards[i]:shatter()
elseif cards[i].destroyed then
cards[i]:start_dissolve()
end
return true ---this is 2538
end
}))
end
end
end
are you checking the lovely dump
anything that gets patched
aah. bad for sell_cost
i don't think i need help with this but i see what you're on about now
i'll go figure out how to do it properly
adding SMODS.destroy_cards to my enemy functions list
does your card have card[1] for some reason
cards is the list of cards put into SMODS.destroy_cards
what's the variable for blind scaling?
which is 4 highlighted cards right now (crashes with any number of highlighted cards though)
i would need to see the log
so it's trying to access a card that doesn't exist which makes no sense
grumble grumble
using this tarot card crashes the game? something like card.lua:607 : attempt to index nil value
dw bout the names
fart
hmm what i think may be happening is that you're using a value in an event that gets cleared before for some reason
fart
What’s a good way to create the 1x and 2x for icons (like a joker or a blind tag), I usually create the 1x but when I try to upscale to 2x it’s all blurred, and I have not found a way to do this reliably
what app do you use for art
i'm using the vanillaremade hanged man code :( i thought it would be easy
use = function(self, card, area, copier)
G.E_MANAGER:add_event(Event({
trigger = 'after',
delay = 0.4,
func = function()
play_sound('tarot1')
card:juice_up(0.3, 0.5)
return true
end
}))
G.E_MANAGER:add_event(Event({
trigger = 'after',
delay = 0.2,
func = function()
SMODS.destroy_cards(G.hand.highlighted)
return true
end
}))
delay(0.3)
end,
why would this not be working
Krita
i mean.. i might have messed up
hmm no works fine for me
iirc -- try to go to Image > Select Image to New Size . . . and in the scaling dialog thing set "Filter" to "Nearest Neighbour" and 200% new size.
I’ll try thx
there's so much shit wrong with my modpack bro
I can't save runs anymore and I thought everyone else also had this problem
relatable
now you're telling me SMODS.destroy_cards doesn't work
its going in the bucket with SMODS.change_base and SMODS.add_card
i think you have a virus
no
it's probably deluxe consumables
but that mod is so cool
it's just not updated for newer smods
half the things are broken
but I want it so bad
bro i just want to add a seal to a card from a tarot, how is it this hard 😭
your set_seal needs your mod prefix before the seal key
thats all i can see
Thanks. Now the problem is that it displayes a quarter of it and not all of it. Maybe I made it too big, is there a way to know how big blid icons are in balatro?
ill check for you
Thank u
32x32, 100% scale.
didn't even need to ping mods for them to get purged,, ,
Cuz it was posted in modding-chat too lol
is there a way to use contexts in the use function for consumables?
like if i wanted a consumable that permanently increases probabilities when used
there isnt
I have no idea what this old conversation was about 😭
oof
though you can increase a global variable
and then use that in a mod calculate
SMODS.current_mod.calculate
what like G.GAME.probabilities.normal?
oh
but would that affect odds on vanilla cards
oh fr
its just a calculate function but global and not attached to a specific game object
do mod calculates trigger before or after jokers
idk
mod calculate was such a sneaky good addition and I feel like nobody talks about it lmao
why doesn't my seal work? , no crash or anything, it just does nothing on a card
---- SEALS
------------------------------
SMODS.Atlas{
key = 'DoodooSeal',
path = 'Seals.png',
px = 71,
py = 95
}
SMODS.Seal{
key = 'Doodoo',
atlas = 'DoodooSeal',
pos = { x = 0, y = 0 },
badge_colour = G.C.BROWN,
config = { extra = { x_mult = 1.1, x_chips = 1.1, flat_chips = 11, flat_mult = 1 } },
loc_txt = {
name = "Doodoo",
text = {
"{X:mult,C:white}x#1#{} Mult, {X:chips,C:white}x#2#{} Chips,",
"{C:chips}+#3# Chips{}, {C:mult}+#4# Mult{}."
}
},
loc_vars = function(self, info_queue, card)
local e = self.config.extra
return { vars = { e.x_mult, e.x_chips, e.flat_chips, e.flat_mult } }
end,
calculate = function(self, card, context)
if context.individual and context.cardarea == G.play then
local e = card.ability.seal.extra
return {
x_mult = e.x_mult,
x_chips = e.x_chips,
mult = e.flat_mult,
chips = e.flat_chips,
card = card
}
end
end
}
after
❤️
anyone?
it has to be context.main_scoring
instead of context.individual
also card.ability.seal isnt a table
you need to use self.config.extra
like?
SMODS.Seal{
key = 'Doodoo',
atlas = 'DoodooSeal',
pos = { x = 0, y = 0 },
badge_colour = G.C.BROWN,
config = { extra = { x_mult = 1.1, x_chips = 1.1, flat_chips = 11, flat_mult = 1 } },
loc_txt = {
name = "Doodoo",
text = {
"{X:mult,C:white}x#1#{} Mult, {X:chips,C:white}x#2#{} Chips,",
"{C:chips}+#3# Chips{}, {C:mult}+#4# Mult{}."
}
},
loc_vars = function(self, info_queue, card)
local e = self.config.extra
return { vars = { e.x_mult, e.x_chips, e.flat_chips, e.flat_mult } }
end,
calculate = function(self, card, context)
if context.main_scoring and context.cardarea == G.play then
local e = self.config.extra
return {
x_mult = e.x_mult,
x_chips = e.x_chips,
mult = e.flat_mult,
chips = e.flat_chips,
card = card
}
end
end
}
?
yes
No, it is.
thats card.seal
yes lets go, it works; thanks.
oh
oops
i wonder why so many mods use self.config for seals then
wow yeah thats goated ty
oh true
not sure if theres a difference i think using not is usually better
ill take your word for it thx
first time making a mod so lmao dont know much about that stuff
my code is probably Not That Great
oh ive seen way worse things in this chat
dw
this doesnt look that bad at all from what ive seen
The difference is not will be true if the value is nil or false
Hi friends! I've been trying to implement a deck into my mod, but it's just been giving me this crash. anyone have any ideas as to how we can fix this?
Code?
Is greater than or equal >= or =>?
=
I had a suspicion, just wanted to check. Thank you, Romeo.
The = is always last.
I need help with localisation, I want to make a file to store names and descriptions of whatever I add, but I have no clue on how to actually "link" it to the files containing jokers n shi
This hooked code only returns Polychrome when I redeem the Hallucination voucher and I have no idea why.
https://github.com/Steamodded/smods/wiki/Localization, as long as the files have the correct names your stuff will use them automatically
the prefix is the one specified in the json file right?
deckIndexList doesn't exist.
Why aren't you using poll_edition?
nevermind
This is hooked code from an already existing function
I don't see anything wrong with what I did but it doesn't seem to be working
what does your localization file look like
Could I, in theory, make this use poll_edition?
card:set_edition(poll_edition('illusion', nil, true, true))
It's bl_ for blinds.
Just replace all this with that?
ok fixed that, either way neither works
are there resources for making music replacement mods?
anyone have any clue why this wouldnt work?
it says something about atlas being a nil value when i hover over the page of the blind
which i find strange because i feel like it shouldnt do that?
do u have other things referencing the same atlas
as in do u have other cases where u have called the atlas "Ode" and referenced it with another object
blinds should have animated atlas
it needs to have atlas_table = "ANIMATION_ATLAS", iirc
animated?
see
also doesnt it need a frames field or is that on the blind
Yes.
In {set = 'whatever'}, is set intended to be a table?
Because I have a precise set of cards I want a making card to pull from, and I don't want to cut up those cards to their own group.
set is meant to be the key of an objecttype as a string
cards can be in multiple groups
when I create a 32x32 file and insert the icon, it only shows one quarter of it, as In the image seems to be 4 times as big
SMODS.Consumable {
key = "lanthanides",
set = "xiferp_Element",
atlas = "Golden_Brick_Road",
cost = 3,
pos = { x = 0, y = 5 },
unlocked = true,
discovered = true,
can_use = function(self, card)
return (card.area == G.consumeables)
end,
use = function(self, card, area, copier)
G.E_MANAGER:add_event(Event({
trigger = 'after',
func = function()
SMODS.add_card({ set = 'xiferp_Element' })
return true
end
}))
end,
loc_txt = {
name = 'Lanthanides',
text = {
'Creates a random Lanthanide card',
},
}
}```
Here's the code of it, and I want it to pull from a list of 15 cards. What do I place in ``SMODS.add_card()``?
you need to create an SMODS.ObjectType with that set of cards
and then put the key of that in there
Can those be inside of other types?
Hmm, will pseudorandom_element{list of keys for the cards} work?
that can also work
I'll go with that, it's easier on my brain. (I love this bit of coding, like a road trip.)
Hello, is there any way for an event to access context? I wanted to create a consumable that on use makes it so next shop has an uncommon joker. But since the consumable is destroyed on use. I can't use calculate()
Have it add an uncommon tag?
Yes, set a flag then hook create_card
(best idea I had)
How would I do that?
G.GAME.modprefix_next_shop_uncommon_joker = true and:
local oldcreatecard = create_card
function create_card(_type, area, legendary, _rarity, skip_materialize, soulable, forced_key, key_append)
if G.GAME.modprefix_next_shop_uncommon_joker and key_append == 'sho' then
_type, _rarity = 'Joker', 'Uncommon'
G.GAME.modprefix_next_shop_uncommon_joker = nil
end
return oldcreatecard(_type, area, legendary, _rarity, skip_materialize, soulable, forced_key, key_append)
end
{ pseudorandom_element({'xiferp_lanthanum', 'xiferp_cerium', 'xiferp_praseodymium', 'xiferp_neodymium', 'xiferp_promethium', 'xiferp_samarium', 'xiferp_europium', 'xiferp_gadolinium', 'xiferp_terbium', 'xiferp_dysprosium', 'xiferp_holmium', 'xiferp_erbium', 'xiferp_thulium', 'xiferp_ytterbium', 'xiferp_lutetium' }, 'Lanthanide_pull' )}
Is this what I should go for?
yes
table with the lanthanides first, then the seed.
I'm getting better at this whole coding thing
On an unrelated note, one line in my code has breached 375 characters long.
But when would I set the flag to true? Wouldn't I need context to know when context.type == 'store_joker_create' and set it to true then?
No, in use
Ok. Sorry Im kinda lost cause I haven't overriden functions yet.
So the key_append = 'sho' means it is for when the jokers are created for the shop?
When/Where in the code would I override this function? Can I place it just in my file outside any class so when the mod is loaded it overrides?
Yes.
Nice, thank you
though this seems like the kind of solution I wouldn't be able to come up on my own xD
okay so currently it displays the flash but it also moves
this is what it looks like rn
It's 34 not 35
key = "wrapped",
pos = {x = 0, y = 0},
config = {extra = {present_points = 5, present_points_mod = 1, present_points_reset = 5}},
discovered = false,
loc_vars = function(self, info_queue, card)
return {
vars = { card, card.ability.extra.present_points_mod, card.ability.extra.present_points, card.ability.extra.present_points_reset}
}
end,
calculate = function (self,card,context)
if context.cardarea == G.discard then
for _, discarded_card in pairs(G.discard.cards) do
card.ability.extra.present_points = card.ability.extra_present_points - card.ability.extra.present_points_mod
if card.ability.extra.present_points == 0 then
SMODS.add_card({ set = 'Joker' })
card.ability.extra.present_points = card.ability.extra.present_points + card.ability.extra.present_points_reset
end
end
end
end,
atlas = "wrapped"
}
)
SMODS.Atlas {
key = "wrapped",
path = "wrapped.png",
px = 71,
py = 95
}```
i want this to lower the present points whenever a wrapped card is discarded
how does one properly implement a malverk skin to a modded card?
when the skin is enabled via mod menu but not in use via the malverk ui, it defaults to using the default balatro sprite
I copied the way Celestial Funk implemented a modded skin (it skinning Asteroid of Multiplayer (?)) Is there any other way to implement modded skinning that doesn't have this happen?
SMODS.Consumable {
key = "potassium",
set = "xiferp_Element",
atlas = "Golden_Brick_Road",
cost = 3,
pos = { x = 15, y = 2 },
unlocked = true,
discovered = true,
can_use = function(self, card)
return true
end,
use = function(self, card, area, copier)
G.GAME.xiferp_alkimetal_chips = (G.GAME.xiferp_alkimetal_chips or 0) + 20
end,
loc_txt = {
name = 'Potassium',
text = {
'Adds +20 chips for the hand',
'after this is used, and adds one',
'new card to the deck',
},
},
calculate = function(self, card, context)
local alki_card = SMODS.add_card { set = "Base" }
G.GAME.blind:debuff_card(alki_card)
G.hand:sort()
SMODS.calculate_context({ playing_card_added = true, cards = { alki_card } })
end
}```
These kinds of cards snap the game upon buying from the shop. I think it has something to do with the ``can_use`` part, saying you can use it even in the shop.
Should I change it to something like context.blind?
Just for curiosity (and future reference) how did you unearth this knowledge?
if context.discard and context.other_card == card
return G.GAME.blind.in_blind
thank you.
Also, is there any way to put a card into the shop with debug plus?
Yes, for vouchers and boosters.
but not standard consumable?
Not without doing it manually.
Welp, better make good use of that $10 button
eval local card = SMODS.add_card({key = 'c_modprefix_key', area = G.shop_jokers}); create_shop_card_ui(card)
Still doesn't help with the fact that the code is still breaking the game it seems
Yes, you need a context check.
SMODS.Consumable {
key = "cesium",
set = "xiferp_Element",
atlas = "Golden_Brick_Road",
cost = 3,
pos = { x = 16, y = 4 },
unlocked = true,
discovered = true,
can_use = function(self, card)
return G.GAME.blind.in_blind
end,
use = function(self, card, area, copier)
G.GAME.xiferp_alkimetal_mult = (G.GAME.xiferp_alkimetal_mult or 0) + 10
end,
loc_txt = {
name = 'Cesium',
text = {
'Adds +10 mult for the hand',
'after this is used, and adds one',
'new card to the deck',
},
},
calculate = function(self, card, context)
if context.blind.in_blind == true then
local alki_card = SMODS.add_card { set = "Base" }
G.GAME.blind:debuff_card(alki_card)
G.hand:sort()
SMODS.calculate_context({ playing_card_added = true, cards = { alki_card } })
end
end
}```
Like this?
No, context.blind doesn't always exist.
then what does that has the same effect?
No, you put it in use
put the stuff in calculate in use?
Yes.
if context.[???] then
local alki_card = SMODS.add_card { set = "Base" }
G.GAME.blind:debuff_card(alki_card)
G.hand:sort()
SMODS.calculate_context({ playing_card_added = true, cards = { alki_card } })
end
end,```
what should be in place of [???]
Is there a dedicated color palette restriction for Balatro?
or can you use any colors
not to my knowledge
there is a palette for jokers if you'd like to follow it, but you don't need to
Most common rule is avoid using pure black
see my recent code
Hey
Hey!
I assume color masking shenanigans
Not really
None of the art uses it, also it looks kinda bad if it has a negative edition on top
No, remove the if
#000000 looks really dark in-game and i assume it's something to do w saturation
its not to say you cant use it, u just need to figure out a way to not make it seem odd
it's fixed now
not just that, but the pack's good too
Well, actually...
uh oh
SMODS.Consumable {
key = "magnesium",
set = "xiferp_Element",
atlas = "Golden_Brick_Road",
cost = 3,
pos = { x = 17, y = 1 },
unlocked = true,
discovered = true,
can_use = function(self, card)
return true
end,
loc_txt = {
name = 'Magnesium',
text = {
'Gives 1 random card a random seal',
'and adds +10 chips to your next hand.',
},
},
use = function(self, card, area, copier)
G.GAME.xiferp_alkemetal_chips = (G.GAME.xiferp_alkemetal_chips or 0) + 10
calculate = function(self, card, context)
local xiferp_seal_the_deal = SMODS.poll_seal({guaranteed = true, type_key = 'shuffletheseed'})
local card_to_change = pseudorandom_element(G.hand.cards, 'shufflethedeck')
G.E_MANAGER:add_event(Event({
func = function()
card_to_change:set_seal(xiferp_seal_the_deal, nil, true)
return true
end
}))
end
end
}```
this doesn't work, doesn't add seals.
No, remove the calculate function.
what would y'all call a certificate-alike that creates enhanced cards instead of sealed cards
Level-Up
SMODS.Consumable {
key = "potassium",
set = "xiferp_Element",
atlas = "Golden_Brick_Road",
cost = 3,
pos = { x = 15, y = 2 },
unlocked = true,
discovered = true,
can_use = function(self, card)
return G.GAME.blind.in_blind
end,
use = function(self, card, area, copier)
G.GAME.xiferp_alkimetal_chips = (G.GAME.xiferp_alkimetal_chips or 0) + 20
local alki_card = SMODS.add_card { set = "Base" }
G.GAME.blind:debuff_card(alki_card)
G.hand:sort()
SMODS.calculate_context({ playing_card_added = true, cards = { alki_card } })
end,
loc_txt = {
name = 'Potassium',
text = {
'Adds +20 chips for the hand',
'after this is used, and adds one',
'new card to the deck',
},
},
}```
WHERE IS THE ERROR NOW!!??? (can't even copy it in without the game closing on itself)
(The cards just like it are perfectly fine)
see above
key = "wrapped",
pos = {x = 0, y = 0},
config = {extra = {present_points = 5, present_points_loss = 1, present_points_reset = 5}},
discovered = false,
loc_vars = function(self, info_queue, card)
return {
vars = { card, card.ability.extra.present_points_loss, card.ability.extra.present_points, card.ability.extra.present_points_reset}
}
end,
calculate = function (self,card,context)
if context.discard and context.other_card == card then
card.ability.extra.present_points = card.ability.extra.present_points - card.ability.extra.present_points_loss
if card.ability.extra.present_points == 0 then
SMODS.add_card({ set = 'Joker' })
card.ability.extra.present_points = card.ability.extra.present_points + card.ability.extra.present_points_reset
end
end
end,
atlas = "wrapped"
}
)
SMODS.Atlas {
key = "wrapped",
path = "wrapped.png",
px = 71,
py = 95
}```
is there a way to make all the wrapped cards share the same present points?
like this works
BUT the points stuck to individual cards
Yes, put it in a global variable.
how do i make it global?
Nevermind, somehow seemed to fix it
G.GAME.(variable)
so G.GAME.present_points
yeag
No, G.GAME.modprefix_present_points
do i declare that in the enhancement?
I have similar variables thanks to that
yes
like this?
what's you mod prefix?
othe
No, you replace modprefix with your mod prefix.
then swap modprefix with othe
yep!
neat
now i can make a variable called splunksplosioncore and no one can stop me now
i fixed the issue
but the only small error left is
before discarding any of them it shows nil cards
instead of 5
fixed it
i just put or 5
Do you have the image in both 1x and 2x?
yeah
key = 'radi',
shader = 'radi',
config = { x_mult = 2, prob = 15 },
in_shop = true,
weight = 3,
extra_cost = 5,
loc_vars = function(self, info_queue, card)
local numerator, denominator = SMODS.get_probability_vars(card, 1, card.edition.prob, 'e_xiferp_radi')
return { vars = { card.edition.x_mult, numerator, denominator } }
end,
get_weight = function(self)
return (G.GAME.edition_rate - 1) * G.P_CENTERS["e_negative"].weight + G.GAME.edition_rate * self.weight
end,
calculate = function(self, card, context)
if context.post_joker or (context.main_scoring and context.cardarea == G.play) then
if SMODS.pseudorandom_probability(card, 'e_xiferp_radi', 1, card.edition.prob) then
SMODS.destroy_cards(card, nil, nil, true)
end,
return {
x_mult = card.edition.x_mult
}
end
end
}```
Where do I put the visual for this, and will this do as I think it will?
(i.e. destroy itself if the odds hit)
Yes, but it will still give xmult after it is destroyed.
The card or the edition?
The edition.
You need to put return nil after SMODS.destroy_cards
so where do I put the visual of the card?
so the game launch now but when the blind want to appear I get
What do you mean?
Like the backing for the cards, like with polychrome and the such.
SMODS.Blind {
key = "selfish",
dollars = 5,
mult = 2,
atlas = "Blinds",
pos = {x = 0, y = 0},
boss = {min = 1},
calculate = function(self, blind, context)
if not blind.disabled then
if context.discard and not context.blueprint and #context.full_hand == 5 then
return {
function ()
ease_dollars(-5)
delay(0.2)
end
}
end
end
end,
boss_colour = HEX("03fcb6"),
}`
Put func = before function ()
oh yeah oups
func = function ()
ease_dollars(-5)
delay(0.2)
return true
end
it crash again
where do I set the shaders for new editions?
nevermind I made it work somehow
I got this error when I played a card with the irken seal. It just says I cant index extra, but the line it points to as an error is an else condition, so that is confusing me.
It's card.ability.seal.extra
I replaced it
func = function ()
for i = 1, #G.discard.cards do
G.E_MANAGER:add_event(Event({
func = function()
G.discard.cards[i]:juice_up()
return true
end
}))
ease_dollars(-1)
delay(0.2)
return true
end
end
why does it work only after the first discard
Because there are no cards in G.discard until the first discard has been used.
but what is the global for the cards that you discard
context.full_hand
oh yeah
Why am I being able to use my consumable when in the shop?
can_use = function (self, card)
if G.GAME.blind and G.hand and G.GAME.dollars >= G.GAME.bankrupt_at + card.ability.extra.amount then
return true
end
return false
end
wsg chat
The goal is to see if I'm inside a blind. I should only be able to use the consumable if Im inside a round
yall my localiztion file isn't workin and i KNOW i fucked up so can yall help me
my deck is crashing when I hover over it
wait I think I see the issue
why isnt the text separate.
try {X:red, C:white} is all I could think
X: removes spaces apparently
ahhh
Winter mods release in ETA whenever an artist gets me one more joker. So probably tomorrow
No way another Sandbox Deck
Would anyone know how to make a playing card in a specific position (like left-most for instance) be destroyed? I know how to do random, but unsure how to do a specific one. My current code below, which is for random
local card_ = pseudorandom_element(G.hand.cards, 'seed')
SMODS.destroy_cards(card_, nil, true)
G.hand.cards[i] is the card in position i from the left
assuming 1 would be leftmost and up from there, or start at 0?
yes, starts at 1 as leftmost
thank you :)
is there a way to ban the blue seal?
should i ban the arm and or flint for balancing or should they not be banned
well you can still level up with i was thinking a space joker and maybe oops
also you can ban blue seal but idk if itll work if you put it into banned_keys, you can ban it in apply instead though
doesnt look like it will work the normal way
does the spectral cards that create cards spawn with seals?
First time making consumables, how would I get this to force draw 3 cards (beyond hand limit)? I saw a similar mod use this "assert" but I haven't used it. Any advice would be great appreciated!
(also just realised even if this did work it would draw nine cards but I can fix that lol)
Confused whats going on here...was working just fine before, but now its not. It has to compare to the number of cards in hand, but saying it cant for some reason-
if context.end_of_round and not context.game_over and context.main_eval and SMODS.find_card("j_DRY_Wyfole") > 0 and #G.hand.cards > 1 then
local nullcard1_ = G.hand.cards[2]
if #G.hand.cards > 2 then
local nullcard2_ = G.hand.cards[3]
SMODS.destroy_cards(nullcard2_, nil, true)
end
SMODS.destroy_cards(nullcard1_, nil, true)
fixed it, used "G.FUNCS.draw_from_deck_to_hand(amount)" instead
this is gonna sound real stupid but is there a way to have a booster pack not return SMODS.create_card
im making an alternate set of tarots with the hidden property so they have a chance of showing up in tarot packs, but you can also open a pack of just those alternate ones
issue is since theyre all hidden the alt pack gives nothing but the default card, since the cards still count as hidden even for their own set
so when i run this i get a variety of 5 cards from the upper bit and then 5 default cards from the lower bit
but removing that return statement just causes a crash
^
Is there a code example of a Red Seal by any chance?
the humble vanillaremade:
me when the vanilla is remade
the vanilla remade in question:
I forgor that existed lol
as a new modder myself this shit is like the bible dawg
All hail the mighty Vanilla Remade
Wait, can I post images?
So I figured out its because I'm looking for a Joker on the table with a number...which seems to be impossible?? Even though it worked for a while?
This consumable is supposed to discard 3 cards, everything works pretty much as intended but it just doesnt discard the selected cards at all, am I using "G.FUNCS.discard_cards_from_highlighted(nil, true)" in the correct way?
NVM FIXED IT
I didnt need the check for selected
istg I should just type this into a personal text document I always post here then fix it 5 minutes later somehow
This current function to check if I have Zim doesnt work when I tested it.
It is Jokerforge generated code, so there is probably a smarter way to do it lol
what is jokerforge on 
you don't need a whole-ass function when smods already has a function for it
next(SMODS.find_card("j_modprefix_zim")) is true if you have at least one Zim joker
(replace "modprefix" with your mod's actual prefix ofc)
lol
So does the find card return true or false depending on if it actually found it?
SMODS.find_card returns a table that contains every instance of the card you're looking for. if you don't have the card, it returns an empty table
putting it in next() means that it ends up returning the first card object in the table, or nil if the table is empty. nil counts as false, and pretty much anything else (including a card object) counts as true
should i add an oops for balancing?
curious why you ban standard packs
anyway another option for balancing would be to give the player a rocket for some bonus econ, it's thematic too
idk how to make sure blue seals not appear in the challange