#đŸ’»ăƒ»modding-dev

1 messages · Page 139 of 1

frosty dock
#

card.ability

candid epoch
#

john smods came into the chat

long sun
#

i mean, granted, Creates

faint yacht
#

I am quite hasty, I will admit. đŸƒâ€â™‚ïž

frosty dock
#
loc_vars = function(self, info_queue, card)
        return {
            vars = {
                card.ability.extra.mult,     -- Current multiplier
                card.ability.extra.multmod  -- Multiplier per dollar
            }
        }
    end,
vocal verge
candid epoch
#

"creates" and "create" is not the same in the grammar

vocal verge
#

Base it on the jokers

#

not the seals

long sun
vocal verge
#

no i know

long sun
#

that implies the planet is random

zealous glen
#

why is he black and white 😭

plain apex
vocal verge
#

so just change that to Mercury or whatever hte pair is

zealous glen
#

Cool art tho

long sun
#

but you can do it with Two Pair / etc. too

vocal verge
#

Create a Mercury card if poker hand contains exactly 2 Aces

plain apex
long sun
plain apex
#

me when im stupid lol

vocal verge
long sun
frosty dock
#

also

self.config.extra.mult = mult

is just as wrong

vocal verge
#

oh wait

#

dumb

candid epoch
zealous glen
#

I’d word it as

When you play a hand containing exactly 2 Aces, create its Planet card
But it’s not necessarily thunk wording

frosty dock
#
local multmod = card.ability.extra.multmod
        local mult = multmod * math.max(0, dollars)  -- Ensure multiplier does not go below 0
        card.ability.extra.mult = mult -- Store the calculated mult
zealous glen
candid epoch
zealous glen
#

Blind people aren’t in greyscale 😭

long sun
#

it's to distinguish it from the other jokers ^^

vocal verge
#

eh?

long sun
#

otherwise it's Cool Jimbo

zealous glen
candid epoch
zealous glen
vocal verge
#

maybe he's from Grayscalia

candid epoch
zealous glen
vocal verge
#

infrared is purple

zealous glen
#

Glass?

vocal verge
#

my phone told me

#

glass is technically green

zealous glen
#

Depends on the glass I guess

vocal verge
#

or rather, it's technically a very very very minor color

#

because it'll still affect the light, just not noticeably

candid epoch
#

⭐ transparecy ⭐

zealous glen
vocal verge
#

my brain isn't braining

#

my brain brained, miku says miku

zealous glen
#

miku

sick sparrow
#

teto

#

tetorisu

#

tetris

vocal verge
zealous glen
vocal verge
#

i am

zealous glen
#

The cards look like they’re becoming Bonus immediately

#

Maybe it’s just the speed

#

But Midas avoids it

vocal verge
#

ah i see where i went wrong

#

don't need the event manager to play a sound without delay

#

miku crashed my game

zealous glen
#

In the return table

#

Not sure

wintry solar
#

Only if it’s with a message

vocal verge
#

ok well

#

how would I go about flipping played hand here

#

trying to do it like ouija/sigil

faint yacht
dim steeple
vocal verge
#

i'm flipping cards
Just

sick sparrow
#

card is composed of front, center, back

faint yacht
#

Flip the context.scoring_hand cards... you may want to also "chain" a bunch of events... flipping the cards first, then set the ability, then flip the cards again.

merry raven
# dim steeple

Holy shit that's incredible
Say I got a few questions about shaders, there are rotations and scales that you can modify, but what about transparency? Does draw_shader support it? I want to do fade in and fade out animations

faint yacht
vocal verge
#

entirelyp ossible i'm just beign dum

stiff locust
wintry solar
#

What context are you using?

stiff locust
#

flipping all the wrong cards

#

might be my new favourite thing

faint yacht
vocal verge
#

oop

#

nvm, no oop

wintry solar
#

Well yeah it says G.hand.cards to flip

#

Not play

vocal verge
#
                local percent = 0.85 + (i-0.999)/(#G.hand.cards-0.998)*0.3
                G.E_MANAGER:add_event(Event({trigger = 'before',delay = 0.15,func = function() G.scoring_hand.cards[i]:flip();play_sound('tarot2', percent, 0.6);G.scoring_hand.cards[i]:juice_up(0.3, 0.3);return true end }))
            end```

it's from ouija, i assume something isn't right here fo rwhat i need to do vs what it does
#

I shouldn't have gotten high

runic pecan
#

Is there really no G.C.PINK?

#

Can I define a colour myself?

#

Wait, I CAN PATCH.

frosty dock
#

you don't need to patch

vocal verge
#

got it to flip the right cards

dim steeple
merry raven
#

How do I add them? Where do I start?

dim steeple
wild patrol
#
--- MOD_NAME: Yu-gi-oh Card
--- MOD_ID: Yugioh
--- MOD_AUTHOR: [elial1]
--- MOD_DESCRIPTION: An example mod on how to create Jokers.
--- PREFIX: xmpl
----------------------------------------------
------------MOD CODE -------------------------

SMODS.Booster = {
    name = "Yu-Gi-Oh Cards",
    slug = "t_yugioh",
  cost = 4,
  config = {},
    pos = {},
  discovered = false,
  weight = 1, 
  kind = 'Standard',
  atlas = 'con'
}```
#

making sure doing this right

#

slug = "t_yugioh", is meant to be the picture for the pack

dim steeple
#

sort out your indentation first for readability

worthy stirrup
#

why does this cause a crash?

SMODS.Keybind{
  key = 'PlayCards',
  key_pressed = '-',

    action = function(self)
        if G.hand and #G.hand.highlighted ~= 0 and G.hand.discards_left ~= 0 then
        G.hand:discard_cards_from_highlighted()
    end
  end
}
worthy stirrup
#

ill grab the crash log in a sec

frosty dock
#

first of all delete the = in the SMODS.Booster line

#

you're assigning to the SMODS.Booster class instead of calling it's constructor

worthy stirrup
frosty dock
wild patrol
#
    name "Yu-Gi-Oh Cards",
    slug "t_yugioh",
    cost 4,
    config {},
    pos {},
    discovered false,
    weight 1, 
    kind 'Standard',
    atlas 'con'
}```
#

so more like this

worthy stirrup
#

what should i call for then?

frosty dock
#

I believe it's G.FUNCS.discard_cards_from_highlighted but I'd have to double check

#

G.hand.discards_left also doesn't exist

worthy stirrup
#

ah, FUNCs are something i havent heard of yet

frosty dock
#

G.hand is just a card area for the cards in your hand

#

it doesn't magically store random properties of your run

#

discards left would be G.GAME.current_round.discards_left iirc

worthy stirrup
#

my bad

runic pecan
dim steeple
#

G.FUNCS.discard_cards_from_highlighted

worthy stirrup
#
SMODS.Keybind{
  key = 'DiscardCards',
  key_pressed = '-',

    action = function(self)
        if G.hand and #G.hand.highlighted ~= 0 and G.GAME.current_round.discards_left ~= 0 then
            G.FUNCS.discard_cards_from_highlighted()
    end
  end
}
SMODS.Keybind{
    key = 'PlayCards',
    key_pressed = '+',
  
      action = function(self)
          if G.hand and #G.hand.highlighted ~= 0 then
          G.FUNCS.play_cards_from_highlighted()
      end
    end
  }
#

so this should work?

#

gotta fix key pressed for Play Cards

frosty dock
#

you have two keybinds on the same key?

worthy stirrup
#

yea, i just noticed

#

let me try it and ill let yall know

wild patrol
#
    {
        name = 'Yu-Gi-Oh Cards',
        group_name = 'Yu-gi-oh', -- Pack group text while a pack is being opened, omit if using group_key
        text = { 'Time to Duel' },
    }
}```
#

this is the proper way of doing this right

worthy stirrup
#

discard works, but playing doesnt

long sun
#

how does this ability for Fainfol (Legendary) sound?

frosty dock
#

please look at some examples from other mods

worthy stirrup
#

wait, does G.FUNCS.play_cards_from_highlighted() exist?

frosty dock
#

I think that's what it's called? can't check rn

#

I mean it'll crash if it doesn't, so just try

wild patrol
worthy stirrup
worthy stirrup
#

i noticed that G.FUNCS.discard_cards_from_highlighted() asks for a hook while G.FUNCS.play_cards_from_highlighted() doesnt

#

heres the code if anyone wants to take a crack at the issue

-- Keybind for discarding highlighted cards, this one currently is working
SMODS.Keybind{
    key = 'DiscardCards',
    key_pressed = '-',

    action = function(self)
        if G.hand and #G.hand.highlighted ~= 0 and G.GAME.current_round.discards_left ~= 0 then
            G.FUNCS.discard_cards_from_highlighted()
        end
    end
}

-- Keybind for playing highlighted cards, currently isnt working
-- no crash, cards just arent played
SMODS.Keybind{
    key = 'PlayCards',
    key_pressed = '+',

    action = function(self)
        if G.hand and #G.hand.highlighted ~= 0 then
            G.FUNCS.play_cards_from_highlighted()
        end
    end
}
dawn socket
#

i am currently trying to make a single-joker mod just to mess around and the mod is not even registering in the game

weary jungle
dawn socket
#

negative

long sun
#

hi, small bug i can't locate - the game's saying my for loop has an invalid length:

local igo = Game.init_game_object
function Game:init_game_object()
  local ret = igo(self)
  ret.current_round.fainfol_card = { suit = 'Spades' } 
  return ret
end

function SMODS.current_mod.reset_game_globals(run_start)
  G.GAME.current_round.fainfol_card = { suit = 'Spades' }
  local valid_cards = {}
  for i, j in ipairs(G.playing_cards) do
    if not SMODS.has_no_suit(j) then
        valid_cards[#valid_cards + 1] = j
    end
  end
  if valid_cards[1] then 
      local chosen_card = pseudorandom_element(valid_cards, pseudoseed('fainfol'..G.GAME.round_resets.ante))
      G.GAME.current_round.fainfol_card.suit = chosen_card.base.suit
  end
end```
#

lemme grab the exact error

dawn socket
weary jungle
#

add a json file next to main.lua

dawn socket
#

ok that would explain why it keeps complaining that it can't find SMODS

long sun
#
Oops! The game crashed:
main.lua:1780: functions/state_events.lua:1158: 'for' limit must be a number

Additional Context:
Balatro Version: 1.0.1n-FULL
Modded Version: 1.0.0~ALPHA-1230d-STEAMODDED
LÖVE Version: 11.5.0
Lovely Version: 0.6.0
Steamodded Mods:
    1: Talisman by MathIsFun_, Mathguy24, jenwalter666, cg-223 [ID: Talisman, Version: 2.0.3~dev, Uses Lovely]
        Break Infinity: omeganum
    2: DebugPlus by WilsontheWolf [ID: DebugPlus, Version: 1.3.0, Uses Lovely]
    3: More Speed by Steamo [ID: MoreSpeed]
    4: Phanta by GhostSalt [ID: GSPhanta, Version: 1.0.0]
Lovely Mods:```
dawn socket
crisp coral
#

nope, that's not where the crash is from

weary jungle
crisp coral
#

do you happen to have a card = self in your joker calculations

long sun
#

likely! lemme check

#

card = self, in the returns?

#

that seems likely

#

nope

#

still busted =w=

weary jungle
#

it works on my machines (laptop and pc)

dawn socket
weary jungle
#

yw

dawn socket
#

is there any way to get intellisense on the SMODS namespace / balatro namespace though?

#

i'm using VSCodium

#

i can live with this but every time SMODS is mentioned i get a warning, which is a little annoying

worthy stirrup
#

i got something, give me a sec

weary jungle
#

try opening up the mods folder in vscode

dawn socket
#

works like a charm

weary jungle
dawn socket
#

tyyyyy :3

worthy stirrup
dim steeple
#

does anyone know if there's any way while using the API to stop the sprite from drawing using the Card:draw() method?

dawn socket
#

would someone be willing o help me out one more time? i am trying to make a joker that increases it's XMult every time a food joker gets "eaten", but it's just not increasing it's mult.

the following should be all relevant code:

SMODS.Joker{
    key = 'ari',
    loc_txt = {
        name = 'Aria',
        text = {
            'Increases multiplier by {X:mult,C:white}X1.0{}',
            'every time you consume a food joker.',
            'Current multiplier: {X:mult,C:white}X#1#{}'
        }
    },
    atlas = 'Jokers',
    rarity = 3, --rarity: 1 = Common, 2 = Uncommon, 3 = Rare, 4 = Legendary
    cost = 150,
    unlocked = true,
    discovered = true,
    blueprint_compat = true,
    eternal_compat = false,
    perishable_compat = false,
    pos = {x = 0, y = 0},
    config = { 
        extra = {
            Xmult = 1.0 --initial multiplier
        }
    },
    calculate = function(self,card,context)
        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,
    handle_food_expiry = function(self)
        self.ability.extra.Xmult = self.ability.extra.Xmult + 1.0 --increase multiplier
    end,
    in_pool = function(self,wawa,wawa2)
        return true --available in the pool
    end
}

-- hook into the game's food expiry mechanic
G.on_food_joker_expire = function(food_card)
    local joker = G.jokers:get_card_by_key('ari')
    if joker then
        joker:handle_food_expiry() -- increment multiplier by +1XMult
    end
end
shell timber
#

is G.on_food_joker_expire a thing?

runic pecan
#

I know it shouldn't be working, but is it possible to put emoji in joker description?

crisp coral
#

nope

#

with a huge asterisk

runic pecan
#

Yeah I figured

dawn socket
#

is there any documented way to achieve what i'm trying to do then?

crisp coral
#

nope

dawn socket
#

:c

shell timber
dawn socket
#

Google Gemini, so i'm not surprised it hallucinated that function lmao

#

should've known better but a central API Documentation would def help

crisp coral
#

🗿

dawn socket
#

seriously tho is there any kind of docs for balatro modding or is it all just handed down knowledge?

crisp coral
#

and the game source code

autumn geode
#

Just be careful with the wiki some stuff was outdated but it's a great resource regardless

wild patrol
#

maybe i'm overlooking something here

#

not entirely sure

#

at first lovely crash said it was because open brackets I closed them now this happens

#

oh I see the issue

tepid crow
#

you're missing loc_txt on some of those jokers

wild patrol
#

yeah

#

I noticed it right after I posted

solar eagle
#

how does one go abt testing a mod?

wild patrol
#

was focused on the }

solar eagle
#

i dont really want to depend on shop rng to find the single joker i've created

#

but choosefirstshopjoker doesnt work

solar eagle
#

thanks!

runic pecan
#

Was curious what number would get_id() return if it's a stone card and this is NOT what I expected (but kinda reasonable)

wild patrol
#

all the text works now, but now none of the sprites don't

elder vapor
wild patrol
#
    key = "forbidden_one",
    loc_txt = {
    name = 'right leg of the forbidden one',
    text = {
        'An automatic victory can be declared',
        'by the player whose hand contains this card with the',
        'card with the Left Leg/Right Leg/Left Arm/Right Arm',
        'of the ForbiddenOne.'      
    },
    config = { payout = 4 },
    loc_vars = function(self, info_queue, card)
        table.insert(info_queue, SMODS.Centers.j_pencil_left_arm)
        table.insert(info_queue, SMODS.Centers.j_pencil_left_leg)
        table.insert(info_queue, SMODS.Centers.j_pencil_right_arm)
        table.insert(info_queue, SMODS.Centers.j_pencil_right_leg)
        return { vars = { card and card.ability.payout or self.config.payout } }
    end,
    rarity = 1,
    pos = { x = 1, y = 0 },
    atlas = "Jokers",
    cost = 8,
    unlocked = true, --where it is unlocked or not: if true, 
    discovered = true, --whether or not it starts discovered
    add_to_deck = forbidden_part_added,
    calc_dollar_bonus = function(self, card)
        return card.ability.payout
    end
    }
})```
#

Do I have anything extra in here that shouldn't be there

#

sprite doesn't wanna load

tepid crow
#

yeah

#

name and text should be the only subkeys of loc_txt

wild patrol
#

oh

#

I see now

#

the } needs to close the loc_text

#

I just have it in the wrong place

tepid crow
#

indenting your code properly should help with seeing that easier next time

weary jungle
#

i dont want to make art

#

im not going to

wild patrol
#

now my game is crashing saing lovely.dll was not found

dreamy thunder
#

i saw it a bit late but thnk you it worked

weary jungle
#

how do i voucher

#

i want to add a voucher to increase spawn rate of runes, how would i do that

urban veldt
#

Workshopped the visuals of the Glyphs a bit more. (from The Owl House)

Gains X.01 Mult for each scored [Diamond/Club/Spade/Heart].
Currently X1 Mult.

weary jungle
#

what is the equivallent of G.GAME.tarot_rate for custom consumable types?

wild patrol
#
    key = 'Jokers', --atlas key
    path = 'Jokers.png', --atlas' path in (yourMod)/assets/1x or (yourMod)/assets/2x
    px = 71, --width of one card
    py = 95 -- height of one card
})
SMODS.Joker({
    key = 'derek', --joker key
    loc_txt = { -- local text
        name = 'Pot Of Greed',
        text = {
            'What does it do?',
            'Gives you two additional',
            '{C:attention}Joker{} Slots'      
        },
    },
    atlas = 'Jokers', --atlas' key
    rarity = 4, --rarity: 1 = Common, 2 = Uncommon, 3 = Rare, 4 = Legendary
    --soul_pos = { x = 0, y = 0 },
    cost = 10, --cost
    unlocked = true, --where it is unlocked or not: if true, 
    discovered = true, --whether or not it starts discovered
    blueprint_compat = true, --can it be blueprinted/brainstormed/other
    eternal_compat = false, --can it be eternal
    perishable_compat = false, --can it be perishable
    pos = {x = 0, y = 0}, --position in atlas, starts at 0, scales by the atlas' card size (px and py): {x = 1, y = 0} would mean the sprite is 71 pixels to the right
    config = { 
      extra = {
        card_limit = 3 --configurable value
      } 
    },
    loc_vars = function(self, info_queue, center)
        return { vars = { center.ability.extra } }
    end,

    add_to_deck = function(self, card, from_debuff)
        G.Jokers.config.card_limit = G.Jokers.config.card_limit + 2
    end,
    remove_from_deck = function(self, card, from_debuff)
        G.Jokers.config.card_limit = G.Jokers.config.card_limit - 2
    end,
})```
#

Lovely is saying G.Jokers.config.card_limit = G.Jokers.config.card_limit + 2 is a nil value but I haven't changed anything from this

#

and it worked before

dim steeple
weary jungle
wild patrol
#

restarted now the mod works

#

everything works but doesn't seem any effects but head works for now

zealous glen
weary jungle
#

how do i make a voucher that increases the rate of my consumable type in the shop?

tepid crow
#

fletch is going crazy on the shaders lol

weary jungle
#

gosh darn you codex arcanum!!! why must you be so wierd!!!!!

elder vapor
#

got the card area working furiyippie

weary jungle
#

10 tags max?? insane

#

(its not)

elder vapor
#

oh fuck i forgot tags go there i'm gonna die

#

😭

#

well now where do i place them

weary jungle
#

ive run out of conumable card mods to look at

weary jungle
wild patrol
#

Is there away to get a debug to show if something isn't working

#

even if the game isn't crashing?

elder vapor
frosty dock
elder vapor
#

basically permanent jokers but smaller effects

#

like relics from STS

topaz sun
#

SMODS.Joker.super.inject(self) is there a version of this for enhancements?

#

SMODS.Enhanced.super.inject(self) didn't work

frosty dock
topaz sun
weary jungle
elder vapor
#

no

#

:3

frosty dock
# topaz sun Thanks

I'm curious what you need it for though? You should only need to refer to parent classes when you're extending a class

#

if you're just trying to build something around the default inject function for enhancements, you should use SMODS.Enhancement.inject(self)

dim steeple
wild patrol
#

Hey question about this does debug menu allow u to test the insta win or do u have to get lucky and get the lastpiece for it to trigger

#

just wanna make sure not my poor coding or if it's just debug menu

#

can't tell because everything else seems to work

#

multipliers and all

#

and I add the function as well

zealous glen
#

Edition or Enhancement or whatever it is

#

to request the base not be drawn

#

it might depend on the object type

dim steeple
zealous glen
#

So an Enhancement?

dim steeple
#

Nope, I'm adding a seal

#

the object im duplicating is a card from seal

zealous glen
wintry solar
#

It’s just a property on the card iirc, you should be able to set it whenever

elder vapor
#

oh uh... thats new

zealous glen
#

The way that Enhancements do it have secondary effects, I think

#

But Editions might not

wild patrol
#

does { xchips = card.ability.xchips } not work anymore?

zealous glen
wild patrol
#
    key = "left_arm",
    loc_txt = { -- local text
    name = 'left arm of the forbidden one',
    text = {
        'A forbidden left arm sealed ',
        'by magic. Whosoever breaks ',
        'this seal will know infinite power.'      
        },
    },
    config = { xchips = 2.5 },
    loc_vars = function(self, info_queue, card)
        return { vars = { card and card.ability.xchips or self.config.xchips } }
    end,
    rarity = 1,
    pos = { x = 3, y = 0 },
    atlas = "Jokers",
    cost = 6,
    unlocked = true, --where it is unlocked or not: if true, 
    discovered = true, --whether or not it starts discovered
    blueprint_compat = true,
    add_to_deck = forbidden_part_added,
    calculate = function(self, card, context)
        if context.joker_main then
            return { xchips = card.ability.xchips }
        end
    end,
})```
#

for some reason everything here works but the xchips multi

wintry solar
#

I don’t think enhancements do it

#

Editions just turn off the base layer from being drawn

dim steeple
#

Are you sure its just a property on the card?

elder vapor
#

thats better, now time to get them working

dim steeple
wintry solar
#

Should be card.ignore_base_shader = {‘seal’ = true}

zealous glen
wintry solar
#

It can be any reference

dim steeple
wintry solar
#

It’s just so you can turn it off again afterwards

#

No, it stops rendering if the table has anything that is true in it

#

Editions apply and remove it automatically if you specify a property

#

But you should be able to manually set it in a set_ability function

dim steeple
#

Excellent, thank you!

solar eagle
#

how does one add the lil tooltip on the side of jokers? i'd like to add a custom one

#

like this

zealous glen
tight thistle
#

can anyone explain to me how to "loop the played hand for queens"? i cant find anything on how to check for that

zealous glen
#

This is a Joker right

autumn geode
#

would anyone know the resources i can learn about lovely patching for my mod or generally know how i can go about it

tight thistle
#

it is for a joker, this is an image that someone sent to me to try and explain how to do it

zealous glen
#

Should be config = { extra = { queen_check = false } }

viscid bough
#

.

zealous glen
#

If that does get saved to config.extra (also known as ability.extra) somewhere else then it’s fine

#

Anyways, the cards in the hand would be G.hand.cards if I remember correctly

#

So you can loop over the cards in hand in that table

worthy stirrup
#

How could i make every joker into a negative one

zealous glen
#

Try printing to see if the block executes to try and identify where the error happens

zealous glen
worthy stirrup
#

cheers

zealous glen
#

I also think you’re missing a check

tight thistle
#

would appreciate knowing whats wrong with it

zealous glen
#

What is create_joker

tight thistle
#

ah, so the tutorial in SMODS wasnt working out entirely for me (the joker had no custom texture and all the numbers in the description said nil) so i tried coding following bunco's code, apologies

weary jungle
tight thistle
#

oh i know, i was going to get to that later

weary jungle
#

ok mb

vagrant cedar
#

Is there a way for me to make it to where only one Joker in a lua file is able to appear in the shop per run?

candid epoch
#

considering sometimes a joker will never appear in your run, god forbid you

vagrant cedar
#

yeah well they're all common and I want them to stay that way but I also only want one of them per run because they all BASICALLY do the same thing (and that's by design)

candid epoch
#

why you have multiple if they all do the same thing?

vagrant cedar
elder vapor
#

actually i'm a little confused

candid epoch
#

whats the point?

vagrant cedar
#

Each gives chips based on the year the album came out, but they each play the album instead of the balatro music

candid epoch
#

you can just... make it dependant who is leftmost?

vagrant cedar
#

I want them to be common enough that you can use them, but also I don't want 4 of them appearing in one run, replacing slots that other Jokers could've used

vagrant cedar
runic pecan
#

So it'd be like Cavendish but reversed

candid epoch
#

makeing so only 1 out of 4 cards appear per run makes people like needing alot before they see everything out from mod, more than they need

vagrant cedar
#

i'm making this for me and my friends, when did i ask for the opinion on how i want it to work

runic pecan
#

There are several vanilla jokers that only appear in the shop at certain conditions, maybe start from there.

vagrant cedar
weary jungle
#

why can i not find a simple voucher that does 2x the chance a consumable type in the shp[

autumn geode
#

does anyone know how to use the new joker sizing thing added to SMODS so that i can set one of my jokers to the same size as the square joker

weary jungle
#

every mod is all wierd

runic pecan
vagrant cedar
elder vapor
vagrant cedar
elder vapor
#

and no albums show up while there is one in a joker slot

vagrant cedar
#

yeah

elder vapor
#

but albums can show up when there isn't

#

okay one second

vagrant cedar
#

yes

#

sorry i know it's complicated

#

that's why i didn't know how to do it 😩

elder vapor
#

whats your mod prefix

vagrant cedar
upper fern
#

7th Heaven (Common)
Art: Jimbo with an angel halo and wings
Effect: Retrigger each played 7

Random question for whoever wants to answer, for a common card that retriggers a card of one specific rank and no other qualifiers, do you think it should retrigger once, or twice? Trying to make it vanilla-balanced

solar eagle
#

rename to Seventh Heaven

#

inline with the game's existing styling

elder vapor
#
in_pool = function(self, args)
  for i = 1, #G.jokers do
    if G.jokers[i].rarity == "MUSC_album" then
      return false
    end
  end
  return true
end
#

try that

solar eagle
#

i'd say once

weary jungle
#

it feels like i have to do a patch, or hooking but it seems like this is too much of a common thing to not have a specific function for this

solar eagle
#

two retriggers on every 7 would be insane especially with an idol

#

cause this would also stack with stuff like hanging chad, red seals

elder vapor
maiden river
#

how do you split up mod code into several different files?
I have sets of jokers in my mod and having different files for each set would be preferred

viscid bough
frosty dock
#

this is in the docs

weary jungle
#

im crying right now

elder vapor
#

tbh i didn't know it was the docs i just had to look at other mods lol

weary jungle
frosty dock
#

it's using_consumeable

weary jungle
viscid bough
#

oh my god its just the letter e i was missing??

frosty dock
vagrant cedar
#

and does the MUSC_album target everything in the lua?

elder vapor
#

in where you make the SMODS.Joker{} stuff

frosty dock
elder vapor
#

like that

weary jungle
#

wow

#

insane

proper stratus
#

Wait what's the difference between what you and I did

zealous glen
vagrant cedar
elder vapor
#

yeah

vagrant cedar
#

ok

viscid bough
frosty dock
#

they don't

zealous glen
#

Then why 😭

frosty dock
#

because thunk

zealous glen
vagrant cedar
#

do i then change rarity to MUSC_album on the jokers?

frosty dock
#

same reason that we had caino, I presume

vagrant cedar
#

And then how do I get that rarity to appear in shop

zealous glen
elder vapor
viscid bough
#

the global thunk strikes again...

elder vapor
vagrant cedar
elder vapor
#

oh

weary jungle
#

so this would work for a voucher right?

elder vapor
#

rarity = "album"

frosty dock
#

i could make it prefixable tbh

vagrant cedar
frosty dock
#

not what i meant to say there 💀

#

you can give a shop rate to your SMODS.Rarity by defining default_weight

vagrant cedar
#

It should function as a common, just with the code we have to not allow the others in the same pack at the same time

frosty dock
#

I'm not following, do you want them to be in the same rarity pool as commons and have a separate pack where only these can spawn?

#

then you don't need a rarity

#

you need an ObjectType

vagrant cedar
#

I don't really care one way or another about the pack part

#

I just want them to be in the same pool as common, but unable to be in the shop if you own another in the modpack

solar eagle
#

i have this joker set up to do some experimenting with face cards and chips but whenever an applicable card is discarded the game crashes with "engine/text.lua:114: functions/misc_functions.lua:1808: attempt to index local 's' (a number value)"

vagrant cedar
#

doesn't have to be booster packs or anything

solar eagle
#

looking at the game src for those two doesnt really clear anything up unfortunately

#

is there something obvious im missing?

vagrant cedar
#

in_pool = function(self, args)
for i = 1, #G.jokers do
if G.jokers[i].rarity == "MUSC_album" then
return false
end
end
return true
end,

zealous glen
#

Instead

#

Use a global variable

#

“global”

solar eagle
#

the joker's display works fine, it shows +0 chips before any kings or jacks are discarded (also is that the proper way to check for kings/jacks? view the ranks?)

zealous glen
#

That is set when the Joker is created anywhere

solar eagle
#

but as soon as any king/jack is discarded the game dies

vagrant cedar
#

I am lost

#

I will return to this after a break

#

I will play some Rivals for a little bit while I can and then come back to this

frosty dock
#

you can just check with any other property, like some config value that's shared between your jokers

vagrant cedar
#

They all give different chip amounts

#

Depending on the year the album came out

#

They all use atlas = 'albums' though?

zealous glen
#

Again just set a global variable

#

That also avoids two showing up in the shop at the same time

vagrant cedar
#

But how do I do that 😩

zealous glen
#

Look at the Castle example

#

In Example Mods

viscid bough
#

Idk why this suddenly stopped working (it was working earlier and i dont think i really changed anything) But my consumable card isnt duplicating cards. It prints out the right card key, but it never duplicates it. any idea why? p.s. i only included the consumable and hook in this file

#

omg im sutpid

#

found my issue.

frosty dock
main mica
weary jungle
#

is this a valid loc_txt for a voucher?

#

its not showing up in game

wooden badge
#

maybe {C:attention} the 2X

weary jungle
#

if i have a en_us, can i not use loc_txt?

frosty dock
weary jungle
#

whats wrong

frosty dock
#

it's just name and text, there is no label

#

use set_card_type_badge if you want to change the Voucher badge

tight thistle
wooden badge
autumn geode
#

question how do I look for the context of a played card with a specific enhancement basically just want to +mult for each played card with x enhancement

wooden badge
autumn geode
#

does it work with an enhancement i have added myself?

#

sorry i dont think i was clear

#

i want a joker to trigger that

wooden badge
#

So it depends what you have named it, you will need to add the mod prefix underscored before the name. If your mod prefix is 'mymod' and the enchancement is 'toxic' then you would replace the /enhancement/ bit above to 'mymod_toxic'

wooden badge
#

just goes in the calculate function for that joker

autumn geode
#

ah ok

#

ty ty

wooden badge
#

make sure you are checking each card individually as well with context.individual

autumn geode
#

perfect thanks

wooden badge
#

working?

raw geyser
#

Is there a way to save config to files?

autumn geode
weary jungle
#

do vouchers have a calculate in new calc

#

because that would be really helpful

wintry solar
#

no

weary jungle
#

man

maiden river
#

just saw this while searching - it's my mod, but it's not currently available, I plan to remake those cards and add them to a new modpack I'm making

wintry solar
#

what are you trying to do?

weary jungle
#

spawn a consumable on boss blind enter

maiden river
livid tapir
#

ok

weary jungle
wintry solar
#

a voucher that spawns a consumable on entering a boss blind?

weary jungle
#

yes

wintry solar
#

yeah you'd need to patch in a check for your voucher and then do the creation

weary jungle
#

darn

weary jungle
wintry solar
#

you need it in the function that starts the blind

weary jungle
#

Blind:press_play()?

#

i would rather do a hook

vagrant cedar
#

I have returned equally as confused as before

#

How do I set the global pool to make each of the album jokers not appear in shop if you already own one?

#

I want them to be common rarity, or at least functionally the same, but you can only own one per run

#

Or is this just going to function as I want it to but with extra steps?

sturdy compass
#

You may want to patch into get_current_pool in common_events.lua to create a new gate as opposed to setting a pool

#

That's how jokers like Stone and Glass are set to appear whenever you have the relevant enhancement in your deck

#

I've created a few new ones to check for jokers in hand, editions, seals, and collections of some of those, I think you could do something similar

#

I have a question myself now. I'm interested in creating a new card area, just a simple 1-slot area for a new card type. How would I go about doing that?

urban veldt
#

if context.scoring_hand and not context.other_card.debuff and context.other_card:is_suit(G.GAME.current_round.castle2_card.suit) and not context.blueprint then

How do I make this specifically Diamonds? (code comes from Castle2 is the examples thing)

#

Is it just replaced is_suit(G.GAME.current_round.castle2_card.suit) with is_suit(diamond) or something?

autumn geode
#

is_suit("Diamonds") i believe

urban veldt
#

Thank you!

sturdy compass
upper sigil
#

im sure this has been asked before, but whats the best place to start when learning to make your own jokers, with having 0 coding experience?

wooden badge
autumn geode
#

would anyone know how i can copy the functionality of Jolly joker cant seem to find anything in the actual balatro source code for the calc of it

cerulean rose
cerulean rose
wooden badge
autumn geode
#

thanks

wild patrol
wooden badge
#

that is where those types of jokers are being calculated

wild patrol
#

I'll just change it to a multi or something

cerulean rose
#

not custom necessarily

#

talisman is a separate mod

wild patrol
#

So I can test make sure it works

cerulean rose
cerulean rose
wild patrol
#

Then I guess it's not working on my end because I added all 5 to joker slots nothing happens

#

Try both on the card but screen and in middle of a game

cerulean rose
#

what code do you have right now?

wooden badge
wild patrol
#

Essentially I just have a slightly modified version of what u had

wooden badge
#

Are all the internal tables that hold information about consumeables and such hashed? Would there be any way to manipulate their orders and refer to them without them being jumbled?

cerulean rose
#

did you change the joker keys in the function

wild patrol
#

Only thing I really changed was the name and sprite

wild patrol
#

The only thing I changed was adding description and name to the cards

#

And the sprite coordinates

rose hamlet
#

guys how do i install a mod thats a .lua

wild patrol
#

Actually hold on I think I have the latest Lua on my phone I made

cerulean rose
#

yeah forbidden_part_added has the joker keys that it checks for listed inside it

#

so you need to change those to your jokers

wild patrol
#

I left that in

#

So not sure why

rose hamlet
#

nvm got it but how do i show fps

wooden badge
#

in game

rose hamlet
#

thx

#

wait i dont see it

wooden badge
#

'show hud information' or something like that

rose hamlet
wooden badge
#

oh shit

#

sorry you need the debugger mod as well

rose hamlet
#

np imma get it

wooden badge
#

Wilsonthewolf

rose hamlet
#

where do i get it

wooden badge
rose hamlet
#

kk thx

#

whast the save loader mod?

#

is using the balatro calculator mod cheating?

#

or not

wooden badge
#

nothing's really cheating as long as you're having fun and others aren't losing out

blissful dagger
#

how do I get an enhanced card to destroy itself like glass cards without it triggering jokers like Canio twice

rose hamlet
#

ah its a site not a mod thats a shame

autumn geode
rose hamlet
#

is there any qol mods that i should get

wooden badge
rose hamlet
#

kk

#

i beat my first run today so i thought why not get a few mods

wooden badge
#

If you mean line 3653

autumn geode
rose hamlet
#

what does mipmap do

wooden badge
#

It's checking that seeing double is not included so that it can return x mult freely without needing seeing double's condition

urban veldt
#

SMODS.Joker { key = 'light_glyph', loc_txt = { name = 'Light Glyph', text = { "Gains {C:x_mult}X0#01#{} Mult", "per played Diamond,", "{C:inactive}(Currently {C:x_mult}+#3#{C:inactive} Mult)", } }, blueprint_compat = true, perishable_compat = false, eternal_compat = true, rarity = 2, cost = 6, config = { extra = { x_mult = 0, x_mult_mod = 0.05 }}, atlas = 'ModdedVanilla', pos = { x = 5, y = 0 }, loc_vars = function(self, info_queue, card) return { vars = { card.ability.extra.x_mult_mod, card.ability.extra.x_mult, }} end, calculate = function(self, card, context) if context.scoring_hand and not context.other_card.debuff and context.other_card:is_suit("Diamonds") and not context.blueprint then -- extra.mult_mod = 0, -- Mult to add card.ability.extra.x_mult = card.ability.extra.x_mult + card.ability.extra.x_mult_mod return { message = localize('k_upgrade_ex'), colour = G.C.CHIPS, card = card } end if context.joker_main and card.ability.extra.x_mult > 0 then return { message = localize { type = 'variable', key = 'a_xmult', vars = { card.ability.extra.Xmult } }, Xmult_mod = card.ability.extra.Xmult } end end }

So, trying to make this increase by 0.05 per scored Diamond,

#

Is this, like, the right direction?

tepid crow
#

use triple backtick for multi-line codeblocks

#

(you can then also do the ```lua for the language highlighting)

rose hamlet
cerulean rose
# wild patrol

so yeah it's not working cus your jokers will have a different mod prefix

wooden badge
rose hamlet
#

its in the graphics option

#

in the settings

wooden badge
#

well it's an image processing technique to reduce aliasing

rose hamlet
#

does it affect fps or smth

#

its on 4 by default

wild patrol
wooden badge
#

I don't think it's anything to worry about

rose hamlet
#

kk

cerulean rose
wooden badge
#

I assume a higher level just means higher processing required

upper sigil
#

would anyone be willing help someone make their first joker mod? Im following this youtube video but it totally doesn't account for someone having 0 coding experience which i dont blame it

cerulean rose
#

the mod prefix is set to pencil, needs to be xmpl

tight thistle
wooden badge
#

so it could affect frame rate although I doubt it, it's not incredibly intensive

tight thistle
#

not sure why

wild patrol
cerulean rose
#

yup

wild patrol
#

Alright I do that tomorrow and see what happens

wooden badge
tight thistle
wooden badge
#

How about "X1.5 Mult per scoring King if played hand contains at least one Queen" - a bit more concise.

bold sleet
#

So uh, for some reason, when hovering over 'the fool' after using this card the game crashes, for some reason finding center.ability.extra.cards inside loc_vars being nil or something, idk. Is there a fix for this?

SMODS.Consumable { -- Summer
  key = "summer",
  set = "Tarot",
  atlas = "tarot",
  pos = { x = 1 , y = 0},
  config = {
    extra = {
      cards = 3
    }
  },
  loc_vars = function(self, info_queue, center)
    return {
      vars = {
        center.ability.extra.cards
      }
    }
  end,
  can_use = function(self,card)
    if G and G.hand then
        if #G.hand.highlighted ~= 0 and #G.hand.highlighted <= card.ability.extra.cards then --if cards in hand highlighted are above 0 but below the configurable value then
            return true
        end
    end
    return false
end,
  use = function (self, card, area, copier)
    for i=1, #G.hand.highlighted do
      G.hand.highlighted[i]:set_ability(G.P_CENTERS["m_sbc_fire"])
      G.hand.highlighted[i]:flip()
      G.E_MANAGER:add_event(Event({
        trigger = "after",
        delay = 0.5,
        func = function()
          G.hand.highlighted[i]:flip()
          return true
        end
      }))
    end
  end
}
frosty dock
#

I provide you with a fake card on latest steamodded, so I think this should no longer crash if you update

bold sleet
#

I'll check that.

#

ok

tight thistle
bold sleet
#

It doesn't implode now.

tight thistle
#

whatever i try the game either freezes hard or the joker does not work at all

vagrant cedar
tight thistle
#

ive just been stuck on this for days

wooden badge
bold sleet
#

yay, something completely unrelated broke. What am I doing wrong here?

vagrant cedar
#

Speaking of being stuck on something:
I still don't know how to get these Jokers into a global pool.
I just want them to be common rarity, but I don't want you to be able to grab multiple of them in the same run, so I want only one from this mod to show up in each run.

dim steeple
wooden badge
#

other_card isn't populated otherwise

#

so it's trying to index a nil value

bold sleet
#

why tf did it work like a few versions ago then?

dreamy thunder
#

how to make a config tab

bold sleet
#

do i like, add context.individual to it and run with it?

wooden badge
bold sleet
#

ok

vagrant cedar
#

I was told in.pool(global) I think, but I still don't know how to work that

cosmic vigil
#

im playing the negative deck, but almost everything i do makes my game crash, is there something i can do about this?

cinder elk
#

chat how do i make it so a card detects a certain rank of card no matter if it's played or unplayed

tight thistle
foggy carbon
#

is there a way that I can give a Joker like, two rarity squares in its description? I don't want it to have two rarities for RNG, just so that I can do something like this:

foggy carbon
tight thistle
foggy carbon
#

so change v:is_face() to v:get_id() == 12

tight thistle
#

ok, ill try that

ionic verge
#

does anyone here know how to code a blueprint type joker?
cus im trying to make one that copies a random joker every round and at this point i dont know what im doing and need help

#

the game doesnt crash when i try to use the guy, but he doesnt actually copy anything either

sudden dew
#

Returning whatever value is returned by calculate is important

sturdy compass
#

I know this sounds like a weird solution but instead of not other_joker == nil try other_joker ~= nil. Changing that ordering around has fixed things a surprising amount of times for me

ionic verge
#

what is ~= ?

sturdy compass
#

Also yeah there's no return

ionic verge
#

i keep seeing it and being confussled

sturdy compass
#

opposite of ==

ionic verge
#

i see

sudden dew
#

You can just do if other_joker, nil evaluates to false

ionic verge
#

used to it being != in other languages

sturdy compass
#

same lmao

ionic verge
sturdy compass
#

Also instead of checking for specific joker names, I'd recommend checking for not context.no_blueprint since that checks for cards that act like blueprints. I'd recommend taking a look at vanilla blueprint code to see how that's set up and implement it into your Joker too

sudden dew
#

Don't put other_joker:calculate(...) in brackets

ionic verge
#

ok

sudden dew
#

It's already returning a table

sturdy compass
#

Was gonna say, you're returning a table with the calculate inside

ionic verge
#

got it

#

there's still a problem outside of it though

#

i have something telling which joker is copied tied to the desc

sudden dew
#

Also 90% sure it should be context.blueprint and not G.Game.context.blueprint, but that shouldn't keep it from working

ionic verge
#

and it still sayse none

#

got it

sturdy compass
#

What does your loc_vars look like

ionic verge
sudden dew
#

get center.xyz out of brackets

#

wait nvm

sturdy compass
#

You're setting the randomJoker variable at calculate

#

So it won't show until after calculating

ionic verge
#

mhm

#

so is there a way to do that better?

proper stratus
#

hey fellas! i need help figuring out how to make probabilities

sturdy compass
# ionic verge so is there a way to do that better?

Yes. Since you're rotating the joker every round, you'll want to create a new global variable that holds your target joker and hook into reset_game_globals to have it rotate every round (like an Idol for example)

proper stratus
frosty dock
ionic verge
proper stratus
#

right, is it somewhere in here?

proper stratus
ionic verge
#

ok

proper stratus
#

look in your SMODS folder

#

example mods

sturdy compass
ionic verge
#

got it

frosty dock
#

(example mods were moved to a separate repo recently, so it won't be in your smods folder if you're on latest)

sudden dew
#

Your loop that picks a joker also has faulty logic. Should be something like:

for i,v in ipairs(G.jokers.cards} do
    if v.name ~= 'Blueprint' or v.name ~= 'Brainstorm' or v.name ~= 'Mimic Joker' or v.blueprint_compat then
        jokerList[#jokerList + 1] = v
    end
end
proper stratus
frosty dock
#

v.name however doesn't work, it'd be v.ability.name

proper stratus
ionic verge
proper stratus
#

all i want for now is for the text to reflect the 1 in 4 odds i want, and change with oops

#

baby steps 😅

frosty dock
proper stratus
#

this is one of those things where you figure it out for the first time and it takes like an hour but you just know what you did wrong for the rest of your life

frosty dock
proper stratus
frosty dock
#

you put a comma instead of a .

frosty dock
proper stratus
sudden dew
proper stratus
vivid forge
#

is there a list of contexts i can check out?

ionic verge
#

ooooooo

#

thats clever

sturdy compass
#

mr. smods I have a question while you are here, is it possible to patch into smods yet? Stuff I wanna change keeps getting hijacked by smods first lol

ionic verge
vivid forge
#

Awesome ty

ionic verge
#

among a couple other things this lists just about every joker context

frosty dock
sudden dew
frosty dock
#

there's also this which is currently incomplete

sturdy compass
ionic verge
proper stratus
#

well, thats the text, now to do the actual functionality

ionic verge
#

(and making a global variable is just doing 'global thing = 'xyz' ' right?)

sturdy compass
ionic verge
#

got it

#

extremely good news
the game crashed inside the if other_joker ~=nil block

frosty dock
#

right, seal things. i don't think you actually get the card

ionic verge
#

that means its actually getting there

frosty dock
ionic verge
#

i see

proper stratus
ionic verge
#

HOLY SHIT IT COPIED SOMETHING

#

i however dont think its doing so randomly

#

in a test it copied the same joker 4 times in a row

#

i have three compatible jokers

#

so a 1/3^4 chance

sturdy compass
#

I actually cannot find the page so I just took the liberty of writing it out for ya:

function SMODS.current_mod.reset_game_globals(run_start)
    local eligible_jokers = {}
    local new_target = [TARGET JOKER VARIABLE]
    if #G.jokers.cards <= 1 or not next(SMODS.find_card([YOUR JOKER KEY])) then
        new_target = nil
    else
        for i = 1, #G.jokers.cards do
            if G.jokers.cards[i].config.center.key ~= [YOUR JOKER KEY] and G.jokers.cards[i] ~= new_target and G.jokers.cards[i].config.center.blueprint_compat then
                eligible_jokers[#eligible_jokers + 1] = G.jokers.cards[i]
            end
        end
        if next(eligible_jokers) then
            new_target = pseudorandom_element(eligible_jokers,
                pseudoseed([whatever you want]))
            else
                new_target = nil
        end
    end
    [TARGET JOKER VARIABLE] = new_target
end
#

and in your loc_vars you can check if the variable is nil

ionic verge
#

mhm

#

rq is this part set up right?

#

cus i dont like thinking i got a 1/81 chance to roll the same joker 4x in a row

#

5x even i think

sturdy compass
#

The block I just sent handles no repeats

ionic verge
#

im talking about my joker selection

cerulean rose
ionic verge
#

not the global variable stuff

#

do i just leave it empty?

cerulean rose
#

you need to use pseudorandom

ionic verge
#

you think that'd be covered by pseudorandom_element

sturdy compass
#

Not if you're using the same key every time

cerulean rose
#

you'd think

#

but no

sturdy compass
#

pseudorandom is the illusion of randomness, in reality it's either taking or creating a key and putting it through an algorithm. So if you're putting the same key through the same algorithm, you'll get the same result

proper stratus
#

hey quick question, im looking at the lucky card code and got a little lost, how does pseudorandom and G,GAME.probabilitie-

#

well perfect timing then

sudden dew
#

You should be good to put the same seed in every time

cerulean rose
#

no

#

well to pseudorandom yeah

sudden dew
#

Every example in the vanilla game code has the same seed every time đŸ€”

cerulean rose
dim steeple
proper stratus
#

right

#

hm

dim steeple
#

The condition checks that that value is less than the normal probability (1) divided by 15

#

Meaning that the probability of it landing within that threshold is 1/15

proper stratus
#

oh, so if you have oops it just does that automatically

dim steeple
#

Oops increases the normal value

proper stratus
#

yeah

dim steeple
#

From 1 to 2

proper stratus
#

so its double as likely

dim steeple
#

Exactly

#

The threshold is twice as big

sudden dew
ionic verge
#

i did that

sturdy compass
#

pseudoseed, not pseudorandom

ionic verge
#

i see

devout pewter
#

Is there a visual interface or something like that to make balatro jokers? Something like clickteam?

proper stratus
#

im not using it because i want to understand how everything works, but it very much is here!

devout pewter
#

ohhh??

#

interesting

ionic verge
#

ok
it selects a random joker now
just need for it to tell what joker it's copying

proper stratus
#

ive been staring at my pc for like two hours and i havent done anything lmao_the_third

#

all ive done is just the text

ionic verge
sturdy compass
#

anywhere really, it's self contained

#

I keep mine above where I define my jokers

proper stratus
#

im trying to figure out how to do this but i think im just missing something

#

like im looking at the vanilla lucky card code and i cant figure out how to check if a card scores

#

like literally just scores

#

thats all i need rn

#

baby steps and all

sturdy compass
#

context.cardarea == G.play and context.individual maybe?

proper stratus
#

well, it doesnt scream at me when i put it in so thats a good sign

#

also for some reason i cant do if statements

#

it just doesnt recognise the word if

ionic verge
#

little confuzzed

sturdy compass
proper stratus
#

vsc

sturdy compass
sturdy compass
proper stratus
#

yes

sturdy compass
#

Huh

proper stratus
#

dunno but whatever

#

guess im not using if statements

sturdy compass
#

can you send a screenshot without the big popup in the way?

proper stratus
sturdy compass
#

You don't have your calculate function defined

proper stratus
#

oh right

ionic verge
sturdy compass
#

Yes

ionic verge
#

i wasnt sure where exactly to put it

#

but i was expecting within the calculate function

proper stratus
#

im trying to figure out what piece of code just goes "hey! the card's scorin'! "

#

also is this right for the calculate function

#

like is this the right function

sturdy compass
#

no

proper stratus
#

mm

sturdy compass
#

after loc_vars, you want to have something like this:

calculate = function(self, card, context)
   -- ALL JOKER CALC CODE WITHIN THIS FUNCTION
end
proper stratus
#

well its not a joker though, its a seal

#

same thing?

sturdy compass
#

Oh I see

proper stratus
#

yeah

#

this is a thing thats added to a playing card

ionic verge
#

i think seals still get calculate, but it works differently

sturdy compass
#

It looks like that is still correct though

ionic verge
#

from my limited knowledge

proper stratus
#

alright

#

again, this is the first thing im ever coding

#

so

proper stratus
#

thanks! long way to go..

sturdy compass
proper stratus
#

yeah i have lol

#

this should just make it do the little bloop animation when it scores, then?

sturdy compass
#

Not when it scores, you don't have a context defined

tight thistle
#

hello! i have a question, how would i make a joker destroy a random card of a specific rank, rather than destroying each card of that specific rank?

proper stratus
#

oh

#

wait

#

its just 'if context.card whatever" right?

toxic ibex
#

where can I find the documentation on the G/G.GAME object so I can see what all is callable?

proper stratus
#

probably the Smod docs!

toxic ibex
#

I was looking through there, and didn't find it. it's all the SMODS functions and such

zealous glen
#

I don’t think it has anything on that

proper stratus
zealous glen
ionic verge
toxic ibex
sturdy compass
sturdy compass
#

This way it doesn't pick up a mimic to copy

ionic verge
#

ooooh that key

#

mb mb

#

wait what's going on in these blocks?
this is from the code block you sent me

ionic verge
#

also current status, the global var works before i enter a game, which i can check by looking at the collection, but not after

sturdy compass
#

That first loop goes through your joker hand and adds them to the eligible_jokers table if A.) It's not a mimic, B.) it's not the same card as last round, and C.) it's a blueprint compatible card. After that, it checks if eligible_jokers has anything in it. If it does, it populates new_target with a pseudorandom_element from eligible_jokers. If not, new_target becomes nil

#

also your mimic key should be 'j_[MOD PREFIX]_mimic'

ionic verge
#

oh

#

so wait is it also trying to choose the joker mimic is selecting?

sturdy compass
#

Yes

ionic verge
#

mhmmmm

#

ok

wraith topaz
#

Dang, this is some premium spagetti code.

sturdy compass
#

ouch

ionic verge
#

this is this person's joker

#

im just coding it for them

wraith topaz
#

Nah, because I understand ZERO codin

sturdy compass
#

dawg 💀

wraith topaz
#

Good work btw.

ionic verge
#

this looks like pretty normal code tbh btw

#

one note btw, and ill just implement this myself, the joker also blacklists blueprint and brainstorm

wraith topaz
#

I don't know any code of this game so that's probably why.

ionic verge
#

where can i find the keys for vanilla jokers?

sturdy compass
#

game.lua

autumn geode
#

how do you make it so certain scored cards give you money ive tried returning money = card.ability.extra.money but that does not work

sturdy compass
#

you wanna use ease_dollars(card.abililty.extra.money) instead

#

Not in the return btw

autumn geode
#

oh right

#

where does that want to go then

sturdy compass
#

somewhere before the return

#

Actually I just remembered, instead of ease_dollars you could just return dollars = card.abililty.extra.money

#

That's probably an easier solution

autumn geode
#

ill give that a go

vagrant cedar
ionic verge
#

sanity check, this is how you get the name of a joker in string form right?

#

well, yeah by the looks of it

#

cus thats how it works in an earlier part of my code

sturdy compass
#

ok hold on lmao

#

You want G.localization.descriptions.Joker[other_joker.config.center.key].name

#

That way if the target is a modded joker it gets the actual name

autumn geode
#

lol my shit just crashed now what that should just work says that its a nil field for ability

proper stratus
#

well now im confused

#

its saying there's a problem on line 721

ionic verge
proper stratus
#

and my mod is like 40 lines long

autumn geode
ionic verge
proper stratus
#

yeah i assumed so

sturdy compass
proper stratus
#

what file is it on then?

#

state_events.lua

ionic verge
#

functions/stateevents

proper stratus
#

hm

ionic verge
#

probably in SMODS

proper stratus
#

right

proper stratus
#

state_events.lua is in lovely > dump > functions

ionic verge
# sturdy compass replacing

ok so here's the deal, the line i posted is in the mimic joker's code block, because i just want the targetJoker global var to remember the name of the joker chosen by mimic

proper stratus
#

hmmmmmmm

sturdy compass
proper stratus
#

right

#

ive just done messed somethin up then

#

something's wrong with this then

ionic verge
proper stratus
#

because thats all i added, and now it crashes whenever i try to play a card with the seal

frosty dock
proper stratus
#

(i know what we're talking about dont worry)

ionic verge
#

i believe you also add 'and context.jokers'

proper stratus
ionic verge
#

i think

frosty dock
#

i see you're on old calc?

proper stratus
#

yeah

ionic verge
#

you check for both of these

frosty dock
#

isn't this not a joker?

ionic verge
#

oh wait

sturdy compass
#

It's a seal

ionic verge
#

dur

proper stratus
ionic verge
#

i forgot

#

mb

frosty dock
#

for better calc it's context.cardarea == G.jokers and context.main_scoring

proper stratus
#

here's the api for seals

frosty dock
#

you don't need to show me, I wrote that

proper stratus
#

(for the other guy :3 )

ionic verge
#

i imagine these then

#

depends

frosty dock
proper stratus
#

i can just switch SMODS version

frosty dock
#

that's defo the better thing to do, the less code still getting written for old calc, the better

wintry solar
#

I should finish my calculate guide

sturdy compass
#

I hate to butt in, but how would I go about editing something that SMODS took ownership of? This edition in game_object.lua for example, I want to edit what's being returned slightly

frosty dock
#

just uh

#

take ownership of it again

proper stratus
#

WAIT

#

IT WORKED

#

alright

#

we're getting somewhere

#

(i cant believe the problem was a wrong version of smod im jumping off a balatro shaped building)

sturdy compass
frosty dock
#

you need to put only the function/value you're changing

sturdy compass
#

ah ok

frosty dock
#

the rest will stay put

sturdy compass
#

Ok, but what about for a function itself, i.e. random_destroy? There's something in that I need to edit as well

frosty dock
#

oh, that's a local function to game_object.lua

sturdy compass
#

yes

frosty dock
#

that should maybe be made a global util function

long sun
#

really proud of this one, so forwarding it here :D

proper stratus
#

oh wow that looks amazing

frosty dock
#

hopefully lovely 0.7.0 is soon, in which case you'll be able to patch into it

sturdy compass
#

Ah that's what I'd be waiting for, alright

frosty dock
#

other than that, you'd have to redefine your own version

wintry solar
#

did you add the unique identifiers yet aure?