#Raised Fist Strength Joker

1 messages · Page 1 of 1 (latest)

still bolt
#

can you resend your code in this thread to make things easier

still bolt
#

I'd recommend separating that one really long line of code into separate lines so it's easier to look at

#

have each part be its own line

#

doesn't affect how the code runs but just for organization's sake

#

then I'd put a print statement after the if raised_card == context.other_card

dapper ice
#

Rq, is there a quick restart key for debug+?

#

Also, I put it after the thing

#

And it works

#

Also, I got a royal flush while attempting to test it, so that's cool

dapper ice
#

you there?

still bolt
#

I believe you can do alt+f5

dapper ice
#

That works, thanks

#

Anyways, what now?

still bolt
#

is the test on line 119 being printed right now?

dapper ice
#

Yes

still bolt
#

try replacing G.play.highlighted[i] with raised_card on line 125

#

actually why do you have that code in a for loop?

#

you just want to increase the rank of one card right?

#

the lowest played card? or the lowest card held in hand?

#

or the lowest scored card?

dapper ice
still bolt
#

mmk so then in lines 114-116, every time you access G.play.cards or G.hand.cards you should be using context.scoring_hand instead

#

that's how you get the array of scored cards

dapper ice
still bolt
#

you still need the # before context.scoring_hand on line 114

#

that's how you get the length of an array

#

so you're telling the for loop what number to start with and what number to end on

dapper ice
still bolt
#

and then in the loop, see how in the original you had [i] after G.play.cards? You still need that any time you're accessing an element from the array

dapper ice
#

Where do I put the [i]s

still bolt
#

after scoring_hand

#

scoring_hand is an array, which in Lua is a list of values. [1] or [2] or any number inside of [] is how you get one of the things from the awway

#

the number represents the position

#

in the array of the thing you're trying to get

#

so something like context.scoring_hand[1].base_id would look at the first element in the scoring_hand array (aka the leftmost scored card) and get its base_id

dapper ice
still bolt
#

115 and 116

dapper ice
#

after context.scoring_hand.base.id?

still bolt
#

I think you're having a really difficult time because you don't know the basic mechanics of Lua

dapper ice
still bolt
#

context.scoring_hand[i].base_id

dapper ice
#

O ok thx

still bolt
#

and context.scoring_hand[i].ability.effect

#

after you're done fixing that you should probably remove the loop on line 120 and the end on line 129

#

otherwise it will potentially rank up the card multiple times based on how many cards were played

#

I'm going to be offline for a bit but I'll be back later, good luck soldier

dapper ice
#

Fixed the crash, but it's not doing anything

still bolt
#

can you send a progress screenshot

dapper ice
#

The code thus far

still bolt
#

do we get a print

dapper ice
#

No

still bolt
#

k, so that if statement must be false

#

you're comparing raised_card to scoring_hand, which is asking if the card we selected is equal to the entire list of scored cards

#

in the previous screenshot that was context.other_card, which I honestly don't fully know what that does, but I'm guessing you got that code from somewhere?

dapper ice
#

I mainly ripped the code from strength and raised fist

still bolt
#

yeah

#

so let's set that line back to how it was originally

dapper ice
#

it's back to other_card, now what?

still bolt
#

do we get a print? or an error?

dapper ice
#

in Balatro?

#

nothing happens

still bolt
#

maybe let's try getting rid of that if statement and see if we can get it to work at all

#

and the for loop

#

on lines 119 and 120

dapper ice
still bolt
#

yeah

dapper ice
#

I tried that and 3 errors appeared

still bolt
#

did you also delete the end

#

remember if statements and ends need to always match up, if you remove one you have to remove the other

dapper ice
#

Errors are gone now

still bolt
#

cool

#

did you get rid of the loop too

#

the one that was on line 120

#

and its end

dapper ice
#

Delete all of line 120?

still bolt
#

yes

dapper ice
#

And also delete return true?

still bolt
#

no hang on, you shouldn't be deleting anything from the e_manager stuff

#

just the for loop that was above the e_manager call

dapper ice
#

Is this good rn?

still bolt
#

your code is very jagged rn but I think so

dapper ice
#

The game crashed after scoring and the test pop-up appeared, I think we're getting somewhere

still bolt
#

at the top of your calculate function change
if context.after then

#

to
if context.after and context.cardarea == G.play

#

or wait

#

there, it should be G.play

dapper ice
#

There was no crash or test pop-up or ability trigger

still bolt
#

I'm trying to look at the code for raised fist

#

let's try
if context.individual and context.cardarea == G.play then

dapper ice
#

Didn't the crash say something about index field base?

still bolt
#

yeah but that was in the modify_rank function

#

which means it was actually getting called

#

but with an invalid card

#

but looking at how raised fist is set up, it gets called during the context.individual context

#

oh I see it, you're setting raised_card to context.scoring_hand instead of context.scoring_hand[i]

#

on line 116

dapper ice
#

No test text or anything

still bolt
#

show me the current status

dapper ice
#

It finally works

#

Mostly

still bolt
#

!!

dapper ice
#

It increases rank whenever a card is scored

#

although it has no affect on the played hand

#

the code atm

still bolt
#

so what is it doing that you don't want it to do?

dapper ice
#

It increases a rank when a card is scored, it is only supposed to increase its rank once

still bolt
#

oh so it increases whenever any card is scored

#

not just when the lowest card is scored

dapper ice
#

Yes

still bolt
#

then try putting the whole G.E_MANAGER thing (lines 119-127) inside of this if statement:

if raised_card == context.other_card then

end
dapper ice
#

Thanks for the help, I also wanna try and have it do the flipping thing that strength and the other tarot cards do

dapper ice
#

Although I've been at this one joker for like two days, so I wanna move onto other jokers

still bolt
#

not sure if it would work, but you can try putting
raised_card:flip()
before and after the event

#

inside the if statement

dapper ice
#

It didn't work quite as intended, however, the end result is honestly quite smooth either way

still bolt
#

nice!

#

glad it's working