Hello, I have a problem in my coding. After the first boss fight in the pacifist run, I have set the code so that it places the tilemap before the dialog/cutscene bit. However, it doesn’t do that, it plays the dialog before setting the new tilemap. (To get there fast spam up and A, then free the old man, spam B on his previous tile.) (Also the function is called COMdeathpacifist if you need it.) Anyways, could you help me with it please? Here’s the link: https://arcade.makecode.com/S60413-41860-71849-08057
1 Like
How to fix it
You can force the game to update the tilemap visually before starting the dialog:
Option 1 — Small pause
typescript
CopyEdit
tiles.setCurrentTilemap(tilemap`newTilemap`)
pause(100) // Let the screen update
game.showLongText("Your dialog here", DialogLayout.Full)
Option 2 — Split logic into steps
Place the dialog in a function or game.onUpdateInterval
so that the tilemap update occurs first, and the dialog is triggered on the next frame or after a short delay.
Example:
typescript
CopyEdit
tiles.setCurrentTilemap(tilemap`newTilemap`)
timer.after(0, function () {
game.showLongText("Your dialog here", DialogLayout.Full)
})
Why it happens
- Tilemap changes are queued for rendering.
- Dialogs/cutscenes take control of the screen immediately.
- Without a frame in between, the tilemap is technically changed in memory but not drawn before the dialog appears.
- the JavaScript text I am talking about in blocks if you do not know the language which is fine use either a tillemap from tiles and drag or edit your tilemap and pause from loops and drag t if do not see it just scroll down and if need to edit the input or parameters click the white bubble to update the parameter for 100 milliseconds. Hence, it works method 2 use the same tilemap but make after 0 milliseconds mean just wait for 0 milliseconds then inside the function use a show long text and edit your text there and done, and if want to edit where to place the side of the dialog just click that down arrow and select what side position you want to place the dialog. And if you forgot where the dropdown picker is, do not worry, if you see bottom or full screen, or to the center like those, then just click on it to select which side you want the dialog to be to make the game better.
1 Like