#💻・modding-dev

1 messages · Page 678 of 1

daring fern
#

Also yes quantum enhancements can make a stone card count as a wild card.

vital wren
#

question about that, i can't use SMODS.has_enhancemnt inside context.check_enhancement cuz it will infinite loop (if im reading the documentation correctly), so how do i apply m_wild to cards with m_stone

daring fern
vital wren
#

oh, just check it using vanilla. okay lol

wild escarp
#

Is there an equivalent to the config = {} of jokers for blinds?

daring fern
wild escarp
#

Can I not get it in the set_blind function, for example, then?

daring fern
wild escarp
#

Yeah, just figured that out. Reading comprehension is key, it turns out.

vale zinc
#

I've noticed that the Challenge Deck modifiers have their value information directly sent into the localization strings, like the one for X-ray Vision with 4:

ch_c_flipped_cards={"{C:green}1 in #1#{} cards are drawn face down",},

How do I change what values are passed to that?

ch_c_LAPSEMS_only_boss_blinds = {"All {C:attention}Boss Blinds{} are #1#"},

G.GAME.modifiers.ch_c_LAPSEMS_only_boss_blinds.value takes a table of the valid Boss Blind keys, and I have a function that turns a table of strings into a list "string_a, string_b and string_c".

vital wren
#

couple questions regarding quantum enhancements:

  1. do these cause lag? i'm getting a lot of slow down when they're in hand
  2. i have stone cards also being wild, and it automatically applies the wild sprite. how do i control what it looks like?
  3. when i use set_ability to remove stone, the wild sprite stays on the card even though it's not wild anymore. how do i fix that?
daring fern
vital wren
#

should i switch to dev or just wait for the next release?

daring fern
vital wren
#

i dont see a dev branch in the github. do you mean just grabbing the code from main instead of using the latest release?

daring fern
vital wren
#

great. ill grab that. thanks

#

im guessing there's not really a way to optimize the quantum enhancements to prevent the slowdowns?

tall wharf
daring fern
tall wharf
#

it's not just about the challenge value - it's about the fact that it reads the value raw

vital wren
tall wharf
#

[[patches]]
[patches.pattern]
target = "functions/UI_definitions.lua"
pattern = '''          game_rules[#game_rules+1] = {n=G.UIT.R, config={align = "cl"}, nodes= localize{type = 'text', key = 'ch_c_'..v.id, vars = {v.value}}}'''
position = "before"
payload = """
if v.akyrs_localized_value then
    game_rules[#game_rules+1] = {n=G.UIT.R, config={align = "cl"}, nodes= localize{type = 'text', key = 'ch_c_'..v.id, vars = {localize(v.akyrs_localized_value)}}}
else
"""
overwrite = true
match_indent = true
[[patches]]
[patches.pattern]
target = "functions/UI_definitions.lua"
pattern = '''          game_rules[#game_rules+1] = {n=G.UIT.R, config={align = "cl"}, nodes= localize{type = 'text', key = 'ch_c_'..v.id, vars = {v.value}}}'''
position = "after"
payload = """
end
"""
overwrite = true
match_indent = true
#

this is what i did

#

and then when i put the rules in i do

{id = 'akyrs_all_blinds_are', value = "bl_akyrs_the_thought", akyrs_localized_value = {type = "name_text", key = "bl_akyrs_the_thought", set = "Blind"}},
#

hope this helps

vital wren
flint spindle
#

Is there a way to call a list of the keys for all the currently legal planet cards? Like to use pseudorandom_element to call a random planet key or something

tall wharf
#

G.P_CENTER_POOLS.Planet

flint spindle
#

ty

#

This was supposed to return a random planet key but it's returning a table for some reason? How do I make it return a planet key like c_pluto or something

vale zinc
# tall wharf hope this helps

Made some modifications, but they haven't quite worked.

[[patches]]
[patches.pattern]
target = "functions/UI_definitions.lua"
pattern = '''          game_rules[#game_rules+1] = {n=G.UIT.R, config={align = "cl"}, nodes= localize{type = 'text', key = 'ch_c_'..v.id, vars = {v.value}}}'''
position = "before"
payload = """
--[[
Code adapted from Aikoyori's Shenanigans.
[#💻・modding-dev message](/guild/1116389027176787968/channel/1233186615086813277/)
--]]
if v.LAPSEMS_localized_value then
    game_rules[#game_rules+1] = {
        n=G.UIT.R,
        config = {
            align = "cl"
        },
        nodes = localize{
            type = 'text',
            key = 'ch_c_'..v.id,
            vars = {
                v.LAPSEMS_localized_value
            }
        }
    }
else
"""
overwrite = true
match_indent = true

[[patches]]
[patches.pattern]
target = "functions/UI_definitions.lua"
pattern = '''          game_rules[#game_rules+1] = {n=G.UIT.R, config={align = "cl"}, nodes= localize{type = 'text', key = 'ch_c_'..v.id, vars = {v.value}}}'''
position = "after"
payload = """
end
"""
overwrite = true
match_indent = true
{
    id = 'LAPSEMS_only_boss_blinds',
    value = {
        'bl_lapsems_mask',
    },
    LAPSEMS_localized_value = LAPSEMS.recursive_list_of_localized_blind_names({'bl_lapsems_mask'}, 'or')
},
daring fern
flint spindle
#

so then how do I make it a key ;-;

daring fern
flint spindle
#

TYTYTY

#

I forgot that was a thing

vale zinc
#

There was some debacle I was dealing with where localization files weren't loading in correctly. Here I punched them in manually and there was no hassle.

daring fern
vale zinc
mild bramble
#

im using joker forge
i made a variable but i cant fucking use it

tall wharf
mild bramble
#

wait nvm i solved it

vale zinc
# tall wharf what does `LAPSEMS.recursive_list_of_localized_blind_names({'bl_lapsems_mask'}, ...
LAPSEMS.recursive_list_of_localized_blind_names = function(list_of_blind_keys, end_of_list)
    local localized_table = {}
    for _, blind_key in pairs(list_of_blind_keys) do
        localized_table[#localized_table + 1] = localize {
            type = "name_text",
            key = blind_key,
            set = "Blind"
        }
    end
    
    return LAPSEMS.recursive_list_maker(localized_table, end_of_list)
end
LAPSEMS.recursive_list_maker = function(list_to_use, end_of_list)
    --[[
    k_lapsems_list_and = "#1# and #2#",
    k_lapsems_list_or = "#1# or #2#",
    k_lapsems_list_recursive = "#1#, #2#",
    --]]
    if not LAPSEMS.contains({'and', 'or'}, end_of_list) then
        end_of_list = 'and' -- defaults to "and"
    end
    
    if #list_to_use == 1 then
        return list_to_use[1]
    elseif #list_to_use == 2 then
        return localize{
            type = 'variable',
            key = 'k_lapsems_list_' .. end_of_list,
            vars = {
                list_to_use[1],
                list_to_use[2]
            }
        }
    else
        return localize{
            type = 'variable',
            key = 'k_lapsems_list_recursive',
            vars = {
                table.remove(list_to_use, 1),
                LAPSEMS.recursive_list_maker(list_to_use, end_of_list)
            }
        }
    end
end
tall wharf
#

frankly i am too lazy to read can you send just the output 😭😭

vale zinc
#
eval LAPSEMS.recursive_list_of_localized_blind_names({'bl_lapsems_mask', 'bl_lapsems_final_cloak'}, 'or')
-- "The Mask and Chromatic Cloak"
tall wharf
#

hmmm

#

try with a string first

#

like LAPSEMS_localized_value = "TEST"

#

if that works

vale zinc
#
{
    id = 'LAPSEMS_only_boss_blinds',
    value = {
        'bl_lapsems_mask',
    },
    LAPSEMS_localized_value = 'The Mask'
},
tall wharf
#

hmmm

#

so it works with just string

#

i would suspect LAPSEMS.recursive_list_of_localized_blind_names({'bl_lapsems_mask'}, 'or') to not return string so try adding like parentheses and "".. to coerce it into string

#
LAPSEMS_localized_value = (""..LAPSEMS.recursive_list_of_localized_blind_names({'bl_lapsems_mask'}, 'or'))
vital wren
#

why would this in my joker cause the game to crash on hover? works fine when this is commented out

loc_vars = function(self, info_queue, card)
    info_queue[#info_queue + 1] = G.P_CENTERS.m_stone
    info_queue[#info_queue + 1] = G.P_CENTERS.m_wild
end,
tall wharf
#

what's the crash

vital wren
#

that's in the SMODS.has_enhancement() function

tall wharf
#

huh

tall wharf
vital wren
#

oh, is it because of quantum enhancements?

tall wharf
#

i dont use quantum enhancement

#

but this works for me

vital wren
#

i feel like the info_queue is just cursed for me. i've never gotten it working correctly

vale zinc
tall wharf
#

actually i think i kinda do know why it doesn't work

#

the challenge is initialised at the start of the game alongside the rules

#

that includes the value

#

i think that is why i localize it that way

#

so you'd have to put the function that gets the localization of the things you want in the patch

#

so it runs the function to get the text at runtime

wild patrol
tall wharf
#

ngl i encourage people to start coding

wild patrol
#

forge is ok if u wanna make a template for something but once you need to add custom stuff forge just sucks at it

#

I use it just to cobble together something that I want to do when certain stuff is met then just fill in everything else with custom stuff lol

#

to lazy to retype game conditions

vital wren
# tall wharf huh

okay, so it's because i was trying to dynamically change the description of stone cards with this particular joker

wild patrol
#

Is there a smod function to set a custom boss to show up at a specific ante

#

wanna make a custom boss always be the ante 8 boss

tall wharf
#

idts

wild patrol
#

man i'm getting old I had to google what idts meant

vale zinc
#

I was advised, @tall wharf, to refresh the localization values with a hook instead, but this one just crashes the game when I try. What do I do, Noodlemire?

local LAPSEMS_game_main_menu_old = Game:main_menu(change_context)
function Game:main_menu(change_context)
    --
    
    return LAPSEMS_game_main_menu_old(change_context)
end
vital wren
#

huh, okay... so i've been having an issue with info_queue where the things i put in it just don't show up. but then sometimes some things do and others dont for the same card. i just figured out what the pattern is: the last thing i add to my info_queue just doesn't show up.

so THIS, shows stone and wild. but only shows wild once. if i remove the second instance of adding wild to the queue, then only stone shows up:

loc_vars = function(self, info_queue, card)
    info_queue[#info_queue+1] = G.P_CENTERS['m_stone']
    info_queue[#info_queue+1] = G.P_CENTERS['m_wild']
    info_queue[#info_queue+1] = G.P_CENTERS['m_wild']
end,
#

why would this be happening?

daring fern
vale zinc
daring fern
daring fern
vale zinc
daring fern
vital wren
vale zinc
vital wren
#

how do i change a card's sprite dynamically? i'm using key in loc_vars to dynamically change it's description, but im not sure where to put the code for changing the sprite or what that code actually looks like

daring fern
vital wren
#

that seems to accept a center and front but i want to change the sprite of a center dynamically. can i just modify card.config.center.atlas and its .pos directly?

#

or maybe instead, changing G.P_CENTERS['enhancementkey'].atlas?

frosty dock
#

no

#

you have to use card.children.center

#

you can change the sprite pos by calling card.children.center:set_sprite_pos({ x=x, y=y })

#

you do still have to take care of it being properly reloaded by saving the pos somewhere and reapplying in set_sprites

vital wren
#

so what im trying to do is make all stone cards use my custom sprite when my custom joker is in play

#

where do i put it? update? current_mod.calculate listening for context for gaining and losing jokers?

frosty dock
#

add_to_deck/remove_from_deck of your joker should do

vital wren
#

what do i use for the card ref in that context?

frosty dock
#

iterate through G.playing_cards

vital wren
#

are add_to_deck and remove_from_deck a context or a method?

#

oh they're methods. okay

#

got it working. thanks for the help

vital wren
#

there's some way to get localized card names for loc_vars. is it something like localize('name', card.edition.key)?

daring fern
vital wren
#

ah, thanks

thorn ingot
#

Hi everyone.

Do you know how to make a tag only appear on the big blind?

fading rivet
fading rivet
fading rivet
keen blaze
#

how might i be able to check if a certain key leads to an object ? specifically an SMODS.Sound object in this case

keen blaze
#

oh thats surprisingly simple

#

thanks !

lyric wadi
#

question : when making spectral to apply custom seals, do you have to prepend the seal key with the mod prefix?

fading rivet
#

where could I find documentation for dynatext

#

nvm

safe dawn
#

how do i animate Jokers?

faint yacht
#

In the SMODS.Atlas definition, add

  atlas_table = 'ANIMATION_ATLAS', -- items using this atlas are animated.
  frames = x, -- how many frames are there.
  fps = y -- optional, how fast it animates.

and align the frames horizontally.

safe dawn
#

and i would use a separate sprite for this?

faint yacht
#

All depends on the sheet you've made.

safe dawn
faint yacht
faint yacht
#

✌️

safe dawn
faint yacht
#

😅 My bad-

analog slate
lyric wadi
#

tried making a spectral card but it crashes when hovering over it

#
SMODS.Consumable {
    key = 'fragility',
    atlas = 'HangedMan_Spectrals',
    set = 'Spectral',
    pos = { x = 0, y = 0 },
    config = { max_highlighted = 1 },
    loc_vars = function(self, info_queue, card)
        info_queue[#info_queue + 1] = {key = 'hangedman_glass_seal', set = 'Other'}
        return { vars = { (card.ability or self.config).max_highlighted } }
    end,
    use = function(self, card, area, copier)
        local conv_card = G.hand.highlighted[1]
        G.E_MANAGER:add_event(Event({
            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.1,
            func = function()
                conv_card:set_seal('HangedMan_glass', nil, true)
                return true
            end
        }))

        delay(0.5)
        G.E_MANAGER:add_event(Event({
            trigger = 'after',
            delay = 0.2,
            func = function()
                G.hand:unhighlight_all()
                return true
            end
        }))
    end,
}
#

not even when used i jsut looked at it in the collection

mystic river
#

does your info queue thing also need vars?

lyric wadi
#

oh

#

yeah it has a "X in Y chance" thingy

#

so it crashes because the infoqueue is not getting the vars? do i have to return those as well or

#

are infoqueue with vars jsut not allowed

safe dawn
lyric wadi
#

ok i guess i just wont pass infoqueue for now then

#

idk what to do about it

solemn wharf
#

hii, sorry i was wondering if anyone can help me with this joker. This joker gives x1.5 mult for each consumable card you have, but i want to make it so the cards get destroyed once the hand is played, i saw that i had to add 'remove = true', but its not working, what am i missing?

primal robin
#

@frosty dock probably you was wanted smth like this right?

#

Or, super short super easy use

red flower
#

idk why i said to

mystic river
#

and it's the same vars table as loc_vars returns

#

though i think there's a different key it can want sometimes for no apparent reason even though it's literally the same info for the same purpose

lyric wadi
#

yewh

#

also same bit of code, the spectral crashes on use, which im suspecting is because im not using the correct seal key

#

is it not [modprefix]_[sealname] ?

red flower
solemn wharf
primal robin
frosty dock
#

why the chained calling though 🤔

primal robin
#

because you cannot do stuff like ```lua
{
config = {}
"string 1"
config = {}
"string 2"
}

#

Unless you're specifying array of inputs

frosty dock
#

i mean you could always call it twice, but sure

#

does it work the same way on other templates?

primal robin
#

Benefit of chained calling that it does not override previous config but merge them

#

So you're basically extending previous call if you need this

#

So if you want keep everything but just change, for example, alignment, you can do that

primal robin
frosty dock
#

like can I do

PB.R({})({})

and have it be two rows

primal robin
#

no, this treated as extending of single row, aka adding more config or more children

#

rather than creating multiple of it

frosty dock
#

so it's exclusively for loc boxes? alr

primal robin
frosty dock
#

wait i'm confuzzled

lyric wadi
#

but i cant find how to do it with seals

primal robin
red flower
primal robin
#

PB.LOC_TEXT is basically PB.C, which parses text lines to actual UI to make them properly render

#

It's still a single node

red flower
frosty dock
# primal robin

so in this case there's no use in chain calling for config

#

well these values just apply to the node itself, not its children

#

so that wouldn't make sense anyway right

primal robin
# frosty dock so in this case there's no use in chain calling for config

correct, unless you want to do smth like this:

-- usual ui work, collection, idk
local my_constructed_nodes = {}
-- global? conditional? anything
local my_config_1 = { colour = G.C.MULT }
local my_config_2 = config.centered and { align = "cm" } or nil

PB.C(my_config_1)(my_config_2)(my_constructed_nodes)
frosty dock
#

fair

primal robin
#

So each call extend element

#

Same logic for loc_text element

#

It extends configs for SMODS.localize_box or row definitions, and adds new lines

#

While for PB.R there's no point of it

frosty dock
#

ok yeah i see

primal robin
frosty dock
#

row_config == line_config?

primal robin
#

I'm still not sure about namings

frosty dock
#

what if r_cfg

primal robin
#

looks ass

frosty dock
#

it does, that's the point

#

-# i'm not seriously suggesting that

primal robin
#

c_config, r_config, t_config

frosty dock
#

yay, more memorizing what things mean

primal robin
#

exaaaactly

frosty dock
#

imo things should be descriptive

primal robin
#

then row_config or line_config

#

probably row right

lyric wadi
frosty dock
#

i also think things should be consistent

#

which means row

primal robin
#

Makes sense

lyric wadi
#

there are just no one in this server that has ever mentinoed doing it with seals

frosty dock
#

but line isn't all terrible either

lyric wadi
#

everyone's doing it with jokers

#

i cant search for past solutions because there's none

primal robin
#

what about loc_box_config, it is passed directly to SMODS.localize_box

frosty dock
#

btw what's the point of column_config, can't we have that top level

#

in which case fuck consistency because it's easier to understand that the text entries are lines than rows

#

🤔

primal robin
#

Hm, I think I can remove column_config part

#

Yea it does work

frosty dock
#

don't love loc_box_config tbh, but I'm not sure how to do better

red flower
primal robin
#

I mean howunique input for this function

#

I know default_col, scale, vars

frosty dock
#

that appears to be all

primal robin
#

ew, yea, should be separate probably

#

ans especially because of vars

#

Anyway, naming can be discussed, easy fixable

#

More important that it's working

frosty dock
#

+1

primal robin
#

I have im plans implement element which creates full info_queue just like card does

#

I need it from time to time but generate_ui sucks

#

Want it be like ```lua
PB.INFO_QUEUE({
direction = "l",
crawl = true,

{ set = "Other", key = "", vars = {} },
{ set = "Planet", key = "Saturn", vars = {} },
{ set = "Other", key = "", vars = {} },
})

#

or smth like this

frosty dock
#

love me some invalid keys

#

but sure, sounds useful

primal robin
#

You get the idea

analog slate
primal robin
#

Same can be done for blind, or card' description

#

Like make templates for commonly used UI as this components

frosty dock
#

good stuff

primal robin
#

main problem is of courser generate_card_ui

#

I have no fucking idea how it works, especially w/o center

#

I guess good opportunity to take a look

frosty dock
#

it's a bit of a mess built on top of a giant mess

primal robin
#

actually very important question

#

let's assume we add this as part of SMODS

#

SMODS.O SMODS.C is not happening for sure

#

SMODS.UIT.C too long, even SMODS.T.C kinda long

frosty dock
red flower
frosty dock
primal robin
#

I'm using PB because PaintBrush

frosty dock
#

i don't mind taking UI actually
-# unless any existing mods use this as a global

primal robin
#

if they do that's a shame for them

#

most generic thing you can ever imagine

#

Only Game can become closer

frosty dock
#

the alternative is naked globals

#

R { O(), T { text = 'hello world' } }

#

that sounds horrible icl

primal robin
#

while it would be really cool and very short, but I dont see this happening

#

I was using initially SUI as SimpleUI, but as SmodsUI also may work

frosty dock
#

short/long form duality: SMODS.Column, S.C

primal robin
#

I meann

#

actually it can be optimized, since I added getter

#

idk who said that phrase but he always right:

The most difficult parts of programming is cache invalidation and variable names

hidden notch
#

Just a simple Yes/No since I can't check atm.;
Is there a "Minimum Discard Limit"? - Ex. Setting it to "2" means you cannot just Discard one card.

red flower
#

you can probably implement that in the same place the maximums are implemented but it sounds like it would lead to soft locks

hidden notch
#

It's for a challenge so that's not gonna be too problematic lewxen_ok

hidden notch
granite raptor
#

how would i use SMODS.scale_card to scale a card's extra value, as extra_value is in the card.ability table where i'd be putting the scalar value in card.ability.extra, a separate table?

red flower
granite raptor
#

ah, missed that, mb

fading rivet
#

now do I enable/disable a custom button?

#

nvm

median veldt
#

help me out here. the discarding thing does not work at all

i'm trying to send every card in hand to discard and then redraw the rest of the hand

#

the discarding part just does not work at all

#

if i put it in an event, the event just never happens and the game is softlocked

#

if i make a new event inside the for loop instead of the for loop inside one event it creates events indefinitely

frosty dock
#

isn't there G.FUNCS.draw_from_hand_to_discard or something along those lines?

#

@primal robin on the topic of simple UI, what do you think of autowrapping misplaced rows/columns where columns/rows are expected?

primal robin
#

This is definitely possible

frosty dock
primal robin
#

correct

#

but this introduces some moments with filling & aligning

#

Needs some experimenting with this, but better of course idk, avoid messing with them

frosty dock
#

does a column directly in a column have a use at all? (or same for rows)

#

I don't do enough UI to recall

primal robin
#

yes, for coloring/outlines

#

this is technically correct UI

#

I'm doing a lot of R in R just to paint them

frosty dock
#

oh sure

#

that would do it

primal robin
#

But I see your idea

#

Implement some idiot-proof mechanics

#

This makes sense actually

#

resolve R/C things, empty G.UIT.O, moments when you need nore or array of nodes

frosty dock
#

yeah it's just mixed ones then. but it's definitely in the spirit of making UI simpler

primal robin
#

I'll think about this common issues

#

Rewarding idiots for be itiots is not cool tho

#

But maybe printing some things in console may be useful while making ui not crash, makes sense

frosty dock
#

eh, maybe it makes getting into UI easier if we clean up after idiots where we easily can

primal robin
#

also kinda true

#

Need refine API for all of this first, implement proper extending and such

#

not sure how to do it properly yet

#

Basic things like hooking method works but not pretty

#

and due to lua stuff, I cannot index function, it crashes

#

kinda lame tho, in js I can do that

keen atlas
#

index function?

primal robin
#

wait that's right, it's a function, not metatable

keen atlas
#

......oh

primal robin
#

I made smth like this for not but meh, need more thinking on this one

#

probably instead of function it should be callable metatable with extending things

#

or just fuck it and use Object:extend() like everyone else do

open moth
#

I made a joker that draws a card before hand is scored, but this card doesnt seem to activate due to held in hand effects

calculate = function(self, card, context)
        if context.before then
            draw_card(G.deck, G.hand, 100/#G.hand.cards, 'up', nil, self.foobar_reference, 0.08)
        end
    end
rapid stag
open moth
#

nice, it now works, thanks

#

is there like a documentation specifically for all context?

red flower
open moth
#

this one only lists 4 of them

red flower
#

??

open moth
#

5

red flower
#

it lists all of them

open moth
#

WAIT IM DUMB

#

i dk how to read

red flower
#

smh

open moth
#

guess I'll sell Blueprint

median veldt
#

sorry i took forever to get back

red flower
median veldt
#

ooh yeah true

red flower
#

G.FUNCS.discard_cards_from_highlighted is the easiest way to discard

median veldt
red flower
#

yeah, you need to highlight them

#

thats what the hook does

median veldt
#

ohhh

median veldt
#

it should be G.hand.cards

frosty dock
#

oh whoops I should have seen that

median veldt
#

and then if i send it again it does the rest

red flower
#

local old_limit = G.hand.config.highlighted_limit
G.hand.config.highlighted_limit= 9999
-- code
G.hand.config.highlighted_limit= old_limit

: )

median veldt
#

oh yeah

#

lmao

next timber
#

ok clearly i am approaching this the wrong way. this causes lag spikes every time you draw your hand and also does not work and causes ghost cards.

#

its just meant to make editioned playing cards give +1 hand size

#

fuck it im just patching whatever code checks for card_limit

red flower
#

hooking CardArea:count_property might work?

#

also this joker looks absolutely broken

next timber
#

it is

#

do you mean gameplay wise or coding wise

#

because its kinda both

red flower
#

gameplay wise

#

i found negative playing cards to be too strong personally

next timber
#

well only one person is ever gonna play this mod so

red flower
#

🫂

next timber
#

no i mean like

#

i am making it specifically for my friend

#

lmao

fading rivet
#

What do I need to create a custom card area?

#

I tried CardArea(0, 0, 2, 2 {}) and it crashed

red flower
fading rivet
red flower
#

there's a template for cardarea in vanillaremade

fading rivet
fading rivet
red flower
#

ah

#

dont copy_table a card

fading rivet
#

ah

#

should I just insert the card there as is

#

its purely for cosmetic purposes and has no interaction (I hope)

red flower
#

no, that will create ghost cards

#

what is the goal

fading rivet
#

put a card here

red flower
#

you can use copy_card

rapid stag
#

if i put a function in a custom deck, i should be able to access that via the G.GAME.selected_back table somewhere, right?
so if i wanted to get the func here:

SMODS.Deck{ ..., myFunc = function(...), ... }

i would do

G.GAME.selected_back.myFunc()```?
fading rivet
#

yippee

red flower
austere jungle
#

What’s a syntax in coding? I got a syntax error and need help fixing it. Btw if there’s an experienced coder here, I’d really appreciate someone looking over my formatting

fading rivet
#

syntax is the format you write the code in

austere jungle
fading rivet
#

I would HEAVILY recommend learning lua

red flower
#

syntax error is when the code is written incorrectly
like 5 + 5 = 10 is not valid syntax in code

austere jungle
#

Okay, so theres a formatting problem. Damn, Idk any of the formatting. Just been copying balatros base code

#

and altering it

fading rivet
#

this won't work

austere jungle
#

Heres the rest of this code

fading rivet
#

Tarot isn't defined

austere jungle
#

Okay

#

thank you so much btw

fading rivet
red flower
austere jungle
#

really appreciate it

austere jungle
#

SMODS.Joker{
key = "Giraffe",
config = { extra = { poker_hand = "Straight", Tarot} },
pos={ x = 0, y = 0 },
rarity = 3,
cost = 4,
blueprint_compat=nil,
eternal_compat=true,
unlocked = true,
discovered = true,
effect=nil,
soul_pos=nil,
atlas = 'Giraffe',

calculate = function(self, card, context)              --define calculate functions here
    if context.joker_main and context.cardarea == "Giraffe" and G.jokers and #G.consumeables.cards + G.GAME.consumeable_buffer < G.consumeables.config.card_limit then
        if next(context.poker_hands{self.ability.extra.poker_hand}) then
            local card_type = 'Tarot'
            G.GAME.consumeable_buffer = G.GAME.consumeable_buffer + 1
            G.E_MANAGER:add_event(Event({
                trigger = 'before',
                delay = 0.0,
                func = (function()
                    local card = create_card(card_type, G.consumeables, nil, nil, nil, nil, nil, 'sup')
                    card:add_to_deck()
                    G.consumeables:emplace(card)
                    G.GAME.consumeable_buffer = 0
                return true
            end)}))
        return{
            message = localize('k_plus_tarot'),
            colour = G.C.SECONDARY_SET.Tarot,
            card = self
        }
       
    end
end,

loc_vars = function(self, info_queue, card)
    return { vars = { card.ability.extra.poker_hand, card.ability.extra.Tarot }, key = self.key }
end        

}

fading rivet
#

;-;

#
SMODS.Joker{
    key = "Giraffe",
    config = { extra = { poker_hand = "Straight", Tarot} },
    pos={ x = 0, y = 0 },
    rarity = 3,
    cost = 4,
    blueprint_compat=nil,
    eternal_compat=true,
    unlocked = true,
    discovered = true,
    effect=nil,
    soul_pos=nil,
    atlas = 'Giraffe',
    
    calculate = function(self, card, context)              --define calculate functions here
        if context.joker_main and context.cardarea == "Giraffe" and G.jokers and #G.consumeables.cards + G.GAME.consumeable_buffer < G.consumeables.config.card_limit then
            if next(context.poker_hands{self.ability.extra.poker_hand}) then
                local card_type = 'Tarot'
                G.GAME.consumeable_buffer = G.GAME.consumeable_buffer + 1
                G.E_MANAGER:add_event(Event({
                    trigger = 'before',
                    delay = 0.0,
                    func = (function()
                        local card = create_card(card_type, G.consumeables, nil, nil, nil, nil, nil, 'sup')
                        card:add_to_deck()
                        G.consumeables:emplace(card)
                        G.GAME.consumeable_buffer = 0
                    return true
                end)}))
            return{
                message = localize('k_plus_tarot'),
                colour = G.C.SECONDARY_SET.Tarot,
                card = self
            }
           
        end
    end,
    
    loc_vars = function(self, info_queue, card)
        return { vars = { card.ability.extra.poker_hand, card.ability.extra.Tarot }, key = self.key }
    end        
}
austere jungle
#

Making an animal balatro mod

fading rivet
#

okay so this is going to break
config = { extra = { poker_hand = "Straight", Tarot} },
Tarot isn't defined

#

blueprint_compat=nil,, effect=nil,, and soul_pos=nil, are unneeded

austere jungle
#

Okay

fading rivet
#

here's your syntax error

austere jungle
#

uhhh, how do I define tarot? Like assuming its already defined, what is the actual thing

fading rivet
#

if next(context.poker_hands{self.ability.extra.poker_hand}) then

austere jungle
#

uhhhh, good question

fading rivet
austere jungle
#

okay so lets start with the syntax error then

fading rivet
#

can you send the text in the localization file for this card

fading rivet
austere jungle
#

thats a good start, one moment

fading rivet
#

okay thats another issue

austere jungle
#

j_Al_worm = {
name = "worm",
text = {
{
"This Joker gives {C:chips}+#1#{} chips",
}
},
},
j_Al_Giraffe = {
name = "Giraffe",
text = {
{
"When you play a Straight, create a{C:tarot} tarot{} card",
}
},
},

#

From the localization file

fading rivet
austere jungle
#

which one?

fading rivet
#

make the return in loc_vars output
return { vars = { card.ability.extra.poker_hand} }

austere jungle
#

j_Al_Giraffe = {
name = "Giraffe",
text = {
{
"When you play a #1#, create a{C:tarot} tarot{} card",
}
},
},
Like this?

fading rivet
#

and make the config at the start of the joker
config = { extra = { poker_hand = "Straight"} },

austere jungle
#

Can you show me where exactly?

fading rivet
#

i did ;-;

austere jungle
#

oh okay

fading rivet
#
SMODS.Joker{
    key = "Giraffe",
    config = { extra = { poker_hand = "Straight"} },
    pos={ x = 0, y = 0 },
    rarity = 3,
    cost = 4,
    blueprint_compat=true
    eternal_compat=true,
    unlocked = true,
    discovered = true,
    atlas = 'Giraffe',
    
    calculate = function(self, card, context)              --define calculate functions here
        if context.joker_main and #G.consumeables.cards + G.GAME.consumeable_buffer < G.consumeables.config.card_limit then
            if next(context.poker_hands{self.ability.extra.poker_hand}) then
                local card_type = 'Tarot'
                G.GAME.consumeable_buffer = G.GAME.consumeable_buffer + 1
                G.E_MANAGER:add_event(Event({
                    trigger = 'before',
                    delay = 0.0,
                    func = (function()
                        local card = create_card(card_type, G.consumeables, nil, nil, nil, nil, nil, 'sup')
                        card:add_to_deck()
                        G.consumeables:emplace(card)
                        G.GAME.consumeable_buffer = 0
                    return true
                end)}))
            return{
                message = localize('k_plus_tarot'),
                colour = G.C.SECONDARY_SET.Tarot,
                card = self
            }
           
        end
    end,
    
    loc_vars = function(self, info_queue, card)
        return { vars = { card.ability.extra.poker_hand}}
    end        
}
austere jungle
#

so far I'm caught up

fading rivet
#

id also recommend making this a common instead of a rare

austere jungle
#

Apolagies about needing so much help. I've had minimal coding experience in the past but I love balatro so I wanted to give it a try

fading rivet
austere jungle
fading rivet
#

whatever you want to make

austere jungle
#

got it

#

syntax error again

#

SMODS.Joker{
key = "Giraffe",
config = { extra = { poker_hand = "Straight"} },
pos={ x = 0, y = 0 },
rarity = 3,
cost = 4,
blueprint_compat=nil,
eternal_compat=true,
unlocked = true,
discovered = true,
effect=nil,
soul_pos=nil,
atlas = 'Giraffe',

calculate = function(self, card, context)              --define calculate functions here
    if context.joker_main and context.cardarea == "Giraffe" and G.jokers and #G.consumeables.cards + G.GAME.consumeable_buffer < G.consumeables.config.card_limit then
        if next(context.poker_hands[self.ability.extra.poker_hand]) then
            local card_type = 'Tarot'
            G.GAME.consumeable_buffer = G.GAME.consumeable_buffer + 1
            G.E_MANAGER:add_event(Event({
                trigger = 'before',
                delay = 0.0,
                func = (function()
                    local card = create_card(card_type, G.consumeables, nil, nil, nil, nil, nil, 'sup')
                    card:add_to_deck()
                    G.consumeables:emplace(card)
                    G.GAME.consumeable_buffer = 0
                return true
            end)}))
        return{
            message = localize('k_plus_tarot'),
            colour = G.C.SECONDARY_SET.Tarot,
            card = self
        }
       
    end
end,

loc_vars = function(self, info_queue, card)
    return { vars = { card.ability.extra.poker_hand}} 
end        

}

fading rivet
austere jungle
#

somewhere in this lua

fading rivet
#

yes WHERE

#

what does the error say

idle plaza
fading rivet
# austere jungle SMODS.Joker{ key = "Giraffe", config = { extra = { poker_hand = "Straigh...

try this

SMODS.Joker{
    key = "Giraffe",
    config = { extra = { poker_hand = "Straight"} },
    pos={ x = 0, y = 0 },
    rarity = 3,
    cost = 4,
    blueprint_compat=true
    eternal_compat=true,
    unlocked = true,
    discovered = true,
    atlas = 'Giraffe',
    
    calculate = function(self, card, context)              --define calculate functions here
        if context.joker_main and #G.consumeables.cards + G.GAME.consumeable_buffer < G.consumeables.config.card_limit then
            if next(context.poker_hands{self.ability.extra.poker_hand}) then
                local card_type = 'Tarot'
                G.GAME.consumeable_buffer = G.GAME.consumeable_buffer + 1
                G.E_MANAGER:add_event(Event({
                    trigger = 'before',
                    func = function()
                        local card = create_card(card_type, G.consumeables, nil, nil, nil, nil, nil, 'sup')
                        card:add_to_deck()
                        G.consumeables:emplace(card)
                        G.GAME.consumeable_buffer = 0
                        return true
                    end
                }))
            end
            return{
                message = localize('k_plus_tarot'),
                colour = G.C.SECONDARY_SET.Tarot
            }
           
        end
    end,
    
    loc_vars = function(self, info_queue, card)
        return { vars = { card.ability.extra.poker_hand}}
    end        
}
austere jungle
#

fuck dude I found it lol

#

end,

#

thining thats the issue

austere jungle
fading rivet
#

oh mb i forgot a comma

#

add a comma after blueprint_compat=true

#

that shoudl fix it

austere jungle
#

IT LOADED

#

THANK YOU SO MUCH

fading rivet
#

np

austere jungle
#

I'm going to see if it works in game :)

fading rivet
#

WAIT

austere jungle
#

Then Im going to do the same code but with a spectral card instead of a tarrot

fading rivet
#

i left a issue

austere jungle
#

waiting

fading rivet
#

try this

SMODS.Joker{
    key = "Giraffe",
    config = { extra = { poker_hand = "Straight"} },
    pos={ x = 0, y = 0 },
    rarity = 3,
    cost = 4,
    blueprint_compat=true,
    eternal_compat=true,
    unlocked = true,
    discovered = true,
    atlas = 'Giraffe',
    
    calculate = function(self, card, context)              --define calculate functions here
        if context.joker_main and #G.consumeables.cards + G.GAME.consumeable_buffer < G.consumeables.config.card_limit then
            if next(context.poker_hands[card.ability.extra.poker_hand]) then
                local card_type = 'Tarot'
                G.GAME.consumeable_buffer = G.GAME.consumeable_buffer + 1
                G.E_MANAGER:add_event(Event({
                    trigger = 'before',
                    func = function()
                        local card = create_card(card_type, G.consumeables, nil, nil, nil, nil, nil, 'sup')
                        card:add_to_deck()
                        G.consumeables:emplace(card)
                        G.GAME.consumeable_buffer = 0
                        return true
                    end
                }))
            end
            return{
                message = localize('k_plus_tarot'),
                colour = G.C.SECONDARY_SET.Tarot
            }
           
        end
    end,
    
    loc_vars = function(self, info_queue, card)
        return { vars = { card.ability.extra.poker_hand}}
    end        
}
austere jungle
#

Alright, going to test it out

#

uh oh

#

nvm

fading rivet
#

what broke

austere jungle
#

IT WORKS

#

THANK YOU SO MUCH

analog slate
#

this is for polishing but how do i check if the cards are done being played so i can add all the stuff together in this kinda code

analog slate
fading rivet
analog slate
#

heres quagmire

analog slate
#

actually

fading rivet
#

it is

analog slate
#

thats kinda rhetorical of course it can

austere jungle
#

What does empty pool mean?

faint yacht
teal grotto
#

how do you make a joker which levels down a hand
and not specifically the played one

austere jungle
#

Can you steal the code from the bind that does it?

teal grotto
#

ok ig im dumb that does work

#

lol thanks

austere jungle
#

no problem lol. I just be thieving like crazy since I'm not very code savvy

#

what does crash message empty pool mean?

red flower
#

usually that the rarity/consumable type for your object doesn't exist

faint yacht
#

Do it outside of scoring, like context.before, context.after, etc.

analog slate
#

why wont this work what did i do rong?

fading rivet
#

your going to have to manually iterate

median veldt
#

can i ask what your joker is supposed to... do?

analog slate
fading rivet
#

that too

analog slate
#

but its a joke card based off a meem

median veldt
analog slate
median veldt
#

unfortunately you overprogrammed this

analog slate
#

D:

fading rivet
median veldt
#
if context.joker_main then
  return { xmult = 3 }
end
frosty rampart
#

i would suggest copying the regular joker from vanillaremade, and then swap the mult in the return table with xmult

#

or yea lol

median veldt
#

damn

frosty rampart
#

triple whammy

median veldt
fading rivet
#

what about it

median veldt
frosty rampart
#

ye smods automatically handles standard scoring messages

frosty rampart
analog slate
#

oh..

analog slate
#

the thing is, i get my code either from here or from the yahimod, i just read and try and use it, and it sometimes works

fading rivet
median veldt
analog slate
frosty rampart
analog slate
#

i made something like that

median veldt
#

foo your mods are so fucking funny

fading rivet
#

:3

analog slate
#

so like, xmult exists but whats the version for chips

fading rivet
#

xchips

median veldt
#

xch yeah

fading rivet
#

please go look at vremade

#

it will answer 90% of your questions

analog slate
#

i use vanillaremade sometimes

median veldt
#

smods docs + vremade is your best friend

#

if you can't figure something out from those, then come here

fading rivet
#

vremade wiki has a ton of tips too

median veldt
#

the vremade wiki is so amazing

median veldt
fading rivet
median veldt
#

i can be a tester

#

😼

#

but yeah sure send it over in liek dms or wherever you want

analog slate
#

next thing i need to do on my list before making paper dolls is to add lancer, add programs to connect lancer and susie, and then finish robotic and soul

fading rivet
#

go to minigame.lua and comment line 194 and uncomment 195

analog slate
#

paper dolls might have to add messages because when it adds up i want it to just say paper dolls, referencing stomach book

fading rivet
#

note that'll also put baguette in the pool

analog slate
#

ill deal with it l8r

fading rivet
fading rivet
#

i just know they exist

median veldt
analog slate
#

the paper dolls card is gonna work like kindness luigi but if you play a lucky card then it adds ten chips

analog slate
#

i worked my jokers out

#

so could i use context.other_card:is_suit('Hearts') and replace hearts with some kind of lucky card

median veldt
#

lucky cards arent suits

#

they're enhancements

#

vremade + vremade wiki will have everything you need for that joker i believe

analog slate
#

oh yea

#

ohh lemme find it

#

i have like god knows how many github tabs

#

where can i find enhancements

median veldt
#

wdym?

analog slate
#

the thing about enhancements and how to check

median veldt
#

on the wiki

analog slate
#

BUT WHERE THO

median veldt
#

look at the table of contents dog

analog slate
#

context.check_enhancement?

median veldt
#

with all due respect

#

where did you get that from

analog slate
#

the wiki

median veldt
#

what

#

oh

#

i see that

analog slate
#

right here

median veldt
#

okay that's. for quantum enhancements

analog slate
#

:0

median veldt
#

you dont need to worry about that

fading rivet
analog slate
#

oh wow

analog slate
median veldt
austere jungle
#

Question, I've been getting an empty pool error message. Whats the proper format for spawning Spectral cards?

            local card_type = 'Spectral'
            G.GAME.consumeable_buffer = G.GAME.consumeable_buffer + 1
            G.E_MANAGER:add_event(Event({
                trigger = 'before',
                func = function()
                    local card = create_card('Spectral', G.consumeables, nil, nil, nil, nil, nil, 'sea')
fading rivet
analog slate
median veldt
median veldt
fading rivet
median veldt
#

ah

#

fun fact your mod works perfectly with this deck

fading rivet
#

no patches needed to fix that

#

its supposed to take you to the shop

#

i might change it for balancing though idk

median veldt
#

uh huh.

fading rivet
#

what

median veldt
#

idk u tell me

fading rivet
#

wait did you extract the zip or no

median veldt
#

oh

fading rivet
#

oh

median veldt
#

why is the filepath like that

fading rivet
#

FooBar is the path on mine

median veldt
#

yeah i can see that

fading rivet
#

I need to get the mod path

frosty dock
#

oh look

#

we're back to assuming file paths

median veldt
#

i've never needed to do file paths outside of load_file so idk if that's different or

#

yeah cool it's very scuffed but it works

frosty dock
#

I mean you just use SMODS.current_mod.path

median veldt
#

ah

frosty dock
#

anyhow there's little to no reason most of the time to not load png files with SMODS.Atlas, in which case you also don't have to deal with that

fading rivet
#

shenangains

fading rivet
frosty dock
#

median veldt
frosty dock
#

oh that makes more sense now

median veldt
#

are they ever going to fix this

fading rivet
#

okay fixed it

#

not releasing a patch since, again this isn't in code someone coudl access without tampering

#

but heres what you need to change

#

line 95 in projectsekai.lua

#

replace it with

local name = SMODS.Mods["foobar"].path
        local t = {}
        for word in string.gmatch(name, "([^/]+)") do
            table.insert(t, word)
        end
        name = t[#t]
        self.ability.cover_path = "Mods/" .. name .. "/assets/covers/" .. self.ability.current_song .. ".png"
frosty dock
#

... wtf

frosty dock
#

what's this parsing nonsense

median veldt
#

brother

fading rivet
#

i'll replace it with atlases later

median veldt
#

its like One line of code

frosty dock
#

btw the mods folder is not guaranteed to be named Mods

fading rivet
#

okay hang on lemme add more code to it ;-;

median veldt
#

less

frosty dock
#

no

median veldt
#

less code

frosty dock
#

less code

median veldt
#

smods.current_mod.path

fading rivet
median veldt
#

uh huh

frosty dock
#

SMODS.Mods["foobar"].path.."rest of path"

#

what's so hard

fading rivet
#

wait does love.graphics.newImage work with absolute paths

fading rivet
frosty dock
fading rivet
#

okay replace line 95 with

self.ability.cover_path = SMODS.Mods["foobar"].path .. "assets/covers/" .. self.ability.current_song .. ".png"
frosty dock
#

the path is obviously constructed in such a way that it works™

median veldt
#

good job

#

you've done it

fading rivet
frosty dock
#

Also this will absolutely drown so you should just make a proper hotfix

fading rivet
fading rivet
#

rn I"m waiting on a chart

frosty dock
#

your choice

fading rivet
#

okay nvm we're doing it now

#

how can I extract the image from an atlas?

median veldt
#

a tear runs down my cheek

fading rivet
median veldt
#

neither have i, grins

fading rivet
median veldt
#

not me

#

i have my own issue with my mod actually

#

is there a way to likeeeeee

fading rivet
#

to what

median veldt
#

make it so you can't hit play hand/discard while its highlighting the cards lmao

#

cuz you can if you're fast enough

frosty dock
fading rivet
fading rivet
fading rivet
frosty dock
fading rivet
#

sometimes it works, sometimes it doesn't

median veldt
#

what ide

fading rivet
#

sometimes it works but doesn't tell me what the key actualy has

#

vscode

median veldt
#

odd

frosty dock
#

it should tho, I'll have to add that

fading rivet
#

can I have folders inside my 1x and 2x if I put it int he path

fading rivet
#

i copied it from the skip blind button

fading rivet
median veldt
#

i feel like theres a better way to do this

frosty dock
median veldt
#

yeah lowkey this barely works i'm just gonna add a comment to deal with it later

fading rivet
analog slate
#

how do i make a sell price of a joker?

fading rivet
analog slate
#

like my rare joker sells for a doller, i dont think it should be

frosty dock
median veldt
#

did you get it for free

fading rivet
analog slate
fading rivet
analog slate
#

like price = 3

fading rivet
#

not the config sorry

#

uhh joker definition

analog slate
#

?

#

wazzat

frosty dock
#

cost, not price

#

things like this are in the wiki

#
GitHub

A Balatro Modding Framework. Contribute to Steamodded/smods development by creating an account on GitHub.

red flower
#

@fading rivet hii im reviewing your pr, do you think it's ok if it crashes when no condition can be met? idk if thats intended behaviour

fading rivet
red flower
#

also crashes

#

so i guess its fine?

fading rivet
#

then yeah

fading rivet
#

wait im stupid I don't need to convert

median veldt
fading rivet
#

ight this works

median veldt
#

whats up with the font anyway

fading rivet
#

idk

#

whatever localthunk did with his text rendering removes the blurryness with large upscales

#

no clue how he did it

#

i'll probably switch to balatro ui for this

red flower
median veldt
#

eh, hardly

fading rivet
median veldt
#

i'm not sure if i should change the code but like

fading rivet
#

its either you can click or can't click

median veldt
#

there were still a few frames where i could hit the button while it was selecting

fading rivet
#

at the start or end

median veldt
#

start

fading rivet
#

hmmm

red flower
#

did you put the lock before the selecting code?

median veldt
#

i;m wondering if i could remove all the after stuff and just put the evnet at the end of the code

red flower
#

i think it actually should go inside the other event at the end

#

that makes more sense

median veldt
#

should i remove the stuff that isnt func?

red flower
#

i dont think its necessary

#

but maybe its there for a reason idk lol

median veldt
#

i don't think the commented stuff should change that

red flower
#

weird

#

i have no idea why that could be

median veldt
#

yeah me neither

primal robin
#

@frosty dock I did what you're asked: fixing R/C, allow arrays as input and auto-adding empty moveable for G.UIT.O
While system became more and more versatile, it starts to became messy in terms of what and how you can do stuff.
If you interested in some specific things, let me know. For now I'll leave this thing, have other mod in mind want to start on.

runic goblet
#

Does anybody know how to fix this? my game is crashing when i try to use a custom rarity for my joker. I made sure there's not a type in the key. (sorry if this is something obsious, this is my first mod)

thorn ingot
fading rivet
real crown
#

My mod was working previously, but a new smods version broke it
Does anyone know what changed that could've broken it?

thorn ingot
red flower
red flower
#

idk if thats the issue tho

real crown
#

I do have it as

for poker_hand_key, _ in pairs(G.GAME.hands) do
    SMODS.smart_level_up_hand(nil, poker_hand_key, true, -1)
end```
But the documentation says: card - If included, juices up this card during the animation
analog slate
#

can i give myself a lucky card to check if paper dolls works

red flower
#

yeah but the documentation also says its deprecated so something may have changed lol

#

when are you calling this?

#

i think the problem is the new context

real crown
#

apply = function(self) of an SMODS.Back

red flower
#

in an event?

real crown
#
        G.E_MANAGER:add_event(Event({
            func = function()
                if G.jokers then
                    SMODS.add_card {
                        key = "j_princess",
                        stickers = {"eternal"},
                        force_stickers = true,
                        edition = "e_negative"
                    }
                end
                return true
            end
        }))

        for poker_hand_key, _ in pairs(G.GAME.hands) do
            SMODS.smart_level_up_hand(nil, poker_hand_key, true, -1)
        end

        G.GAME.pool_flags.stp_vessel_packs = true
    end```
dusty jewel
#

can anyone help? i downloaded the newest version

red flower
#

do it in the event

real crown
dusty jewel
real crown
#

Yes

dusty jewel
#

i already downloaded it idk if its correctly downloaded though

#

ill show you

red flower
dusty jewel
real crown
red flower
dusty jewel
red flower
#

no

dusty jewel
red flower
dusty jewel
#

this correct?

red flower
#

yes

dusty jewel
#

ok done

#

thanks alot it worked

analog slate
#

i feel like an idiot, what did i do wrong now? (also the holographic luigi joker there IS paper dolls, i just didnt put a texture yet cuz idk what to make yet)

red flower
analog slate
#

FROM MYSELF

#

from myself

red flower
#

oh i see the issue

#

SMODS.has_enhancement(context.other_card, "m_lucky")

analog slate
#

ohhhh ok

rapid stag
#

i'm vaguely recalling or misremembering that there was a way added to specify in a custom deck, what the deck of cards you actually get should be, like as a recent thing? - but i forget how to do that or where that might be documented?

or if i'm hallucinating and you still have to just do it in an event in apply

red flower
rapid stag
#

i have that page open noooooooooo girldmDead thank you

#

how did i just ignore this tab

red flower
#

it is also in SMODS.Back's page

rapid stag
#

ok i'm just stupid, i was staring at SMODS.Back's page for like 10 minutes girldmDizzy

analog slate
#

is this right?

rapid stag
#

...oh. initial_deck = { Ranks = { 'King', 'Queen', 'Jack' } } just gives me 12 cards total.

red flower
rapid stag
#

if i wanted the deck to start with more cards, did i need to add them in apply?

red flower
#

yes

median veldt
#

i am. forgetting how to do an x in y chance

red flower
#

it's in the calculate page im the docs

median veldt
#

found it, though new problem, it seems to have created a ghost card

#

not sure why...

hoary spear
#

does anyone know where i can find a list of everything you can change with take_ownerships?

red flower
hoary spear
#

oh really?

#

i thought it wouldve been different

red flower
#

yeah taking ownership just makes the object into an smods object if it wasn't already and adds/replaces anything you put in it

hoary spear
#

ah, cool

#

yknow, probably shouldve been able to figure that out after doing a whole calculate function with one

red flower
#

there are some vanilla things that are hardcoded and take ownership doesnt work perfectly with but there isn't a list for that

rapid stag
# red flower yes

what area should they be going into? girldmDizzy G.deck just leaves them on the screen free-floating, and G.playing_cards results in a crash

red flower
hoary spear
#

or is it a shot in the dark?

red flower
#

but other than that it's trial and error

rapid stag
hoary spear
rapid stag
# red flower code?
apply = function(self, back)
                G.E_MANAGER:add_event(Event({
                    trigger = 'after',
                    delay = 0.1,
                    blocking = false,
                    blockable = true,
                    func = function()
                        local KQJ = { 'K', 'Q', 'J' }
                        
                        for _s, cSuit in ipairs(CirnoMod.miscItems.cardSuits) do
                            for _r, cRank in ipairs(KQJ) do
                                for am = 1, 4 do
                                    table.insert(G.playing_cards, SMODS.create_card{
                                        set = 'Base',
                                        area = G.deck,
                                        rank = cRank,
                                        suit = cSuit,
                                        no_edition = true
                                    })
                                end
                            end
                        end
                        
                        return true
                    end
                }))
                
            end```
hoary spear
#

i had an idea for blue seal, but not lucky so idc about that one

red flower
rapid stag
red flower
#

no it does it for you, also don't insert them into playing_cards either because it also does it for you

rapid stag
#

but you said to add them to the playing cards table girldmDizzy

#

ohhh i mixed up create_card and add_card

red flower
#

because i imagined you were doing it with create_card so i gave you a solution for that

austere jungle
#

Oh man, my mods in a bad state. I keep getting an error about steammodded utils inset object "joker name" empty pool. It appears even when I remove all the code surrounding that joker. Now I can't get my mod to run at all and I'm not sure why. Any ideas?

rapid stag
#

could we see the full crash log?

austere jungle
#

sure

runic goblet
#

does anybody know what could be causing this deck to crash when i try to start a run?

noble ore
idle plaza
red flower
austere jungle
#

SMODS.Joker{
key = "Okapi",
config = { extra = { poker_hand = "Straight"} },
pos= { x = 0, y = 0 },
rarity = 5,
cost = 10,
blueprint_compat=true,
eternal_compat=true,
unlocked = true,
discovered = true,
atlas = 'Okapi',

calculate = function(self, card, context)              --define calculate functions here
    if context.joker_main and #G.consumeables.cards + G.GAME.consumeable_buffer < G.consumeables.config.card_limit then
        if next(context.poker_hands[card.ability.extra.poker_hand]) then
            local card_type = 'Spectral'
            G.GAME.consumeable_buffer = G.GAME.consumeable_buffer + 1
            G.E_MANAGER:add_event(Event({
                trigger = 'before',
                func = function()
                    local card = create_card('Spectral', G.consumeables, nil, nil, nil, nil, nil, 'sea')
                    card:add_to_deck()
                    G.consumeables:emplace(card)
                    G.GAME.consumeable_buffer = 0
                    return true
                end
            }))
        end
        return{
            message = localize('k_plus_spectral'),
            colour = G.C.SECONDARY_SET.Spectral
        }
       
    end
end,

loc_vars = function(self, info_queue, card)
    return { vars = { card.ability.extra.poker_hand}}
end        

}

red flower
#

rarity 5 doesn't exist

austere jungle
#

...

#

how do I do legendary jokers?

red flower
#

4

austere jungle
#

oh

#

Yeah that worked. I'm onto the next error lol. Thanks for the help!

runic goblet
#

sorry if this is something obvious, this is my first time making a mod

runic goblet
rapid stag
#

ok so i tried looking at vanillaremade's green deck to get ideas as to how i'd accomplish this, but it uses config values/G.GAME vars and not any kind of technical implementation girldmDead but basically:

i want to make an end of round dollar earn wherein you get $1 for every 10% of score overkill - as a deck effect.

i thought i did know the actual calculation to do, but it turns out i hadn't thought beyond G.GAME.blind.chips - G.GAME.chips and G.GAME.blind.chips / 10 girldmDizzy i thiiiink i modulo, then floor that?
so math.floor((G.GAME.blind.chips - G.GAME.chips) % (G.GAME.blind.chips / 10)) girldmDead i'm uncertain

but i'm struggling on the logistics of actually implementing it. at a cursory glance, it looks like i need to patch state_events?

frosty rampart
#

you can just do it with the deck's calculate function i think
the documentation isn't the most helpful, so gimme a minute to figure out what you actually have to return

red flower
#

calc dollar bonus for decks soon(tm)

frosty rampart
#

oh it's a function, not a return variable

median veldt
#

is G:start_run called on starting a new run?

red flower
#

it is called when the run is loaded too

median veldt
#

could i hook it and do some sort of check to make sure it's a new run

#

actually i'm overcomplicating this

red flower
#

do you just need a function for a new run or does it need to be that one

median veldt
#

it can be any function

red flower
median veldt
#

for the record if it helps im going to add a counter for using that button i've been adding, i wanted it to start at zero

red flower
#

you don't need to initialize counters in lua

median veldt
#

but i'm realizing i can just

#

yeah

runic goblet
#

I'm having a very specific problem, so idk if it's something people here can help with. I have a joker (olimar) that creates other jokers at the end of round, and the jokers it creates are meant to give +1 joker slot each. However, when a blueprint is copying olimar, only 1 of the created jokers gives +1 joker slot. Here's my current code:

median veldt
#

would i have to like

for example

mult = G.GAME.my_counter or 0
or can i omit the or 0

red flower
#

in a mult return you can omit the or 0

#

it will treat it as if you returned nothing

median veldt
#

i'm assuming you specified because some things will break if nil is passed

#

like if i tried to do math on it

frosty rampart
#

yea anywhere you try to increment the counter should have or 0 attached to it

median veldt
#

noted

red flower
rapid stag
median veldt
#

i'm realizing now that i have been putting a lot of things in G.GAME.BALATROSTUCK2_

e.g. G.GAME.BALATROSTUCK2_can_ability

would it be cleaner if i made that first underscore a period and like idk G.GAME.BALATROSTUCK2 = {} at the start of a run (if i have to)

red flower
#

probably

rapid stag
#

why is SMODS.calculate_context{round_eval = true} being called during a saved game load?

red flower
#

are you loading in round_eval?

rapid stag
#

oh, i thought i was loading at the start of a blind, but it might not be for whatever reason

red flower
#

round eval is the cashout screen

#

if its being called at the start then that might be an issue

rapid stag
#

ok yeah i was apparently loading during round eval girldmDizzy

wild escarp
#

Where is the number of consumable and joker slots stores?

red flower
rapid stag
#

ok, my formula for determining $1 for every 10% over blind requirement is wrong

#

i don't know what it should be

mint hull
#

trying to come up with a deck gimmick for my mod, i want it to be like kind of vanilla-ish like extra credit or all in jest

rapid stag
#

even after testing and tweaking, i realise i'm in completely the wrong mindset with
(scored_chips - blind_req) % (blind_req / percent) girldmDizzy
is it closer to
(scored_chips - blind_req) / (blind_req / percent)...? or am i stupid

mint hull
#

so far my only ideas are "all the cards are a new suit that cant form flushes BUT counts as any suit for a joker (one spirals suit card would trigger all 4 suit jokers)", "cards from my mod appear more, so do negative cards", or "randomize the suit of all cards at end of round" (this one sucks)

rapid stag
red flower
rapid stag
#

wait no i'm dumb, that's not 10% girldmDizzy

red flower
#

yeah lol

rapid stag
#

330 would be where it starts

#

ok thanks

rapid stag
#

i know why it's not displaying the correct amount of cash out dollars - because the dollar amount needs to feed into the local dollars variable in G.FUNCS.evaluate_round, so i need to patch in it accepting a value it can increment the dollar amount somewhere, but i'm not sure where? my first thought was to make it parse a return table from SMODS.calculate_context()? but i'm wondering if there's a better.recommended way to try and get my value there atm girldmDizzy

i'm just gonna patch it to pass in the dollars variable, so i can influence it within calculate 🥴 goofy fix but should be fine this doesn't work girldmDead

dapper sun
#

joker that hooks Card:is_suit() to return a 1 in 2 pseudorandom check

rapid stag
#

worse idea: joker that hooks Card:is_suit() to return false every time

is suit? no

#

chudjoker but it fucks over flush builds

dapper sun
#

nah i'd say 1 in 2 is worse bc it's inconsistent

#

like,, what happens if you're in a suit debuff blind?

rapid stag
#

ok so what exactly is the point of being able to do add_round_eval_row in context.round_eval if we can't influence the cashout value

red flower
#

wait for my calc dollar bonus pr to get merged i guess

rapid stag
#

girldmDead what should i do in the meantime? i've tried patching several different things to no avail

red flower
#

you can copy my patches

versed swan
#

n: copy my patches

#

Does anyone have a list of select_music_track functions that would be applicable to the vanilla tracks?

#

i.e. I have a set of 5 tracks corresponding to vanilla tracks, I want those tracks to play in the same gameplay contexts as the vanilla tracks + some other conditional

daring fern
versed swan
#

nice, thank you

vital wren
#

whats a bool value i can use to check if i'm in a game and not in like the main menu area?

#

(needed for checking collection)

daring fern
vital wren
#

thanks

scenic umbra
#

can you see the symbol

#

ik im blind as a bat but i swear there's no other symbols there

#

It was fine before I seperated the descriptions from the Consumables.lua file

slim ferry
scenic umbra
#

which part

#

the } or ,

slim ferry
#

both

scenic umbra
#

lmfao eris saving me yet again

#

Tysm!

solemn wharf
#

hii im trying to make a joker that acts kinda like a combination between gros michel and invisible joker. I want it to make so that the joker does nothing, you just have to wait 20 rounds. Past these 20 rounds, the joker gets "transformed" (it gets extinct and generates an specific legendary joker)

#

im looking through the code from gros michel and invisible joker but i really dont know how to start because im still learning modding

#

i just have this at the moment

#

if anyone could help me i would really appreciate it <:)

daring fern
sullen igloo
#

so im trying to make my first mod
is there a way i can find like the key phrases used?
cus i know what to do i just dont know what phrases are used for what

#

for example im currently making a scaling x_mult joker that scales when a flush five is played
but i dont know the phrases used for making it scale when a certain poker hand is played

sullen igloo
#

thanksies

solemn wharf
red flower
#

transforms the joker

solemn wharf
#

so im assuming i need to change the 'j_modprefix_key' by the name of the joker i want to transform it to?

red flower
#

yes

solemn wharf
# red flower yes

that worked!! thank you so much, tho i would also like to be able to make it appear only doing that and not using a soul card, would that be possible using a pool like gros michel and cavendish?

red flower
solemn wharf
tepid heron
#

hey im a beginner

#

how do i alter shop slots

tepid heron
#

okay that worked

#

how do i make it require a vanilla voucher that has spacces in the name though

red flower
#

i don't see how having spaces would be a problem here

tepid heron
#

requires = v_overstock_plus doesnt really work

#

wait can i just put a space

red flower
#

ah i didnt read vanilla

tepid heron
#

maybe i should have tried that first

red flower
#

they dont have spaces

#

the keys are all one word

tepid heron
#

nope

red flower
#

yes

tepid heron
#

i was referr ing to can i just put a space but

#

that doesnt work either

red flower
#

check the code below what i linked for the syntax on require

#

it needs to be a table

tepid heron
#

ohhh

#

okay

#

{ requires = v_overstockplus }

#

like this?

#

it still doesnt work'

red flower
#

requires = { "v_overstock_plus" }

tepid heron
#

didnt work "

#

:

#

this is the error im getting but it only occurs when requires is therte

wintry solar
#

Share your code

#

You gave an error somewhere

tepid heron
#

`-- Overstock Plus +
SMODS.Voucher {
key = 'overstock_norm',

pos = { x = 0, y = 0 },

config = { extra = { shop_size = 1 } },

requires = { "v_overstockplus" }

loc_vars = function(self, info_queue, card)

    return { vars = { card.ability.extra.shop_size } }
end,

redeem = function(self, card)

    G.E_MANAGER:add_event(Event({
        func = function()

            change_shop_size(card.ability.extra.shop_size)

            return true
        end
    }))
end

}
`

red flower
#

you're missing a comma after that line

tepid heron
#

oh