#Raised Fist Strength Joker
1 messages · Page 1 of 1 (latest)
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
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
I believe you can do alt+f5
is the test on line 119 being printed right now?
Yes
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?
lowest scored
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
Crashed upon scoring
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
Did the thing, another crash
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
Where do I put the [i]s
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
The ones in lines 114 and 116?
115 and 116
after context.scoring_hand.base.id?
I think you're having a really difficult time because you don't know the basic mechanics of Lua
Do I do this though?
context.scoring_hand[i].base_id
O ok thx
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
can you send a progress screenshot
The code thus far
do we get a print
No
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?
I mainly ripped the code from strength and raised fist
it's back to other_card, now what?
do we get a print? or an error?
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
if raised_card == context.other_card then print('test');?
yeah
I tried that and 3 errors appeared
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
Errors are gone now
Delete all of line 120?
yes
And also delete return true?
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
Is this good rn?
your code is very jagged rn but I think so
The game crashed after scoring and the test pop-up appeared, I think we're getting somewhere
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
There was no crash or test pop-up or ability trigger
I'm trying to look at the code for raised fist
let's try
if context.individual and context.cardarea == G.play then
Didn't the crash say something about index field base?
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
No test text or anything
show me the current status
!!
It increases rank whenever a card is scored
although it has no affect on the played hand
the code atm
so what is it doing that you don't want it to do?
It increases a rank when a card is scored, it is only supposed to increase its rank once
oh so it increases whenever any card is scored
not just when the lowest card is scored
Yes
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
Thanks for the help, I also wanna try and have it do the flipping thing that strength and the other tarot cards do
Although I've been at this one joker for like two days, so I wanna move onto other jokers
not sure if it would work, but you can try putting
raised_card:flip()
before and after the event
inside the if statement
It didn't work quite as intended, however, the end result is honestly quite smooth either way