#Easier Scoring - Snapshot 24w28d

1 messages · Page 1 of 1 (latest)

timid pike
#

_

Easier Scoring

This mod implements easy functions to put in your Jokers calculate functions, so you can focus on what your Joker does instead of thinking about what to put into the return{} brackets.

Commands

  • aChips(amt,card,context) adds amt to the Chips amount;
  • xChips(amt,card,context) multiplies the Chips amount by amt;
  • aMult(amt,card,context) adds amt to the Mult amount;
  • xMult(amt,card,context) multiplies the Mult amount by amt;
  • addMoney(amt,card,context) adds amt to the $ amount.

Examples

In order to use it, put this code in your Joker's calculate function

if context.joker_main then
  aMult(20,card,context) -- does +20 Mult
end

other versions to multiply Chips (like for each scoring card) are made like this

if context.individual and context.cardarea == G.play then
  xChips(3,card,context) -- each scoring card does x3 Chips
end

Compatibility

This mod is fully compatible with all mods that don't implement/modify these functions:

  • aChips()
  • addMoney()
  • aMult()
  • calculate_joker()
  • xChips()
  • xMult()
GitHub

Contribute to cerloCasa/Easier-Scoring development by creating an account on GitHub.

modern vapor
#

haha blue number go up

tawny mulch
#

nice

#

but that syntax you went for there actually can't be compatible with proper visuals, you'd need to pass the card to the message

timid pike
#

yeah I thought about that

#

but since this implementation of the function doesn't add any visual at all, I just did xChips(amt)

#

I think v1.1 will be xChips(amt, card) with the card being a playing card or a joker

#

do you think it's possible?

tame harness
#

You can search for xchip in the project to see where it's being used

#

Math said he might add PR to steamodded for this

timid pike
#

Now I added the visual update

#

it functions like the others

timid pike
#

Easier Scoring - Add and multiply Chips and Mult without the return{} function

#

Easier Scoring

Updated the mod so it doesn't only add xChips(amt,card) but also adds Chips, Mult and XMult!
Github is here

GitHub

Contribute to cerloCasa/Easier-Scoring development by creating an account on GitHub.

timid pike
timid pike
rocky marten
#

Hey where's my tetration function

#

How will I ever make my custom Joker now

Imbalance
Legendary

^^2 Chips

timid pike
rocky marten
#

(In case you aren't a math whiz, 15^^2 = 15^2^2 = 50,625)

timid pike
rocky marten
#

If ANYONE dares put tetration on a Joker I will eat my own hat

timid pike
#

lmao

rocky marten
#

I know we like e notation

#

but that's too free

timid pike
rocky marten
#

I

#

Hm

timid pike
rocky marten
#

Yeah no, I don't see powers ever being balanced

#

Even ^1.1 is nutty when stacked with Blueprint or w/e

timid pike
#

that's just a proof of concept

rocky marten
#

At some point you'd need something like break_infinity.lua
god forbid break_eternity.lua

timid pike
#

i don't plan to actually add jokers with pow mult

rocky marten
timid pike
#

lmao

#

Joker with Mult^1.001

rocky marten
#

Finally something less useful than Jimbo

#

Unless your Mult is what
250+

#

It's too late for me to be doing the mental math on that

#

2000

#

Wait, no, that's not how powers work

#

gah

fresh stirrup
#

yep, it's a ^Mult joker
gain ^0.01 Mult when Xmult is triggered, start at ^1.1 Mult

fresh stirrup
fresh stirrup
timid pike
#

i didn't say it was a bad thing

fresh stirrup
#

yea, it's not bad tho, just satisfying to watch

#

fyi ^Mult and ^^Mult have their own sfx

fresh stirrup
#

15^^2 = 15^15
15^^3 = 15^15^15

rocky marten
#

it is 11 pm

#

my brain is just not working

timid pike
#

Name: Balanced Joker
Rarity: Common
Effect: X(4!)^^6 Mult

timid pike
#

jokes aside, I made this mod to help new modders to create their jokers without having to check game code and possibly making errors

#

I have very little experience with lua programming and modding, so I thought having a function called aMult(3,card) would be easier than

return{
  message = localize{type='variable',key='a_mult',vars={3}},
  mult_mod = 3,
  colour = G.C.MULT
}
#

and all errors that could come with it

#

A little issue I'm having with this, is that when Brainstorm copies the aMult effect, the juice_up animation is still activated on the first joker and not on Brainstorm

#

same happens with Blueprint

#

right now the function looks like this, EzSc_card_eval_status_text is just a copy of the card_eval_status_text function but with the addition of XChips, so it doesn't change much from the vanilla one

#

inside the Back Alley Doctor's calculate there is a more complex thing than the photo, but in this exact scenario the one showed in the photo and the actual calculate function are equal

timid pike
final otter
#

You’d have to see how blueprint/brainstorm handle this in vanilla

#

It never popped up as an issue for me when implementing effects, but the other card is probably stored as some variable in context

tame harness
#

Blueprint in vanilla will run the function as other joker, but will return the return value of that joker

#

I am not at pc rn but iirc there's like a blueprint_card or something along the lines in the context

#

So maybe you'd want to do smth like xMult(amount, card, context)

tame harness
timid pike
#

the point of the xMult() function is that you only use the xMult() function

#

nothing other than one single line of code

tame harness
#

Ye I mean you'd say return xMult(...)

#

In xMult function you apply xMult but also return table with message and color

#

Like that

#

That would also work

timid pike
#

that would work but that's not the point

#

that's the point

tame harness
#

From my perspective it's the same tbh. If you're modding a joker, a single "return" shouldn't confuse you

timid pike
tame harness
#

I mean, it's just a 2nd suggestion, lol ¯_(ツ)_/¯

timid pike
#

i know that and i thank you for that

timid pike
tame harness
#

👍

tawny mulch
#

I think these kinds of effects usually need context.blueprint_card or card

timid pike
#

so aChips(20,context.blueprint_card or card)

#

it works

#

thanks @tawny mulch ❤️

#

Easier Scoring v1.2a - Add and multiply Chips and Mult without the return{} function

tame harness
#

isn't it better to send context in the aChips() function

#

instead of writing context.blueprint_card or card every time

#

you just aChips(20, card, context)

#

and in function you do the blueprint check

timid pike
#

you're right, it would be easier

timid pike
#

which is better?
1: aChips(amt,card,context);
2: aChips(card,context,amt)
since amt is the only thing that changes most of the time

#

card only changes when the animation happens on a playing card instead of the Joker

tame harness
#

I like amount first better

#

I'm not entirely sure where context should be tho

#

oh actually in steamodded it already goes card, context

#

so that's fine

paper bay
#

hello @timid pike , thank you for making your mod. I fully support attempting to make calculation easier.
I am concerned that your mod does not have the right behavior. Effects in this game are sometimes collected across multiple cards/jokers and then later evaluated in order; your functions will "jump the queue" of effects since they go off immediately, leading to incorrect ordering. How well would you say you understand the game's evaluation/calculation code?

We can discuss this issue and how to improve calculation on the Steamodded thread, if you want.

timid pike
#

I'm really interested in what you have to say

paper bay
#

Imagine you play a 5 when you have Odd Todd

timid pike
#

oh I get it

#

if I have xChips on a joker to the right of Odd Todd,

#

the multiplication still happens before odd todd's ability

paper bay
#

actually it would be even worse, it could go before the 5

#

I believe that all effects on a single card are collected first

timid pike
#

maybe I got it wrong

paper bay
#

so, this is a code snippet showing how scoring a played playing card works: local effects = {eval_card(scoring_hand[i], {cardarea = G.play, full_hand = G.play.cards, scoring_hand = scoring_hand, poker_hand = text})} for k=1, #G.jokers.cards do --calculate the joker individual card effects local eval = G.jokers.cards[k]:calculate_joker({cardarea = G.play, full_hand = G.play.cards, scoring_hand = scoring_hand, scoring_name = text, poker_hands = poker_hands, other_card = scoring_hand[i], individual = true}) if eval then table.insert(effects, eval) end end

#

then there's code that loops over effects that actually does them

timid pike
#

the thing you're trying to say is: this functions work only if you have them on all the jokers of the game?

paper bay
#

Yes, essentially

#

so, I think that this requires a lot of thought. A radical solution is to rewrite how the calculation algorithm works, such that effects are evaluated immediately

#

I brought up other issues with calculation in the Steamodded thread (like G.GAME.dollars)

timid pike
timid pike
#

Because that would force every new modder to use the EzSc functions

paper bay
#

my solution would be backwards compatible with vanilla code

#

essentially you'd evaluate every effect right after you define it, so there's no possibility of things going out of order

#

you wouldn't have to change what vanilla jokers return

#

of course, it's a very invasive change. not a pleasant solution

timid pike
#

want to elaborate your solution?

#

which function should we change?

open zephyr
#

I feel like it would be good to have adollars to add money outside of the payout screen

#

Possibly copycard too

#

Maybe even functions for the various messages like reset and upgrade

#

Retriggers too

#

Leveling up hands

timid pike
#

The main idea is to have an "API" of functions that modders can use instead of multiple repetitive lines, to improve the astraction of the code for modders

NinjaOne

A high-level programming language is a highly abstracted language that’s designed to simplify programming for developers. Learn more in our in-depth breakdown.

paper bay
timid pike
#

instead of modifying the vanilla functions, I think an easier solution for us would be to modify the behavior of the EzSc functions and putting them inside return{} in the calculate functions

#

so, instead of doing

function aChips(amt)
  update_hand_text()
  card_eval_status_text()
end

it does something like

function aChips(amt)
  return{
    message = localize{type='variable',key='a_chips',vars={amt}},
    chip_mod = amt,
  }
end
#

so you still call aChips(amt,card,context) in your Joker, but it behaves like you did return{}

#

what you think @paper bay?

paper bay
#

oh, you won't be able to return from an inner function like that

#

that return returns a value from aChips, but you'd have to return that result yourself (return aChips(amt))

timid pike
#

yeah that would be the only solution

#

without modifying the vanilla code

#

but still, a Joker that does

calculate = function()
  aChips(20)
  aChips(30)
end

could never exist

#

one that does the same operation twice would be not supported

paper bay
#

there are a lot of modded jokers that give both chips and mult, though

timid pike
#

you can do that

#

but you cannot do chips twice

#

and that's a thing I would like to be added

#

that would give more freedom to modders

#

also, little problem with the current setup: jokers don't juice_up when the EzSc functions are activated

#

the message is shown but the card doesn't move

timid pike
#

So the function needs the calling Joker to be passed too

#

So function aChips(amount,activated_card,calling_joker,context) and inside the calculate: aChips(20,context.other_card,card,context)

paper bay
#

hm, have you taken a look at the better_calc branch of Steamodded (very wip)? instead of making achips a function, you could give people a function to evaluate any effect they choose to. which would look like eval_effect({chips = 10})

timid pike
timid pike
#

maybe it does it in a .toml file

paper bay
#

it's more about it being maybe possible to make an eval_effect() function

paper bay
#

I am trying to make something easily usable and general. not sure if the eval_effect() function is the best way to do that

timid pike
#

I am having difficulties reading that

#

the calc.toml

timid pike
#

I added that G.E_MANAGER:add_event() section

#

I'm still learning what this function does and why it solves all the problems

timid pike
#

Update: I was tinkering with @fallow hawk and we found a solution to the timing problem. Basically, we would inject into the base code's function that populates the effects table at line 692, with a global variable that is populated by the EzSc functions, so that all their effects can be executed at the proper time by the actual base game

#

Huge thanks to arachnei for this solution

mellow narwhal
#

thanks for this mod btw, this is helping me get started on my mod a lot faster

timid pike
#

love to help

#

a new version is coming out soon fixing bugs

novel totem
#

@timid pike #💻・modding-dev message
what exactly is the problem you mention here? thought I'd move this discussion out of main modding-dev

timid pike
#

👍

#

This is what I got right now

#

Left is Balatro state_events.lua, right is Easier-Scoring [1.3-WIP].lua

#

i don't know if a setup like this could work

#

with EzSc_Effects being used as a global variable

#

the C injecting block will go down after if effects[ii].chips then, this is just a proof of concept

novel totem
#

you'll need to make sure the EzSc_Effects is actually global for it to work, and I'm not sure how desired doing it this way is, but it should work from what I can see

timid pike
#

how do i make sure the EzSc_Effects is actually global?

novel totem
#

don't define it within a function

timid pike
#

that's the question

#

do I need to inject EzSc_Effects = nil in the base game or just putting it in the mod file?

novel totem
#

I believe it will be fine in the mod file

timid pike
#

this would be the final product

#

now I just need to read how to write .toml and I'll be good to go

novel totem
#

you don't need injection A anymore

timid pike
#

I don't need it, but I'll keep it there because there will be bugs

novel totem
#

nah, it's just reassigning nil to something that is already nil

timid pike
#

Brace yourselves, v1.3 is ready to come out

#

thanks to @novel totem, @tame harness, @vocal ivy and @scenic heart for the help

timid pike
#

Wiki is up!

GitHub

Contribute to cerloCasa/Easier-Scoring development by creating an account on GitHub.

timid pike
#

4 done, 18 to go

timid pike
#

Easier Scoring v1.3a - Add and multiply Chips and Mult without the return{} function

#

Hoping to receive your feedbacks

vocal glacier
timid pike
# vocal glacier

I'd love to see the crashing report, where do I find the message?

vocal glacier
timid pike
#

wow that's a LOT of mods

#

the reason for this problem is that v1.3-a heavily modifies the game code, so other mods that do the same might not be compatible

#

in the final v1.3 i'd like to do something about this problem, but v1.3-a is meant to be tried alone

vocal glacier
#

Ok noted
since I'm doing a modpack everything can be happening

timid pike
#

thinking more about this, I'm rewriting the whole mod with a different approach, so stay tuned

#

for now, I suggest you to uninstall the mod

vocal glacier
#

sorry for the hassle

timid pike
#

no, thank you for the feedback

#

no hassle here

timid pike
#

Easier Scoring v1.3-REWORKED-0.1 - Add and multiply Chips and Mult without the return{} function

#

Easier Scoring v1.3-REWORKED-0.1 - a modder's dream

timid pike
#

Easier Scoring v1.3 - a modder's dream

#

THE FINAL VERSION 1.3 IS OUT
This version adds the following commands:

  • aChips;
  • xChips;
  • aMult;
  • xMult;
  • addMoney.

To see in which contexts you can put these commands, read the Wiki

GitHub

Contribute to cerloCasa/Easier-Scoring development by creating an account on GitHub.

paper bay
#

huh, how did you do injection?

#

I don't see any .toml files

#

you're overwriting Card:calculate_joker? unfortunately everyone and their mother is overwriting that function. I worry about incompatibilities

#

ok, sorry. I made some discouraging comments there

#

I fully support your project, it's great, it solves a problem a lot of modders are having

timid pike
#

first of all, huge thanks for the feedback and the support ❤️

#

unfortunately, this mod can't exist without modifying the game code

#

V1.3 was the first fully working version, even while modifying heavily the calculate_joker function and making this project incompatible with a bunch of other mods

#

I'll start working on V1.4 which will modify the function very slightly, so that it will cause less problems.
Problems with other mods will arise every now and then, every feedback will help making this mod better for everyone

timid pike
#

Easier Scoring - Snapshot 24w23a

timid pike
#

Easier Scoring - Snapshot 24w23b

#

Easier Scoring - Snapshot 24w28b

This version modifies the code to improve readability.

WARNING

This version modifies the function calculate_joker(context), so compatibility with other mods isn't guaranteed.
Check the section Compatibility inside README.md for more info.

If you want to contribute to improving this mod, please create an issue or comment on the Discord's post.
Your support is highly appreciated.

GitHub

Contribute to cerloCasa/Easier-Scoring development by creating an account on GitHub.

timid pike
#

Easier Scoring - Snapshot 24w28c

Bug fixing, added some modifications for state_events.lua for implementing xChips in context.individual.

WARNING

This version modifies the function calculate_joker(context) and some code in state_events.lua, so compatibility with other mods isn't guaranteed.
Check the section Compatibility inside README.md for more info.

If you want to contribute to improving this mod, please create an issue or comment on the Discord's post.
Your support is highly appreciated.

timid pike
#

Easier Scoring - Snapshot 24w28d

This you?

But what if I don't want to add xChips too? I downloaded a mod that does the same!
Then don't worry, now the xChips() functionality has been moved to another separate mod.

WARNING

This version modifies the function calculate_joker(context) and some code in state_events.lua, so compatibility with other mods isn't guaranteed.
Check the section Compatibility inside README.md for more info.

If you want to contribute to improving this mod, please create an issue or comment on the Discord's post.
Your support is highly appreciated.

#

Easier Scoring - Snapshot 24w23d

#

Easier Scoring - Snapshot 24w28d

paper bay
#

Looks like the +chips noise during joker scoring is not correct

#

it uses the same noise as chips from playing cards, but testing with Sly Joker shows +chips on jokers makes a different sound

timid pike
#

i'll check it out

paper bay
#

@timid pike letting you know that your lovely patches apply too many times- they interfere with purple seals working.

#

you might also have problems with patch order- your patches have to come after Steamodded

timid pike
#

thanks for letting me know ❤️

half mango
#

the website is gone