#💻・modding-dev
1 messages · Page 517 of 1
What pseudorandom functions are there? I need one that generates a float between 0 and other number
bump
there isnt one that does exactly that, you would use pseudorandom("seed") that gives you one between 0 and 1 and multiply it
why do poll_enhancement and poll_seal just have args for their arguments? is that just to make it not care what you put in there or something?
Oh thanks
oh its probably because you input a table isnt it
it's to have a table that you can easily add more arguments too and have them be named arguments
yeah okay
Oh I need to make SMODS.poll_edition actually
which is better than poll_edition(ni, nil, nil, nil)
would i refer to the arguments by args.<name> then?
in a hook? yes
Does the calculate function of a consumable apply when its held in the hand or what
yes
What are you hooking the poll functions for?
Damn, I’m not sure how I’m gonna make this work. I want it to keep an internal counter to check if it’s still the same ante it was used on, and then, when a hand is played, it should halve the chips, sorry if this is shittly worded
is options in poll_enhancement just a table of enhancements like <key> = true etc.?
and is the output just the key as a string
eremel have you seen my fork of smods ?
🍴
see below and yes
we love the smods docs
if poll_enhancement returns nil, will that crash or just do an unenhanced card?
the enhancement page doesnt say what it returns lol
ok, so jokerless does it with custom = {
{id = 'no_shop_jokers'}, but as far as I can tell there is no id for 'no_shop_planets'
Did you make a PR?
challenges are annoying
So when you say that I would have to patch here, you are saying I would have to add something to the main game code? I can ban planets in the code for the challenge specifically?
yes, you would need to add a no_shop_planets and check for it there
Can I add the no_shop_planets somewhere in my mod instead of editing the actual code for the game?
bump
you need to hook/patch game functions for the game to read them
you dont necessarily need to patch there exactly, a hook would work
if you really dont want to do any of that you would need to wait for that smods feature like I said
no i just made a fork and edited some ui , i figured i ask before making a pr
you can just make a draft PR
I think it would be useful to see a mod that used a hook as an example
I’m not going to go and seek out forks and read them
I have much better things to do with my time
this edits the function that checks if a card is a face card for pareidolia
https://github.com/nh6574/VanillaRemade/blob/d4c5b52b83dc705da6fdaafbf5c49a3540532b15/src/jokers.lua#L908
Hello dilly, I am well, how are you?
i wish we could auto remove embeds instead of having to remove them ourselves for links
Thanks that helps
im doing alright, more awake now and livin
not sure what i want to do with the day yet
i just added some ui changes
I know that the way my mod is now pluto will still show up in shop and blue seals are still possible, but I'd like to playtest it anyway. But when I try to open balatro its crashing so I don't even think I have the folders set up correctly and I'm not sure what I am doing wrong
I don’t see much point for this tbh
its good for bigger modpack managment
is reload all mods just restarting the game anyway
feels like the keybind fulfills that purpose faster
what's the crash
Adding menu bloat to add niche use case buttons doesn’t seem ideal
i think an ingame button better than a hotkey that not everyone knows about
i'll keep it forpersonal use then
Pastebin
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
can i see the code too
also you can just send the file here
i mean i suppose, id just add a keybind section that says what keybinds do what to solve what not everyone knows about
do empty tables act the same as nil?
Eris what are you trying to do?
pressing a button is better than having to memorize a hotkey
im trying to hook poll_enhancement to remove enhancements that are in G.GAME.banned_keys from options
You mean four buttons right?
you need to press like 5 buttons to reach that
if you struggle to remember 'f5 to restart' then you have greater problems
im just wondering what to do if all enhancements are banned
because i assume it doesnt like it when poll_enhancement returns nil
youre missing the quotes around the file
or if options is empty
Nah returning nil should be fine
That’s what it does when your poll doesn’t hit
the game already does this i think
at least banner lets me ban all of them
Hey, just wanting to get some help, how could I make the event trigger whenever the ante is the same as the ante it was used and when a hand is played?
use = function(self, card, area, copier)
self.ante_used = G.GAME.round_resets.ante
self.active = true
G.E_MANAGER:add_event(Event({
func = function()
return true
end
}))
end,
i mean that does really say much because banner couldve also added a hook for that
Then it uses the current pool which should respect banned keys anyway
bump
It would only not look at the banned list if the options have been manually fed in
<@&1133519078540185692>
<@&1133519078540185692>
bro, i want help not scams
🔫
ty mods

small little bumpy :3c
okay so i think this would work?
since i dont need to do anything if options was nil anyway
its still crashing though
Pastebin
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
because that already respects bans
If #⚙・modding-general is a chat for mods then what's #💻・modding-dev 🤨
Options can also be an integer indexed table of strings
helping others, i mean... just look around
here is where mods get trained
syntax error, there's a missing comma or bracket probably
so i would also have to do k, v instead and also check if v is a key thats in G.GAME.banned_keys?
Well its good to know that forgetting a comma is as annoying to figure out in lua as it is in every other language lol
this is why you get a good editor that highlights errors :3
you can also make it complete your commas for you
wait, is there even a way to do this
okay NOW this should always work properly
== {} doesnt work
FUCK
ok, so why does the name of the challenge show up as ERROR instead of SpongeBob? and why aren't the three jokers negative?
do not next(table) or #table == 0
now would it be correct to assume that poll_seal doesnt respect bans by default, unlike poll_enhancement
youre missing a loc_txt for the first one
i think it does
it uses the same function
i dont know if challenges let you add seals to banned keys but no idea
Is that a separate file I need?
i forgot that i need to do something with this too,..,,,
I thought that was what I was doing with name = 'SpongeBob',
bump
oh banner adds defaults
ah
but i assume i wouldnt need to do that for enhancements because returning nil already works
yeah im guessing
would this solve the weight system
i made a joker that's like a blueprint for both sides of itself in joker forge and put it in with the rest of my mod but it's not copying the joker to the right, anyone know why?
because joker forge doesnt work properly with copying multiple jokers
it would be v.key but if v is not a table it will crash so you need to check taht first
then how would I fix ut
idfk ive never made a blueprint card
I'm so confused
how would i check if v is a table
there can only be one calculate function. you need to do all this in one calculate.
type(v) == "table"
what part
well now it's doing two returns which won't work
yes. you need to combine the return tables that you get from either joker
i think smods has a function for that
it does i made it :3
I replaced name = 'SpongeBob' with
loc_txt = { name = 'SpongeBob' }
and now the game crashes
jokerforge card copying is not working you just kinda cant copy in most cases
wait maybe because I forgot a comma again
use " not '
use not?
use quotes (") not apostrophes (')
" and ' both work
oh
theyre interchangable in like almost every single programming language i thought
this joker does the exact thing you want https://github.com/Trif3ctal/Tangents/blob/10786b7cb9cc36e8c92656ad4cc9af637c13835c/stuff/wankers/TheLegend27/its9inches.lua#L362
ok, I got the name working! WOOOO this is so exciting
Still not understanding why my starting jokers aren't negative though
idk i just use quotes and usually only see quotes
I have negative = true
try edition = 'e_negative' instead
i despise how this git path is
good git path
@lament agate
does this cover like every single way that options can be filled in now?
how dare u tattle on me
you would use pairs for options, not ipairs
also its usually not a good idea to modify a table while iterating it
Lets go!!! it was negative not e_negative, but that works!
ok, now to figure out blue seals
hi everyone can anyone tell me how i make this create the planet card for the most played hand? i know the key arg is what decides which planet to create but how do i make it look for the most played hand?
you would need to loop through the hands to check the most played (check Obelisk for something similar) and then iterate through the planets to get the planet for that (check blue seal)
when should I check if the ante has changed, the start or end of a blind
heres the one to get the planet i have in my mod https://github.com/nh6574/JoyousSpring/blob/0496dfe91c2fedfe5c5cfe6adb2d42ddb55d2c07/src/utils.lua#L599
so instead just make a list of keys to remove from the table and then remove them after?
i would do that yeah
wait no, i can just check when a hand is played and intregate it with the rest
I tried to add a custom info_queue, but it always returns without the text component...?
How would I get context into a Event?
Im trying to check if a hand is played and then trigger the false part
use = function(self, card, area, copier)
self.ante_used = G.GAME.round_resets.ante
self.active = true
G.E_MANAGER:add_event(Event({
func = function()
if self.ante_used == G.GAME.round_resets.ante then
print("Same Ante")
return false
end
print("New Ante")
return true
end,
blocking = false
}))
end,
bump, does no-one know at all what i need to put in config?
@slim ferry wait so can I use banned_keys to ban blue seals?
there are no contexts in use
only in calculate
How would i check when a hand is played
but you said the calculate only ran when the card is in hand, however I want the affect to apply when the consumable is used
sorry if what im saying isnt clear
you cant use the consumable and play a hand at the same time unless you modify the vanilla functions
whats the goal?
The card when used, gives the player a tooth, however for the rest of that ante the player will suffer with .5x chips
oh then you would need to do other stuff, thats kinda difficult
the easiest way i can think of is like Balatro Goes Kino's consumables that stay in hand after use and apply an effect and then get destroyed
oh, that does soundlike something I could try, thank you
else you would need to do stuff with dummy objects or things like that
I could probably make the tooth do the debuffing
ok @red flower so i have to use a hook to make a 'no_shop_planets' so that I can include that in my rules.custom
so I am going to write a local something but what function am I modifying?
i copied this code from another mod which is supposed to create the planet card for your most played poker hand, but it just keeps creating pluto. which part is causing this and what do i need to change?
Game:start_run
probably
I'm lost again I think
i honestly would just recommend waiting for that PR
When do you think that would be?
oh, ok then I guess I'll just wait
you can also use that version of smods
which version?
the one that includes my changes
of course it would be hard to convince othe rpeople to use it haha
How would I go about doing that? 🤔
@red flower btw did you mention there was a way to ban blue seals without a Hook? using banned_keys or something?
anybody?
im sorry thats from a month ago haha whats this about?
you can add them to G.GAME.banned_keys, maybe challenges already do that but no idea
try adding "Blue" as a banned key
would that be in restrictions or in rules? or somewhere else?
restrictions
so in restrections I can make a banned_keys table? and add id='blue' ?
ok so in cards I would put {G.GAME.banned_keys = 'Blue'}
Yeah makes sense 
I wanna add a custom section for my Localisation, and I don't wanna add my new entries to "Others"
;; When accessing my custom "Artist"-Section, it shows the Name but not the Text
-# basil_squaredd had a very very similiar issue and was able to resolve it by adding their new description to "Others"
But I'd like to know how to make the game register my new "Artist"-Section x'3
no 😭
like you did with the jokers and the packs
ah no idea
Gosh
Darn it
id = G.GAME.banned_keys.Blue
i did something like that by making a dummy object that extends from a center
but theres probably an easier way
no, just Blue
oh just id = Blue with no quotes or with quotes
with quotes
ok, adding this:
{ id = 'Blue' }, Makes the game crash at startup
whats the crash
i took a look through the process. this shouldn't be returning nil in nil.
further investigation is confusing me to no end - i tried intentionally causing crases by rempving config entirely from my table to no effect. i've tried doing config = { vars = { 1, 4} } to see if that's what's going on here. nothing. i've also tried wrapping the get_probability_vars in an assert() to see if i could work out what it's trying to grab, also to no effect.
why is it nil in nil
Pastebin
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
that looks like a syntax error
okay, i ended up giving up and solving it this way
not the best way to do it, but should be fine for now, i guess?
yep you're right I spelled id wrong 🤦♂️ ok now the game boots but it crashes when I look at the restrictions on the challenge screen
Pastebin
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
I think because it doesn't know what Blue is
yeah then seals dont work
Darn
Honestly that doesn't bother me as much as the fact that pluto cards still show up. If I could figure out how to ban planet cards I would be happy but I think I just don't know enough about lua to understand how hooks work
@red flower How does this mod prevent planet cards from showing up in shopt? https://github.com/NewtTheFish/SylvieSilly/blob/main/SylvieSilly.lua
He seems to just set planet_rate=0
I can't be the first person trying to ban planet cards in a challenge right?
no its not that hard to do what i said lol
lol, I'm sorry I am having such a hard time lol
maybe try SMODS.add_card{type = "Planet", key = _planet}?
-# Other it is, sorry to whomever might search trough all tooltip messages for a solution 
This dude is literally trying to do the same this as me: https://discord.com/channels/1116389027176787968/1352326255474770041
still only creating pluto. maybe the issue is with the system for detecting the most played hand?
now that im testing the joker i copied this from it also creates pluto, so the issue is in fact the code for detecting most played hand
id probably try printing v.config.hand_type and G.GAME.current_round... to see if they are different
nvm actually after playing more hands it works, so the issue is within my own code
@red flower I need something like this? But i don't know what the og function is and also idk how the syntax works
local SomeFunction_old = ???
if challenge is spongebob
self.GAME.planet_rate = 0
else
local ret = SomeFunctionOld()
return ret
end
i already checked the example vanilla mod and also tried searching the modding wiki on github but
theoretically speaking
how would one go about making a joker that gives 5 times current ante in mult?
and how is one expected to find specific variables on their own?
im so confused
G.GAME.current_round.ante i think?
This one I think I can answer lol. Copy the Balatro.exe file to a different folder, change the extension to .zip and unzip it. Then open the files and look for the variable names
the function is Game:start_run, read it in the source code
also for the logic here you dont want to do an if... else... because you want to run the original code always
the key for the challenge is in G.GAME.challenge
but as for the latter part of your question, mostly just remembering the variables through muscle memory lol
ah!
I didn't know you could do that thank you 💖
Hi bepis
i recommend checking the code in the lovely/dump folder in your mods folder instead
pretty sure its G.GAME.round_resets.ante
yeah makes sense
i always mix round_resets and current_round, bleh
ok so I start with
local Game:start_run = SomeObject.SomeFunction
but what is the object function? it equals? Is that SMODS.Challenge ?
i guess i could try them one bye one
ill do that first actually
Ooo
Does it add the total to cav
Ie becomes x4.13 or does it do x3 and then x1.13
Jimbo's weakest cousin
nope, you got it backwards
local game_start_run_ref = Game.start_run
they multiply each other
You can open the game.lua and search for terms you know to find the actual things you need
Icic
its almost X2
by almost i mean X5.99999 mult type of almost
but also, you arent meant to have this much passive and attacks anyways lol
-# at least, not outside of bsr
That's pretty epic
Almost like my glitch edition which gives a random boost to values
those effects use their own calculate
ok, then
Game.start_run = function(self, arg1, arg2)
but then what is this function?
and very easy to add new effects too
wdym
To make mine work I had to do some wack ass hooking lmao
The link you sent me the example is
SomeObject.SomeFunction = function(self, arg1, arg2)
so is that
Game.start_run = no_shop_planets()
no
I am trying to follow this
local SomeFunction_old = SomeObject.SomeFunction
SomeObject.SomeFunction = function(self, arg1, arg2)
print("PRE hook!")
local ret = SomeFunction_old(self, arg1, arg2)
print("POST hook!")
return ret
end
tbf my hook is pretty wack too
-# i did fix the table later on
local game_start_run_old = Game.start_run
Game.start_run = function(self, args)
print("PRE hook!")
local ret = game_start_run_old(self, args)
print("POST hook!")
return ret
end
Ill have to show you mine sometime
Im pretty sure it doesn't even work for dollars but I haven't checked
right so then what is the function(self, args)
the hook is as i wrote it
you would only replace the prints with your code
args is the argument to the original
OH! I thought the function was a place holder fo rmy function
ok so then where to I set planet_rate=0? instead of the prehook print statement?
sob
probably instead of the post hook
and can i just not have a pre hook?
yeah
So like this:
local game_start_run_old = Game.start_run
Game.start_run = function(self, args)
local ret = game_start_run_old(self, args)
planet_rate = 0
return ret
end
How do I make it only disable planet cards inside the one challenge though and not everywhere?
you can maybe do G.GAME.banned_keys["Blue"] = true there too
it's G.GAME.planet_rate
and you would check if G.GAME.challenge == "your challenge key"
local game_start_run_old = Game.start_run
Game.start_run = function(self, args)
local ret = game_start_run_old(self, args)
if G.GAME.challenge == "spongebob"
G.GAME.planet_rate = 0
G.GAME.banned_keys["Blue"] = true
return ret
end
like that?
you're missing the then and end on the if statement
are you missing lua extension
also im not sure if the key for the challenge is correct
it might need to be ch_key or something
local game_start_run_old = Game.start_run
Game.start_run = function(self, args)
local ret = game_start_run_old(self, args)
if G.GAME.challenge == "spongebob"
then
G.GAME.planet_rate = 0
G.GAME.banned_keys["Blue"] = true
end
return ret
end
c_[modprefix]_[key]
aside from the key thing i just said it looks correct
what is the mod prefix?
whatever you set in your json file
oh right
And did I put the hook in the right place?
...uhhhh
why is it doing that?
can't reproduce it
not sure what i did to make it happen
i only see one line
my bad
yeah thats good
omg apparently not
Pastebin
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
yep yep, what part of the error messege told you that was the mistake
finally finished this up, it should account for actually everything now
whats the first part for
allows ignoring bans if you dont fill in options
heyaa does anyone know is there an option to check if the joker is being retriggered? i want to make so one of its abilities is not affected by retriggers
but if i wanted to do that what pool would i even check
if context.retrigger_joker iirc
wdym
thanks!
well if you pull enhancements from a pool
you can use any pool
and how would i check in the correct pool
OK! I think everything is working and I learned a bunch. Thanks for the info and patience @red flower and @slim ferry 🙂
bump
poll_enhancements is always on the enhancements pool
or the options
not in a custom pool
well then it wont ignore that though right?
because if options is filled in it changes nothing
and otherwise it does the regular enhancements pool like usual
Hey um on a scale of 1-10 how hard is modding balatro without jokerforge?-
no, because you're adding all enhancements into the options with your first condition
yeah you would need to check in_pool for each
is G.P_CENTER_POOLS.Enhanced not the enhancement pool?
yes
but it has all enhancements
in_pool doesnt remove it from the pool directly
thats why get_current_pool exists
works! thanks ^^
and how would i check in_pool
where is that
because its not a function
is it in G.P_CENTER_POOLS?
for each enhancement
so just add if v.in_pool?
you need to add the entire if block in the screenshot
if v.in_pool would only check if the in_pool function exists
honestly it was probably easier to patch get_current_pool to not check banned keys lol
but then where would i add the enhancements to options
im goimg imnane
because this just makes a bunch of variables
but i dont see it doing anything with them
besides changing them
you would add it if the returned in_pool is true
What's your atlas definition?
Or are you trying to pass animation atlas to a joker?
Like in joker
i think you can ignore pool_opts for enhancements
this is my entire joker lua (the message above urs)
youre just putting a png path
you need an atlas
unless your atlas is called joker.png which i doubt
Oh I'm on mobile I thought it was a crash log
am i seeing the wrong file
the problem is that the atlas shold be named Analog in the joker
both of you said it wasnt there so i thought i was crazy lol
can you tell i have no idea what im doing
hey um
i tried looking inside the game.lua file
i couldn't find the voucher redeem context at all
i need to make sure hieroglyph is accounted for and stuff since im not just making a joker so um
how do i?...
is this correct?
also when would something not be banned but also not be in_pool anyway
I have examples of this but probably not your use case
Oh wait no you mean in general
A lot of things can be not banned but not in the pool
its easier to add an in_pool than hook a function to ban the key
or hook a function to unban the key dynamically
yes
Yeah
context.buying_card
They could be in the pool but have a weight of 0
this is supposed to trigger if all cards held in hand are either hearts or clubs, so i have it do nothing if it finds a spade or diamond, otherwise it runs the rest of the code. but for some reason it's doing nothing in both cases? what did i do wrong here?
So if you’re creating objects, I suggest not creating those with a weight of 0
context.individual and context.joker_main dont happen at the same time
also why dont you check for the suits directly?
this will work incorrectly with any modded suit
if i do that it will still trigger if there are hearts/clubs AND other suits
i need it to be only hearts/clubs
Check if the card is hearts or clubs and if not stop
You currently only stop if it’s spades or diamonds
What if it’s a modded suit?
hey. I'm a noob
`v_1_joker: "1 Joker Tag"
v_2_jokers: "2 Jokers Tag"
v_3_jokers: "3 Jokers Tag"
v_d_tag: "D Tag"
v_reroll_tag: "Reroll Tag"
are these vouchers? tags?
Your check would not catch it and youd end up with a hand that could contain other suits
jumpscare
does something like this work?
No because like N said before, context.individual and context.joker_main are never both true at the same time
oh right forgot to fix that
vouchers use the prefix v_, so i assume theyre vouchers? seems like wierd names for vouchers though
tags have the prefix tag_ so identifying them is usually pretty easy
that's the base game code
That said you're not still checking correctly anyway, if you need to poll all cards in hand
bump
where in the base game code did you even find these lmao
You'd need to loop through the rest of the cards in G.hand.cards and then cancel if any of them are not your two valid suits
you probably want
if context.joker_main then
local is_all_h_or_c = true
for _, pcard in ipairs(G.hand.cards) do
if not (pcard:is_suit("Hearts") or pcard:is_suit("Clubs")) then
is_all_h_or_c = false
break
end
end
if is_all_h_or_c then
-- your effect
end
end
yeah
in the language file 🙁
i cant find them...
what the FUCK is a 3 jokers tag‼️
it's like the 1 Joker Tag but x3
exactly
Is this a modded thing?
IDK
i love 1 joker tag
7 grand tag
yoo
Honestly Cardsauce should add one of those or smth writing that down
Idk we already have a 7 grand dad joker
for some reason this part that's supposed to create the planet for most played hand only updates each ante, so like if most played hand changes on big blind it only starts creating the new planet card after the boss blind. why's that?
Winter :)
because that value is set for blinds that check for the last ante, you would need to check in a loop through all hands like I said before
obelisk does something similar, but instead of checking the most played hand it checks if any hand has been played more than the current one
you can use this as a basis for what you want
https://github.com/nh6574/VanillaRemade/blob/d4c5b52b83dc705da6fdaafbf5c49a3540532b15/src/jokers.lua#L2124
Doesn’t the Ox do that
Oh i see
I meant if it works
for obelisk it has a set hand to compare with, that being the current played hand, but for me I want to get THE most played hand, so i can't compare it to another hand and say "yes, this hand is played more, trigger the joker effect now"
how can i achieve that?
look at the screenshot i just sent
What is reading
Two if we count the SiIvagunner mod.
But I think Love Live jokers would be peak
how do i up text size in a joker's title
idk if you can
im making a double-blueprint of sorts, how do I also copy target_joker2
we said before, SMODS.merge_effects() you want to merge blueprint_effect with joker1 and joker2
where would I put it
change return to local ret =
Had to leave that day, thank you so much!
takes any number of 2D arrays
once you have ret from your first blueprint effect, and something like ret2 storing your second blueprint effect, it's literally justreturn SMODS.merge_effects(ret, ret2)i think
should be SMODS.merge_effects { ret, ret2 } iirc
sanity check: does the seed value passed into pseudorandom_probability become the context.identifier in context.pseudorandom_result?
so for example, lucky card mult proc is SMODS.pseudorandom_probability(self, 'lucky_mult', 1, 5), i can detect that on the other side via context.identifier == 'lucky_mult'
yes
i literally sent you the entire code 😭
apparently the link is blocked
microsoft family safety
goddammit nxkoo
i should have edited some weird choices here but i cant be bothered
Something I do every night before bed with a concerning list of tags in my AO3 filters
is this double sided blueprint lol
yes
great i guess lol
hmmmmm trying to figure out the best way to display artist credits for my decks....
infoqueues are usually what people do
also is your mod out yet?, i think i asked before but i just wanna check some shader codes
i got mine working btw
thanks again
No, it's currently private b/c it has my real name on it and it's unfinished
please let me no when it's public
know*
sure, it'll get a thread here
idk what's up with me sorry my headache is getting the best of me
idk I don't think you did anything wrong?
just a spelling mistake
oh I see, shrug
btw how can i give a card a sticker
use Card:add_sticker(sticker_key, bypass_check)
local btct = {ticks = (1)}
local upd = Game.update
local btct_DEvil_dt = 0
function Game:update(dt)
upd(self, dt)
local DEvilobj = G.P_CENTERS.b_btct_DEvil
btct_DEvil_dt = btct_DEvil_dt + dt
if DEvilobj and btct_DEvil_dt > 0.1 then
btct_DEvil_dt = btct_DEvil_dt - 0.1
if DEvilobj.pos.x > 30 then
DEvilobj.pos.x = 0
else
DEvilobj.pos.x = DEvilobj.pos.x + 1
end
end
end
for k, v in pairs(G.I.CARD) do
if v.children.back and v.children.back.atlas == G.ASSET_ATLAS["btct_DEvilAtlas"] then
v.children.back:set_sprite_pos(G.P_CENTERS.b_btct_DEvil.pos or G.P_CENTERS["b_red"].pos)
end
end
this doesnt update the deck constantly but it does update if i look at a different deck and look at this deck again. How can i make it update constantly?
Uhhh question, does this work? Or do I have to hard declare the self argument if I send it to the function explicitly
Otherwise I can just do this I suppose
I've got a working language pack that change up some names, but the misc = {} section isn't working
what's wrong here?
is it nested one too far down?
it should be at the highest level of the return table for the localization
For example I'm fairly certain I saw you had quips aside it, but quips is actually within misc in the vanilla structure
yeah, it was the nesting level
imma bump this since htis is apparently the only message that was sent about this but never answered. for me its before scoring tho
i never figured it out myself and just used a similar effect
..which likely wouldn't work for whatever you're doing
it's ok, i was already chatting in the next channel over
imma look at how the calculate works in the game elsewise rq
how does one check the amount of money one has
its dollar_buffer or something, right?
G.GAME.dollars
k_not_allowed_ex is supposed to be the "Not Allowed!" text, right?
so G.hand.chips * G.hand.mult right
wait it's the guy from reddit that is doing the same thing as me XD
i'd assume so
wait fr?
there are 3 different ones
which one
i'm the guy that suggested we join forces
and nobody listened even though it'd be a great idea
i didnt see this :(
it's ok
competitive me
you can help code tho for sure
i also have another developer but he got another remote job + exams so hes busy
there are also some jokers that have no art and I did some myself
*hacker voice* i'm in
back to this, is the psychic stupid?
everything else is working so idk
try searching for "Not Allowed!" in the language file maybe?
maybe the psychic is just stupid though idk
that's the first thing i did
did you save it
bump
hi team. im bumping a wall rn tbh. why the hell dosent the context.before and context.after trigger? the context.joker_main works perfectly fine
calculate = function(self, card, context)
if context.joker_main then
return {
xmult = card.ability.extra.xmult
}
elseif context.before and context.cardarea == G.play then
card.ability.extra.old_chips = to_Number(G.GAME.chips)
elseif context.after and context.cardarea == G.play then
print(to_number(G.GAME.chips))
print(card.ability.extra.old_chips)
if to_number(G.GAME.chips)-card.ability.extra.old_chips >= to_number(G.GAME.blind.chips) then
because the joker isnt in G.play
i think what youre trying to do is iterate over G.play
but this isnt the way to do that
also i dont think G.GAME.chips exists, pretty sure its G.hand.chips
idfk what im doing wrong
hardcode moment
you dont need to so elseifs for each context check btw, each check can be (and generally should be i think?) its own if statement
there must be a better way 🤔
its that little more computing power you need to squeze out
okay well apparently the docs are just fucked up ig
apparently i can just use context.before without the context.cardarea check 🤷
for the context.before check you should instead do if context.before and context.main_eval and not context.blueprint
or
i assume the context.after check could be the same as the context.before
wierd that the docs do it like that though, because context.cardarea == G.play would be for enhancements...
in context.before/after at least
ea
yea
wth
context.after triggered before scoring finished
uhhh,,
did you put context.main_eval
because you could maybe try doing not context.main_eval? idk if that would work
putting the not just prevented it from triggering
gonna go sleep
ill ask tomorrow
tysm for trying to help <3
am i stupit (dont answer that) whats the context for scored cards
context.cardarea == G.play
no i mean like, for getting the amount of scored cards
#context.full_hand is the full hand
That's the "amount" of cards in the full hand.
context.full_hand by itself contains said cards.
yes, thats what im looking for, lol
im looking for the number of scored cards
i suppose i could just count them
context.scoring_hand
i really don't wanna do this, but it seems i have no choice
where do you put this? or just plop it at the end of the main.lua?
I want a localization for k_not_allowed_ex, but it's not working (as shown earlier)
i don't know why thunk has that hackfixed but you can try patching that line to reverse it
"But Winter," you might ask, "isn't it completely unnecessary and overdesigned to make every single one of your functions hooks completely modproof in terms of arguments and returns?"
And to that I would reply, "Yes."
wait that's in the SOURCE CODE?!?!?!
yes
wtf man
if anyone adds a single new argument to a function im hooking im sending them a virus
same if they return something in a function that doest return anything
......I can see use cases for it
wait so how do you fix it
[[patches]]
[patches.pattern]
target = "functions/state_events.lua"
pattern = '''play_area_status_text("Not Allowed!")--localize('k_not_allowed_ex'), true)'''
position = 'at'
match_indent = true
payload = '''
play_area_status_text(localize('k_not_allowed_ex'), true)
'''
that?
where does it go?
goes in a .toml file
FUCK IT WE BALL
i should probably fix that in my hooks too
forgot how quotes work
there's a set of single quotes too lol
oh damn
incredible line
i don't understand :(
according to meth, none
a
but i already had it like that from copying smods
why did smods change it
it's futureproofing. It might not be necessary now but could be useful later
Do I replace "Not Allowed!" in pattern with what I want instead?
wait nevermind i'm dumb
i just realized that it just replaces hard-code into a localization
how do I make a deck that starts with a specific joker,consumable,playing card with specific edition stickers etc
Bump
the for loop is outside of update
I'm looking at the BUMod's hook to change the hangman text into two lines (since returning a table inside of the loc file crashes the game, unless i missed something), and it has a hook for the card's center.
All that is to say, what is the voucher's center that has the 'REDEEM' text in it?
that's beyond the point, you get the idea.... What is the pointer to that text?
that's not beyond the point, it's what you asked lol
wdym pointer? the key? the ui node?
...localization entry?
b_redeem
okay im a little stuck, ive been looking at refrence code, and the smods wiki but im unsure how to go about making my new tarot function which will turn all cards in hand to an enhancement like a stone card, ive got the enhancement working i just dont know where to start for creating the config stuff for it.
you would do the stuff in this comment but instead of G.hand.highlighted you would use G.hand.cards
https://github.com/nh6574/VanillaRemade/blob/d4c5b52b83dc705da6fdaafbf5c49a3540532b15/src/tarots.lua#L1006
oh sweet thanks so much
no, that's not it
I want to write two lines into the 'REDEEM' text (that is in b_redeem), but passing a table into it crashes my game
b_redeem = {
"two lines",
"of text"
}```
So, I thought of BUMod and how it does it with the Hanged Man, where it says "Hang / 'em" so I went to that as a first idea. In there, I found out that it has a hook for `G.UIDEF.use_and_sell_buttons` using the card's `card.config.center.name/key` to interact with it within the code. Naturally, I wanted to find an equivalent to that within the voucher, and now we're here
In short: how do you put two lines of text instead of REDEEM in the voucher
you would patch into the code were b_redeem is used
if you want it for a certain voucher then you would need the key of that voucher but thats not relevant if you want it for all
it's in create_shop_card_ui
for some reason, moving my mouse over the edge of jokers with custom badges crashes the game??
there b some insane ui hook code im writing
the crash seems like it's trying to display a ui that was removed
but no idea
Oh so where do i put it?
well here's how i'm handling badges
does it work if you hover over them twice normally?
as far as i can see it shouldnt
because you're creating the badge once and it's getting destroyed as soon as you close the description
?
okay yeah it's not about "the edge" like i thought before, it's specifically on the second hover
yeah that makes sense
it's not the same joker either
the second time i hover any joker with a badge
wait i think i get it now lol
yes because they all share the badge
yeah
as soon as you unhover any uibox it destroys all the children
thats why you need to recreate nodes or you need to copy cards when displaying them in a UI window
I seriously don't like the UI functions for this game...
Here's what I know:
- the use button of the voucher is a certain "t2" type object that contains a UI.T node with localize('b_redeem'), which is what i'm looking to hook.
- BUMod uses a different, custom UI.T for their use button. I don't know what the difference is yet, but clearly they did something to allow for line breaks.
I'm completely clueless as to what to do still, by the way
i'm trying ;-;
t2 is the name of the variable, not the object type
what they did is probably just add an extra row of nodes
in the else orrrrr?
the buy and use button code is below that, you can check that out for two rows
idk
here's what i'm gonna do
since i'm a Professional Programmer™, I'm going to do a pro gamer move: ctrl + c, ctrl + v
and see what happens
help i can't check my deck suits and all that bc everytime i click on the deck i get this error
i only modified the rarity of blueprint to common so idk if i may have just missclicked something else
this kinda looks like you don't have SMODS installed... have you?
what's smods
or are you modifying the game's internal code? 😰
ok
?
okay, i started using print to try and trouble shoot, and my joker is trying to retrigger the joker to it's right, but fails to do so.
Code below.
it's trying to retrigger 4 times, but other than it not being able to retrigger, i dont know what else there could be wrong with it
if anyone can help push me in the right direction, that would be very helpful
alr bro theres like 5000 words to read right there and i need to install lovely, install steamodded and then idk what else follows and im not doing that only to fix not being able to see how many kings i have
If you want to mod the game, you probably want to use that because it makes it orders of magnitude easier
i dont think anyone here is going to be able to help you with modifying the exe directly
At the very least, try to install them and then maybe we could help you from there
especially not when the crash logs don't help in that situation
ok imma have that done when i complete the plasma gold stake so i finally have 2 goldstakes
update: it didn't work :(
i give up, this shit is too hard
it works thanks
bro i think i found out what went wrong let me tell you if i actually made it work
lets fricking go
i found out what went wrong
i fixed it
guys do you know why this keeps crashing? its the g.sound.play or its sound = "xmpl_whatevername" (fixed)
the hell is G.SOUND
use play_sound(key, pitch, volume)
oh ok
like this? play_sound("xmpl_myhonorvoice", 1, 75)
or the pitch and volume are optional?
75 is much too loud
1 is 100% volume
not optional
alr
i believe
thanks
only the key isn't
how do you check if something is in the pool or not?
is there a way to check the start of an ante?/what is the context for the start of an ante/the first selection of blinds
actually nvm i have an idea lol
you would check if the prototype has an in_pool function and it returns true
now it crashes when play_sound("myhonormusic", 1, 1) lol
do u have the mod key prefixed to ur string that u pass in?
like the SMODS.Sound({ key = "xmpl_myhonorvoice", path = "myhonorvoice.ogg" })
yeah]
?
alright, thank you
so do play_sound("xmpl_myhonorvoice",1,1)
or just play_sound("xmpl_myhonorvoice")
if what im told about the last 2 numbers is correct
How can I change this joker to Cryptid exotic
I already have Cryptid as a dependency
set it to cry_exotic i think
String or just replace 4 with cry_exotic?
i have xmpl_myhonorvoice and xmpl_myhonormusic
as a string
Thx
ok no i do have one thing to ask
for no reason
is there any way to detect when you ARE rerolling a boss blind, using the tag or the director's cut/retcon vouchers or otherwise
yeah, just pass in the whole key with the mod prefix whenever u play a sound
someone correct me if im wrong but i believe you have to hook G.FUNCS.reroll_boss()
i dont believe theres a context for rerolling boss blinds
so the code SHOULD not crash?
unless theres some other issue, yeah
that makes enough sense at least but how woudl i go about doing that if you mind my asking
or how should i start
any_global = 0
hook = G.FUNCS.reroll_boss
G.FUNCS.reroll_boss = function(e)
any_global = any_global + 1
return hook(e)
end
or something like that
i mightve messed up something tho
its at least smth i can try to work off of, im not the most familiar with hooks n all yet so i appreciate it lol
oh right it needs to reset to 0 when a run starts
(almost) full code
the general idea of a hook is to store the function in a global variable, then override it, do any functionality you desire and call the stored function
are you still crashing?
yep... same error
real quick can i see the sound definitions
so like where u create the SMODS.Sound(s) that u play
if you comment out the play_sound function, does the joker work as intended?
like how
Have you tried removing the xmpl_ from the keys?
it needs the prefix
No, only the play_sound function does.
Yes, it says only when accessing the sounds.
delete xmpl from the key there
key = "myhonorvoice",
path = "myhonorvoice.ogg"
})
SMODS.Sound({
key = "myhonormusic",
path = "myhonormusic.ogg"
})```
ok
Nope!
crash
Thread error (Thread: 0x01dfa0c4cd80)
Could not open file resources/sounds/myhonorvoice.ogg. Does not exist.
stack traceback:
[C]: at 0x7ff9a3d958a0
[C]: in function 'newSource'
engine/sound_manager.lua:63: in function 'PLAY_SOUND'
engine/sound_manager.lua:197: in main chunk````
wait i will do smthing
can i see the file directory for how u store the sounds? like up to the resources folder
huh
i dont even know whats happenin
ok so the joker 1 in 2 chances of x2 mult, 1 in 2 chances of x2 chips, 1 in 8 of losing instantly
ok, last ditch effort try adding back the mod prefix to the function calls only but remove the extra numbers
hmm i think we need the help of some outside people
i will bring in the heavy artillery of actually intelligent people
:0
so wait this would check for if a boss is getting rerolled but how would i call it/check it
-# like just if hook() or
so when the game naturally calls this (due to a boss reroll), it will call the new function
you dont call the function urself unless u want to reroll the boss
so wait the hook just would change how the function is
OHHHH
hangon i think i might get what you mean
yeah a hook changes the functionality of a function
or rather adds on to it
so what i should be doing is not checking if hook() but rather the variable change or smth else associated with it
so by adding a global counter to the function i can get the number of times the boss has been rerolled
i see now
real quick are u trying to do an effect whenever a boss is rerolled?
the solution i sent earlier works if ur joker scales based on boss rerolls
No, it doesn't because the variable would reset when reopening the game.
yeah, to be precise im just having it reroll whenever the eye is encountered
i want the visual effect to be there lol
ive already got a case covered mostly, in the case of just ending the shop, but its the Reroll im checking
any_global = 0
hook = G.FUNCS.reroll_boss
G.FUNCS.reroll_boss = function(e)
any_global = any_global + 1
return hook(e)
end
wait hold on am i misunderstanding how hooks work
oh right the global isnt saved
aaaaa
i should not be trying to help people right now my brain is fried'
(For context it's a reference to a creepypasta that's become an inside joke in a friend grou pim in)
should i hook start_run too then maybe so it DOES get reset?
Also hook should be called oldgfuncsrerollboss or similar and be local.
no u need to save it to G.GAME i believe
What is the goal?
that was mostly a dummy name but i'll make sure to remember the local whenever i do hooks
Then you would probably just remove it from the pool.
yeah imma leave i cannot program to save my life rn
well given ive hooked the boss reroll, i just need a way to set up a global counter that can reset to 0 at the start of a run
i can probably figure out a way to detect the change easy enough
that's true, admittedly the rerolling every time is more of a visual thing im going for lol
i think i did manage to figure smth out with it so i appreciate it :>
really i just gotta figure out a proper way to detect the global var changing now but it shouldn't be THAT hard
Im genuinly strugglimng so hard to find out how to make the description box thinner
is there a way I can get a joker to directly modify the round score?
Can someone with a little more lua knowledge than me explain why exactly trying to change the third argument here doesn't work?
I get the results I want if I'm using the named arguments the function is declared with, but I want to make the hook respect other mods
Modify G.GAME.chips
whelp I figured this out, weh. It's an issue that's been solved in 5.2 onward so I just have to deal
quick ques, what function is run when a joker is removed?
im assuming Card:remove() but just to be sure
Yes.
wtf is this
G.shop_jokers, G.shop_vouchers and G.shop_booster
i feel so old that people dont know the MARIO creepypasta 💔
mhm thanks
is there a way to change the way the deck acts instead? Because i want to create a specific joker on a deck and the sleeves special feature of that deck is changing it to negative. My first thought was just to check once card is created then just negative it but i was wondering if there might be an easier way to do it?
???
Hi guys, does anybody know if there's a way to force trigger jokers, not like a retrigger but like, for example: i have perkeo on my jokers and another joker forces its activation after you discard a card, just an example
Yes, but you would need to add support for it yourself.
Or just use Cryptids function, if it is installed.
Honestly haven't checked (nor downloaded) criptid yet, lmao
i'll look into it
Whats the name of the card that uses that function?
i don't think it's a card, the Hooked sticker forces one hooked joker to trigger whenever the other one triggers and vice versa (the hooked sticker can only ever be applied in pairs)
Demicolon
But everything related to forcetriggering is in forcetrigger.lua
Yeah, im seeing it now
honestly didn't thought it would be this complicated lol
Jesus cooking rice
Depending on whatever, even older people may not be well versed in creepypastas (myself kinda included)

i dont know like any of them
they were just never my cup of tea
if self.get_current_deck_key() == "b_btct_DEvil" then
G.E_MANAGER:add_event(Event({
func = function()
if G.jokers then
SMODS.add_card{ key = "j_btct_EvilAndTwisted2006ChevySilverado", edition = { "e_negative" } }
end
end,
}))
else
What does this crash mean?
-# (the code is not where the crash is btw)
edition should be a string, not a table.
oh woops thanks
most of the code is related to the logic for forcetriggering vanilla jokers
so allat has to be custom
a little help here?
G.GAME.joker_buffer = G.GAME.joker_buffer - #destroyed_jokers
G.E_MANAGER:add_event(Event({
func = function()
for _, joker in ipairs(destroyed_jokers) do
joker:start_dissolve({HEX("ff0000")}, nil, 1.6)
play_sound('slice1', 0.9 + math.random() * 0.2)
end
-- trying to figure out how to add all of their sell value to the joker
card.ability.extra.mult = (card.ability.extra.mult or 0) + total_value
card:juice_up(0.8, 0.8)
G.GAME.joker_buffer = 0
return true
end
}))
return {
message = localize{type = 'variable', key = 'a_mult', vars = {total_value}},
colour = G.C.RED,
no_juice = true
}
in theory, how would i make this so that it gains all of the joker's sell value and put it into its own sell value
local total = 0
for k, v in pairs(G.jokers.cards) do
total = total + v.sell_cost
end
card.ability.extra_value = (card.ability.extra_value or 0) + total
where would i put this
Probably replacing -- trying to figure out how to add all of their sell value to the joker
letting the extra mult ability?
@manic rune he did answer
here's the thing tho
it just
doubles the player's money
how
Show the entire joker code.
its a hook, ill show that instead?
Yes.
hold
Yes, you're setting the button to be use_card
shoot
what do i do then
You set it to a G.FUNCS function that runs your use_joker function.
oh
right
so i just
change it to use_joker?
No, because that is not a G.FUNCS function.
is there an easy way to find what card area i should use based on just the set name of a center
in order to support other mods content easily
No.
rip
In what sense?
Bump
Wait how does someone even make misprint-like text
can you detect how much cards the player bought?
No, you have to count it yourself I think.
Do I need to manually put game seed into pseudorandom()? If yes, how do I access it?
No, you just put a string.
got it
Will pseudorandom_element(G.P_CARDS, pseudoseed('colr_green')) work in 0711a or does it also need to be converted somehow?
No pseudorandom_element is used to fetch something random inside a table so it's fine
Thanks
Rounds numbers
turns 4.9 into 4
got it
thanks
im trying to fix this one joker
it goes into negative mult whenever the game crashes
What’s the issue
that
Can i see the code
Use abs
there
I’m on phone, can you screenshot?
Huh? It doesn't even say where it went wrong in my code
Code?
I tried removing card_eval_status_check and the G.E_MANAGER:add_event things to check where the problem is, but problem was still here
in where