SOLVED (4.5.9.) Make tile solid only when a certain action step of the player is active

5kids2feed

Well-known member
Long time, no see! Hope you've all been good. I'm trying to make a script where a tile is only solid when my action step 3 is active. What's a better way of coding this? Thanks!

Code:
    CPX player1_object
    BNE jaa

        LDA Object_direction,x
        AND #%00001111
        STA Object_direction,x
   
GetActionStep #00
CMP #$03
BEQ jaa

LDA ObjectUpdateByte
ORA #%00000001
STA ObjectUpdateByte ;; makes solid

jaa:
rts
 
Last edited:

dale_coop

Moderator
Staff member
If you want it solid only when your player is on Action Step 3, the "BEQ jaa" should be a "BNE jaa" (if not 03 then you skip / branchout to the label).
 

5kids2feed

Well-known member
Thanks, Dale! I tried both BNE and BEQ. Neither seem to work. Most be something else in the code of my game that I have to decipher. Appreciate it!
 

5kids2feed

Well-known member
Iā€™m waving the @CluckFox symbol in the sky since you helped me before šŸ¤£

any ideas how to make a tile solid only when your action state 3 is active within the arcade platformer module? Getting all kinds of weird results when I try to program it with the code and similar above.
 

dale_coop

Moderator
Staff member
Hmmm... it should work.
You could try:
Code:
    CPX player1_object
    BNE jaa

        LDA Object_direction,x
        AND #%00001111
        STA Object_direction,x
       
GetActionStep player1_object
CMP #$03
BNE jaa

LDA ObjectUpdateByte
ORA #%00000001
STA ObjectUpdateByte ;; makes solid

jaa:
rts
 

5kids2feed

Well-known member
Ooooh getting warmer. When action step 3 is active it's solid. But it comes with issues. I can't jump when i'm on the tile now... and when I jump where this special tile is, i'll get stuck in it even if action step 3 isn't active.

Does it have something to do with my jump through platform script when I jump? Should I alter this code.. I don't have any platforms to jump through.. just solid tiles so this could probably be simplified:
 
Last edited:

5kids2feed

Well-known member
NEVERMIND!

Good lord that gave me a headache.

Dale's code is correct but as Jonny pointed out to me on discord.. my special tile was occupying a standard tile I wasn't using (as things are hardcoded to use that tile space). Moved my special tile to the very bottom of the list and now I can jump through the tile. All is good!

SOLVED! Thanks @dale_coop & @Jonny
 
Top Bottom