You are not logged in.
Pages: 1
ld hl, wSimulatedJoypadStatesEnd
ld de, RLEMovementMOVEUP3
call DecodeRLEList
dec a
ld [wSimulatedJoypadStatesIndex], a
call StartSimulatingJoypadStates
ld c,80
call DelayFrames
ld a, $4
ld [$ff8c], a
call DisplayTextID
ld c,80
call DelayFrames
callba BlowUpMansion
For some reason it displays the text first, then calls "BlowUpMansion" and then moves the character? How do I make it do things in order?
Offline
I'm not totally sure and I haven't experimented with this code myself, but the first solution I can think of is replace the call to DelayFrames with a loop that loops while the character's coords don't match the final position after the movement. I'm pretty sure simulated movement gets updated in the interrupts so a small loop inside a script that waits for the coordinates to change should work.
Offline
I'm not totally sure and I haven't experimented with this code myself, but the first solution I can think of is replace the call to DelayFrames with a loop that loops while the character's coords don't match the final position after the movement. I'm pretty sure simulated movement gets updated in the interrupts so a small loop inside a script that waits for the coordinates to change should work.
Changed it to this:
ld hl, wSimulatedJoypadStatesEnd
ld de, RLEMovementMOVEUP3
call DecodeRLEList
dec a
ld [wSimulatedJoypadStatesIndex], a
call StartSimulatingJoypadStates
.isWhereNeeded
ld a,[W_YCOORD]
cp 24
jr nz,.isWhereNeeded
ld a, $4
ld [$ff8c], a
call DisplayTextID
callba BlowUpMansion
And game just freezes.
Offline
Yeah I guess I'm wrong about how simulated movement is updated.
My next suggestion would be to have that script call StartSimulatingJoypadStates and then change the map's script number to a new script. This new script would check if the player's y coord is 24 and return if not. If it is 24, change the map's script number to a new script then return. This new script displays the text then calls BlowUpMansion.
Offline
Pages: 1