#💻・modding-dev

1 messages · Page 499 of 1

brave blade
#

I did some looking at code, do I need to write if v:get_id() == 12 then instead?

sonic cedar
#

let me do this fix for ijiraq first though

#

high card

#

current patch

daring fern
sonic cedar
#

i am plagued forevermore

#

maybe i can fix iscariot's at least

#

dumbass 🥀 where tf is your func,,,

brave blade
#

Is there a way to ban blinds for non-challenge decks? (I'm using a regular deck because not having calculate() sucks)

candid prism
#

all i know is its possible bc deckcreator did it

sonic cedar
modern kindle
#

I should make a pr to break it

sonic cedar
#

i should kill you

modern kindle
#

Woah there pal

#

Bit aggressive

sonic cedar
#

,,,ok what if i put the table insert in a func (losing it)

modern kindle
#

Hi winterrrr

chrome widget
#

Oh yeah tomatose im curious, why are your red and blue text colors made more pastel?

sonic cedar
brave blade
daring fern
#

And yes, you put it in apply

sonic cedar
brave blade
#

Ok, sorry I was just going off of prior lua experience

daring fern
sonic cedar
daring fern
sonic cedar
sonic cedar
sonic cedar
# daring fern No.

maybe scaling causes it to go through the for loop twice? so the calculate_joker is being called twice?

#

or it's getting called once for both joker and trig?

daring fern
sonic cedar
#

maybe i reverse them?

#

no youre right that doesnt make sense

sonic cedar
#

will that work?

sonic cedar
daring fern
sonic cedar
#

ughhhhhhhhhhhhh

sonic cedar
#

like a #jokers_table

daring fern
sonic cedar
daring fern
sonic cedar
# daring fern No.

did you ask where because it could work if i put it somewhere else maybe? isaac_grin

sonic cedar
# daring fern No.

ok so calculate_joker is being called twice right

and extra_jokers_list is being set to copy_table(G.GAME.raqeffects)

so MAYBE the way things are being added to raqeffects is the issue?

#

or even the way it's being called in the calculate_joker override?

daring fern
sonic cedar
#

wait right?

#

raqeffects is only for Ijiraq's, well, effects

#

and all that goes in it are the transforming jokers' keys

#

why would all the fake jokers trigger twice if this was the issue?

#

what do you mean you dont know
that's what you said bro 😭

#

are we dementia today

jolly shadow
#

somethingcom is always delusion

frigid cargo
sonic cedar
#

somecom what exactly are you lost in

#

cause if it's reached the point where youre confused at a picture of your own message we are borderlining "cooked"

jolly shadow
daring fern
faint urchin
#

I have the following code in one of my files:
local video = love.graphics.newVideo(mod.path .. "assets/video/video.ogv")
This successfully loads the video for me but crashes the game for my friend. I am on Mac and he is on Windows so we suspect that may be the issue but does anyone know why it isn't working/how to fix?

frigid cargo
sonic cedar
sonic cedar
jolly shadow
#

somethingcom give suggestions rather than simply denying stuff challenge

sonic cedar
sonic cedar
#

i see

#

hell

#

pain lovely

sonic cedar
#

probably computer issue

subtle merlin
#

how can i make a joker retrigger other jokers?

daring fern
subtle merlin
#

enabled... what, exactly?

daring fern
subtle merlin
#

alright, set up

#

now what?

daring fern
vestal magnet
#

whats the px py for a tag atlas

jolly shadow
#

34

timid crater
#

Sorry I know I’m not a dev myself but here’s an idea for anyone who sees this. How about you make a joker just like the multiplier multiplier but instead with the same amount of jokers for points so that let’s say every king or queen in hand played gives 2x to points, I get that multiplier is for this purpose but what if bot the points and multi make it into the exponents, this at least seems interesting to me it might not to you but for anyone willing to make it please dm me.

gray void
#

I didnt quite catch it

gray void
chrome widget
#

Does the game automatically deep copy anything in G.GAME on save?

#

Okay yeah it does recursive table cull on it. I should be good

unborn bay
#

it only doesn't save tables with a object metatable

#

thats about it

chrome widget
#

Yep yep

#

I don't have objects stored here so I don't gotta worry

#

Hmm..... is there a specific benefit to using G.GAME.modifiers over just G.GAME?

#

The vanilla game typically uses the former for challenges but I'm not sure if there's any real functional benefit

vestal magnet
#

uhh how do i make the blind debuff multiple ranks

daring fern
vestal magnet
#

thanks

faint yacht
#

...I am missing something trying to set G.GAME.chips in context.before, huh.

G.E_MANAGER:add_event(Event({
    trigger = 'ease',
    blocking = false,
    ref_table = G.GAME,
    ref_value = 'chips',
    ease_to = G.GAME.chips + math.floor(G.GAME.blind.chips*card.ability.extra.leech),
    delay = 0.5,
    func = (function(t) return math.floor(t) end)
}))
G.FUNCS.chip_UI_set()
humble pawn
#

Is it possible to add an order to SMODS.score_card? so that the card added doesnt score first?

#

Here ill get a video of it

humble pawn
#

trying to get it so it doesnt score first because its causing issues

faint yacht
#

This sounds like an inverse of my Hyperlink Seal.

humble pawn
# daring fern Code?
calculate = function(self, card, context)
        if context.cardarea == G.hand and context.before then
            SMODS.score_card(card, {cardarea = G.play, full_hand = context.full_hand, scoring_hand = context.scoring_hand, scoring_name = context.scoring_name, poker_hands = context.poker_hands})
        end
    end
daring fern
# humble pawn ``` calculate = function(self, card, context) if context.cardarea == G.h...

No, remove that and put this somewhere in your file but outside the seal:

local oldsmodsscorecard = SMODS.score_card
function SMODS.score_card(card, context)
    if not G.modprefix_sealkey and card:get_seal() == 'modprefix_sealkey' and context.cardarea == G.hand then
        G.modprefix_sealkey = true
        context.cardarea = G.play
        SMODS.score_card(card, context)
        context.cardarea = G.hand
        G.modprefix_sealkey = nil
    end
    return oldsmodsscorecard(card, context)
end
#

It'll score at the correct time.

humble pawn
#

Thanks!

faint yacht
normal crest
#

try initial scoring step

subtle merlin
faint yacht
daring fern
faint yacht
daring fern
#

As long as it's not in any joker definitions or anything.

faint yacht
#

If I just do G.GAME.chips = G.GAME.chips + math.floor(G.GAME.blind.chips*card.ability.extra.leech), then it's accounted for.

split panther
#

im using this code that i modified from vanilla remade hex to destroy all jokers, how would i make the jokers also give their sell value when destroyed?

split panther
#

thanks

vestal magnet
#

how do i set/change hand amount

subtle merlin
daring fern
daring fern
vestal magnet
#

hands

subtle merlin
daring fern
subtle merlin
#

would this actually work?

wintry solar
#

That will always be false

#

37584 isn’t between 1 and 10000

subtle merlin
#

right sorry im tired

#

but if the right number was between 1 and 10000 would it?

faint yacht
#

If the == does check for a number between 1 and 10000, then yes.

vestal magnet
#

how do i force a game over

wintry solar
daring fern
faint yacht
# wintry solar Yeah that would give it a minute chance of being in the pool

As you're here, can I ask about

if context.before then
    return {
        message = localize('toga_leech'),
        func = function()
            G.E_MANAGER:add_event(Event({
                trigger = 'ease',
                blocking = false,
                ref_table = G.GAME,
                ref_value = 'chips',
                ease_to = G.GAME.chips + math.floor(G.GAME.blind.chips*card.ability.extra.leech),
                delay = 0.5,
                func = (function(t) return math.floor(t) end)
            }))
        end
    }
end

not actually having the eased chips stay put, instead being overwritten at the end? Or would I need to "ease" it first, then actually set to the desired value? 🤔

vestal magnet
daring fern
vestal magnet
#

yes

#

its a boss blind function

wintry solar
#

context.before is before the initial values are set so any changes you make will get removed

faint yacht
#

Changing to context.initial_scoring_step still did not help.

wintry solar
#

Oh

#

Those chips

#

I didn’t read fully

#

I’d need to check the code properly to see where it resets

vestal magnet
faint yacht
# wintry solar I’d need to check the code properly to see where it resets

This, per chance?

function ease_chips(mod)
    G.E_MANAGER:add_event(Event({
        trigger = 'immediate',
        func = function()
            local chip_UI = G.HUD:get_UIE_by_ID('chip_UI_count')

            mod = mod or 0

            --Ease from current chips to the new number of chips
            G.E_MANAGER:add_event(Event({
                trigger = 'ease',
                blockable = false,
                ref_table = G.GAME,
                ref_value = 'chips',
                ease_to = mod,
                delay =  0.3,
                func = (function(t) return math.floor(t) end)
            }))
            --Popup text next to the chips in UI showing number of chips gained/lost
                chip_UI:juice_up()
            --Play a chip sound
            play_sound('chips2')
            return true
        end
      }))
end
narrow pendant
#

Any thoughts as to why this is making the money popup message say ERROR?

faint yacht
#

Why not use ease_dollars(card.ability.extra.money)?

narrow pendant
#

because i forgot that existed

#

im an artsit not a coder :P

daring fern
narrow pendant
#

oh whats the money one?

daring fern
#

In the return.

narrow pendant
#

okay, thanks :)

#

love ur work

vestal magnet
faint yacht
pearl jacinth
#

how do i localize a key

#

like inputting j_joker returns "Joker"

daring fern
pearl jacinth
#

thanks

#

is there an ease_discard but for hands instead

#

i've been searching for it for a while but couldn't find it

daring fern
slim ferry
#

whats the difference between G.GAME.round_resets.ante and G.GAME.round_resets.blind_ante

formal parrot
#

Go figure

wintry solar
vestal magnet
#

how can i make this but it draws the base card sprite

wintry solar
#

Just don’t add that bit

vestal magnet
#

i don't want it to give base card chips

daring fern
slim ferry
#

what does G.GAME.banned_keys do? and does it actually work

faint yacht
daring fern
slim ferry
#

okay good, i thought it might not work properly since its unused in vanilla

real night
#

i think its used in challenge decks

slim ferry
#

oh i forgot that

red river
#

how do i get a random number from 1 to X?

red flower
#

pseudorandom("seed", 1, X)

red river
#

thanks. is "seed" supposed to be replaced with anything?

red flower
#

yes, a unique string for your effect (normally some version of the object's key)

red river
#

i see

slim ferry
#

at moderators

rotund sable
#

<@&1133519078540185692>

wintry solar
faint yacht
#

So do you imply this then?

func = function()
    G.GAME.chips = G.GAME.chips + math.floor(G.GAME.blind.chips*card.ability.extra.leech)
    G.E_MANAGER:add_event(Event({
        trigger = 'ease',
        blocking = false,
        ref_table = G.GAME,
        ref_value = 'chips',
        ease_to = G.GAME.chips + math.floor(G.GAME.blind.chips*card.ability.extra.leech),
        delay = 0.5,
        func = (function(t) return math.floor(t) end)
    }))
end
wintry solar
#

So if you do G.GAME.chips = x it updates instantly right?

faint yacht
#

Yeah, that it does.

red river
#

how do i get a numerical index of a card held in hand?

wintry solar
#

Okay this is a bit jank but I think it’ll work, keep that bit you have now, store the initial value within your joker, and set it back to the initial value in context.after

#

It might need to be set to the value after your first event too

faint yacht
#

Like so?

if context.initial_scoring_step then
    card.ability.extra.preleech = G.GAME.chips + math.floor(G.GAME.blind.chips*card.ability.extra.leech)
    return {
        message = localize('toga_leech'),
        func = function()
            G.GAME.chips = G.GAME.chips + math.floor(G.GAME.blind.chips*card.ability.extra.leech)
            G.E_MANAGER:add_event(Event({
                trigger = 'ease',
                blocking = false,
                ref_table = G.GAME,
                ref_value = 'chips',
                ease_to = G.GAME.chips + math.floor(G.GAME.blind.chips*card.ability.extra.leech),
                delay = 0.5,
                func = (function(t) return math.floor(t) end)
            }))
        end
    }
end
if context.after then
    G.GAME.chips = card.ability.extra.preleech
end

-# Sorry, my brain does NOT want to cooperate due to it being too hot still. x.x

slim ferry
#

how would i get an object's own key with prefixes? just card.ability.key?

faint yacht
#

card.config.center.key

slim ferry
#

will that get the id of the copying joker instead in the case of context.blueprint?

faint yacht
#

context.blueprint_card.config.center.key

wintry solar
faint yacht
wintry solar
#

Delete this line

faint yacht
wintry solar
#

Hmmm

faint yacht
#

...deducing from the screenshot, maybe we can postpone brainstorming of this until you can get on a PC?

wintry solar
#

Yeah good idea

tepid crow
#

Eremel do you need me to find someone to review the wiki pr?

wintry solar
wintry solar
#

there are some that you said are fine to merge that I need to get round to

faint yacht
wintry solar
# faint yacht Sort of, yeah. Assuming safety with retriggers and copies...
if context.before then
            card.ability.extra.chips = G.GAME.chips
             G.E_MANAGER:add_event(Event({
                trigger = 'ease',
                blockable = false,
                ref_table = G.GAME,
                ref_value = 'chips',
                ease_to = G.GAME.chips + 3000,
                delay =  0.8,
                func = (function(t) return math.floor(t) end)
            }))
            G.GAME.chips = G.GAME.chips + 3000
        end
        if context.after then
            G.GAME.chips = card.ability.extra.chips
        end
faint yacht
#

Does work without wanting to time it with the message and juice up of the Joker...

wintry solar
#

you should be able to use SMODS.calculate_effect alongside it

#

just set blockable to be true

#

looks a bit jank with more than one of the effects though

faint yacht
#

-# Jank go brr.

#

...I've not used that for messages yet, is it SMODS.calculate_effect({message = localize('toga_leech')}, card = context.blueprint_card or card)?

wintry solar
#

no need for card =, just context.blueprint_card or card

faint yacht
#

Bringing Blueprint in and there's the jank-

hidden notch
#

I want a Joker (or Voucher) to set the Text for the Consumable slots, I figured patching the "cardarea.lua" might be the approach to do that... The below Code works just fine without the "and G.GAME.SEMBY_Test" - But I wanna activate/deactivate that effect too...
I can't access G.GAME at this position, any other Ideas?

#-- Allow editing the card-count text for the consumeables-area
[[patches]]
[patches.pattern]
target = "cardarea.lua"
pattern = '''self.children.area_uibox = UIBox{'''
position = "before"
payload = '''
if self == G.consumeables and G.GAME.SEMBY_Test then
  card_count.nodes = {
    {n=G.UIT.B, config={w = 0.1,h=0.1}},
    {n=G.UIT.T, config={ref_table = self.config, ref_value = 'SEMBY_text', scale = 0.3, colour = G.C.WHITE}},
    {n=G.UIT.B, config={w = 0.1,h=0.1}}
  }
end
'''
match_indent = true

Relevant Joker Code:

add_to_deck = function(self, card, from_debuff)
  G.GAME.SEMBY_Test = true
  G.consumeables.config.SEMBY_text = 'Blocked!'
end
rotund sable
#

would this be how i'm supposed to add arrow key input?

faint yacht
hidden notch
#

I'd say that's acceptable honestly

wintry solar
#

yeah I don't think you can stop that unless you just tell the display not to update

obtuse wraith
faint yacht
faint yacht
wintry solar
#

oh wait I can solve this I think

#

let me try on my end first

subtle urchin
#

Is there a line for custom sound effects? Like when a joker activates itself

faint yacht
#

sound = 'modprefix_key'

wintry solar
#

@faint yacht

if context.before then
            Ortalab.wide = true
            card.ability.extra.chips = card.ability.extra.chips or G.GAME.chips
            SMODS.calculate_effect({message = 'Chips pls'}, card)
             G.E_MANAGER:add_event(Event({
                trigger = 'ease',
                blockable = true,
                ref_table = G.GAME,
                ref_value = 'chips',
                ease_to = G.GAME.chips + 3000,
                delay =  0.8,
                func = (function(t) return math.floor(t) end)
            }))
            G.GAME.chips = G.GAME.chips + 3000
        end
        if context.after and Ortalab.wide then
            G.GAME.chips = card.ability.extra.chips
            card.ability.extra.chips = nil
            Ortalab.wide = nil
        end

this works for multiple copies and blueprint

pastel remnant
#

does anyone know why this would cause a crash?

wintry solar
#

message = localize...

#

also should be localize('k_upgrade_ex')

pastel remnant
#

I'm fairly sure I'm doing that cause you need to put it in a return but that won't work here

wintry solar
#

you most definitely are not doing that

pastel kernel
#

If I’m trying to make a joker that checks for if a voucher gets redeemed specifically to do an action, what should I write in context?

wintry solar
#

there are 3 problems here, 1- localise isn't a function, it's localize, 2- localize needs a string argument to work properly with this message, 3- you must give calc_effect a table that is key-value

faint yacht
#

So for me it'd be

if context.before then
    togabalatro.loremipsum = true
    card.ability.extra.chips = card.ability.extra.chips or G.GAME.chips
    SMODS.calculate_effect({message = localize('toga_leech')}, context.blueprint_card or card)
    G.E_MANAGER:add_event(Event({
        trigger = 'ease',
        blockable = true,
        ref_table = G.GAME,
        ref_value = 'chips',
        ease_to = G.GAME.chips + math.floor(G.GAME.blind.chips*card.ability.extra.leech),
        delay = 0.8,
        func = (function(t) return math.floor(t) end)
    }))
    G.GAME.chips = G.GAME.chips + math.floor(G.GAME.blind.chips*card.ability.extra.leech)
end
if context.after and togabalatro.loremipsum then
    G.GAME.chips = card.ability.extra.chips
    card.ability.extra.chips = nil
    togabalatro.loremipsum = nil
end

?

pastel remnant
#

I don't quite understand what that wants me to do

wintry solar
#

SMODS.calculate_effect({message = localize('k_upgrade_ex')}, card)

pastel remnant
#

I find it so funny that

#

one of the bugs is

#

Didn't use American spelling

#

thank you tho

#

actually with this same joker what's the context for a joker destroyed?

wintry solar
#

context.joker_type_destroyed

pastel remnant
#

thank you

#

can I change joker to consumables (this is for mod compatibility)

red flower
red flower
wintry solar
#

I did

#

I haven't fixed it yet 🙃

#

you added it as an issue right?

red flower
#

no :3

wintry solar
#

smods discord bug reports?

red flower
#

yes

pastel remnant
pastel remnant
#

great

#

one less block of code

modern kindle
#

👋

red flower
# red flower yes

it wasn't really for me, someone else was testing it with hex and it didn't work

red flower
modern kindle
#

Hi n!

#

How are you

red flower
#

sleepy

#

wbu

formal parrot
#

Sleepygg?

modern kindle
#

Me too my eyes have just opened
And im doing that thing where one eye is open but the other is still too heavy to wake up

red flower
#

i am sleepy hi i made handy

#

anyway im beating pokermon in joker count today

modern kindle
#

Hell yea

modest dock
#

Hi, is there a context for when a card is deselected?

modern kindle
#

Im beating joyous spring in bad content today myself

red flower
red flower
modern kindle
#

Lmfao

red flower
#

im really excited to finish this update to start working on an overhaul of the mod

#

sadly that means a lot of UI

modern kindle
#

I wish you great luck

#

I really need to buckle up soon and do some shit

wintry solar
modern kindle
#

Oh that reminds me do you guys know a good way to track time in a round
Im using love timer for an ante and it starts when it notices an ante change but im not sure how to count it for time in current round for a blind

subtle urchin
#

Anybody knows if it has to be ogg, wav, mp3 or what???

red flower
manic rune
#

i think its suggested that the file is .ogg

#

🤔

#

check SMODS.Sound, its listed somewhere

red flower
#

hi bepis!

manic rune
#

hi N', hi dilly

modern kindle
manic rune
#

i drew dog today :3

modern kindle
#

Hi bepis

red flower
manic rune
red flower
#

i love when u talk to dog

modern kindle
#

I need a friend of mind to hurry up and test if a specific joker works on his pc

#

Since he runs Linux

manic rune
#

i love talking to dogs although they probably dont understand what im saying

#

:3

modern kindle
#

You know they say im a dog

subtle urchin
red flower
#

dogs understand what i say they just dont like me

modern kindle
#

Dogs love me

novel yarrow
#

joker didn't want to work for the life of me
refactored the code a 1000 times
I just had forgotten to return the values again

azure valley
#

In general, how would one change the text on a button in response to some sort of event in the engine? Specifically, a UIBox_button

subtle urchin
subtle urchin
#

ima check

red flower
#

i would copy what that function does and use a text node with ref_table and ref_value

azure valley
#

Thanks!

#

Would it be possible to simply remake the button from scratch and replace it when it changes instead?

red flower
#

probably, I just think that would be harder haha

novel yarrow
#

The program cards from Cyptid mod creates new UI

#

You could have a look there if you want

graceful vapor
#

I got it working and it took so long, and it's an entirely new consumable so I'm adding much more of them like that

brittle yacht
#

wowzers

faint yacht
#

Safe to assume Card:apply_to_run is only used with vouchers?

wicked crow
#

how can I add the rank of a card as mult?

faint yacht
#

mult = context.other_card.base.id?

novel yarrow
#

That "works" until you have to deal with face cards, which have an id higher thant 10

red flower
#

context.other_card.base.nominal?

knotty orchid
#

If I want a tag only to spawn on small blinds what variable tells which blind is next?

wicked crow
midnight coyote
#

@red flower i tried doing the lua workspace settings thing in a .luarc.json fiile in my project root but tis not playing nice

#

its just outright not processing it

#
{
  "workspace.library": [
    "/home/juniperg/.local/share/Steam/steamapps/compatdata/2379780/pfx/drive_c/users/steamuser/AppData/Roaming/Balatro/Mods/smods",
    "/home/juniperg/.local/share/Steam/steamapps/compatdata/2379780/pfx/drive_c/users/steamuser/AppData/Roaming/Balatro/Mods/lovely/dump"
  ]
}

#

so im confused

red flower
#

hmmm maybe you need a relative route? im not sure

#

i have it as relative in my folder but im also on windows so idk

midnight coyote
#

its a .luarc.json that ive placed in the project root

#

would it go in .vscode?

red flower
#

no i mean the routes for smods and the lovely dump

midnight coyote
#

hmm

#

thats gonna be confusing

#

a relative route would just be ../.local/share/...

#

because my mod folder is symlinked into the balatro mods folder

#

so i can get to it easier

#

i wonder if i could just symlink the lovely dump and smods into my home folder?

wild berry
#

im new to modding, how can i get the player's current amount of $?

midnight coyote
#

my dumbass never had a lua language server installed

#

😭

wild berry
#

k thank you

knotty orchid
midnight coyote
#

seach up lua language server

knotty orchid
#

I was using nvim, but I never questioned that I could configure the workspace

#

done it a second ago

#

😅

novel yarrow
#

I thank GOD the game isn't coded in C++

formal parrot
#

C++ isn’t even that bad

#

Lua is worse imo

modern kindle
#

any diskers in chat

rotund sable
modern kindle
#

in progress smeele

#

not as easy to test linux as im not running it and i cant be bothered to vm it, provided it cant find disks it defaults to 1 disk anyway

#

so i gotta give it to a buddy of mine

wild berry
#

why doesnt this destroy the card

red flower
#
if context.destroy_card and pseudorandom("seed", 1, 15) == 15 then
  return { message = "...", remove = true }
end
wild berry
#

ah thanks

modern kindle
#

why are you guys sobbing my goat

#

smh my head

hidden notch
modern kindle
#

if i were wise enough id love to help you, but unfortunately i am not so wise
if N or smt show up they may be able to assist you

#

im sorry i cannot be of service friend

red flower
#

i would need to read that part of the code

hidden notch
#

It's round about line 270 in the original cardarea.lua file
my patch should be applied after ~290

red flower
#

what do you want to do with the count exactly? delete it?

hidden notch
#

Overwrite it entirely (add a new text) kinda like debuffing the count ig

#

Removing it when a certain voucher or joker is around would also work

wild berry
#

im trying to make the card self destruct

red flower
wild berry
#

joker

red flower
#

destroy_card is for playing cards

#

when do you want the joker to be destroyed

wild berry
#

during its trigger

red flower
#

just write SMODS.destroy_cards(card) after it triggers

wild berry
#

gotcha

red flower
#

personally i think the easiest way is to just always replace it with your own count and just recreate the original count when you don't want it replaced

hidden notch
#

Well, if I use "if self == G.consumeables then" and then I just set the Text trough a Joker it Updates the text perfectly fine?

wild berry
#

i put it before the return and nothing happens

red flower
red flower
wild berry
#

nvm it worked now

#

thank you

modest dock
#

hey guys
ive been using this code to help to make a context whenever a card is deselected

-- from [#💻・modding-dev message](/guild/1116389027176787968/channel/1233186615086813277/)
local highlight_ref = Card.highlight
function Card:highlight(is_highlighted)
    if G.deck then
       SMODS.calculate_context{card_selected = true, highlighted = is_highlighted, card = self}
   end
   return highlight_ref(self, is_highlighted)
end

it works perfectly for both selecting and deselecting a card but i dont know how to use it to check only for deselecting a card

#

trying to make a joker which gives chips but destroys itself if a playing card is deselected

hidden notch
red flower
red flower
tepid crow
hidden notch
modest dock
red flower
modest dock
ivory citrus
#

Hello, does anyone know if there is a context that is activated each every time a card changes suit?

red flower
#

its different

modest dock
#

Wait u right my bad
Let me check

red flower
ivory citrus
ivory citrus
candid prism
#

working on a joke shitty jokerforge mod and we got harrison

formal parrot
#

Amd

wintry solar
floral narwhal
#

how can i play music when a special booster kind is opened? i know what i have to do my problem is how can i use special booster kind

tepid crow
sonic cedar
#

what the peak

#

good shit Lars

tepid crow
#

🫡

#

Now to wait for the next user in modding-chat to somehow misread parts of it

brave blade
#

Is there a way for me to inject into an SMODS function?

red flower
#

yes, hooking

brave blade
#

I know I can hook/inject into functions, I'm just checking if I can do it for non-vanilla functions

wintry solar
#

you can patch smods files too

iron burrow
#

When balatro creates consumables for the shop (outside of boosters), does it store them in the shop_jokers object?

This is from update_shop() in game.lua.

if not shop_exists then
    if G.load_shop_jokers then
        nosave_shop = true
        G.shop_jokers:load(G.load_shop_jokers)
        for k, v in ipairs(G.shop_jokers.cards) do
            create_shop_card_ui(v)
            if v.ability.consumeable then v:start_materialize() end
            for _kk, vvv in ipairs(G.GAME.tags) do
                if vvv:apply_to_run({type = 'store_joker_modify', card = v}) then break end
            end
        end
        G.load_shop_jokers = nil
    else
        for i = 1, G.GAME.shop.joker_max - #G.shop_jokers.cards do
            G.shop_jokers:emplace(create_card_for_shop(G.shop_jokers))
        end
    end
    ...
short girder
#

can i use ownership by kind for a consumable type or is it booster exclusive?

brave blade
#

What does the scored_card field do in get_card_areas()? Is that just what gets animated when the context is calculated?

red flower
daring fern
brave blade
#

Wait, is it purely aesthetic or does it actually affect the card? I assumed it's only aesthetic because the "scored_card" field in blind calculation seems to refer to the blind's texture

iron burrow
brave blade
#

What should I put as my patch target if I want to inject into SMODS' utils.lua? Is it just utils.lua or does it need some kind of file path?

brave blade
#

Wait, like this?

daring fern
brave blade
#

So it needs to be target = '=[SMODS _ "src/utils.lua"]'?

brave blade
#

Ok got it, thanks

short girder
#

hey folks. so i was updating my mod after having published the repo for it, and the mod just. isn't in the list anymore. what could be causing this?

short girder
#

yeah!

#

one of my guesses was the "smods.find_mod", which could be messing with things (since i dont have cryptid when testing the base mod)

daring fern
short girder
#

im going to try updating smods (though that wasnt an issue before, it could be now)

#

im also going to try to turn on cryptid, will return with more results

#

mod still isn't appearing

#

let me send the json real quick

#

json file

#

if anything else is needed ill gladly send it

#

because im really confused. the mod is still in the folder, it even appears in Balatro Mod Manager as a local mod

#

it also appears "enabled", despite not even showing up

wild berry
#

is there a function / variable to check the played hand type

daring fern
short girder
#

check obelisk in vanilla remade

#

yeah that

wild berry
short girder
#

last test im going to do: gonna try and put the cryptid exclusive consumables as comments to see if the mod appears

brave blade
#

Can anyone help me out? I'm trying to add a custom rule that allows for a calculate function in challenge decks, but I'm getting this crash that seems to happen at a short interval after blind is selected (I'll send code in a moment)

#

Here's my code

daring fern
# brave blade Here's my code
local oldsmodsgetcardareas = SMODS.get_card_areas
function SMODS.get_card_areas(_type, _context)
    local output = oldsmodsgetcardareas(_type, _context)
    if _type == 'individual' then
        if G.GAME.modifiers['calculate_context'] then
            local fake_deck = setmetatable({}, {
                __index = center,
            })
            function fake_deck:calculate(context)
                return putcalculatefunctionhere
            end
            output[#output+1] = {
                object = fake_deck,
                scored_card = G.deck.cards[1] or G.deck,
            }
        end
    end
    return output
end
proven adder
#

does anyone know how to detect re triggers? I've looked at cryptid's candy cane and the code did not help at all

daring fern
brave blade
proven adder
daring fern
# proven adder how? please
[[patches]]
[patches.pattern]
target = '''=[SMODS _ "src/utils.lua"]'''
pattern = '''effect.message = effect.message or (not effect.remove_default_message and localize('k_again_ex'))'''
position = "after"
payload = '''
effect.extra = {func = function() SMODS.calculate_context({modprefix_card_retriggered = true})}
'''
match_indent = true
``` And use `context.modprefix_card_retriggered`
brave blade
brave blade
#

Unless I'm misunderstanding, you're defining the function inside of get_card_areas, which means it's hardcoded to that specific function

brave blade
#

Yeah I think I did misunderstand hold on

#

Can I define the calculate() function within my challenge deck and then have the calculate_context rule return the calculate() function for my current challenge deck?

daring fern
brave blade
#

Is the entire contents of the SMODS.Challenge entry stored in the save file?

daring fern
#

The rules are because their stored in G.GAME.modifiers

#

Which is in G.GAME so it gets saved.

brave blade
#

What I want to know is, can I do something like this? (I know current_challenge_deck isn't correct, I'm just using it as a placeholder to describe what I mean)

ivory citrus
daring fern
daring fern
ivory citrus
#

--Metamorphosis
SMODS.Atlas{
key = 'trans',
path = 'trans.png',
px = 71,
py = 95

}

SMODS.Joker {
key = 'trans',
unlocked = true,
blueprint_compat = true,
rarity = 2,
cost = 5,
loc_txt = {
name = 'Metamorphosis',
text = {
'Gives {C:mult}+#1#{} Mult for each',
'card that change its {C:attention}suit{}',
'{C:grey}(currently {C:mult}+#2#{}{C:grey}){}'
}
},
atlas = 'trans',
pos = { x = 0, y = 0 },
config = { extra = {
mult = 0,
mult_add = 4
}},
loc_vars = function (self,info_queue,center)
return{vars = {center.ability.extra.mult_add, center.ability.extra.mult}}
end,
calculate = function(self, card, context)
local ref = Card.set_base
function Card:set_base(card, initial)
if self.playing_card and self.base then
local new_rank = card and card.value and SMODS.Ranks[card.value] and SMODS.Ranks[card.value].id
local contexts = {}
local function table_add(t1, t2)
for i,v in pairs(t1) do
t2[i] = v
end
end
local function get_table_length(t)
local i = 0
for , in pairs(t) do
i = i + 1
end
return i
end
end
end
end
}

daring fern
#

Also move it outside of the joker.

#

Also please wrap your code around:
```
-- Code Here

brave blade
daring fern
ivory citrus
daring fern
brave blade
#

How do I get a challenge object from its id?

#

(Like c_modname_challengename)

daring fern
rotund sable
#

how would i useSMODS.Font in a text node?
because rn im doing:

{n=G.UIT.T, config={text = "➡︎", font="EF_NotoEmoji", scale = 0.8, colour = G.C.UI.TEXT_LIGHT, shadow = true}}

and it crashes with:

#

the font file is being loaded and doing eval on SMODS.Fonts returns:

maiden phoenix
#

try font = SMODS.Fonts.EF_NotoEmoji ?

#

I have 0 clue never used fonts

rotund sable
short girder
rotund sable
#

are you sure the json is correct

short girder
#

i sent the json

short girder
rotund sable
#

didn't notice

short girder
#

if it's wrong then ill fix it but quite literally the only thing between yesterday and today was that i added the code consumables and it broke

rotund sable
#

it's the version

#
"version": "1.0.0", // ! Must follow a version format of (major).(minor).(patch)(rev). rev starting with ~ indicates a beta/pre-release version.
#

from the docs

short girder
#

oh,

#

didnt see that when making it

#

gotcha, thanks

#

also

#

this code is giving an error (apparently take_ownership_by_kind is a nil value)

#

is there no other way of doing this other than copying and pasting this into EVERY single ticket consumable?

vague crest
#

im using context.post_trigger to scale another joker, how would i make it so it only scales if the leftmost joker triggers?

short girder
#

consider checking brainstorm in vanilla remade, quite sure it has what you're looking for

vague crest
#

i know how to do that bit, just not sure how to like, connect it to the post trigger criteria

daring fern
short girder
#

oh gotcha

#

thats what i was confused, if it was ConsumableType or consumable

daring fern
#

take_ownership_by_kind is only for boosters.

short girder
#

so you'd do?

daring fern
#

Also dollarReturn dollars and cost all don't exist.

misty radish
#

Can someone please give me an entropy save file with the tutorial completed?
He crashes my game and I can't escape him

short girder
#

returns true when a certain voucher is redeemed

daring fern
short girder
vestal magnet
#

how do i make it so a specific enhancement isn't given out by spectral packs (when familiar/grim or other cards are used)

daring fern
#

And just use global.Ticket instead of SMODS.Consumable

daring fern
vestal magnet
#

thx

short girder
proper relic
glass crown
#

whats the best way to detect what deck the player is using?

daring fern
daring fern
glass crown
#

thank you!

short girder
daring fern
short girder
#

oh

daring fern
# short girder oh

You have to do SMODS.calculate_effect({dollars = card.cost / 2}, card)

flint sparrow
#

hey, im currently working on a meme mod for myself and a few of my friends. this is the first time im doing anything like this, i'm not fluent with lua (or any coding language lol). im trying to make a joker that functions identically to space joker, but it only levels up full house when you play it and im not sure how to start with that any help is appreciated :)

short girder
#

this boy is crashing. ticketRate is another globally defined value, so it exists. here's the error code

daring fern
chrome widget
#

how do you use variable colors for backgrounds in localization text, if possible?

chrome widget
#

cool

pure salmon
#

do playing cards have some sort of unique index or identifier?

lost current
pure salmon
#

which value is that? just need to use it for a variable for playing multiple of an enhancement

daring fern
glass crown
#

is it possible to have a consumable type not show up in the collection?

glass crown
#

how would i go about that?

daring fern
glass crown
#

thank you!

jolly shadow
#

im trying to make a joker that turns unplayed aces in hand into steel cards & this doesnt work what should i change

flint sparrow
vague crest
#

is there an easy way to make this show the normal numbers as a fallback? it doesnt show anything unless it's also showing the compatible sign

vague crest
wintry solar
#

context.individual and context.cardarea == 'unscored'

#

OH UNPLAYED

#

nvm

daring fern
wintry solar
#

good god no

#

that's better

#

don't you question mark react me

daring fern
flint sparrow
daring fern
#

Also remove if self.debuff then return nil end because that does nothing.

vague crest
#

new question since i figured out the last one, when doing repetitions it returns this in the console because i have a joker which copies other jokers in order to find out when they do that kind of trigger, but it doesnt actually copy the joker

#

is there a way to make those not appear?

flint sparrow
daring fern
vague crest
#

this is what im working with

jolly shadow
vague crest
#

uhhh could juice up the card

flint sparrow
daring fern
vague crest
#

something like that i think?

daring fern
vague crest
#

i mean if i return ret itll copy that joker right?

brave blade
#

Can someone remind me where I set challenge rule descriptions? I can't find it on the wiki

flint sparrow
vague crest
#

i dont want it to, im just having it check when a joker triggers in order to gain mult

daring fern
#
SMODS.current_mod.optional_features = function()
    return {
        post_trigger = true
    }
end
vague crest
#

wouldnt post trigger also trigger for when a joker scales? thats what i was using before but i ran into that issue

#

like every time you played a 2 wee joker would trigger it

daring fern
slim ferry
#

you can check for the source trigger of whatever context.post_trigger triggered from

#

iirc

vague crest
#

this is what im going with

daring fern
short girder
slim ferry
daring fern
vague crest
#

i guess im more looking for when a joker returns something then

daring fern
vague crest
#

my definition of a trigger for the purpose of the joker was just anything that blueprint would copy

short girder
#

oh

vague crest
#

because that lets me add a compatible incompatible thing too which is nice

daring fern
short girder
#

so it has to be my mod prefix thing? like i have to put NotVanilla.Tickets?

vague crest
#

ok i guess thats not what im looking for then

daring fern
slim ferry
ivory citrus
daring fern
#

Like this:

proper relic
slim ferry
#

its just the return table?

#

which

#

doesnt say everything most of the time

daring fern
daring fern
proper relic
#

I dunno what's going on in here but I approve of the ❓ spam

slim ferry
#

like anything other than this you cant see from that?

ivory citrus
short girder
slim ferry
#

because other stuff doesnt go in the return table

daring fern
short girder
#

oh

#

okay!

daring fern
slim ferry
#

its just the return table

#

literally how would this help telling you what a joker does for the purposes of only triggering on certain joker effects

#

or this

#

anything that isnt a pretty basic scoring effect will just return a message

slim ferry
#

and the original point was to not have a context.post_trigger thing trigger on scaling

short girder
# daring fern No, that's correct.

also, the tier 2 voucher is appearing regardless of me having the tier 1 voucher or not. is this supposed to happen? (the requires might be formatted wrong, idk)

slim ferry
#

and you cant really detect scaling with context.other_ret

vague crest
#

i will say the joker works perfectly gameplay wise with how i want to rn ! the only issue is that it puts weird messages in the console with repetitions specifically

#

uh not necessarily

#

itd also work with like, hallucination

short girder
slim ferry
#

doesnt sound like it

#

imo

daring fern
slim ferry
#

can you actually say things instead of just question mark reacting everything

vague crest
#

well i mean it does work with hallucination rn

slim ferry
#

cool

slim ferry
#

you cant make it not work only on specifically scaling effects

#

at least not easily

vague crest
#

unfortunate

ivory citrus
#

Someone told me I was overriding Card:set_base, but I don't know how I'm doing it.

daring fern
short girder
daring fern
short girder
#

otherwise dollarReturn just sits there at false

daring fern
#

Because that value will reset if you reload.

short girder
#

oh shit didnt know that

daring fern
#

Also if it's the sell value it would be card.sell_cost instead of card.cost

short girder
daring fern
short girder
#

oh that's much easier than what i did

vague crest
#

if i do use post trigger, how would i check to make sure it's the leftmost joker?

daring fern
short girder
#

like im pretty sure this wouldn't work

vague crest
#

yep i was confused

#

hm yeah its less buggy than the other implementation but isnt really at allwhat im looking for

#

ill ponder

wintry solar
#

what're you trying to do?

wild escarp
#

Where is the rarity of a joker stored?

jolly shadow
#

joker.config.center.rarity

sonic cedar
#

can i check for if G.jokers so my joker wont crash trying to render nil localization in the collection?

sonic cedar
#

now would it be if G.jokers or do i need the cardarea and cardarea etc

sonic cedar
sonic cedar
#

ok i thought so

misty radish
#

How could I delete the "New Run" button when you're in a game and you press Esc? There's a bug where it crashes the game when you click anything in Galdur on that specific menu in my modpack and I'd like to just disable it entirely because I keep forgetting and click it.

proven adder
#

is it possible to have a deck start with an eternal card? I'm using cavendish for the joker, and it summons, but isn't eternal, and literally nothing I try works.

daring fern
#

Remove everything except the event and do: ```lua
if not G.jokers then return false end
SMODS.add_card({key = "j_cavendish", stickers = {"eternal"}})

proven adder
#

thanks so much! appreciate the help!

sonic cedar
#

even when i reset the unlock, the card continues to already be unlocked on launch? i even ran an eval, and it returned wheel_fails as 0? so it shouldnt unlock?? and yet every time i open the game after setting the unlock state to false it's unlocked???

#

"what are you trying to do?" Unlock condition of failing WOF 3 times in a row

#

had a working version before using ownerships, but that shouldnt be necessary now that there's a probability calculation function expansion

chrome widget
#

What's the unlock behavior look like on the card itself?

sonic cedar
#

?

chrome widget
#

also mind you you're checking if not ret then which means that it'll reset G.GAME.wheel_fails when the wheel of fortune fails instead of succeeds

sonic cedar
chrome widget
#

The check_for_unlock function on the center, or the unlock_condition property

tiny hemlock
#

Hi everyone can someone give me an example of smods.Challenges? (Like a template for making the balatro challenges yk)

slim ferry
#

look at vanilla remade

chrome widget
#

replace that whole block with return args.type == 'hpfx_nope'

sonic cedar
#

really? What’s the dif?

chrome widget
#

you shouldn't use unlock_card(self) in the center function, the SMODS behavior calls it for you based on if the function returns true or false

#

regardless I think with all these fixes you just need to reset your profile

#

Since you can't relock already unlocked/discovered cards without doing so (or manually removing them in some other code)

sonic cedar
#

Im just resetting it with the shorty systems thing

chrome widget
#

and the center has both discovered = false and unlocked = false?

sonic cedar
#

well yeah ofc
I’ll try your fix

sonic cedar
#

cause I haven’t had to do this

#

or is it “old” but because of how this unlock works

chrome widget
#

It's not that you can't, but it just means it's ignoring the framework given to you

#

makes the code less readable if it's not following the API standard

sonic cedar
#

I see
should I do this for all of them then?

chrome widget
#

Personally yeah

sonic cedar
#

Alrighty

#

Fix time then

chrome widget
#

Otherwise if it's giving an unlock pop up every time you reset your profile, it means that the unlock type is being sent more often than you think

#

if it doesn't and it's already unlocked with no fanfare, then your profile isn't being reset correctly

pure salmon
#

why do ALL played cards with this enhancement get the probability boost when any one of them fails?

chrome widget
#

you're setting self.config (the center's config) instead of self.ability (the instanced copy of the config on the card)

#

use self.ability in general

pure salmon
#

i remember trying that on some other enhanced card and it was causing issues

chrome widget
#

Could be a different use case or an unrelated bug

sonic cedar
chrome widget
#

regardless, change all instances of self.config in that screenshot to self.ability and it'll work

chrome widget
pure salmon
#

yeah that's what i expected

sonic cedar
chrome widget
pure salmon
#

works fine with self.config

#

all these variables exist, the self.ability table does not

chrome widget
#

oh wait, i'm a moron. you should be using card.ability in all of these cases

pure salmon
#

oh shit yea

chrome widget
#

self is the center, not the instanced card

#

(sometimes get turned around b/c the vanilla functions inherently use self where it does actually refer to the card, in functions on the Card table)

#

(in SMODS api functions it generally does not, it calls the functions from the center defintion where self is not an instance, and then passes in the instance as card)

wild escarp
#

Anyone know why this doesn't seem to set card.ability.extra.improved to true? I'd like to have the card behave differently when three or more jokers of this particular rarity are owned. The alternate behaviour does work fine if I set improved to true, but this code can't do that apparently.

if G.Jokers and not context.blueprint then
  local organs = 0
  for i = 1, #G.jokers do
    if G.jokers.cards[i].config.center.rarity.key == "willatro_organ" then
      organs = organs + 1
      if organs >= 3 then
        card.ability.extra.improved = true
      else
        card.ability.extra.improved = false
      end
    end
  end
end
chrome widget
#

for i = 1, #G.jokers do should say for i = 1, #G.jokers.cards do

daring fern
chrome widget
#

alternate more concise code:

if G.jokers and not context.blueprint then 
    local organs = 0    
    for _, v in ipairs(G.jokers.cards) do
        if v.config.center.rarity.key == 'willatro_organ' then organs = organs + 1 end
        card.ability.extra.improved = (organs >= 3)
    end
end```
sonic cedar
chrome widget
#

wheel of fortune key is c_wheel_of_fortune

thorn furnace
#

How do I check a time variable? I want to make a pulsing effect

sonic cedar
chrome widget
#

oh I see right cause this is from probability vars

#

(funny because im the one who wrote that code)

sonic cedar
#

winter 😭

#

yes im hooking into the probability function

chrome widget
#

okay so this is the current defintion for pseudorandom_probability

function SMODS.pseudorandom_probability(trigger_obj, seed, base_numerator, base_denominator, identifier)

#

are you using the vars for the wrong function?

#

seed is the second argument, and identifier is the fifth argument that you don't have

neat leaf
#

I'm trying to adapt the Better Tags mod but after a long while of combining cat tags it starts to lag really bad. I'm trying to diagnose that lag, but it doesn't seem to be anything obvious.

chrome widget
#

where is this?

sonic cedar
#

there's two lsp definitions for the function

chrome widget
#

I only see these two

---@param base_numerator number
---@param base_denominator number
---@param key string|nil optional seed key for associating results in loc_vars with in-game probability rolls
---@param from_roll boolean|nil
---@return number numerator
---@return number denominator
--- Returns a *`numerator` in `denominator`* listed probability opportunely modified by in-game effects
--- starting from a *`base_numerator` in `base_denominator`* probability. 
--- 
--- Can be hooked for more complex probability behaviour. `trigger_obj` is optionally the object that queues the probability.
function SMODS.get_probability_vars(trigger_obj, base_numerator, base_denominator, key, from_roll) end

---@param trigger_obj Card|table
---@param seed string|number
---@param base_numerator number
---@param base_denominator number
---@param key string
---@return boolean
--- Sets the seed to `seed` and runs a *`base_numerator` in `base_denominator`* listed probability check. 
--- Returns `true` if the probability succeeds. You do not need to multiply `base_numerator` by `G.GAME.probabilities.normal`. 
--- 
--- Can be hooked to run code when a listed probability succeeds and/or fails. `trigger_obj` is optionally the object that queues the probability.
function SMODS.pseudorandom_probability(trigger_obj, seed, base_numerator, base_denominator, key) end```
#

in smods/lsp_def/utils.lua at around line 600

#

genuinely no idea where you're getting that

sonic cedar
#

now i dont know 😭

chrome widget
#

There is an error that the lsp_def calls it key instead of identifier but it's benign, and they're in the same location

#

Either way, your function should be this:
function SMODS.pseudorandom_probability(trigger_obj, seed, base_numerator, base_denominator, identifier)

and your check should be
if (identifier or seed) == 'wheel_of_fortune' then

#

Or whatever you want to name the variables. Doesn't matter

daring fern
#

How does one show extra decks on the Deck View menu?

sonic cedar
#

where the hell am i getting this from

#

is it
pulling from get_probability_vars??

#

its whatever i guess
ill just fix it and move on

thorn furnace
thorn furnace
#

Thanks dance

#

Wait
Colours are just float arrays
Nvm CoroboLaugh

sonic cedar
#

😭

thorn furnace
#

I forgot I can just write a colour lerp function

sonic cedar
#

did you literally mean "(identifier or seed)"

#

or did i interpret right and i was supposed to choose

wind steppe
#

how do i add icons to a mod

rapid stag
#

assets/<res>/modicon.png

neat leaf
#

Does there need to be a delay between save_run() and G.FUNCS.go_to_menu() to ensure the save file gets written?

rotund sable
#

If you mean the icon in the mod menu

normal crest
#

I suspect it's just the seed

normal crest
#

In card.lua

ivory citrus
#

Helo

normal crest
#

Hola

ivory citrus
#

Hola

#

Una oregunta

#

sabes si es obligatoria poner todo en main.lua

sonic cedar
ivory citrus
#

o puedo crear más archivos

normal crest
normal crest
sonic cedar
sonic cedar
sonic cedar
#

shoot

ivory citrus
#

what is the name of the balatro programming language, when I tried to read the code I didn't understand anything.

chrome widget
#

Lua

normal crest
#

5.1

chrome widget
ivory citrus
novel yarrow
#

How can I get the value of the biggest discarded card?

ivory citrus
novel yarrow
#

I know about context.other_card.base.nominal but how'd go about iterating the cards, maybe a for loop?

sonic cedar
#

finally I_CAN_FINALLY

chrome widget
sonic cedar
#

since im using return

red flower
chrome widget
#

The unlock descs should def be more human readable no?

sonic cedar
red flower
#

i think the comment at the bottom is clear

chrome widget
#

okay fair, "human readable" usually just means "something that doesn't look like code"

#

Yeah the desc should just be Nope! on Wheel of Fortune 3 times in a row

novel yarrow
#

Thank ya!

sonic cedar
#

the whimsy winter stare dont tell me youve forgotten the whimsy

#

i didnt have any grip ones

thorn furnace
#

If I wanted to check if a blind was beaten in one hand, would I just do G.GAME.current_round.hands_played == 0 or will it have updated to 1 by the time I make that check

chrome widget
#

I think it'd be 1 by that point

thorn furnace
#

Okii
Thank u

modern kindle
thorn furnace
#

True

sonic cedar
short girder
#

does SMODS.add_card({ set = 'set', edition = 'edition'}) work?

sonic cedar
sonic cedar
#

Do dynamic descriptions support randomization? Like if i wanted to do a probability thing each time i hover over the card, and the success will have the line say one thing otherwise it'll default to something else? I know i can do this (image), but that's guaranteed as long as you possess the card

short girder
#

you could do a local variable with pseudorandom

#

and check if the variable is 1 or 2

sonic cedar
#

true...

short girder
#

local locRandom = pseudorandom('blahblahblah',1,2)

#

and then in the loc_txt you could check

#

if locRandom == 1 then
text = ""
else
text = "...?"
end

#

actually

#

hear me out

sonic cedar
#

would returning locRandom = 1 and "...?" or "" also work

short girder
#

table

#

local table

#

and you randomize the element that it picks from

#

and declare that

#

hold on let me write the code

sonic cedar
#

why would i need all that for a choice between two lines bro 😭

short girder
#

because then you only need to write #1#

#

and the randomization does itself

#

actually i didnt put it in a string

#

put both in a string

#
    loc_vars = function(self,info_queue,center)
        return{vars = {descRandom[pseudorandom('blahblahblah',1,2)]}}
    end,```
#

if it returns an error please let me know but it's not supposed to

sonic cedar
short girder
#

yeah but now it's random

#

you wanted it random right

#

also

short girder
#

do we have a context for that

#

@daring fern do we have a context for that (my apologies for the ping)

#

didnt find anything in the wiki

red flower
short girder
short girder
daring fern
sonic cedar
red flower
#

yes

sonic cedar
#

ah

short girder
#

yeah!!!

#

okay so like my code would work

sonic cedar
#

yeah

short girder
#

thanks you 2

sonic cedar
#

i was just saying i dont need all that if it's just a one or the other lmao

short girder
#

i feel ya i feel ya

#

just thought loc_vars didnt handle what ya wanted

sonic cedar
#

same lmao

#

thanks you 3

thorn furnace
#

How do I change the colour of dynatext

manic rune
#

colour = {G.C.RED} in config

thorn furnace
#

Not colours?

sonic cedar
#

-# omg bepis hiiiiiiiiiiiiii

sturdy compass
#

boo

manic rune
#

uhh i dont think so 🤔

thorn furnace
#

Okii

manic rune
sonic cedar
#

-# and astra too i guess 🙄

sturdy compass
#

-# ugh toma's here...

sonic cedar
#

-# ughhhhhhhhh

sturdy compass
#

this bit already sucks lmfao

sonic cedar
#

horrible lmao

#

hi astra

turbid field
#

Hey, just wondering if anyone else knows how to achieve this with SMODS code, I asked Victin but he never responded...

#

Basically I just want to selectively make a scored card skip the "already played/discarded" void and go right back into cards held in hand

sturdy compass
#

helo tomato glagglegreeting

thorn furnace
chrome widget
#

@red flower did you reimplement G.C.DARK_EDITION as an SMODS Gradient for VanillaRemade?

sturdy compass
thorn furnace
#

and now nothing happens again SALADWENTBAD

chrome widget
#

aight

thorn furnace
short girder
thorn furnace
#

context.scoring_hand?

short girder
#

table

sonic cedar
#

context.scoring_hand

short girder
#

so do i just do local cardThing = context.scoring_hand[1]?

sonic cedar
#

thatd be the first card

short girder
#

yeah i want the first scoring card

sonic cedar
#

done

#

that's it

short girder
#

oh gotcha

#

also whats the table for all played cards

#

like cards that were already played

thorn furnace
#

context.full_hand?

#

oh

#

Like cumulatively?

short girder
#

yeah like i want all cards that have been played in a round

thorn furnace
#

I think you might need to make that manually

#

I was gonna say "maybe the discards deck" but that includes discards

short girder
#

actually the discards deck would work

#

because im fetching the first played scoring card in a hand and logging it

#

and then trying to find it in the already played cards deck

#

since it only logs whenever a hand is played i can use that

thorn furnace
#

so you're fine with it also counting cards you've discarded and not just cards you've played?

short girder
#

yeah

thorn furnace
#

in that case it's just G.discard.cards

short girder
#

gotcha

daring fern
thorn furnace
#

o i typo'd

#

thanks

void quest
#

Is there any way to track score

#

Im asking cuz my friend dosent know and im ass at code 💔

thorn furnace
sonic cedar
#

didnt bepis answer that already

thorn furnace
#

it didnt work

short girder
#

yeah no im not doing this shit

sonic cedar
#

what happened bro 😭

short girder
#

someone much more skilled than me is gonna code this guy's joker

sonic cedar
short girder
#

i cant create infinite local variables and destroy every instance in the deck of the cards listed in those local variables and then create them again

thorn furnace
# sonic cedar maybe you did it wrong
ALLOY.total_health = G.GAME.health + G.GAME.shield
    if ALLOY.total_health < normal_min_health then
        health_text_UI.config.colour = health_negative
    elseif ALLOY.total_health > G.GAME.health_max then
        health_text_UI.config.colour = health_shielded
    else
        health_text_UI.config.colour = health_normal
    end
thorn furnace
short girder
#

and then i destroy every card for all indexes in the table

#

how did i not think of that

sonic cedar
wind steppe
manic rune
thorn furnace
#

o true

manic rune
#

-# sorry im in class en

#

rn*

thorn furnace
manic rune
#

true...

short girder
thorn furnace
manic rune
#

weird

short girder
#

there's probably something more i need to do

manic rune
#

im, half certain changing colour should update the DynaText automatically