#💻・modding-dev

1 messages · Page 559 of 1

ocean sinew
#

Dunning Krugger effect

pastel osprey
#
local card_set_cost_ref = Card:set_cost()
function Card:set_cost(self)
    card_set_cost_ref(self)

    if self.edition then
        local cost_sub = self.edition.negative and G.GAME.modifiers.rad_extra_cost_negative or 0
        self.extra_cost = self.extra_cost - cost_sub
        self.cost = self.cost - cost_sub
    end

    return card_set_cost_ref
end
pastel osprey
ocean sinew
pastel osprey
#

yeah i saw that

#

its odd

ocean sinew
#

what If you do and G.GAME ~= nil first

#

maybe it'll work?

pastel osprey
#

see in rust there's no such thing as null so this shit doesnt happen 😎

ocean sinew
pastel osprey
ocean sinew
#

what happens??

pastel osprey
#

wdym what happens

#

oh like how does null work?

ocean sinew
pastel osprey
#

ohhh okay

ocean sinew
pastel osprey
#

yeah

#

so you have an enum called Option

#

Option<T> to be specific

#

it looks like this

#
enum Option<T> {
  None,
  Some(T),
}
#

so the None variant holds no data

#

and the Some variant holds an instance of T

#

now the good part of this

#

is that things cant just be null

#

they must be wrapped in Option

#

so you cant just forget to do null checks because you literally cannot use the value without processing the option

ocean sinew
#

Is there any downside though?

pastel osprey
#

so when something returns an option you either match it, or unwrap it

pastel osprey
#

its slightly more work but its less work in the long run than troubleshooting null errors

ocean sinew
#

Very cool feature ngl

pastel osprey
#

its awesome

#

rust also doesnt have exceptions

#

it uses a similar thing to option called Result

ocean sinew
#

Been thinking of learning rust cuz rust is like the next C++ of programming languages

pastel osprey
#
enum Result<T, E> {
  Ok(T),
  Err(E)
}
#

result has an ok value and an error value

#

same situation as option

#

its awesome

ocean sinew
#

Btw on a scale on 1/10 how hard do you think rust is?

pastel osprey
#

hmm thats tough

#

i think theres a point where the design philosophy of the language just *clicks*

#
local card_set_cost_ref = Card:set_cost()
function Card:set_cost(self)
    card_set_cost_ref(self)

    if self.edition and G.GAME then
        local cost_sub = self.edition.negative and G.GAME.modifiers.rad_extra_cost_negative or 0
        self.extra_cost = self.extra_cost - cost_sub
        self.cost = self.cost - cost_sub
    end

    return card_set_cost_ref
end
pastel osprey
#

it will be way easier if someone can help you lol

#

the first major hurdle is understanding the borrow checker

#

do you know C or C++ at all?

ocean sinew
pastel osprey
#

okay

#

do you know what a use after free is

ocean sinew
#

yes

ocean sinew
# pastel osprey ```lua local card_set_cost_ref = Card:set_cost() function Card:set_cost(self) ...
function Card:set_cost()
    self.extra_cost = 0 + G.GAME.inflation
    if self.edition then
        for k, v in pairs(G.P_CENTER_POOLS.Edition) do
            if self.edition[v.key:sub(3)] then
                if v.extra_cost then
                    self.extra_cost = self.extra_cost + v.extra_cost
                end
            end
        end
    end
    self.cost = math.max(1, math.floor((self.base_cost + self.extra_cost + 0.5)*(100-G.GAME.discount_percent)/100))
    if self.ability.set == 'Booster' and G.GAME.modifiers.booster_ante_scaling then self.cost = self.cost + G.GAME.round_resets.ante - 1 end
    if self.ability.set == 'Booster' and (not G.SETTINGS.tutorial_complete) and G.SETTINGS.tutorial_progress and (not G.SETTINGS.tutorial_progress.completed_parts['shop_1']) then
        self.cost = self.cost + 3
    end
    if (self.ability.set == 'Planet' or (self.ability.set == 'Booster' and self.ability.name:find('Celestial'))) and #find_joker('Astronomer') > 0 then self.cost = 0 end
    if self.ability.rental then self.cost = 1 end
    self.sell_cost = math.max(1, math.floor(self.cost/2)) + (self.ability.extra_value or 0)
    if self.area and self.ability.couponed and (self.area == G.shop_jokers or self.area == G.shop_booster) then self.cost = 0 end
    self.sell_cost_label = self.facing == 'back' and '?' or self.sell_cost
end

this is the original set cost function

pastel osprey
#

i have it up already

ocean sinew
#

as you can see it also indexes G.GAME specifically G.GAME.inflation at the start of first line

pastel osprey
#

i saw that yeah

#

i tried to fix

#

no luck

#
local card_set_cost_ref = Card:set_cost()
function Card:set_cost(self)
    if G.GAME then
        card_set_cost_ref(self)
        if self.edition then
            local cost_sub = self.edition.negative and G.GAME.modifiers.rad_extra_cost_negative or 0
            self.extra_cost = self.extra_cost - cost_sub
            self.cost = self.cost - cost_sub
        end
    end

    return card_set_cost_ref
end
ocean sinew
#

so maybe If you add if G.GAME ~= nil then to the beginning it would fix?

#

If It doesn't work I have no idea ngl

pastel osprey
#

yea this is odd lmfao

urban wasp
ocean sinew
#

yeah

pastel osprey
#

rust is a really fun language though

urban wasp
pastel osprey
#

i have not

#

i have only played one content mod for the game and its cryptid

#

i like vanilla lol

ocean sinew
#

btw guys

#

I gotta sleep cuz I sadly have school tomorrow

#

so bye

pastel osprey
#

aw rip

#

cya

ocean sinew
#

cya

red flower
#

what does this do

#

oh the first line should be local card_set_cost_ref = Card.set_cost

willow scroll
#

okay surely now that i made the whole thing customizable and now that ive used that customizability for one of my existing uses it will now work correctly 100% of the time :clueless:

#

it seems to atleast 🎉

#

i can sleep peacefully now

pastel osprey
red flower
#

i mean it's good practice to have it but that function doesnt return and the way you're returning is wrong

pastel osprey
#

yeah

#

oh i fixed it

urban wasp
#

i was told that asking this in here might be more fruitful

pastel osprey
#

the reference local was calling the function rather than storing a pointer to it

#
local card_set_cost_ref = Card.set_cost
function Card:set_cost(self)
    if G.GAME and self then
        card_set_cost_ref(self)
        if self.edition then
            local cost_sub = self.edition.negative and G.GAME.modifiers.rad_extra_cost_negative or 0
            self.extra_cost = self.extra_cost - cost_sub
            self.cost = self.cost - cost_sub
        end
    end
end
red flower
pastel osprey
#

and i needed to assert that self is not nil

#

thats it

urban wasp
red flower
#

eremel said he was adding them to smods at some point

urban wasp
#

one day... 😔

urban wasp
red flower
#

youre replacing self

#

dont do that

pastel osprey
#

so it appears i made a mistake

pastel osprey
#

every card is now free 💀

red flower
#

it should be function Card:set_cost() or function Card.set_cost(self)

#

: means it has self

pastel osprey
#

ahhh

#

i did not know that

#

once again i have like zero lua experience

#

by the way, in my deck's description it says that negatives are $5 cheaper

#

should i say "-$5 Negative cost" or "$-5 Negative cost"

red flower
#

-$ looks better imo

pastel osprey
#

agreed

#

okay prices are no longer zero

#

okay so it just doesnt work

#

great

#

wait hang on

#

@red flower is this line good

local cost_sub = self.edition.negative and G.GAME.modifiers.rad_extra_cost_negative or 0
#

not sure why my code no worky

#
local card_set_cost_ref = Card.set_cost
function Card:set_cost()
    if G.GAME and self then
        card_set_cost_ref(self)
        if self.edition then
            local cost_sub = self.edition.negative and G.GAME.modifiers.rad_extra_cost_negative or 0
            self.extra_cost = self.extra_cost - cost_sub
            self.cost = self.cost - cost_sub
        end
    end
end
#

yo......

urban wasp
#

nehgaguoietv

pastel osprey
#

i just cannot get this to work bro

pastel osprey
#

it doesnt seem to want to even use the method override here

urban wasp
#

what do you need help with?

urban wasp
#

i'm not really the greatest at coding but

pastel osprey
#

im good at it just not lua

#

im fumbling around in the dark here 💀

#

especially cuz i dont know how smods works very well

urban wasp
pastel osprey
#

it does

#

but it just does nothing

urban wasp
#

i think i'm as braindead as you

pastel osprey
#

i even tried a full manual override

#
function Card:set_cost()
    self.extra_cost = 0 + G.GAME.inflation
    if self.edition then
        self.extra_cost = self.extra_cost + (self.edition.holo and 3 or 0) + (self.edition.foil and 2 or 0) + 
        (self.edition.polychrome and 5 or 0) + (self.edition.negative and 5 or 0)
    end
    self.cost = math.max(1, math.floor((self.base_cost + self.extra_cost + 0.5)*(100-G.GAME.discount_percent)/100))
    if self.ability.set == 'Booster' and G.GAME.modifiers.booster_ante_scaling then self.cost = self.cost + G.GAME.round_resets.ante - 1 end
    if self.ability.set == 'Booster' and (not G.SETTINGS.tutorial_complete) and G.SETTINGS.tutorial_progress and (not G.SETTINGS.tutorial_progress.completed_parts['shop_1']) then
        self.cost = self.cost + 3
    end
    if (self.ability.set == 'Planet' or (self.ability.set == 'Booster' and self.ability.name:find('Celestial'))) and #find_joker('Astronomer') > 0 then self.cost = 0 end
    if self.ability.rental then self.cost = 1 end
    self.sell_cost = math.max(1, math.floor(self.cost/2)) + (self.ability.extra_value or 0)
    if self.area and self.ability.couponed and (self.area == G.shop_jokers or self.area == G.shop_booster) then self.cost = 0 end
    self.sell_cost_label = self.facing == 'back' and '?' or self.sell_cost
end
#

this also did fuckall

urban wasp
pastel osprey
#

(expensive negatives)

rocky plaza
pastel osprey
#

read up

rocky plaza
#

oh

#

lmao

pastel osprey
#

hook didnt do anything, i used an override to test if it was an issue with smods refusing to hook

#

debugging 🔥

pastel osprey
#
local card_set_cost_ref = Card.set_cost
function Card:set_cost()
    if G.GAME and self then
        card_set_cost_ref(self)
        if self.edition then
            local cost_sub = self.edition.negative and (G.GAME.modifiers.rad_extra_cost_negative or 0)
            self.extra_cost = self.extra_cost + cost_sub
            self.cost = self.cost + cost_sub
        end
    end
end


SMODS.Back{
    name = "Overflow Deck",
    key = "rad_overflow",
    pos = {x = 0, y = 0},
    config = {
        rad_negative_rate = 0.097,
        rad_extra_cost_negative = -5,
        joker_slot = -2,
    },
    atlas = 'Radium',
    loc_txt = {
        name = "Overflow Deck",
        text ={
            "{C:attention}-2{} Joker slots",
            "{C:attention}Increased {C:dark_edition}Negative{} chance",
            "{C:tarot}Tarot{}, {C:planet}Planet{}, and {C:spectral}Spectral{}",
            "cards may be {C:dark_edition}Negative",
            "{C:gold}-$5 {C:dark_edition}Negative{} cost",
        },
    },
    apply = function(self)
        G.GAME.modifiers.rad_negative_rate = self.config.rad_negative_rate
    end
}
red flower
#

no idea it looks fine to me

pastel osprey
#

my thoughts precisely

#

see if balala was written in rust this would not be an issue

harsh belfry
pastel osprey
#

i doubt it

harsh belfry
#

you should check but probably not

pastel osprey
#

which usage of self

#

where

#

there are many

harsh belfry
#

the one where you access the config

pastel osprey
#

?

stiff locust
#

how would I make something happen when I click on a joker

manic rune
#

hook to Card:click or smt

#

is it :click 🤔

#

smt similar to that

rocky plaza
#

i think so yea

harsh belfry
# pastel osprey ?
        G.GAME.modifiers.rad_negative_rate = self.config.rad_negative_rate

self.config.rad_negative_rate may be nil (shouldn't be but i don't know what else it would be)

red flower
stiff locust
#

2mo

#

with card:click() the card is the card being clicked on right

pastel osprey
harsh belfry
red flower
stiff locust
#

gotcha

pastel osprey
#

fuck me sideways then ig

harsh belfry
#

yeah i wouldn't say this otherwise

pastel osprey
#

i use it here

harsh belfry
#

too much has been tried

pastel osprey
#
local poll_edition_ref = poll_edition
function poll_edition(_key, _mod, _no_neg, _guaranteed, _options)
  -- do chance roll here - if it succeeds, _guaranteed = true

  if pseudorandom("radium_overflow_deck_negative") < (G.GAME.modifiers.rad_negative_rate or 0) then
    _guaranteed = true
    _options = {'e_negative'}
  end

  return poll_edition_ref(_key, _mod, _no_neg, _guaranteed, _options) -- call original function
end
azure laurel
#

how can i publish mods on the balatro mod manager?

pastel osprey
#

lemme do some further testing

rocky plaza
harsh belfry
pastel osprey
#

wait maybe im not shit hang on

#

am i a dumbass

harsh belfry
#

not in apply

pastel osprey
#

FUCK im not

#

lmfao

rocky plaza
#

yeah i think u need to set it in apply
otherwise the variable isnt set

red flower
pastel osprey
#

i think i just forgor

azure laurel
pastel osprey
#

well fuck

frosty rampart
harsh belfry
pastel osprey
#

balajank

#

bro my dorm smells like cigarettes now who is lighting one up outside my window

#

ill kill them

#

wait nvm it crashes because i broke something else while testing

#

nvm chat

azure laurel
red flower
pastel osprey
#

looks like it worked

#

wacky shop bro

#

for fucks sake

red flower
#

i think it's the parentheses you added

#

it will crash with any editioned card that's not negative

pastel osprey
#

fixed it

#

yeah

humble pawn
#

I regret nothing

pastel osprey
#

i optimized my logic a little

pastel osprey
#

what does it actually do

humble pawn
marble stratus
#

I'm trying to add a custom deck to balala (yahimod balatro) and for some reason it crashed every time I open game

pastel osprey
#

wait i didnt even know that riff raff can make negatives

marble stratus
#

Can somebody help?

pastel osprey
#

send your code

marble stratus
#

Ok

#

Just the one or do I send the whole decks thing?

gilded blaze
#

what are you trying to achieve with that deck

winter flower
marble stratus
# winter flower what’s the crash message (and send the code for the deck you’re trying to make h...

SMODS.Back({
key = "asgoredeck",
loc_txt = {
name = "The Asgore Dagger Deck",
text={
"Start with A Bluenemonial Dagger and Deer. You know what to do.",
}
}

config = { hands = 0, discards = 0, consumeables = 'c_opentolan'},
pos = { x = 4, y = 0 },
order = 1,
atlas = "Decks",
unlocked = true,

apply = function(self)
    G.E_MANAGER:add_event(Event({
        func = function()
            if G.consumeables then
                local card = create_card("Joker", G.jokers, nil, nil, nil, nil, "j_yahimod_blueprintdagger", "yahimod_deck")
                card:add_to_deck()
                --card:start_materialize()
                G.jokers:emplace(card)

                    for i = 1, 2 do
                    local card = create_card("Joker", G.jokers, nil, nil, nil, nil, "c_yahimod_deer", "yahimod_deck")
                    card:add_to_deck()
                    --card:start_materialize()
                    G.consumeables:emplace(card)
                    end

                return true
              end
        end,
    }))
end,

})

#

that the deck

marble stratus
#

its opver 6k

#

chars

winter flower
#

it’ll automatically turn into a txt if you paste

marble stratus
#

ah

winter flower
#

ARGGGFHGHH DGH

#

ok so the issue is

#

after loc_txt you forgot a comma

#

SMODS.Back({
key = "asgoredeck",
loc_txt = {
name = "The Asgore Dagger Deck",
text={
"Start with A Bluenemonial Dagger and Deer. You know what to do.",
}
} << comma missing

#

@marble stratus ^

marble stratus
#

o h

winter flower
#

if it’s your first time then that’s a common mistake for beginners

#

(i’ve gotten the same error several times before)

marble stratus
#

alr lemme try itt

#

TYTYTY

#

help

#

it no wrok

#

im sorrgy

gilded goblet
#

update ur smods version twin

marble stratus
#

what

gilded goblet
gilded goblet
marble stratus
#

a h

pine dove
#

can someone help me fix this?

gilded goblet
#

wdym?

marble stratus
gilded goblet
#

and you put the new smods version in AppData/Roaming/Balatro/Mods?

marble stratus
#

y e s

#

fixed it

#

but the deck is still broken

pine dove
marble stratus
marble stratus
pine dove
#

i got the newest lovely patch though

marble stratus
#

redownlo ad

pine dove
#

i did redownload!

marble stratus
#

try.. two times

pine dove
#

ok fine ill try Two Time(s)

marble stratus
#

jus in case

gilded goblet
#

this one

#

just to make sure

#

wtf

#

big ahh embed

pine dove
#

i did do 0.8.0 but ill do it again

gilded goblet
pine dove
#

nope, didnt work

marble stratus
pine dove
#

using an old version of lovely didnt work either

marble stratus
#

bill cipher i will shake ur hand if u somehow fix alll this.

wild escarp
#

How could I track each time a joker destroys itself? I'm guessing a hook into Card:remove() with a global variable, but idk what to do from there.

pine dove
#

i am suffering

marble stratus
#

same.

#

coding is tghe digital equivalent of the souls of the damned screaming at you.

rocky plaza
wild escarp
rocky plaza
#

oh ok
then yeah i think ur on the right path
tho i will say hooking Card:remove can be very finicky

wild escarp
marble stratus
#

ye s

wild escarp
#

Have you tried updating Yahimod?

marble stratus
#

yes

#

and its yahimod im editing

pine dove
#

YES I FIXED MY LOVELY CRASH ISSUE

#

I AM FREE

marble stratus
#

im not.

#

im trapped, trapped!

#

why am i not free, free!

wild escarp
#

Could you show me what portion of the code you've edited?

marble stratus
#

its at end

#

SMODS.Back({
key = "asgoredeck",
loc_txt = {
name = "The Asgore Dagger Deck",
text={
"Start with A Bluenemonial Dagger and Deer. You know what to do.",
}
},

config = { hands = 0, discards = 0, consumeables = 'c_opentolan'},
pos = { x = 4, y = 0 },
order = 1,
atlas = "Decks",
unlocked = true,

apply = function(self)
    G.E_MANAGER:add_event(Event({
        func = function()
            if G.consumeables then
                local card = create_card("Joker", G.jokers, nil, nil, nil, nil, "j_yahimod_blueprintdagger", "yahimod_deck")
                card:add_to_deck()
                --card:start_materialize()
                G.jokers:emplace(card)

                    for i = 1, 2 do
                    local card = create_card("Joker", G.jokers, nil, nil, nil, nil, "c_yahimod_deer", "yahimod_deck")
                    card:add_to_deck()
                    --card:start_materialize()
                    G.consumeables:emplace(card)
                    end

                return true
              end
        end,
    }))
end,

})

daring fern
wild escarp
marble stratus
#

oh my god.

#

the only problm

#

deer are in consumeable slot

wild escarp
#

It doesn't let you just put jokers in the consumables slot? I'm unfamiliar with that kind of stuff.

marble stratus
#

i am in pain

rocky plaza
#

it should automatically place it in the right area

warm umbra
#

how would i get a list of all the jokers

#

im trying to make it so that if you have multiple of one card it does the negative part of the card once

#

joker*

#

so i also need the position of the joker in the jokers

rocky plaza
# marble stratus whermst?

actually itd be easier to change ur current code

for i = 1, 2 do
  local card = create_card("Joker", G.jokers, nil, nil, nil, nil, "c_yahimod_deer", "yahimod_deck")
  card:add_to_deck()
  --card:start_materialize()
  G.consumeables:emplace(card) -- should be G.jokers:emplace(card)
end

but yeah SMODS.add_card is a lot more convenient

marble stratus
#

th ank y ou

rocky plaza
warm umbra
#

if that makes sense

daring fern
warm umbra
rocky plaza
#

oh

daring fern
warm umbra
#

probably should've been more specific

#

mb

#

😭

warm umbra
#

what type of object is in the thing

rocky plaza
#

to get the key of a joker
do
card.config.center.key
assuming card is a joker

warm umbra
#

get the current position of the joker

#

in the jokers you are using

daring fern
warm umbra
warm umbra
daring fern
#

Two cards cannot be the same.

knotty garnet
#

Having trouble running cryptid mod correctly

#

If anyone is free to help, id appreciate it

stiff locust
#

hooking card:click to play noises

#

but it is crashing because self does not exist?

#

even when I check if self before running it

#

it WORKS

#

i fixed it

versed swan
daring fern
#

glossy sky
#

hey, I'm curious if it is possible to make a consumable "upgrade" a hands chips permanently (kind of like a planet). I have implemented it using the following:

However the problem is that once a planet card is bought, it defaults back to being the chips of said hands level. (e.g. if this increases the chips by 10, and a level would give +20 chips, then the level up only gives +10 chips)

daring fern
#

How does one allow seals to retrigger joker retriggers?

high verge
#

Is there a way to force a card to spawn with a specific seal for testing?

high verge
#

How does one do that

daring fern
high verge
#

I'm guessing this is done with the debugger?

daring fern
high verge
#

Correct

daring fern
high verge
#

Merci

urban wasp
#

why doesn't this work it's like 12:41 am but i gotta get this done

...
    loc_vars = function(self,info_queue,card)
        return {vars = {self.config.extra.winning_ante}, colours = {{0.78, 0.35, 0.52, 1}}}
    end,
...
#

oh and

#
...
    loc_txt = {
        name ="Astro's Deck",
        text={
            "Start with {C:attention}2{} {V:1}Eternal", 
            "{C:dark_edition}Negative{} {C:attention,T:j_mktjk_astro}Astros",
        }
    },
...
urban wasp
#

ah right

#

one more question whats the prefix for stickers

#

s no workie

#

nor does st

daring fern
urban wasp
#

oh so literally just eternal/perishable/etc

#

nah didn't work it crash

burnt tide
#

I wanted to make a poker hand : Triple Pair
i really don't know why it doesn't work

i'm using the double pair code from vanilla remade btw

jolly pivot
#

struggling to check for the exact jokers in context.retrigger_joker_check

#

like i want very specific jokers to be trigger.

daring fern
jolly pivot
#

basically i have joker that should retrigger a very small subset of jokers

#

like 5 or 6 of them from my mod? ill have to count

#

its not a broad range and they dont have anything in common besides their theme

#

wondering if theres an easy way to check the name or key of the joker because my efforts suck

manic rune
#

flag the jokers in their config

#

then you can just check for context.other_card.ability[" your flag"]

jolly pivot
#

ic

#

thank you

manic rune
#

.ability.extra in that case

jolly pivot
#

o

red flower
#

without the extra was ok

jolly pivot
#

i have very little idea of how the config of a joker works i just put variables in and they work

red flower
#

anything in config gets put into card.ability

manic rune
#

.

#

wait no it isnt inside extra

#

my bad 😭

cursive gazelle
#

extra is in card.ability

manic rune
#

just .ability will work yeah

cursive gazelle
#

Oh you mean the check

jolly pivot
#

from what im getting, extra is just a table in the config right

manic rune
#

card.ability.extra is config.extra basically

#

anything in config will be put in card.ability, like N' said

jolly pivot
#

icic

red flower
#

i think the convention is because at one point things outside of extra didn't get saved? idk

#

that's what the docs say in one part

stiff locust
#

yeah that was a thing ages ago

#

we had to put everything in extra

#

it has been gone for eons

cursive gazelle
#

Back in my day …

stiff locust
#

back in my day itayfeder was the one maintaining fusionjokers

#

my journey to a new run involved multiple version changes and manual installs and we didn't have any of this context.beat_boss or context.main_eval baby shit you guys have now

#

this new generation is so spoiled

manic rune
#

dang new lore

stiff locust
#

isnt this all

#

known stuff

manic rune
#

not the extra one

#

thats new to me

red flower
#

no most of us started this year lol

stiff locust
#

i guess im an outlier

cursive gazelle
#

I have an issue
My wifi doesn’t connect to my pc when i open it does thus for like 5 minutes
Even tho i’m using a cable

manic rune
#

did old calc have SMODS.calculate_context

stiff locust
#

I'm old and my keyboard is broken

#

so i cant send exclamation

manic rune
#

I'm Old!

stiff locust
#

thank you

hardy viper
cursive gazelle
#

What are you up to bepis ?

hardy viper
#

back in my day we had to do everything manually without any documentation you younguns have it so good /s

cursive gazelle
#

Sadly i can’t add localization to my mod because there would be so much colors

hardy viper
#

smh what's wrong with color

cursive gazelle
#

Okay picture this

#

5x5 box grid with every box containing a colored text

stiff locust
#

objection this

cursive gazelle
#

I think it’s painful to look at honestly

manic rune
#

hell nah i cant imagine modding without that 🥀

wispy falcon
#

How do I add only Mult to a poker hand?

cursive gazelle
#

If i return false in in_pool does it make it not spawn ?

red flower
willow scroll
#

oop it seems my set_particles from pseudo_open is applying it to the wrong thing 💀

#

how would i make it so a booster pack can spawn multiple of the same consumable even without showman

wispy falcon
long sun
#

two things:

  • what does stickers expect? i've had no luck getting this to work
  • why do the cards spawn in the Jokers area, and how can i fix this?
red flower
#

stickers looks correct to me
for the second problem try adding the area to create_card

wispy falcon
azure laurel
#

someone knows how to make a new area, like a second consumable area?

red flower
#

me

azure laurel
#

how?

red flower
azure laurel
red flower
#

anywhere you like as long as the file is loaded

#

just to be clear, making areas is like intermediate stuff so you will have to make a lot of tweaks to this

#

there's no nice API for it

azure laurel
#

what does JoyousSpring does?

red flower
#

that's the global table for my mod

azure laurel
red flower
#

you dont need that, i just do it to have an easier reference to it

#

oh and the type should be 'joker' instead of 'extra_deck'

cursive gazelle
#

What’s the parameter for add_card to specify a card

red flower
#

a playing card?

cursive gazelle
red flower
#

i dont understand what you mean then

#

a specific card?

cursive gazelle
#

Yes

red flower
#

SMODS.add_card{ key = 'c_key' }

cursive gazelle
#

C lowercase ?

red flower
#

yes, it should be the key for the consumable

#

like c_fool

cursive gazelle
#

I was doing uppercase

red flower
#

F

cursive gazelle
#

“Fool” or “fool”?

#

Nvm got it working

#

Ty N

red flower
#

jokerforge has the list of keys

cursive gazelle
red flower
#

yeah that's what the docs say too

primal robin
gilded goblet
#

how can i get rid of this ugly ERROR badge? my localization entry seems correect (i t hink):

descriptions = {
  -- jokers, etc.
  Other = {
    emith_tax = {
      name = "Tax",
      text = {
        "Lose {C:money}$#1#{} for",
        "every hand played",
      }
    }
  },
  misc = {
    labels = {
      emith_tax = "Tax",
    }
  }
}
#

hold on i have an idea nvm it didnt work

#

stickers.lua file (please ignore the functions, ill worry about them later) :

SMODS.Atlas {
  key = "stickers",
  path = "stickers.png",
  px = 71,
  py = 95
}

SMODS.Sticker {
  atlas = "stickers",
  key = "tax",
  badge_colour = HEX "dcdcdc",
  pos = { x = 0, y = 0 },
  should_apply = true,
  sets = {
    Joker = true,
  },
  apply = function(self, card, val)
    card.ability[self.key] = val
  end,
  loc_vars = function(self, info_queue, card)
    return {vars = {1}}
  end,
  calculate = function(self, card, context)
    if context.end_of_round and not context.repetition and not context.individual then
      ease_dollars(-1)
    end
  end
}
gilded goblet
#

oh...

#

lmfao, thank you 😭

marble stratus
gilded goblet
#

```lua
-- your code here
```

#

only good thing to ever come out of discord

marble stratus
red flower
obtuse silo
#

for some reason, the list still reads as "nil" when i evaluate the "numberarray" list

marble stratus
#

and thisis an issue with a deck i madew

red flower
#

then post code

marble stratus
#

okiw

red flower
marble stratus
#
SMODS.Back({
    key = "asgoredeck",
    loc_txt = {
        name = "Asgore's Dagger",
        text={
        "Start with A Bluenemonial Printer and 2 Deer.",
             "{C:red}You know what to do.{}",
    }
},

    pos = { x = 4, y = 0 },
    order = 1,
    atlas = "Decks",
    unlocked = true,

    apply = function(self)
        G.E_MANAGER:add_event(Event({
            func = function()
                if G.consumeables then
                    local card = create_card("Joker", G.jokers, nil, nil, nil, nil, "j_yahimod_blueprintdagger", "yahimod_deck")
                    card:add_to_deck()
                    --card:start_materialize()
                    G.jokers:emplace(card)

                        for i = 1, 2 do
                        local card = create_card("Joker", G.jokers, nil, nil, nil, nil, "j_yahimod_deer", "yahimod_deck")
                        card:add_to_deck()
                        --card:start_materialize()
                        G.jokers:emplace(card)
                        end

                    return true
                  end
            end,
        }))
    end,
})
red flower
#

hmm I don't think the deck is the problem

marble stratus
#

whar

red flower
#

it seems to be a problem with the whatsapp seal

marble stratus
#

wha huh

#

that was in the base mod and worked fine

red flower
#

does it work if you remove then entire apply function

marble stratus
#

the huh

red flower
#

comment it out for a sec

fair osprey
#

Is there a way to "lock" a local variable during the rounds, then have it be dynamic during the shop?

marble stratus
red flower
marble stratus
#

but thats tge only thing in the de ck

red flower
#

yes

#

and we are diagnosing the problem

#

thats how programming works

marble stratus
#

oj okie

fair osprey
red flower
#

nice

fair osprey
marble stratus
red flower
#

did you only get rid of the apply function

marble stratus
#

ah

#

srry im new to coding

red flower
#
SMODS.Back({
    key = "asgoredeck",
    loc_txt = {
        name = "Asgore's Dagger",
        text = {
            "Start with A Bluenemonial Printer and 2 Deer.",
            "{C:red}You know what to do.{}",
        }
    },
    pos = { x = 4, y = 0 },
    order = 1,
    atlas = "Decks",
    unlocked = true,
})
#

like that

marble stratus
#

okiw

marble stratus
red flower
#
SMODS.Back({
    key = "asgoredeck",
    loc_txt = {
        name = "Asgore's Dagger",
        text = {
            "Start with A Bluenemonial Printer and 2 Deer.",
            "{C:red}You know what to do.{}",
        }
    },
    pos = { x = 4, y = 0 },
    order = 1,
    atlas = "Decks",
    unlocked = true,
    apply = function(self)
        G.E_MANAGER:add_event(Event({
            func = function()
                if G.consumeables then
                    SMODS.add_card { key = "j_yahimod_blueprintdagger" }

                    for i = 1, 2 do
                        SMODS.add_card { key = "j_yahimod_deer" }
                    end

                    return true
                end
            end,
        }))
    end,
})

try this

marble stratus
red flower
#

whats the crash

marble stratus
red flower
#

you probably copied it wrong

marble stratus
#

wha

#

hold up i think u rite

#

ITS FIXEDEXD

red flower
#

i am right, i can read the crash log lol

marble stratus
#

THANKYOUOUOI

twilit tundra
#

does anyone have a jimbo i can edit for making art

#

just the base jimbo

frosty rampart
red flower
#

i thought about it but idk how to explain it

frosty rampart
#

hmm yea
I'll think it over. is there any way to make a PR to the wiki?

twilit tundra
#

ty!

red flower
frosty rampart
#

ok, no worries
I think the wiki has to be its own repository somehow, that's how smods has it set up iirc

red flower
#

i'll see if i can set that up

#

else just send it to me or PR it to the main repo

marble stratus
manic rune
#

why is yahimod in here

frosty rampart
#

they're making a yahimod addon

manic rune
#

o

marble stratus
#

im making yahimod DX

manic rune
#

why is it printing out {}

#

am i missing something

red flower
#

i think only certain keys are returned directly

cursive gazelle
manic rune
#

dang.....

red flower
#

try adding passing ret as an argument to calculate effect

#

calculate context*

manic rune
#

like this?

red flower
#

yeah

manic rune
#

lemme check

#

oh that was it

#

thanks N' :3

red flower
#

yw

manic rune
#

i saw the function returning something so i kinda assumed it would return the ret table

#

bleh

red flower
#

i think it only returns the registered ones

manic rune
#

3:

#

ic

#

well now time to solve the issue of how to get it run this without recursive shenanigans...

twilit tundra
#

how do i use debugplus to give myself a specific joker again

#

or regular debug

frosty rampart
#

hold tab for the debugplus cheat sheet

#

(ctrl-3 while hovering over anything in the collection to spawn it)

twilit tundra
#

what arguments does copy_card() take?

umbral lichen
#

anyone know a way to change the odds of joker rarites in the shop? trying to do a voucher that makes rares and uncommons more likely to be in the shop

red flower
umbral lichen
#

cool ty

frosty rampart
# twilit tundra what arguments does copy_card() take?

function copy_card(other, new_card, card_scale, playing_card, strip_edition)
other is the card you want to copy
new_card is a card object you want to copy to, or just nil if you want to create a new card object
card_scale is the size of the new card object, just set it to nil to default to the same size as the other card
playing_card is uhhhhhhh i dunno tbh
strip_edition is boolean, but i think it only really has an effect on negative?

red flower
#

playing_card is the number playing cards are assigned when added to deck iirc

manic rune
#

@red flower question, why does returning anything will cause the game to crash?

#

🤔

#

i cant seem to figure it out

#

without it the code works fine

red flower
#

why are your screenshots getting smaller

manic rune
#

erm

#

is it

#

sorry its the inflation 3:

red flower
manic rune
#

erm

#

yeah that, makes sense

#

damn

#

hm

red flower
#

no they arent

manic rune
#

:3

red flower
#

hmmm

#

i would ask eremel

manic rune
#

a

manic rune
twilit tundra
#

how would i make this pop up the "Copied!" text below the joker like this without breaking out of the for loop early? (as i still want to count cards drawn afterwards)

wintry solar
manic rune
#

oh so i want to hook to eval_card to have something to calculate the stats v this

twilit tundra
manic rune
#

everything works so far except for when i return anything in context.bsr_stats

#

which will cause the game to hard crash immediately

#

i can easily add a workaround but i want to know whats causing it 🤔

red flower
manic rune
#

-# and if theres potentially a better approach i can go for

twilit tundra
manic rune
#

message_colour?

wintry solar
#

Just colour

manic rune
#

o

wintry solar
manic rune
#

i do...

#

oh, hm

robust marsh
#

how can i make my consumable immune to Perkeo's effect?

wintry solar
#

You are infinitely looping then

#

Just block post triggers from your hook

manic rune
#

adding this didnt seem to work...

#

hm

#

hmmmmmmmmm

red flower
#

hmmm

twilit tundra
manic rune
#

i might be running out of ideas

wintry solar
manic rune
#

put in where 🤔

#

if its that print in the picture then it hard crashes so i cant really tell lol

twilit tundra
#

self?

twilit tundra
#

that also crashes

#

SMODS.calculate_effect({message = localize('k_copied_ex'), colour = G.C.Chips, card})

wintry solar
twilit tundra
#

full joker:

    key = 'infinitejoker',
    loc_txt = {
        name = 'Infinite Joker Glitch',
        text = {
            "Add a permanent copy of every {C:attention}#2#{}th card drawn",
            "to deck and draw it to {C:attention}hand{}",
            "{C:inactive}(#1#/#2#){}",
        }
    },
    config = { extra = {draw_tally = 0, draws = 20 } },
    rarity = 1,
    atlas = 'VTudeJokers',
    pos = { x = 1, y = 0 },
    cost = 5,
    blueprint_compat = true,
    loc_vars = function(self, info_queue, card)
        return { vars = { card.ability.extra.draw_tally, card.ability.extra.draws } }
    end,
    calculate = function(self, card, context)
        if context.hand_drawn
                or context.other_drawn
                and not context.blueprint then
            for _, playing_card in ipairs(context.hand_drawn or context.other_drawn) do
                card.ability.extra.draw_tally = card.ability.extra.draw_tally + 1
                if card.ability.extra.draw_tally >= card.ability.extra.draws then
                    local _card = copy_card(playing_card)
                    _card:add_to_deck()
                    G.deck.config.card_limit = G.deck.config.card_limit + 1
                    table.insert(G.playing_cards, _card)
                    G.hand:emplace(_card)
                    card.ability.extra.draw_tally = card.ability.extra.draw_tally - card.ability.extra.draws
                    G.E_MANAGER:add_event(Event({
                        func = function()
                            _card:start_materialize()
                            return true
                        end
                    }))
                    SMODS.calculate_context({ playing_card_added = true, cards = { _card } })
                    SMODS.calculate_effect({message = localize('k_copied_ex'), colour = G.C.Chips, card})
                end
            end
        end
    end
}```
manic rune
#

oh right

wintry solar
manic rune
#

its G.C.CHIPS btw

wintry solar
#

SMODS.calculate_effect({}, card) fill the table in with stuff

twilit tundra
#

AH

manic rune
wintry solar
#

And if you move it a line up?

twilit tundra
#

wait why did it go from 15 to 19 after discarding 5 cards

#

huh??

manic rune
#

that, makes so much sense

wintry solar
#

Block that one too then 😂

twilit tundra
#

oh huh its also doing the create a card animation uh. after the card gets added to the hand so it looks weird. probably should reorder things then?

#

so it doesnt look like its replacing a card lmao

manic rune
#

it finally works now

#

thanks eremel :3

sonic cedar
#

-# @daring fern figured more out whenever youre available
-# all the values are being saved properly, but it's that they aren't being allocated
-# as you can see, burglar's hand addition value is being saved under extra, as it should be
-# howEVER, there's nothing in place for the joker to use the abilities of jokers with extra as NUMBERS as it will typically look for extra as TABLE
-# which'll get you crashes like ease_hands_played trying to compare with a table when it requires a number

twilit tundra
wintry solar
#

Can you screenshot the code it’s awful to read copy paste on mobile

twilit tundra
#

okay yeah its definitely that sometimes when discarding 5 cards it only goes up by 4 instead of 5?

#

which is weird

red flower
#

can we have SMODS.copy_card

wintry solar
#

Yes

sonic cedar
#

wait really

wintry swallow
#

any tips on how to start modding?

wintry solar
#

So you only draw four

twilit tundra
#

the thing is it even happens going from like 3->7
with no copy added

#

seems to be rare though i cant reproduce it

red flower
marble stratus
burnt tide
red flower
#

Rather than a text table, loc_txt should contain a description table

burnt tide
#

oh ok

#

thanks

dreamy lodge
#

how do I make the message pop up stay for longer?

robust marsh
#

do you guys know any mods that create new card areas? Possibly below the consumables. Anywhere really

red flower
#

mine

red flower
frosty dock
#

what even

red flower
#

i just saw that lmao

hardy viper
#

what is this even for

#

im so intrigued as to the context

#

found it

limber blaze
#

1 day further away from quantum ranks being merged

hardy viper
#

quantum ranks are over

wispy falcon
#

Do my Jokers that use this rarity appear in shop like this?

    key = "chatter",
    pools = {
        ["Joker"] = true,
        ["Joker"] = { rate = 0.7 },
    },
    badge_colour = HEX("8956FB"),
}```
frosty dock
limber blaze
#

just 1 more change

#

and quantum ranks will be ready

#

trust me bro

frosty dock
#

works every time 0.01% of the time

red flower
frosty dock
#

but I certainly am not willing to

red flower
#

its funny tho

frosty dock
#

it works every time 75% of the time

#

I'm not even gonna pretend I'd care to try and understand what the hell this is doing exactly

#

before merging it I'd rather discontinue smods altogether

hardy viper
frosty dock
#

Schrödinger's ranks

frosty dock
#

why are you assigning to the same key twice

#

just the one with the rate table should do fine

wispy falcon
#

But that doesn't answer my question...

chrome token
frosty dock
wispy falcon
frosty dock
#

meaning with no other rarities present, the chance of a given shop joker having your rarity is 0.7/1.7 or about 41%

frosty dock
chrome token
#

it's not my pull request, just thought it should be merged lol

frosty dock
chrome token
#

oh loll

wispy falcon
frosty dock
# wispy falcon ?

do cards of your rarity appear at some other rate? do they not appear at all? is there an unusual abundance of basic jimbos?

wintry solar
#

does it lag at all?

wispy falcon
frosty dock
#

oh i misunderstood what you were saying then

#

my bad

wispy falcon
#

Or at least it doesn't seem like they do

frosty dock
#

did you remove the ["Joker"] = true yet? and can I see code of a sample joker that you assigned this rarity to?

wispy falcon
#

Yes and here:

    key = "shnack",
    config = { extra = { chips = 0, chipsMod = 0.1 } },
    pos = { x = 5, y = 0 },
    rarity = "cstorm_chatter",
    cost = 0,
    blueprint_compat = false,
    eternal_compat = false,
    unlocked = true,
    discovered = false,
    atlas = 'chatters',

    calculate = function (self, card, context)
        if context.joker_main then
            return {
                chips = card.ability.extra.chips
            }
        end

        if context.end_of_round and not context.repetition and not context.individual then
            card.ability.extra.chips = card.ability.extra.chips + card.ability.extra.chipsMod
            return {
                    extra = {focus = context.self, message = localize('k_upgrade_ex')}
                }
        end
    end,

    loc_vars = function (self, info_queue, card)
        return { vars = { card.ability.extra.chips, card.ability.extra.chipsMod }, key = self.key}
    end
}```
frosty dock
#

okay wtf

#

I'm so sorry

#

the wiki has incorrect information

wispy falcon
#

It has?

frosty dock
#

it should be weight = 0.7 instead of rate

wispy falcon
#

Now they immediately showed up in the shop xD

#

Thank you, I was so confused

frosty dock
#

I'll update the wiki right away

wintry solar
#

woah wiki updates?!

frosty dock
#

but incorrect information just doesn't fly

frosty dock
gilded goblet
#

how can i have a sticker only be applied to jokers instead of all cards? i think ive tried a lot of thingfs by no

slim ferry
#

put ```lua
sets = {
Joker = true
}

frosty dock
gilded goblet
slim ferry
#

buhh

#

ive seen this not work for people before

gilded goblet
#

womp womp

slim ferry
#

do you have a should_apply on your sticker definition? because that overrides sets

red flower
gilded goblet
red flower
#

and then i forgot what it was i needed to PR lol

gilded goblet
slim ferry
#

i dont think you need to make a function for the flag? at least the smods.sticker page advertises it that way

frosty dock
#

tbf i also haven't been checking issues on the wiki repo

wispy falcon
#

How do I keep a variable between the instances of a joker and not change even after the joker is sold and the bought again?

slim ferry
#

store it in G.GAME

red cradle
#

how can i get the level of played poker hand?

red flower
#

G.GAME.hands[context.scoring_name].level

red cradle
dreamy lodge
#

how do I make a new effect trigger immediately after a previous effect?

#

I'm trying to make something happen in a specific sequence

red flower
#

thats chips first mult second

dreamy lodge
#

Well what I'm trying to do exactly is send a message then do the thing after its done saying the message

#

but if I put the thing after the message it still does it first so I think I have to make it a different effect

red cradle
#

maybe event with delay can help? (idk)

red flower
#

i literally do this

dreamy lodge
#

is it the extra part?

red flower
#

yes

#

this is done doing that

gilded goblet
#

either stickers are fucked up and evil or im stupid

red flower
#

theyre evil

#

whats the problem

gilded goblet
#

either they apply to every single card or they dont show up at all

red flower
#

can i see your code

dreamy lodge
#

Its still happening before the text

#

even though I put it in the extra

red flower
#

can i see your code too

gilded goblet
# red flower can i see your code
SMODS.Sticker {
  atlas = "stickers",
  key = "tax",
  pos = {x = 0, y = 0},
  config = {
    extra = {tax_rate = 1}
  },
  badge_colour = HEX("dcdcdc"),
  sets = {
    Joker = true,
  },
  apply = function(self, card, val)
    card.ability[self.key] = val
  end,
  loc_vars = function(self, info_queue, card)
    return {vars = {self.config.extra.tax_rate}}
  end,
  calculate = function(self, card, context)
    if context.final_scoring_step then
      G.E_MANAGER:add_event(Event({
    func = function()
          card:juice_up()
          ease_dollars(-self.config.extra.tax_rate, true)
      return true
        end
      }))
      card_eval_status_text(card, "dollars", -self.config.extra.tax_rate)
    end
  end
}```
#

idk what happened with the calculate function formatting-wise

red flower
#

and this doesnt apply or does it apply to everything

dreamy lodge
gilded goblet
errant arrow
#

Where would I start for fusing jokers together to create a new one?

red flower
#

also you should remove that apply function, the default one does more

dreamy lodge
frosty dock
#

cropping is har

gilded goblet
gilded goblet
red flower
dreamy lodge
red flower
frosty dock
#

you should call the default if you want its functionality

red flower
#

did u read the conversation lol

frosty dock
red flower
#

But if it wasn't working for them without it defined then why would it work if they reference it? My point was more about copying what it does rather than copying it directly

frosty dock
#

not sure what that would change

red flower
#

that it might work

gilded goblet
red flower
#

weird that it defaults to true

frosty dock
#

right, enable flags

red flower
sonic cedar
#

does a card's cost get stored in config.center? like card.config.center.cost? realized i should prob ask here

#

like how the key gets stored under card.config.center.key, that sort of thing

gilded goblet
#

im tired, ty all

sonic cedar
errant arrow
#

how do i add dependancies? wasn't it (in the meta data)

"dependencies": [ModFileName]
#

trying to make Talisman a dependency even though everyone should already have it

frosty dock
#

it's not the file name, it's the mod ID

azure laurel
#

@red flower why the game crashes (srry to disrrupt you but i was in school)

red flower
#

uhhh was this about the card areas

azure laurel
cursive gazelle
#

I think they’re using your global

#

(I’m 100% sure )

red flower
#

ok like i said, joyousspring is the table for my mod and you dont need that part

#

just the self.area_name = CardArea(...)

#

i should write about this on the wiki

azure laurel
#

so i only edit the parts where says that?

red flower
#

i can't tell you that you need to "just" do that because i dont know honestly, this is probably something you need to tinker by yourself and find out

primal robin
#

Making own card areas kinda annoying tbf

red flower
#

yeah

primal robin
#

But looks like I finally made it

frigid cargo
#

Hi N

red flower
#

hi

#

how is your name pronounced btw

frigid cargo
#

Ku ra ku

red flower
#

暗く

#

nice

frigid cargo
#

くらく

#

Thanks

red flower
#

i was trying to write it with the jp keyboard but didnt know the kanji

frigid cargo
#

Ah

#

Im learning japanese

red flower
#

i should resume

frigid cargo
#

My memory not too good with kanji

frigid cargo
versed swan
red flower
#

that happens to me too lol, i need to see how to fix that
probably changing the major of the area

#

It doesn't help that the borders of the screen depend on resolution

primal robin
#

It's doable if center your stuff

#

Corners is not reliable place

#

Okay, so I made a card area for dices, where they keeped like in bag. You can even move them, but not outside of area

#

heh

frigid cargo
#

man i hate animations. im tryna do an event to set the speed of the animation to what i want but when i switch its y pos. it just continues the animation for a little while before stopping and its annoying bruh

-- FlopprAnimations
local btct = {ticks = (5)}
local upd = Game.update
local btct_Floppr_dt = 0
function Game:update(dt)
    upd(self, dt)
    local Flopprobj = G.P_CENTERS.j_btct_Floppr
    btct_Floppr_dt = btct_Floppr_dt + dt
    if Flopprobj and btct_Floppr_dt > 0.1 and Flopprobj.soul_pos.y == 1 then
        btct_Floppr_dt = btct_Floppr_dt - 0.1
        if Flopprobj.soul_pos.x > 2 then 
            Flopprobj.soul_pos.x = 1 
            Flopprobj.soul_pos.y = 0 
        else
            G.E_MANAGER:add_event(Event({
                trigger = "immediate", 
                delay = 0.1, 
                func = function() 
                    Flopprobj.soul_pos.x = Flopprobj.soul_pos.x + 1
                    return true 
                end
            }))
        end
--other anims here i didnt put
    elseif Flopprobj and btct_Floppr_dt > 0.1 and Flopprobj.soul_pos.y == 7 then
        btct_Floppr_dt = btct_Floppr_dt - 0.1
        if Flopprobj.soul_pos.x > 16 then 
            Flopprobj.soul_pos.x = 0 
            Flopprobj.soul_pos.y = 1 
        else
            G.E_MANAGER:add_event(Event({
                trigger = "immediate", 
                delay = 0.1, 
                func = function() 
                    Flopprobj.soul_pos.x = Flopprobj.soul_pos.x + 1
                    return true 
                end
            }))
        end
    end
    for k, v in pairs(G.I.CARD) do
        if v.children.floating_sprite and v.children.floating_sprite.atlas == G.ASSET_ATLAS["btct_FlopprAtlas"] then
            v.children.floating_sprite:set_sprite_pos(Flopprobj.soul_pos)
        end
    end
end

anyone here good at anims that can help?

zealous glen
#

floop the pig

#

I'd ask what you're trying to do but I'm going to sleep. If you're still trying tomorrow or on the weekend maybe I could help

frigid cargo
zealous glen
frigid cargo
#

Yes

zealous glen
frigid cargo
#

Im tryna animate the sprite based on whatever happens in game

zealous glen
#

Take a look at Paranoia from my mod or Heartbreak

frigid cargo
zealous glen
frigid cargo
zealous glen
frigid cargo
#

Does the wiki talk about custom draw functions in the SMODS.DrawStep or nah?

zealous glen
#

Custom draw functions are a different thing

frigid cargo
#

Oh

zealous glen
#

I think that e.g. Eremel would say that DrawSteps override the need for custom draw functions, but I disagree

frigid cargo
#

Where can i learn about draw functions?

zealous glen
#

I don't know if it's written down anywhere. I imagine in some page for card objects (like SMODS.Joker), it might mention you can define a custom draw method, but that's not what I'm talking about

#

You can define a custom draw method for the soul sprite itself

frigid cargo
#

Im sorry im havent used draw before

zealous glen
#

I learned it from seeing someone else's code

#

but where you define the position of the soul sprite in the atlas, you can also define a custom draw function for the soul sprite

#

I recommend looking at Paranoia from my mod because I don't remember which mod I reference. I remember looking at Cryptid but Cryptid had other stuff going on so I couldn't understand what it was doing

#

I did get some help from Firch so maybe Bunco might have something, although it was for something specific (determining the cursor position accurately, since I was off by some specific factor)

frigid cargo
#

Great thanks!

sonic cedar
#

anyone know where the rarity NAMES are stored? doing this will just display the rarity as a number

faint yacht
#

Vanilla ones are numbered, otherwise, strings.

sonic cedar
#

yes thank you, but i had already figured that. can i pull those strings automatically like this? or will i just have to specify manually?

faint yacht
#

Via localize.

sonic cedar
#

ahhhh thats right! completely forgot about localize

#

let me workshop something rq

faint yacht
#

k_common, k_uncommon, k_rare & k_legendary.

sonic cedar
#

and do they have the numbers linked to them? like the 1, 2, 3, and 4?

#

or do they act separately?

faint yacht
#

You'd have to "associate" them yourself, assuming, to pass the right one for localize to pull the string.

sonic cedar
#

darnit, was hoping i wouldnt have to

#

thanks for the help regardless though!

faint yacht
high verge
#

I'm having an issue where a seal I'm working on the "sleepypoints" variable is showing as nil in the seal description.SMODS.Seal { key = 'belphegor', pos = { x = 2, y = 1 }, config = { extra = { sleepypoints = 2 } }, badge_colour = HEX('d80007'), loc_txt = { name = 'Belphegor', label = 'Helluva Boss', text = { [1] = 'Each round this card adds', [2] = '{X:mult,C:white} X#1# {} Mult when scoring.', [3] = 'Increases if this', [4] = 'card is held in hand', [5] = 'at end of round{C:inactive}', [6] = '(Resets if played){}' } }, atlas = 'helluvaseals', unlocked = true, discovered = true, no_collection = false, loc_vars = function(self, info_queue, card) return {vars = {}} end, calculate = function(self, card, context) if context.cardarea == G.hand and context.main_scoring then return { x_mult = card.ability.seal.extra.sleepypoints } end if context.main_scoring and context.cardarea == G.play then card.ability.seal.extra.sleepypoints = 1 end if context.end_of_round and context.cardarea == G.hand and context.other_card == card and context.individual then return { func = function() card.ability.seal.extra.var1 = (card.ability.seal.extra.var1) + 1 return true end } end end }

cursive gazelle
high verge
#

Ah, do I just put sleepypoints in there?

cursive gazelle
#

Yes

#

Try checking for nil before returning it or else it might crash

#

Or say “nil”

high verge
#

Is this wrong? I got a nil again xD

cursive gazelle
#

Because it’s nil

#

😭

#

Check for nil and return it else return a string

high verge
#

But it shouldn't be empty, the default value for it should be 2.

cursive gazelle
#

Or just make sure your variable is global or initialized before this joker or else it wouldn’t exist

#

Are you doing local sleepypoints=2

high verge
#

I currently have the sleepypoints in the config extra

willow scroll
#

Instead of sleepypoints

high verge
#

I will try that thanks

cursive gazelle
cursive gazelle
high verge
#

No?

cursive gazelle
#

Seal.config.extra.sleepypoints

high verge
#

Actually yeah this is a seal

#

Yeah xDD

willow scroll
#

Im stupid omfg

high verge
#

Nah you're smarter than I am here xD

cursive gazelle
#

It’s not a card

cursive gazelle
high verge
#

Aaaaa

cursive gazelle
#

Check SMODS.Seal

high verge
#

Well that code crashed it

cursive gazelle
#

What’s the crash

high verge
#
        return {vars = {seal.config.extra.sleepypoints}}
    end,```
cursive gazelle
#

Wait let me check

#

It

#

self.config.extra.sleepypoints

#

Not seal

#

I should’ve checked instead of guessing 00_furinakiss_DNS

high verge
#

That one looks to be working let's gooooo

#

Now I can see if the seal is actually functioning as intended or not

cursive gazelle
#

Also just asking why’s your loc_txt like that

high verge
#

I'm building the seal with joker forge

cursive gazelle
#

Ahh i see

high verge
#

I'm planning on replacing the loc_txt with proper localization later.

cursive gazelle
#

Are you making a multi textbox

#

?

high verge
#

No it's just supposed to be a regular description

cursive gazelle
high verge
#

I also know I'm not gonna translate my mod

cursive gazelle
willow scroll
high verge
#

But in case anyone is insane enough to want to help out with translation, it'll be nice and ready for them to go at it.

cursive gazelle
#

Text=“text1”,text2” works fine

high verge
#

Maybe it's so it's easier to spot for people not as used to code

cursive gazelle
#

Idk i never used jokerforge he probably knows better

high verge
#

I'm surprised it didn't spit out the variable into that area, I should mention it in a bug report.

cursive gazelle
#

I think the majority just plays on english

knotty steppe
#

is there a way to swap the current played hands chips and mult

cursive gazelle
#

To split textbox you just split the strings into multiple tables

red flower
cursive gazelle
#

Text={{“text1”},{“text2”}}

knotty steppe
#

another question
how do i add the grey text?

winter flower
knotty steppe
#

thankssss

feral tree
#

can i add a timer to a boss blind? every ___ seconds something happens

feral tree
#

how?

cursive gazelle
#

Every second is too much tho

feral tree
#

I can tune and balance the timing

#

I just want to know how to actually make it first

cursive gazelle
#

Love has a time function with love.update if you pass a variable for time

#

Like love.update(dt)

#

Dt will increase by 1 every second

red flower
#

you can just use G.TIMERS.REAL

cursive gazelle
#

You can also use os.clock

#

mr_bones you can do for loop btw

twilit tundra
#

and also, how do i check for when a planet/planet-esque card is being used, that it only buffs one hand type? i dont want to proc this on black hole or cryptid’s 3-hand superplanets

cursive gazelle
#

Too much work

cursive gazelle
# twilit tundra

I theres a table for hands but idk if they’re ordered in the same way as ingame

twilit tundra
#

so is there no way to check for the order that shows ingame?

cursive gazelle
#

Just hang this on the fridge and come back later

cursive gazelle
#

I’m too lazy to read browse the wiki or read the src i’m sorry

twilit tundra