#💻・modding-dev

1 messages · Page 430 of 1

daring fern
#

card.base.nominal = 0

rugged pier
#

Cryptid does something similar

lucid owl
#

and then simply index that by doing something similar to
for i = 1, #G.jokers.cards do if G.jokers.cards[i].pools and G.jokers.cards[i].pools.Your_Pool then <do mult whatever stuff you want here> end end

#

adding them to a joker makes them exist

#

it's just a variable you set

signal lotus
#

ah

#

ok

daring fern
lucid owl
#

the only time i index pools is for general centers, not specific objects

sonic cedar
#

how would I run a global function through the console?

pulsar furnace
#

How could I add more buttons, like to separate the decks between categories?

daring fern
scarlet spire
#

would you have an example of this function? I'm not entirely sure how to implement something like this.

sonic cedar
daring fern
scarlet spire
#

thank you

next pivot
#

would it be possible to add icons that you can put in text?

daring fern
signal lotus
#

I think they mean like the suit icons in bunco

daring fern
pulsar furnace
#

is there a way to modify the deck selection ui?

pulsar furnace
spice wadi
lucid owl
# signal lotus what does the i = 1 mean

i acts as a variable that goes up by 1 for every object in the table G.jokers.cards, so G.jokers.cards[i] will be equal to every joker one by one as the loop continues. it then ends when there are no more objects in the table

vivid grotto
#

Do you think you could explain what quantum enchantmnets are and how to use them or link me seomthing for that?

spice wadi
#

Also read the UI guide on the smods wiki if you really want to go through with this

lucid owl
daring fern
signal lotus
lucid owl
lucid owl
signal lotus
#

thanks

lucid owl
# signal lotus alright

given that you're looping through all jokers, smods has a built in context that does that btw

signal lotus
#

if context.other_joker

#

right

lucid owl
#

i would modify your code to

if context.other_joker and context.other_joker.config.center.pools and context.other_joker.config.center.pools.Kanye_Joker then
  return {
    mult = card.ability.extra.mult
  }
end
daring fern
#

How does one change joker slots without changing visible joker slots?

rugged pier
lucid owl
vague crest
daring fern
lucid owl
vague crest
#

ohhh that makes sense actually now that i look at hiker

#

OHHH no i understand completely now thats what was confusing me

lucid owl
signal lotus
#

I did

lucid owl
#

alr

vague crest
#

ohhh wait thats really weird

#

it moves them in the deck order?

lucid owl
#

ah, that's always annoying

#

yeah deck order is based on base chips

#

it's really weird

daring fern
vague crest
#

thats so bizarre i never noticed that before

daring fern
#

It's possible to fix though.

wild escarp
#

How would I change the text styling of a joker throughout the run?

vague crest
#

i guess thats why rubber ducky from extra credit has the +-10 chips thing going on?

daring fern
signal lotus
wild escarp
signal lotus
#

oh shit im stupid

#

it does normal mult not x mult

lucid owl
lucid owl
#

legit just change mult to xmult in your return

wind steppe
#

How would I check if a card is being removed or added to joker slots in a hook of Card.remove_from_deck and Card.add_to_deck?

daring fern
lucid owl
#

you were referencing a variable that doesn't exist and also adding mult rather than xmult

vague crest
#

because it works other than that which is awesome

mild olive
#

probably a common question but how is the "(Currently Xnumber Mult)" text in loc_txt should look like,,

vivid grotto
lucid owl
mild olive
#

thankksss

daring fern
formal parrot
#

Can i use game shaders ?

shell kite
#

I'm making a joker card that turns 4s into aces, the problem is that the resulting aces still score 4 chips
What's wrong?

calculate = function(self, card, context)
        if context.individual and context.cardarea == G.play then
            if context.other_card:get_id() == 4 and not context.other_card.debuff and pseudorandom('j_rdjk_dyslexia') < G.GAME.probabilities.normal/card.ability.extra.odds then
                assert(SMODS.change_base(context.other_card, nil, "Ace"))
                SMODS.recalc_debuff(card)
                play_sound("tarot1")
                return {
                    message = localize('b_rdjk_dyslexia'),
                    colour = G.C.PURPLE,
                    message_card = context.other_card
                }
            end
        end
    end
formal parrot
#

You need to change chip value

daring fern
lucid owl
formal parrot
lucid owl
formal parrot
#

It’s probably a context error

daring fern
lucid owl
lucid owl
#

so it still applies the previous chip value

formal parrot
daring fern
formal parrot
#

And how can i use the game shaders

#

And not a custom one

#

Sorry I really don’t know how draw step works i never used it

shell kite
vague crest
lucid owl
lucid owl
#

since you're changing ranks, it's kinda intended to change order and therefore it doesn't have its own thing to change order - it's totally good with the fact order is changed by changing the base chips

shell kite
# lucid owl wdym?

This

calculate = function(self, card, context)
        if context.before and context.main_eval then
            local fours = 0
            for _, scored_card in ipairs(context.scoring_hand) do
                if scored_card:get_id() == 4 and not scored_card.debuff and pseudorandom('j_rdjk_dyslexia') < G.GAME.probabilities.normal/card.ability.extra.odds then
                    fours = fours + 1
                    assert(SMODS.change_base(scored_card, nil, "Ace"))
                    play_sound("tarot1")
                    scored_card:juice_up()
                    G.E_MANAGER:add_event(Event({
                        func = function()
                            scored_card:juice_up(0.3, 0.3)
                            return true
                        end
                    }))
                end
            end
            if fours > 0 then
                return {
                    message = localize('b_rdjk_dyslexia'),
                    colour = G.C.PURPLE
                }
            end
        end
    end
#

Based in midas mask

vague crest
#

pretty happy with progress so far its been cool to bring these ideas to reality

scenic steeple
#

So, I'm trying to make a joker that gives 2$, and loses 1$ of sell value when an 8 or ace is played, I just have no clue where to start with this specific context, the closest I have to a starting point is the code for retriggers so this is gonna be a pain :/

lucid owl
#

as for giving money, reference vanillaremade's golden joker implementation

scenic steeple
#

does that also include joker losing 1$ sell value?

#

or something similar

lucid owl
#

you can do that in context.individual, it's just modifying a variable

scenic steeple
#

sweet

#

thx

lucid owl
#

you can check how gift card changes sell value, and just do that if you detect the ranks

#

plus a fancy effect if you like

scenic steeple
#

ooo

#

yippie

vague crest
#

is there a way to have a context where it only checks for something if you do it during a blind? like specifically not in the shop or blind selection

scenic steeple
lucid owl
#

actually there's a lot going on here hang on

scenic steeple
#

take your time

#

just make sure to ping me lol

lucid owl
# scenic steeple I think I did most of this right, just gotta make sure this actually changes the...
loc_vars = function(self, info_queue, card)
  return { vars = { card.ability.extra.sell_value, card.ability.extra.dollars } }
end,
calculate = function(self, card, context)
  if context.individual and context.cardarea == G.play then
    if context.other_card:get_id() == 8 or context.other_card:get_id() == 14 then
      card.sell_cost = card.sell_cost + card.ability.extra.sell_value
      return {
        message = "Placeholder message"
      }
    end
  end
end,
calc_dollar_bonus = function(self, card)
  return card.ability.extra.dollars
end
#

not perfect but i think that should work

#

i would definitely recommend familiarizing yourself with the lua language

subtle merlin
#

quick question: card.base.value gives the number of chips the card would give, right?

scarlet imp
violet gulch
subtle merlin
gusty hatch
#

hey guys i got a smol doubt here

next pivot
gusty hatch
#

i want to include my second joker here but with this sintax its giving me bugs:


SMODS.Atlas{
    key = 'beerimg',
    path = 'beer.png',
    px = 71,
    py = 95
}

SMODS.Joker{
    key = 'beerjoker',
    loc_txt = {
        name = 'Beer',
        text = {
            'Sell this card to',
            'create a free',
            '{C:attention}uncommon tag{}'
        },
    },
    atlas = 'beerimg',
    pos = {x = 0, y = 0},
    rarity = 1,
    cost = 6,
    blueprint_compat = false,
    calculate = function (self, card, context)
        if context.selling_card then
            add_tag(Tag('tag_uncommon'));
        end
    end
}


SMODS.Atlas{
    key = 'wineimg',
    path = 'wine.png',
    px = 71,
    py = 95
}

SMODS.Joker{
    key = 'winejoker',
    loc_txt = {
        name = 'Wine',
        text = {
            'Sell this card to',
            'create a free',
            '{C:attention}rare tag{}'
        },
    },
    atlas = 'wineimg',
    pos = {x = 0, y = 0},
    rarity = 2,
    cost = 14,
    blueprint_compat = false,
    calculate = function (self, card, context)
        if context.selling_card then
            add_tag(Tag('tag_rare'));
        end
    end
}

#

shrimple right?

#

well this is not supposed to be done because the wine joker actually will give you both a uncommon and a rare tag

#

which makes no sense

#

its probably something to do with item reference, im not using .this

#

but im not sure how

#

:p anyway i should sleep some more gn

violet gulch
#

I don't know if this is actually the problem, but maybe you could use "context.selling_self"

#

my guess is the context.selling_card is triggering on both of the jokers

gusty hatch
#

AH!

#

rightio

#

that sounds accurate

#

thank you

#

Well im going to test but i think it werks tyvm

vague crest
#

getting a crash from this code when using a tarot card, not sure what im doing wrong?

#

its supposed to additionally not do anything when youre in the shop but using it in the shop or in a blindcrashes

frigid blaze
#

Can you tell me where to find it, because on the website it's just like this?

frigid blaze
wind steppe
#

its minimum version not only that version

frigid blaze
vivid grotto
#

hey guys, why this no work? Its adding the text for the -mult and -chips, but when scoring it ignores the chips and always does -1 mult???

SMODS.Enhancement{
key = "backstabbed",
loc_txt = {
name = "Backstabbed",
text = {
"{C:chips}#1#{} Bonus chips",
"{C:mult}#2#{} Bonus mult"
}
},
atlas = "centers",
pos = {x = 1, y = 0},
order = 100, -- Higher order means it appears on top
config = {
chips = -2,
mult = -1
},
loc_vars = function(self, info_queue, card, specific_vars)
if not card or card.fake_card then
return { vars = { "-2x Chip Value", "-1x Chip Value" } } -- Show multipliers in collection
end
local chip_value = card:get_chip_bonus() or 0
card.ability.chips = chip_value * -2
card.ability.mult = chip_value * -1
return {
vars = {
card.ability.chips,
card.ability.mult
}
}
end
}

vivid grotto
wind steppe
#

irregardless: YOU DONT NEED IT

#

its worse than the current version

hasty mist
#

is there a way to make this deck not crash at the drop of a hat

vivid grotto
wind steppe
#

oh i thought you were someone else

#

no i cant help you

vivid grotto
#

oh, ok

hybrid shadow
#

oh wait

#

hold on

hybrid shadow
vivid grotto
#

Ok, that fixed the problem of the chips not being scored, can you tell me why the value used in scoring is always the config and these lines aren't changing it?

local chip_value = card:get_chip_bonus() or 0
card.ability.bonus = chip_value * -2
card.ability.mult = chip_value * -1

vivid grotto
hybrid shadow
vivid grotto
#

can you put variables in the config? and if not can you change the config values after they are set?

hybrid shadow
hybrid shadow
vivid grotto
#

What i am trying to do is have
negative 2 times current cards chip value in chips
negative 1 times current cards chip value in mult
added to the card having the enchantment applied

hybrid shadow
vivid grotto
#

it would make the total chips negative of the original chip value and the mult just what the original chip value was but negative

hybrid shadow
#

multiplying a negative number by a negative number gives you a positive number

vivid grotto
#

I am adding to the card -2 times original chip value in chip and -1 times original chip value in mult

#

if a = original chip value then I would have -2a + a -> -1a chip and -a mult, Unless I am seriously confused

hybrid shadow
#

then why do you have config set in the first place

#

if the config doesnt do anything why is it set

wind steppe
#

does anyone know how to check, when hooking remove_from_deck and add_to_deck, if a joker is being added to/removed from joker slots specifically?

vivid grotto
#

I was udner the impression it was required for enchantments as that was what they all used in the vanilla modded thing

wind steppe
#

its good practice

#

to have config (but you need to use it)

hybrid shadow
reef belfry
#

does get_chip_bonus also take editions like foil

vivid grotto
vivid grotto
hybrid shadow
vivid grotto
#

and how would that calculate function work exactly, as when ive attmepted to do so before it didn't work for some reason

#

this is what I have now, and it didn't work 😦

config = {
    extra = {
        bonus = -2,
        mult = -1
    }
},
loc_vars = function(self, info_queue, card, specific_vars)
    if not card or card.fake_card then
        return { vars = { "-2x Chip Value", "-1x Chip Value" } }  -- Show multipliers in collection
    end
    local chip_value = card:get_chip_bonus() or 0
    card.ability.extra.bonus = chip_value * -2
    card.ability.extra.mult = chip_value * -1
    return { 
        vars = { 
            card.ability.extra.bonus,
            card.ability.extra.mult
        }
    }
end,
calculate = function(self, card, context)
    if context.joker_main then
        return {
            bonus = card.ability.extra.bonus,
            mult = card.ability.extra.mult
        }
    end
end

}

hybrid shadow
#

joker_main is when joker effects happen, not when cards are scored

vivid grotto
#

alright, this is what I have now, and it results in ignoring the bonus and having -1 mult when scored isntead of what is one the card

config = {
    extra = {
        bonus = -2,
        mult = -1
    }
},
loc_vars = function(self, info_queue, card, specific_vars)
    if not card or card.fake_card then
        return { vars = { "-2x Chip Value", "-1x Chip Value" } }  -- Show multipliers in collection
    end
    local chip_value = card:get_chip_bonus() or 0
    card.ability.extra.bonus = chip_value * -2
    card.ability.extra.mult = chip_value * -1
    return { 
        vars = { 
            card.ability.extra.bonus,
            card.ability.extra.mult
        }
    }
end,
calculate = function(self, card, context)
    if context.main_scoring then
        return {
            bonus = card.ability.extra.bonus,
            mult = card.ability.extra.mult
        }
    end
end

}

hybrid shadow
#

idk how to fix the other issue other than actually grabbing the chip value of the card and not the bonus chip value

vivid grotto
hybrid shadow
#

idk

hybrid shadow
hasty mist
#

what should i do?

hybrid shadow
tribal kestrel
#

I'm excited to have worked this much out so far, and I wanted to share it here. Making a scrollable uibox

hasty mist
#

it mostly works but it crashes at random points for seemingly no reason

hybrid shadow
hasty mist
#

it should be i think

hybrid shadow
hasty mist
#

if it contains original_mod its vanilla

hybrid shadow
#

hm

vivid grotto
# hybrid shadow in the return statement it would be chips not bonus i think

I needed to add the change for the chips and mult inside the calcaulte function as well, but Its woroking Thank you very much for the help. I now also understand what you were refering to about the negative and negative becoming a positive when both cihps and mult are negative for the total score 😭

vivid grotto
#

Yeppp

#

thank yooouuuu

#

just a fundamental flaw with the idea itself, that im working on now

hybrid shadow
#

np

scarlet imp
#

if I wanna find out if the player has a specific Joker I can use next(find_joker("name")) right

#

if next(find_joker("Cricket's Head")) then did I just make the if statement wrong then

#

this is inside of another Joker's calculate function

hybrid shadow
scarlet imp
#

mod prefix included?

hybrid shadow
#

id imagine so

scarlet imp
#

alr I'll try that

hybrid shadow
#

i used next(SMODS.find_card in my code that detects a certain joker so idk exactly the difference here

scarlet imp
#

that's probably a better function to be calling anyways

hybrid shadow
scarlet imp
#

worked, thanks!

hybrid shadow
#

np (i cant believe how many times i had to use that parameter while taking ownership of vanilla consumables so i could have jokers change stuff about said consumables)

scarlet imp
#

Yeah, my Joker amplifies the mult effects of any Jokers that give mult. When its added or removed from the deck it messes with the config of other Jokers so that they get amplified, and divides by the same amount when its lost. Obelisk was giving me issues bc it would reset to 1 and then selling it would cause you to be at like 0.66X mult lol

merry raven
#

Is there a check to see whether a card has been destroyed
Currently making a Joker where it will grant effects after a specific enhancement has been destroyed

if playCard.config.center == G.P_CENTERS.[enhancement] and [card destroyed detection logic] then
                    -- do stuff
                end
scarlet imp
merry raven
#

I see I see

scarlet imp
#

I've never implemented something like that myself but that's where I would start

merry raven
#

Alright, I'll take a look, cheers

#

Yep there it is, but it's a global value for one criterion, so it's pretty simple
I don't know how I'm going to figure out global variables when there are multiple cards with the same enhancement, I'm worried about potential conflicts

frigid blaze
#

Could you give me a hint on how this line works?

card. ability. extra = math.min (math.floor (card.ability.extra), 1000)

scarlet imp
#

actually nvm I figured it out lol

hybrid shadow
scarlet imp
#

yeah but I found a workaround

hybrid shadow
#

oh ok

hasty mist
#

why is this still repeating so much

scarlet imp
#

it probably prints once for every card because context.full_hand[5] returns a value every time, but you might also need to check something like context.other_card == context.full_hand[5]

#

just a guess though

manic rune
#

whats the effect here

hasty mist
scarlet imp
#

there's a context.scoring_hand that you can use

hasty mist
#

isnt that for poker hands though

manic rune
#

you could use context.before and context.main_eval, context.joker_main, or context.after depending on the timing

scarlet imp
#

so something like if #context.scoring_hand.cards == 5 then

hasty mist
#

alright

#

this seems to have no effect

scarlet imp
#

try taking the .cards off of scoring hand thats my bad

frigid blaze
#

Could you give me a hint on how this line works?

card. ability. extra = math.min (math.floor (card.ability.extra), 1000)

hasty mist
#

hm, still nothing

glass scaffold
scarlet imp
#

I think they're just trying to get the conditional to pass before programming the behavior

hasty mist
#

yeah

brittle tide
#

does anyone know what causes this crash? I want to know if its one of my Jokers

wintry solar
#

@manic rune don’t know if I missed your response to this or if you were sleeping

manic rune
#

oh yeah it was 2 am for me lol

#

yeah this looks much cleaner, people wont put card = card in their calculate now

stoic fulcrum
#

can context.other_joker be called upon doing something specific (ie, selling a card or starting blind) or does it only work after scoring?

frigid blaze
#

Help me how to do.
In the game there is Flush Five, and I want to create for example Flush Six or Seven, how to fit it correctly in SMODS.PokerHand?

tough temple
#

hey real quick

#

how do i get a joker to do that <Nope!> thing

#

that appears with wheel of fortune

whole lava
#

how can i use perma bonuses? do i need to create the calculate file to calculate the bonus?

scarlet imp
whole lava
#

What about permanently upgrade the x chips and mult?

scarlet imp
#

that line permanently upgrades a card's chips. Mult I wouldn't know how to do though

whole lava
#

Ok thanks

reef belfry
manic rune
reef belfry
#

im guessing because stuff like hiker and bonus use perma_bonus instead

#

😭

manic rune
#

yup

subtle merlin
subtle merlin
#

Is there a way to tell if a card was created without manually applying a flag to each card that's created?

zealous glen
zealous glen
#

Maybe you need to be a bit clever to handle copying

#

But marking cards that start in the deck is easier

subtle merlin
#

I wouldn't know how to do that without redoing the flag every round...

#

(Doing this from a Joker, if that wasnt obvious and is relevant)

zealous glen
#

Just mark the cards at the start of the game

#

The cards remember

subtle merlin
#

How would i do that from a joker that can be acquired at any time, though? would I just flag every card regardless, and how would i even do this option?

zealous glen
#

You just do it at the start

subtle merlin
#

I'e never done smth like this before, i'd need a bit more elaboration

zealous glen
#

In SMODS

subtle merlin
zealous glen
daring fern
#

How does one change the text on a button?

manic rune
#

whats the buffer stuff for G.jokers 🤔

manic rune
daring fern
manic rune
#

huh

#

i mean you could try using DynaText instead of G.UIT.T or smt

#

it will update if you use ref_table and ref_value instead of a string

paper zealot
glacial igloo
#

how would i go about putting a clearance sale effect on my deck but specifically for boosters?

    unlocked = true,
    loc_vars = function(self, info_queue, back)
        return { vars = { self.config.consumable_slot } }
    end,
    apply = function(self,back)
        G.E_MANAGER:add_event(Event({
            func = function()
                G.GAME.discount_percent = center_table.extra
                for k, v in pairs(G.I.CARD) do
                    if v.set_cost then v:set_cost() end
                end
                return true
            end
        }))
    end,```
rugged pier
placid star
#

can you trigger a message outside of a returnr?

placid star
#

how..?

daring fern
sudden arrow
#

Dont know if this is the right chat to ask this, but I've been compiling ideas for a mod that I theoretically want to make, and I would like to work on the art for it but I dont really know how to...start per say

sudden arrow
#

Oh thank you

faint yacht
#

That... and start with something simple at first, then branch out to said ideas.

#

-# Or go full hog-

sudden arrow
#

I mean, I could try and go full hog, and some of the joker ideas are simple in nature and shoul be easy to code but most are complicated in both art AND effect. On top of that I've gotta design a new look for a consumable type thats gonna be similar to Tarots and Spectrals. Now im probably going in way over my head-

#

(and the whole mod concept is kind of complex and open ended)

daring fern
#

daring fern
gusty hatch
#

OMG YOU GUYS

#

LOOK

#

This is gold

#

EZ

#

i was searching for smod docu and i finally found the sauce

#

:p

daring fern
#

glacial igloo
#

how do i make this a percent? and also my joker is getting deleted from the deck

    unlocked = true,
    loc_vars = function(self, info_queue, back)
        return { vars = { self.config.consumable_slot } }
    end,
    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_buns_dante")
                    card:add_to_deck()
                    G.jokers:emplace(card) -- makes the lil guy stay still
                    return true --stops king crimson
                end
            end,
        }))
    end,
    apply = function(self,back)
        G.E_MANAGER:add_event(Event({
            func = function()
                G.GAME.discount_percent = 
                for k, v in pairs(G.I.CARD) do
                    if v.set_cost then v:set_cost() end
                end
                return true
            end
        }))
    end
}

local card_set_cost_ref = Card.set_cost
function Card:set_cost()
    local g = card_set_cost_ref(self)
    if (self.ability.set == 'Booster') then self.cost = self.cost - G.GAME.discount_percent end
    return g
end```
gusty hatch
ivory coral
#

is there a way to know if a crash was caused by a mod i added or by smods itself
because im getting a consistent crash in smods/src/overrides.lua but im not sure what the exact conditions are for it so i wouldnt know how to reproduce it

spice wadi
#

It contains all the steps involved in whatever caused the crash

#

If it's a mod you added, then it'll be in there

ivory coral
#

i dont think its in there but i dont really know how to read it

#

okay its caused by opening the deck while not having any diamonds in my deck

red flower
#

yeah that's a recent smods bug

ivory coral
#

im gonna test it some more

#

ah shucks

ivory coral
#

oh well at least its not something i did

tepid crow
subtle merlin
#

How would i debuff a card using a consumable?

gusty hatch
subtle merlin
gusty hatch
merry raven
#

Meeting a problem with one of my Jokers, its ability is to create this special sticker on a random card that expires after 3 uses, but there are a few problems

  • Any subsequent stickers made after the first one either has less than 3 uses or has none, because the player used up all 3 uses of the first sticker
  • Multiple stickers shares the same "pool" of uses
    • For example, If I have two of the stickers starting off with 3 uses each, after they activate, they'll both have 1 use left instead of 2

I've heard something about shallow and deep copying, so I was wondering if anyone here could give me any pointers

crisp coral
#

make the counter right on the card itself similar to perish_tally

tepid crow
#

sounds like you're modifying the base of the sticker, not the instance of the sticker

merry raven
#

I never knew perish_tally existed

#

What Joker or whatever card has that

crisp coral
#

Perishable sticker

pale holly
#

I would like to know, since there's SMODS.has_enhancement/seal/edition to detect modified cards, is there a way to detect non modified one ?

I tried to do something like this but i'm most probably doing the wrong thing :

           for i = 1, #G.hand.cards do
           if G.hand.cards[i].seal ~= nil and G.hand.cards[i].edition ~= nil and G.hand.cards[i].ability.set ~= "Default" then
                       end
       end
   end,```

What i want precisely is to make non modified cards debuffed
zealous glen
subtle merlin
#

Question because i can't figure this out for some reason: why doesn't this debuff the drawn card?

#

I thought card.debuff = true debuffed it but ig not?

gusty hatch
#

maybe you need a setter

#

or its in the wrong context

subtle merlin
#

It doesn't have a context, it cant if you look at the use function, it's not a joker this time

gusty hatch
#

mb i'm still learning myself

tardy juniper
#

okay first time trying sounds, how do i play this sound?

#

(did i even do it right?)

#

doing this crashes the game

#

says file doesnt exist

#

which it does but okay

manic rune
#

SMODS.debuff_card(selected_card, true)

snow vale
manic rune
subtle merlin
manic rune
#

oh, thats weird

#

oh yeah you need source too

#

my bad

subtle merlin
#

What do i put as the source? Actually, what can i put as the source?

manic rune
#

any string

#

like, how do i explaaain this

#

im guessing source is there so that until all the source's debuffs are set to false, the card will still be debuffed

#

so that it wont conflict with other debuffing code, i guess

snow vale
#

how can i do smthing like this (example from myst)

#

i mean separating the boxes

red flower
#

just put your description in a table

manic rune
#

you couldve just asked them directly, but uh

#

this is an example of how to do it

snow vale
#

idk, it says dont reply pings so uh idk

#

ok thanks anyway

manic rune
#

you can just reply them without pinging

#

:p

snow vale
#

oh

subtle merlin
spice wadi
#

you can also reply with ping but they might not like that xD

manic rune
gusty hatch
#

hey guys i also need help

#

I want the card to show a tooltip of a tag

#
text = {
            'Sell this card to',
            'create a free',
            '{C:attention,T:tag_uncommon}uncommon tag{}'
        },
tardy juniper
gusty hatch
#

this does not have the expected behaviour

#

the tooltip for tag_uncommon is not there :/

#

despite being in G.P_TAGS

manic rune
#

you need to use info_queue lol

red flower
gusty hatch
#

Oh!

#

Great, thank you, ill read on that too

#

:D awesome

subtle merlin
manic rune
#

you can try hooking to end_round()

#

one sec

manic rune
# manic rune you can try hooking to `end_round()`
local end_round_ref = end_round
function end_round()
  local ret = end_round_ref()
  for _,v in ipairs(G.playing_cards) do
    if v.ability["a flag so that the code knows which card is debuffed by that"] then
      v.ability["a flag so that the code knows which card is debuffed by that"] = false
      SMODS.debuff_card(v, false, "source in here")
    end
  end
  return ret
end
#

this is how i would do it

old epoch
#

I'm trying to make a joker that gains mult per wild card scored, but when i spawn it in it crashes the game saying 'attempt to index local 'card' (a nil value)'.
Code:

    config = { extra = { mult_gain = 1, mult = 0 } },
    loc_vars = function(self, info_queue, card)
        return { vars = { card.ability.extra.mult_gain, localize('m_wild'), card.ability.extra.mult } }
    end,
    calculate = function(self, card, context)
        if SMODS.has_enhancement(context.other_card, 'm_wild') then
            card.ability.extra.mult = card.ability.extra.mult + card.ability.extra.mult_gain
            return {
                message = localize('k_upgrade_ex'),
                colour = G.C.RED
            }
        end
        if SMODS.has_enhancement(context.other_card, 'm_wild') then
            return {
                mult = card.ability.extra.mult
            }
        end
    end

I dont really know much about stuff like this if that isn't obvious

subtle merlin
#

(it didn't work, the card is still debuffed)

manic rune
#

are you sure you set the flag of the debuffed card?

#

like, in here

#

there should be smt like selected_card.ability.flaggedsmtsmt = true

subtle merlin
red flower
# old epoch I'm trying to make a joker that gains mult per wild card scored, but when i spaw...

you want something like this because context.other_card doesn't exist in every context

    calculate = function(self, card, context)
        if context.individual and context.cardarea == G.play and SMODS.has_enhancement(context.other_card, 'm_wild') then
            card.ability.extra.mult = card.ability.extra.mult + card.ability.extra.mult_gain
            return {
                message = localize('k_upgrade_ex'),
                colour = G.C.RED
            }
        end
        if context.joker_main then
            return {
                mult = card.ability.extra.mult
            }
        end
    end
old epoch
#

ah okay, do i just plug that in place of my other code?

red flower
#

yes

old epoch
#

alright let me try that

#

it works, thank you!

burnt apex
#

Haiya people, Im trying to set up a joker that converts Jacks/Kings into Queens, is there an existing joker function for turning one card into another?

red flower
#

SMODS.change_base

burnt apex
#

thanks

whole lava
#

is this how i can make the card held in hand upgrade to score more chips when scored later?

formal parrot
#

Hey 1 question

#

So

#

How in god’s green earth you guys make selectable ankh

#

Instead of random

unkempt thicket
#

Select joker copy joker

tardy juniper
#

how do shaders work? is there like a tutorial on it?

#

for editions

pure salmon
#

do enhancements run calculate if they're in the deck?

red flower
#

i think you need to enable the deck area optional feature

pure salmon
#

the what

red flower
#

there's an optional smods feature to run calculation in the deck

pure salmon
#

oh

red flower
#

let me see if i can find the syntax

red flower
nova finch
#

can anyone help me here? I have no idea why this crash is happening
I'm trying to make a joker that upgrades every time a certain amount of diamond cards are scored. I figured out how to make it upgrade, but for some reason every time i try to reset the count it crashes. I've tried having it above the return but it also crashes in that situation

copper thorn
#

i have a quick question from me, a begginer, how can i make it sothat i have multiples jokers in one mod ? i already have a joker but iwanna add another one in the same mod

red flower
copper thorn
#

ok but how ?

red flower
#

the same way you did it the first time

nova finch
red flower
#

that's also a syntax error

#

you're writing the code wrong

exotic imp
#

how do I comment out multiple lines?

red flower
lucid owl
exotic imp
#

ok thank you

whole lava
#

is this the way to make the held in hand cards to score more chips

red flower
#

what's decard

whole lava
#

decard is a variable to check if the played hand have multiple suits

primal terrace
#

So far, if I want a Joker to destroy cards, I set getting_sliced = true to the destroyed card

But I found that it doesn't work with ExtraCredit Ship of Thesus, which checks for context.removed

modern kindle
#

Hi N

red flower
#

hii

red flower
whole lava
#

i want to give chips when played next time

nova finch
# red flower you're writing the code wrong

I've like quadruple checked now, I don't see a single syntax error, it should be working unless it's a problem with the single line itself
if I take out card.ability.extra.cardcount = card.ability.extra.cardmin out, it functions fine

red flower
red flower
red flower
nova finch
red flower
nova finch
red flower
#

oh there's a comma after + 1 that shouldn't be there

nova finch
#

that worked! thank you so much!

modern kindle
#

sometimes i be comma-ing as well

exotic imp
#

how do I make the text change like baseball card

copper thorn
#

help, the freak did i do wrong ? i just wantedtoadd another joker

red flower
exotic imp
# red flower wdym

I want the text of my card to change the value after each round ends similar to how bull increases chips with money

copper thorn
#

it's supposed to work though no ?

red flower
copper thorn
#

mmmmmmmm, great questioni maybeforgor todoit

#

my spacebar is kinda broken don't mind it btw

exotic imp
tough temple
sonic cedar
#

is there a context for like
post ease_dollars?

#

like something i can use to call a return after a dollar bonus

chrome widget
#

I had to add contexts for all those myself

red flower
chrome widget
#

So now I have a context for dollars changed, hands changed, discards changed, ante changed

#

Once again if you want em, you can have em

sonic cedar
#

im sensing a pattern (that'd be awesome actually)

exotic imp
red flower
#

yes

exotic imp
#

k

chrome widget
#

I'd just recommend changing the fnwk_ prefix I use in these because that's my mod prefix, and I tend to label all my custom contexts to prevent conflicts

--------------------------- Value easing contexts
---------------------------

local ref_ease_hands = ease_hands_played
function ease_hands_played(mod, instant)
    local ret = ref_ease_hands(mod, instant)
    G.E_MANAGER:add_event(Event({
        trigger = 'immediate',
        func = function()
            SMODS.calculate_context({fnwk_change_hands = true})
            return true
        end
    }))

    return ret
end

local ref_ease_discards = ease_discard
function ease_discard(mod, instant, silent)
    local ret = ref_ease_discards(mod, instant, silent)
    G.E_MANAGER:add_event(Event({
        trigger = 'immediate',
        func = function()
            SMODS.calculate_context({fnwk_change_discards = true})
            return true
        end
    }))
    return ret
end

local ref_ease_dollars = ease_dollars
function ease_dollars(mod, instant)
    local ret = ref_ease_dollars(mod, instant)
    G.E_MANAGER:add_event(Event({
        trigger = 'immediate',
        func = function()
            SMODS.calculate_context({fnwk_change_dollars = true})
            return true
        end
    }))
    return ret
end

local ref_ease_ante = ease_ante
function ease_ante(mod)
    local ret = ref_ease_ante(mod)
    G.E_MANAGER:add_event(Event({
        trigger = 'immediate',
        func = function()
            SMODS.calculate_context({fnwk_change_ante = true})
            return true
        end
    }))
    return ret
end```
sonic cedar
#

i mean ywah

chrome widget
#

You can also ofc edit them to send the mod that just changed

#

I don't need it for my current purposes so I didn't bother

sonic cedar
#

right right ok

#

standing_bowing_lady my gratitudes

chrome widget
#

🙂‍↕️

#

And no yeah I'm a firm believer in theft. I want people to steal my stuff so I might as well just give it if ppl need it

sonic cedar
#

me mid updating the credits

modern kindle
chrome widget
#

Oh if you want it, sure

modern kindle
#

i thought it looked so peamly...

chrome widget
#

I need to make an update to it because it currently requires a lovely patch and tbh it doesn't need one

#

A hook would work better

modern kindle
#

there is something i do ill have to dm to see how i can make that work but idk how shrimple it is cause im wack to make it work

sonic cedar
chrome widget
#

It's actually fairly shrimple, only issue is that I ended up recreating the card creation logic because there's no built in way to create a card key without creating a new card and I didn't want to make random keys for the prediction just to destroy the cards initially generated and recreate them

sonic cedar
# chrome widget 🙂‍↕️

So I guess it doesn’t work with end_of_round?
was trying to prevent it from triggering in any point other than the end of the round, only after the dollar bonus

chrome widget
#

Yeah the one I made is a kind of naive context that's just universal, any time the dollar ease changes

#

What specifically is your use case?

sonic cedar
#

literally just want to call a function after the joker's dollar bonus

#

(sorry i was restarting my computer i accidentally left it on all night)

#

end of round
joker gives money
same joker calls function

modern kindle
sonic cedar
#

-# >horse walks in

red flower
brave echo
#

hey chat am i stupid

chrome widget
#

Rather than specifically the dollar ease. Mine is used for a joker that needs to know your current dollar state at all times, and a similar one that needs to know your ante and hands state at all times

brave echo
# brave echo hey chat am i stupid

SMODS.Sound({key = "visitor", path = "visitor.ogg",})

SMODS.Atlas{
    key = 'visitor',
    path = 'visitor.png',
    px = 70,
    py = 95,
}

SMODS.Joker{
    key = 'visitor',
    loc_txt= {
        name = 'visitor',
        text = { "{C:red} Pays you a visit.",
    },},
    atlas = 'visitor',
    rarity = 2,
    cost = 20,
    pools = {["Yahimodaddition"] = true},
    
    unlocked = true,
    discovered = true,
    blueprint_compat = true,
    eternal_compat = true,
    perishable_compat = false,

    pos = {x=0, y= 0},
    config = { extra = {chance = 50}},

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

    calculate = function(self, card, context, center) --BEHAVIOUR BELOW
    if context.selling_self then
        play_sound("blasphemy")
        return nil
    end
    
    if context.joker_main then
        -- Play sound and show visual for 850 frames
        G.showvisitor = 850
        play_sound("visitor")

        -- 50/50 chance for either multiplier type
        ----local visitor_mult = pseudorandom(1, center.ability.extra.chance)
        local chance = card.ability.extra.chance
        local visitor_mult = pseudorandom(1, chance)
        local mult_value = 1
        
        if pseudorandom(1, 2) == 1 then
            -- Option 1: XMult between 1 and 50
            mult_value = visitor_mult
        else
            -- Option 2: XMult between 0.02 and 1 (1/50 to 1/1)
            mult_value = 1 / visitor_mult
        end
            
        return {
            message = "    ",
            colour = G.C.RED,
            Xmult_mod = mult_value,
            card = card
        }
        end
        
    end,
    
    check_for_unlock = function(self, args)
        if args.type == 'test' then --not a real type, just a joke
            unlock_card(self)
        end
        unlock_card(self) --unlocks the card if it isnt unlocked
    end,
    
}```

(Building off of the yahimod for this specific one in case that matters)
chrome widget
#

But for a specific dollar giving action, there's def locations for it

red flower
brave echo
#

yes! 😭 thats why im so confuse kfjdklgj

faint yacht
#

Missing modprefix for playsound.

chrome widget
#

For mine my joker checks the current dollar count and uses a base 10 log to determine the number of digits, and then gives you an extension to your joker count depending on how many digits of money you have

faint yacht
#

playsound('modprefix_visitor')

brave echo
chrome widget
#

Corpse Crimelord was.... uhh.... busted before it got nerfed p hard

sonic cedar
#

bruh

sonic cedar
red flower
#

state_events

sonic cedar
#

oh i see

pulsar furnace
#

how could i add buttons here? ( on the sides )

sonic cedar
red flower
#

no idea

sonic cedar
#

most terrifying answer actually

#

how would the if statement go though

red flower
#

_card.config.center.key == "key"

sonic cedar
#

ahh ok

sonic cedar
copper thorn
#

ihave aproblem, my joker addsupthe xmult in his desc but it doesn't multiply the mult while playinga hand

    key = "Parada",
    loc_txt = {
        name = "Parada",
        text = {
            "This Joker gains {X:mult,C:white}X1{} Mult",
            "every time that scoring hand",
            "contains three scoring cards",
            "{C:inactive}(Currently {X:mult,C:white}X#1#{C:inactive} Mult)"
        }
    },
    atlas = "LegParada",
    soul_pos = {x = 0, y = 1},
    rarity = 4,
    pos = { x = 0, y = 0},
    cost = 10,
    unlocked = true,
    discovered = true,
    blueprint_compat = true,
    eternal_comat = true,
    perishable_compat = true,
    config = { extra = {
        xmult = 1,
        xmult_gain = 1
    }
    },
    loc_vars = function(self, info_queue, center)
        return {vars = {center.ability.extra.xmult}}
    end,
    calculate = function(self,card,context)
        
        if context.before and #context.scoring_hand == 3 then
            card.ability.extra.xmult = card.ability.extra.xmult + card.ability.extra.xmult_gain
            return { 
                message = localize('k_upgrade_ex') 
            }
        end
        if context.joker_main then
            return {
                   
                card = card,
                xmult_mod = card.ability.extra.xmult,
                message = "X" .. card.ability.extra.xmult,
                colour = G.C.MULT,
            }
        end
        
    end,
    in_pool = function(self,wawa,wawa2)
        return true
    end```
sonic cedar
#

change it to card

copper thorn
#

like this or the 2nd one too ?

sonic cedar
#

both

copper thorn
#

found it out eventually yeah x)

#

so uhh i changed it and it stilldoesn't work

sonic cedar
#

?

copper thorn
#

itstill doesn't multiply the mult

#

want a recording ?

sonic cedar
#

if you want

#

id prefer the code

#

but yeah let me see what you mean

copper thorn
#

the code is the same but with card insted of center

violet void
#

Hello, what's the best way to have SMODS.create_card use a pool of every jokers from a specific mod?

copper thorn
#

@sonic cedar

sonic cedar
#

no

#

im

#

right here

#

i was just

copper thorn
#

oh sry

sonic cedar
#

trying to decipher the frames

copper thorn
#

saw you offline, sorry

sonic cedar
#

weird

copper thorn
sonic cedar
#

anyway

#

isnt it a capital X for Xmult_mod

#

not too sure but who knows

copper thorn
#

it's indeed a capital X istg if this si it T-T

#

your never gonna believe me... it was all because of the capital X

#

-_-

sonic cedar
#

yeah

#

everything else looked fine so i figured

copper thorn
#

i have the same issues for two cards that works thesame way butthe firstoneuses money and the second one chips

so what do i put for those two?

pure salmon
#

this description is showing all nils in the collection, for some reason

chrome widget
#

you need to wrap it in vars = {}

pure salmon
#

ohhhh

#

my bad lol

chrome widget
#

So it's return { vars = {card.ability.extra.mult_mod, math.max(0, cumulative_mult)}}

copper thorn
#

i got no visible errors, whatcan i do ?

sonic cedar
#

youre not gonna believe this

copper thorn
#

...

sonic cedar
#

no wait firstly what happened

copper thorn
#

same asbefore but withchips instead

sonic cedar
#

(CHIPS instead of Chips)

copper thorn
#

hahahahahahahaha...

sonic cedar
distant rock
#

How do I make a joker draw cards face down?

copper thorn
#

wanna hear a story ?

it didn't work

sonic cedar
#

yeah i didnt think it would, but it's something to note

#

can you send the full thing

copper thorn
#
    key = "smiley",
    path = "Smiley.png",
    px = 71,
    py = 95
}
SMODS.Joker{
    key = "Smiley",
    loc_txt = {
        name = "This random ass smiley I found",
        text = {
            "This Joker gains {C:chips}+69{} ",
            "every time that scoring hand",
            "contains three scoring cards",
            "{C:inactive}(Currently {C:chips}#1#{C:inactive})"
        }
    },
    atlas = "smiley",
    pos = {x = 0, y = 0},
    rarity = 3,
    cost = 10,
    unlocked = true,
    discovered = true,
    blueprint_compat = true,
    eternal_comat = true,
    perishable_compat = true,
    config = { extra = {
        chips = 1,
        chips_gain = 69
    }
    },
    loc_vars = function(self, info_queue, card)
        return {vars = {card.ability.extra.chips}}
    end,
    calculate = function(self,card,context)
        
        if context.before and #context.scoring_hand == 3 then
            card.ability.extra.chips = card.ability.extra.chips + card.ability.extra.chips_gain
            return { 
                message = localize('k_upgrade_ex') 
            }
        end
        if context.joker_main then
            return {
                   
                card = card,
                CHIPS_mod = card.ability.extra.chips,
                message = "+chips" .. card.ability.extra.chips,
                colour = G.C.Chips,
            }
        end
        
    end,
    in_pool = function(self,wawa,wawa2)
        return true
    end
}```
sonic cedar
sonic cedar
#

you capitalized the wrong chips

#

i meant the colour

copper thorn
#

ohhhhhhhh

#
    key = "Smiley",
    loc_txt = {
        name = "This random ass smiley I found",
        text = {
            "This Joker gains {C:CHIPS}+69{} ",
            "every time that scoring hand",
            "contains three scoring cards",
            "{C:inactive}(Currently {C:CHIPS}#1#{C:inactive})"
        }
    },
    atlas = "smiley",
    pos = {x = 0, y = 0},
    rarity = 3,
    cost = 10,
    unlocked = true,
    discovered = true,
    blueprint_compat = true,
    eternal_comat = true,
    perishable_compat = true,
    config = { extra = {
        chips = 1,
        chips_gain = 69
    }
    },
    loc_vars = function(self, info_queue, card)
        return {vars = {card.ability.extra.chips}}
    end,
    calculate = function(self,card,context)
        
        if context.before and #context.scoring_hand == 3 then
            card.ability.extra.chips = card.ability.extra.chips + card.ability.extra.chips_gain
            return { 
                message = localize('k_upgrade_ex') 
            }
        end
        if context.joker_main then
            return {
                   
                card = card,
                chips_mod = card.ability.extra.chips,
                message = "+chips" .. card.ability.extra.chips,
                colour = G.C.Chips,
            }
        end
        
    end,
    in_pool = function(self,wawa,wawa2)
        return true
    end
}```
sonic cedar
#

NOT the

#

this one

copper thorn
#

oh, x)

#
    key = "smiley",
    path = "Smiley.png",
    px = 71,
    py = 95
}
SMODS.Joker{
    key = "Smiley",
    loc_txt = {
        name = "This random ass smiley I found",
        text = {
            "This Joker gains {C:chips}+69{} ",
            "every time that scoring hand",
            "contains three scoring cards",
            "{C:inactive}(Currently {C:chips}#1#{C:inactive})"
        }
    },
    atlas = "smiley",
    pos = {x = 0, y = 0},
    rarity = 3,
    cost = 10,
    unlocked = true,
    discovered = true,
    blueprint_compat = true,
    eternal_comat = true,
    perishable_compat = true,
    config = { extra = {
        chips = 1,
        chips_gain = 69
    }
    },
    loc_vars = function(self, info_queue, card)
        return {vars = {card.ability.extra.chips}}
    end,
    calculate = function(self,card,context)
        
        if context.before and #context.scoring_hand == 3 then
            card.ability.extra.chips = card.ability.extra.chips + card.ability.extra.chips_gain
            return { 
                message = localize('k_upgrade_ex') 
            }
        end
        if context.joker_main then
            return {
                   
                card = card,
                chips_mod = card.ability.extra.chips,
                message = "+chips" .. card.ability.extra.chips,
                colour = G.C.CHIPS,
            }
        end
        
    end,
    in_pool = function(self,wawa,wawa2)
        return true
    end
}```
violet void
copper thorn
#

still doesn't work

#

btw

sonic cedar
copper thorn
#

?

sonic cedar
#

have that surrounding your code

#

it'll format for lua

violet void
# red flower wdym
[patches.pattern]
target = "functions/common_events.lua"
pattern = "if v.yes_pool_flag and not G.GAME.pool_flags[v.yes_pool_flag] then add = nil end"
position = "after"
payload = '''
if G.GAME.current_alignment ~= "chameleon" then
    if v.set == 'Joker' 
    and v.config.alignment ~= G.GAME.current_alignment 
    and G.GAME.current_alignment_only then 
        add = nil 
    end
else
    if v.set == 'Joker' 
    and G.GAME.current_alignment_only 
    and v.atlas ~= "CrazyStairs_atlas" then 
        add = nil 
    end
end```
red flower
#

oh

copper thorn
#

yeah the ```

#

i don't have it on my french keyboard thoug

red flower
sonic cedar
copper thorn
#

lua exemple

violet void
red flower
#

yes

violet void
#

but wouldn't the type be Joker

red flower
#

no

violet void
#

so it works as subtype

red flower
#

basically yeah

sonic cedar
copper thorn
#

not the subhject tho ._.

sonic cedar
#

easier (for me) to read is all

violet void
copper thorn
#

oh ok

sonic cedar
daring fern
#

sonic cedar
#

seal location is sprite based no? just move the sprite

copper thorn
#

i still don't knowhow to resolve my problem, it got ignored in between T-T

sonic cedar
copper thorn
#

oh sorry

#

haven't figuredit out

daring fern
copper thorn
#
SMODS.Atlas {
    key = "smiley",
    path = "Smiley.png",
    px = 71,
    py = 95
}
SMODS.Joker{
    key = "Smiley",
    loc_txt = {
        name = "This random ass smiley I found",
        text = {
            "This Joker gains {C:chips}+69{} ",
            "every time that scoring hand",
            "contains three scoring cards",
            "{C:inactive}(Currently {C:chips}#1#{C:inactive})"
        }
    },
    atlas = "smiley",
    pos = {x = 0, y = 0},
    rarity = 3,
    cost = 10,
    unlocked = true,
    discovered = true,
    blueprint_compat = true,
    eternal_comat = true,
    perishable_compat = true,
    config = { extra = {
        chips = 1,
        chips_gain = 69
    }
    },
    loc_vars = function(self, info_queue, card)
        return {vars = {card.ability.extra.chips}}
    end,
    calculate = function(self,card,context)
        
        if context.before and #context.scoring_hand == 3 then
            card.ability.extra.chips = card.ability.extra.chips + card.ability.extra.chips_gain
            return { 
                message = localize('k_upgrade_ex') 
            }
        end
        if context.joker_main then
            return {
                   
                card = card,
                chips_mod = card.ability.extra.chips,
                message = "+chips" .. card.ability.extra.chips,
                colour = G.C.CHIPS,
            }
        end
        
    end,
    in_pool = function(self,wawa,wawa2)
        return true
    end
}```
sonic cedar
errant fulcrum
#

So I've got this code for a tarot that destroys a card for money

use = function(self,card,area,copier)
        ease_dollars(2)
        G.E_MANAGER:add_event(Event({
                trigger = 'after',
                delay = 0.2,
                func = function() 
                    for i=#G.hand.highlighted, 1, -1 do
                        local card = G.hand.highlighted[i]
                        card:start_dissolve(nil, i == #G.hand.highlighted)
                    end
                    return true end }))
                return {
                    message = '$2',
                    colour = G.C.MONEY,
                    delay = 0.45, 
                    remove = true,
                    card = card
                }
    end,

But I've just discovered it doesnt work with Canio. Is there a simple way to make it work or am I going to have to rewrite some code? I know destroy_card is a little funky

sonic cedar
copper thorn
#

only this ?

red flower
#

oh wait no i see it

#

the return doesnt do anything

#

you need to call the remove_playing_card context manually or use SMODS.destroy_cards

copper thorn
#

IT WORKS AFTER ALL THIS DUMB ERRORS I MADE

#

i still need you tho

#

x)

sonic cedar
#

still here

frigid blaze
#

Can you tell me what I need to add to make it work?

errant fulcrum
copper thorn
# sonic cedar still here

same issues but with money mi boy

SMODS.Joker{
    key = "D4rck",
    loc_txt = {
        name = "D4rck",
        text = {
            "This Joker gains {C:money}+1 ${} ",
            "every time that scoring hand",
            "contains three scoring cards",
            "{C:inactive}(Currently {C:money}#1#${C:inactive})"
        }
    },
    atlas = "d4rck",
    soul_pos = {x = 0, y = 1},
    rarity = 4,
    pos = { x = 0, y = 0},
    cost = 10,
    unlocked = true,
    discovered = true,
    blueprint_compat = true,
    eternal_comat = true,
    perishable_compat = true,
    config = { extra = {
        money = 1,
        money_gain = 1
    }
    },
    loc_vars = function(self, info_queue, card)
        return {vars = {card.ability.extra.money}}
    end,
    calculate = function(self,card,context)
        
        if context.before and #context.scoring_hand == 3 then
            card.ability.extra.money = card.ability.extra.money + card.ability.extra.money_gain
            return { 
                message = localize('k_upgrade_ex') 
            }
        end
        if context.joker_main then
            return {
                   
                card = card,
                mod = card.ability.extra.money,
                message = "$" .. card.ability.extra.money,
                colour = G.C.MONEY,
            }
        end
        
    end,
    in_pool = function(self,wawa,wawa2)
        return true
    end```
frigid blaze
#

Can you tell me what I need to add to make it work?

red flower
#

oops

red flower
sonic cedar
red flower
#

i would check how other mods do poker hands

frigid blaze
red flower
#

what's not clear

copper thorn
#

itworks

#

everything works

sonic cedar
copper thorn
#

i can set you free fianlly

sonic cedar
#

yw

blazing salmon
#

does incrementing values with (var += number) not work in lua?

red flower
#

no

sonic cedar
#

no?

blazing salmon
#

sad

#

now i have to spend another half a second writing the longhand version!

copper thorn
#

time to not play my freshly working mod :)

sonic cedar
#

somecom sleep is a thing btw

copper thorn
#

somecome ?

frigid blaze
#

What does it mean if next(parts._flush)?

red flower
#

next checks if the table has something

frigid blaze
#

What is the correct spelling of Flush Five right here?
parts._???

red flower
wise terrace
#

Hi, I'm trying to use smods post_trigger and its working so far, but when retirgger jokers (like seltzer) trigger it doesn't work

red flower
#

iirc it just doesn't work with retriggers

#

but ive never used it

frigid blaze
#

Fix?

vast night
#

Hey itsameeee. How are you doin. I wanted to ask if someone knows how to replace an already existing joker (8 ball in my case)

daring fern
frigid blaze
exotic imp
#

I want my card to increase for each played card would this work for that or what would I need it to change
if context.cardarea == G.play and context.main_scoring return {xmult = card.ability.extra.xmult + ( 1 * G.play )}

vast night
daring fern
daring fern
vast night
#

which card

subtle merlin
daring fern
frigid blaze
exotic imp
vast night
daring fern
exotic imp
subtle merlin
# frigid blaze Help guys

How the hell would you even select 6 cards, is my first question

also you need to specify the card you're getting the rank of with rank.key, there may be more issues but that's the main one i see

exotic imp
vast night
subtle merlin
exotic imp
sonic cedar
#

no matter what i patch into here, the game gets stuck and the cash out button never appears
i can get around it by hitting enter, but i literally gain no money
what do i do?

daring fern
#

It is needed when you want to send a message or give mult or chips or similar.

sonic cedar
#

oh ok

daring fern
frigid blaze
#

I can play 6 cards with a joker, I want 6 kings and I wrote key = 13, but the error

exotic imp
old epoch
#

Is there a way to track how much money has been earned over a run?

daring fern
sonic cedar
red flower
sonic cedar
#

ohhhh ok

exotic imp
hushed field
#

In base SMODs, there's no function to discard a card passed through as a parameter, right? All discarding goes through the discard from highlighted function?

sonic cedar
red flower
#

_card instead of card
also context doesn't exist

subtle merlin
sonic cedar
#

got it got it

daring fern
sonic cedar
subtle merlin
errant fulcrum
#

Hey guys, what does this mean? The line referenced has this SMODS.destroy_cards(card)

errant fulcrum
#

I updated it a few days ago

frigid blaze
#

Syntax error

red flower
red flower
errant fulcrum
red flower
#

yeah, update

errant fulcrum
#

Welp

frigid blaze
exotic imp
#

how do I make it so that I can't get a copy without showman?

red flower
old epoch
old epoch
#

np

exotic imp
#

I didn't know it worked like that

old epoch
#

i was confused about it for a while as well

frigid blaze
snow vale
#

what parameters do i have to give to pseudorandom_element() ?

subtle merlin
red flower
subtle merlin
#

How could I have a consumable give a card 2x chips and +20 mult that's removed on score?

frigid blaze
#

I choose 6 cards but it still shows flush five😞

old epoch
#

Is there a way to detect how much money was earned over the run?

red flower
chrome widget
#

You can set the size and length of rows for the custom consumable page

old epoch
tough temple
#

thx

daring fern
#

Not current money?

daring fern
# old epoch yeah

You would hook ease_dollars and check if the value is more than 0 and store the number in a G.GAME variable probably.

old epoch
#

Im pretty new to this and dont really understand what most of that means

frigid blaze
daring fern
# old epoch Im pretty new to this and dont really understand what most of that means
Klei Entertainment Forums

In LUA, it is a very important concept to understand that everything is a variable and all variables may be edited in runtime. This includes functions. With modding other peoples' LUA files, like Klei's basegame code, you may find yourself wanting to run your code before or after the original fun...

old epoch
#

alright i'll read that thanks for the help!

daring fern
frigid blaze
daring fern
scarlet imp
#

W Klei

primal terrace
daring fern
subtle merlin
#

Played card

frigid blaze
old epoch
frigid blaze
tough temple
#

how do i make a mod icon?

daring fern
tough temple
#

thanks

blazing salmon
#

how can i make variables persist between sessions? (if you quit out of a game and then continue)
and also how can i make them reset to default at the start of a new run

red flower
#

is this for a joker?

blazing salmon
#

yes

red flower
#

anything you save in card.ability.extra (local) or G.GAME (global) gets saved

blazing salmon
red flower
#

just put it there
like G.GAME.yourvariable = value

#

i recommend adding your mod's prefix tho

blazing salmon
#

well alright, thanks

frigid blaze
#

How in parts._? Write flush five?

#

???

wise terrace
wise terrace
rigid bear
#

stupid question but how do i load in my custom deck? i just cant seem to figure it out

#

ive looked at a lot of source code but i cant seem to find what im looking for

unkempt rover
#

Someone help me pls :/

unkempt rover
rigid bear
#

yup

unkempt rover
red flower
daring fern
unkempt rover
rigid bear
#

i think im stupid

hallow slate
#

How would I trigger a sound upon the card being created?

daring fern
unkempt rover
daring fern
daring fern
hallow slate
#

Does it work when it shows in the shop?

#

It's a joker thing I wanna do

daring fern
hallow slate
#

Ohhh

tender blade
#

can anyone point to a reference mod that adds new consumable types, rarirites etc?

daring fern
tender blade
#

thank you

frigid blaze
#

Bitch, tell me why it's not working.

subtle merlin
red flower
rigid bear
#

@red flower so the issue im having is that my deck does not load onto the deck list and i cannot find what im doing incorrectly

#

but the code seems to match fine

#

heres the code if you would like to see

red flower
rigid bear
#

theres that

rigid bear
sturdy compass
#

Header spotted Ded

rigid bear
#

is that the issue?

sturdy compass
#

Not necessarily but you should be using a metadata .json instead

rigid bear
#

oh i am

frigid blaze
rigid bear
#

can i remove the steamodded thing then?

sturdy compass
#

Yes

rigid bear
#

alrighty

red flower
frigid blaze
rigid bear
#

okay header removede

#

what now?

sturdy compass
#

Also the Steamodded version you’re checking for is INCREDIBLY old

rigid bear
#

i saved and reloaded

sturdy compass
#

Steamodded is on Beta now lol

rigid bear
#

oh yea i just put that there cause it looked right

#

i dont think it contributes anything to the code

#

i will change it tho

sturdy compass
#

Likely not but it’s better safe than sorry

rigid bear
#

alright

#

i still dont know how to make my deck appear in the deck list tho

#

like when starting a new run

#

i hate lua so much

sturdy compass
#

If you click on the mods tab on the main menu, does your mod show in that menu?

rigid bear
#

yup!

#

author and everything

sturdy compass
#

And is this deck in your main file (or is it being loaded in your main file)

#

Main file being the one defined by your metadata

rigid bear
red flower
#

i mean i didnt say that would solve your problem

sturdy compass
#

In your metadata there should be a main_file parameter

frigid blaze
rigid bear
#

one second

#

forgive me

subtle merlin
red flower
sturdy compass
rigid bear
#

yea i got that once you pointed me toward that

#

i appreciate it

#

i see what needs to change now

#

i had the wrong file as the main_file it seems

#

yeesh

sturdy compass
#

Ah rip

rigid bear
#

thank you

#

ill be back if i have another issue

frigid blaze
# red flower idk

Why are you telling me it's right if you don't know how it's supposed to work?

sturdy compass
#

Damn that is some mean tude dude

#

Don’t expect people to help you if you’re gonna be like this

subtle merlin
#

Coding can be frustrating at times but you don't need to take that out on others :/

zealous glen
#

People won’t code your mod for you

red flower
rigid bear
#

@sturdy compassi got it! thank you!! just one more thing

#

i have a custom sprite for the deck (not in an atlas its a singular png)

#

how do i make the deck sprite the one i drew

#

?

sturdy compass
#

You would still need to define an atlas, even if it’s just one png

rigid bear
#

alrighty then

#

see i did not know that

#

but thats lua i guess

#

ugh

red flower
#

nah that's smods

rigid bear
#

oh what

#

ew

#

look man i dont like lua

#

adding more stuff to it makes it mor eof a headache for me

#

especially after i spent like 2 days readign the lua manual

red flower
#

ok the lua manual is trash

sturdy compass
#

Lmfao

rigid bear
sturdy compass
#

I learned just by doing stuff here and I think I’m having a pretty decent time

subtle merlin
#

FUCK YES I GOT IT

red flower
rigid bear
#

lolololol

#

thanks for making me feel better about it

#

im not the brightest but reading that manual made me feel like a neanderthal

#

it was really discouraging to read lmao

#

i was doing my best

red flower
#

yeah it's not good, thankfully it was easy for me to transition from python

rigid bear
#

yea that makes sense

subtle merlin
rigid bear
#

btw i see it everywhere and im usign one just in case

#

but whats an src file and why does every mod i see use it

red flower
hasty mist
#

is there a way to use blueprint_effect on a joker in the collection rather than in the joker cardarea

#

prob stupid question

rigid bear
#

in the mod folders i have (was using them for reference), like cryptid and some other things, they have an src folder

#

like

#

just a folder called 'src'

red flower
rigid bear
#

and it seemed important so im using one but i dont know what it means

hasty mist
#

yeah thats what i thought

rigid bear
#

its in smods too if im correct

#

this

red flower
# rigid bear just a folder called 'src'

src stands for source and it usually means the source code, it's normal for programs in general to have the code in a folder called src
but it's not mandatory and there's no special function to it

rigid bear
#

oh

#

that

#

makes more sense

#

thank you

maiden phoenix
red flower
#

shh

rigid bear
#

you guys mind looking at this and telling me whats wrong

#

i think im using atlases wrong but im not too sure

hybrid shadow
rigid bear
gentle rain
#

not understanding how to fix the ERROR message or how to change the background color

hybrid shadow
# rigid bear

atlases should have their path defined in SMODS.Atlas

rigid bear
#

whats some example syntax of this?

gentle rain
#

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

rigid bear
#

and i can put this above the code i just submitted?\

gentle rain
#

i have mine like this

rigid bear
#

oh this really helps

#

i needed an example

#

thank you

gentle rain
gentle rain
feral panther
#

No its like small text

gentle rain
#

-# yeah thats what -# does

feral panther
#

so what you do it on both sides?

gentle rain
#

no

feral panther
#

oh I see