Non-textbox based pause

mongolianmisfit

New member
chronicleroflegends said:
A few questions:

The screen dimming doesn't seem to do anything for me. Any idea why?

Is it possible to use graphics from our HUD to make the word paused? How would you indicate that you wanted to use those graphics instead?
^^ This would be really useful to me, because it would solve the issue I have of using a number for the equipped ability in my game instead of text.

Edit:
The dimming does actually work, but only when I run the game in Mesen. Not the default emulator.

Were you able to get the game to display PAUSED by pulling from the HUDTiles file?
If so, I'd love to know how you accomplished it. :)

And Mugi, it looks like the following code on the input scripts results in the walk animation being locked in the first frame (so the character 'hovers around'):

LDA isPaused
BEQ +
RTS
+
 
mongolianmisfit said:
chronicleroflegends said:
A few questions:

The screen dimming doesn't seem to do anything for me. Any idea why?

Is it possible to use graphics from our HUD to make the word paused? How would you indicate that you wanted to use those graphics instead?
^^ This would be really useful to me, because it would solve the issue I have of using a number for the equipped ability in my game instead of text.

Edit:
The dimming does actually work, but only when I run the game in Mesen. Not the default emulator.

Were you able to get the game to display PAUSED by pulling from the HUDTiles file?
If so, I'd love to know how you accomplished it. :)

And Mugi, it looks like the following code on the input scripts results in the walk animation being locked in the first frame (so the character 'hovers around'):

LDA isPaused
BEQ +
RTS
+

Not yet, for now I just copied text over to the game object tiles. I'm sure there is a way but I haven't looked into it yet.
 

jakenastysnake

New member
Hey Mugi,

This might be a dumb question, but what would we need to do to just pause everything on the current animation frame? If I hold right/left while pressing pause my walking animation will continue until I release the d pad. Any ideas?
 

dale_coop

Moderator
Staff member
Check again your "Input Editor", maybe you missed assigned some scripts? (assigned the pause script to multiple buttons?)
 

rodrigotadeu

New member
No, I take a look there, but, no, no other button set for pause.asm


8PZj7cL.png
 

Razzie.P

Member
ZeGGamer1 said:
I got an error saying,

Routines\Basic\ModuleScripts\InputScripts\Pause.asm(3): Unknown label.
Routines\Basic\ModuleScripts\InputScripts\Pause.asm(9): Unknown label.
Routines\Basic\ModuleScripts\InputScripts\Pause.asm(23): Unknown label.
demo.txt written.

All I did was add dale's script into my input scripts and assign it to start. Am I missing something?


Try clicking Project Settings > User Variables, and adding a user variable called isPaused. That should fix the issue.
 

CGdfc

New member
I have a small problem with the pause, when pausing it stops all but unpause, the character moves to the left alone. any solution?
 

CGdfc

New member
hi Dale, I have used your script and RTS in the last line. But it is the same, unpause the character goes only to the right, just stop doing it by moving it to the left.

Code:
    LDA isPaused
    BNE unpausegame
    LDA gameHandler
    ORA #%00100000 ;; objects bit
    STA gameHandler
    LDA #$01
    STA isPaused
	;; we play the pause sfx:
	PlaySound #SND_PAUSE	
	;; we make the screen dark:
	LDA soft2001
	ORA #%11100000
	STA soft2001
	
    JMP thePauseEnd
unpausegame:
    LDA gameHandler
    AND #%11011111 ;; objects bit
    STA gameHandler
    LDA #$00
    STA isPaused
	;; we play the unpause sfx:
	PlaySound #SND_UNPAUSE
	;; we make the screen back normal:
	LDA soft2001
	AND #%00011111
	STA soft2001
thePauseEnd:
	RTS
 

dale_coop

Moderator
Staff member
Could you share your left and right scripts? (you did modify them, right? The StartMovingPlayerXXX... not the StopMovingPlayer ones)
 

CGdfc

New member
dale_coop said:
Could you share your left and right scripts? (you did modify them, right? The StartMovingPlayerXXX... not the StopMovingPlayer ones)

for Right
Code:
    LDX player1_object

    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
    ;;;;; this is for platform game.
    GetCurrentActionType player1_object
    CMP #$03 ;; attack
    BEQ +
    CMP #$01
    BEQ +
    LDA Object_physics_byte,x
    AND #%00000001 ;; is it on the ground?
    BEQ +
    ChangeObjectState #$01, #$04
    JMP +
    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
    ;;;;;;;;;;;; END PLATFORM TYPE GAME
+
    StartMoving player1_object, MOVE_RIGHT
    FaceDirection player1_object, FACE_RIGHT
    
    RTS

left:

Code:
    LDX player1_object

    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
    ;;;;; this is for platform game.
    GetCurrentActionType player1_object
    CMP #$03 ;; attack
    BEQ +
    CMP #$01
    BEQ +
    LDA Object_physics_byte,x
    AND #%00000001 ;; is it on the ground?
    BEQ +
    ChangeObjectState #$01, #$04
    JMP +
    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
    ;;;;;;;;;;;; END PLATFORM TYPE GAME
+
    StartMoving player1_object, MOVE_LEFT
    FaceDirection player1_object, FACE_LEFT

    RTS
 

dale_coop

Moderator
Staff member
As Mugi, suggested on his post, you could try adding this code:
Code:
LDA isPaused
BEQ +
RTS
+

At the begining of the StartMovingPlayerXXX scripts (and maybe in shoot / melee scripts too) to prevent those scripts to execute when the game is on Pause.
 

Mugi

Member
time to update this a little too,
some people asked for this but i never mentioned how i did it,
in my game, when you pause, everything freezes in place instead of playing their animations (objects only, my tiles still animate)

to do this, open DrawSprites.asm in routines/basic/modulescripts/mainscripts

and find the label doneDrawingThisObjectsSprites: from around line 227

Code:
doneDrawingThisObjectsSprites:
    TXA
    STA spriteOffset
    ; restore x so we're talking about the right object
    PLA
    TAX

after this code, add a new piece under it

Code:
    ; freeze object aniamtions when game is paused.
    LDA isPaused
    BNE notAtEndOfFrame

and you're done, now when you pause the game, objects will never register "an end of frame" which means that they are indefinitely frozen on their current animation frame until you unpause the game.

https://youtu.be/tXRY1S7TTtE
 

dale_coop

Moderator
Staff member
As Kasumi epxlained somewhere (on the Discord channel maybe), for pausing the music...
Modify the MainASM.asm script, under the "skipNMIstuff:", you will find this block of code:

Code:
	LDA currentBank
	STA prevBank
	LDY #BANK_MUSIC  ;; switch to music bank
	JSR bankswitchY
	soundengine_update  
	LDY prevBank
	JSR bankswitchY

Comment those 7 lines, like this:

Code:
	; LDA currentBank
	; STA prevBank
	; LDY #BANK_MUSIC  ;; switch to music bank
	; JSR bankswitchY
	; soundengine_update  
	; LDY prevBank
	; JSR bankswitchY

And just after them, add this block of code:

Code:
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; PAUSE MUSIC
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
	LDA currentBank
	STA prevBank
	LDY #BANK_MUSIC  ;; switch to music bank
	JSR bankswitchY

	LDA isPaused
	BEQ unpause_music
	JSR pause_song
	JMP post_pause_music_handle
unpause_music:
	JSR resume_song
post_pause_music_handle:
	soundengine_update  
	LDY prevBank
	JSR bankswitchY   
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 
Top Bottom