[4.5.9] Drop through OneWay Tile (when down is pressed)

Jonny

Well-known member
@vanderblade Curious, did you try just having one check, i.e #00100001 ? I recall trying something similar where I had to seperate the checks, just wondered if you'd tried it as DOWN / A combined gamepad check.
 

vanderblade

Active member
I hadn't. I just tried that, though, and it doesn't work right. I don't think it's checking if both are pressed but rather if either are pressed in that case. For me, that means if I jump with A and am still pressing A when on top of a two-way platform, I just fall through right away. If you find a solution, I'll gladly update to the more efficient code.
 

Jonny

Well-known member
I hadn't. I just tried that, though, and it doesn't work right. I don't think it's checking if both are pressed but rather if either are pressed in that case. For me, that means if I jump with A and am still pressing A when on top of a two-way platform, I just fall through right away. If you find a solution, I'll gladly update to the more efficient code.
I thought so. I tried something similar a while back and I also had to put both inputs seperately.
 

SciNEStist

Well-known member
The only major issue with the method described above, is that all one way platforms become not solid whenever player 1 presses down. Any other objects effected by gravity (a 2nd player for example) would fall as well.

I went another route with this;

1: added an action step for ducking for my players.
2: set up the control scripts for pressing down and for releasing down. (basically just ChangeActionStep to the crouch action step, and release is changing it back to idle)
3: set an action step flag up, labeled it as "ignore oneways" made sure it was clicked on when ducking and when in the hurt action step (hurt action step default is 7)
4: added this bit of code for the one way tile:
Code:
 +isOneWaySolid
        LDA Object_vulnerability,x
        AND #%00000010
        BNE +notSolid
(in this example, i am useing the 2nd action step flag)

now whenever a player ducks, only they will fall through a platform. and as a bonus, if a player is hurt, they fall through as well. (but thats optional)

If you want to make it simpler, you could do skip the action step flag stuff and just do a direct check on the action step.
Code:
+isOneWaySolid
TXA
STA temp ;; assumes the object we want to move is in x.
GetActionStep temp
CMP #$05
BNE +isSolid
this would mean action step 5 would fall through
 
Last edited:

vanderblade

Active member
The only major issue with the method described above, is that all one way platforms become not solid whenever player 1 presses down. Any other objects effected by gravity (a 2nd player for example) would fall as well.

I went another route with this;

1: added an action step for ducking for my players.
2: set up the control scripts for pressing down and for releasing down. (basically just ChangeActionStep to the crouch action step, and release is changing it back to idle)
3: set an action step flag up, labeled it as "ignore oneways" made sure it was clicked on when ducking and when in the hurt action step (hurt action step default is 7)
4: added this bit of code for the one way tile:
Code:
 +isOneWaySolid
        LDA Object_vulnerability,x
        AND #%00000010
        BNE +notSolid
(in this example, i am useing the 2nd action step flag)

now whenever a player ducks, only they will fall through a platform. and as a bonus, if a player is hurt, they fall through as well. (but thats optional)

If you want to make it simpler, you could do skip the action step flag stuff and just do a direct check on the action step.
Code:
+isOneWaySolid
TXA
STA temp ;; assumes the object we want to move is in x.
GetActionStep temp
CMP #$05
BNE +isSolid
this would mean action step 5 would fall through
Yeah, it's kind of a "bug" right now that when players press down and press A (in my script) that it turns all one way solids into empty tiles. Like you said, monsters and other objects fall through as a result. You have be strategic where you place things.
 
Top Bottom