Bucket Mouse said:Okay, that stops the timer during the text.....but it's still going during Victory. I don't know why FF is what we're comparing player1 to...what does FF represent?
If it's checking to see if the player isn't there, shouldn't the number be 00 instead? Of course, that doesn't work either.
dale_coop said:Bucket Mouse said:Okay, that stops the timer during the text.....but it's still going during Victory. I don't know why FF is what we're comparing player1 to...what does FF represent?
If it's checking to see if the player isn't there, shouldn't the number be 00 instead? Of course, that doesn't work either.
The player1_object is set to #$FF when he's destroyed. But looks like it's not yet there.
What's module are you using? the maze? the simple platformer?
LDA #$FF
STA player1_object
dale_coop said:You could modify Handle Player Win script, adding this code, just after the "DeactivateCurrentObject" line:
Code:LDA #$FF STA player1_object
Then the timer code I proposed some days ago, should work.
PS: sorry guys for the late reply... I was on a flight back home (Japan -> Amsterdam -> France... about 16 hours). And now jet lagged (>_<)
LDA #$00
STA ifVictoryNoTimer
dale_coop said:Glad you found out
LDA #$00
CMP newScreen
BEQ dontUpdateGameTimer
LDA #$01
CMP newScreen
BEQ dontUpdateGameTimer
justadude said:where do you write this script?
HandleGameTimer:
; checks to see if the text box is on
LDA gameHandler
AND #%00100000
BNE dontUpdateGameTimer
LDA ifVictoryNoTimer
CMP #$01 ; player is no more... because destroyed and been replaced by the tenth Game Object, which is the Victory animation
BEQ dontUpdateGameTimer
LDA #$00
CMP newScreen ; checks to see if the Start screen is on
BEQ dontUpdateGameTimer
LDA #$01
CMP newScreen ; checks to see if the Win screen is on
BEQ dontUpdateGameTimer
Razzie.P said:Thanks for the code snippets here! I've been trying to learn to do this for a bit, but my ASM is pretty weak... well... VERY weak :roll: so things like this has been invaluable to me in trying to learn how it all works.
Something I'm finding, though, that makes no sense -- when using timer code, my rooms where X is an odd number (such as X=1, Y=1; X=3, Y1; X=5, etc etc) have a very strange occurance. Tile X=11. Y=5 causes issues. Perhaps more tiles are problematic as well, but this is the only one I'm seeing where I can duplicate the issue. Using the Maze module, when I have a "power up" tile placed at 11, 5, my project goes to the Win Screen as soon as I enter the room. When I remove the "power up" tile, I can enter the room fine, BUT as soon as I stand on the tile (normal, walkable floor), the timer rapidly decreases, and sometimes I'm warped to the Win Screen as well. Any ideas on what could be going on, and/or what I could do to troubleshoot this?
Hey Dale. I wanted to implement this into my game on NESmaker 4.5. But it doesn't seem to be working with 4.5.Agree with Mugi, on that!!!! I hate Facebook for that, we always loose everything. I keep saying post on the forum, ask on the forum, share on the forum...
I hate FB >_<
Anyway... another version of the same script, posted on FB:
Code:;; create a variable in your HUD called myTimer ;; set the initial value for myTimer from your HUD ;; myTimer needs to have a max value of 3 ;; this script was used for NESMAKER 4.1.1 and calls the SubtractValue macro ;; make sure that SubtractValue is the *proper* version ;; This script wouldn't be possible without Kevin Skeen's Timer_Tick.asm script ;; Thank you for everything, Kevin Skeen! HandleGameTimer: DEC gameTimer ;decrement memory by one BNE dontUpdateGameTimer ;if gameTimer = 0, don't update LDA gameTimerLo ;load gameTimerLo into accumulator CLC ;clear the carry flag ADC #$01 ;add 01 to acumulator with carry STA gameTimerLo ;store to the accumlator LDA gameTimerHi ;load gameTimerHi into accumulator ADC #$00 ;add 00 to acumulator with carry STA gameTimerHi ;store to the accumlator ;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; DO WHATEVER READS OF THE GAMETIMER YOU MIGHT WANT HERE. LDX #$02 ;;Checking Hundreds LDA myTimer,x ;;Load Hundreds Digit BNE SubtractTime ;;If not 0, we have more than 000 DEX ;;Checking Tens -- Decrease x so x is 1 LDA myTimer,x ;;Load Tens Digit BNE SubtractTime ;;If not 0, we have more than 000 DEX ;;Checking Tens LDA myTimer,x ;;Load Ones Digit BNE SubtractTime JMP RESET ;;this is what happens when the time is zero ;;;;;;;;;;;;;;;;;;;;;;;;;;; LDA #DayNightSpeed STA gameTimer dontUpdateGameTimer: RTS SubtractTime: SubtractValue #$03, myTimer, #$01, #$00 ;;Subtract 1 from the Ones digit ;;Update HUD LDA #$03 ;; your timer can only have max 3 numbers STA hudElementTilesToLoad LDA DrawHudBytes ORA #HUD_myTimer STA DrawHudBytes RTS DoAlarm: ;;; we're going to edge-load monsters one at a time if they are of edge type and are not active. LDX #$00 doLoadMonsterOnTimerLoop: LDA edgeLoaderInCue BEQ noEdgeMonstersInCue LDA currentBank STA prevBank LDY #$1C ;; data bank JSR bankswitchY JSR CreateTimedEdgeSpawner DEC edgeLoaderInCue LDY prevBank JSR bankswitchY noEdgeMonstersInCue RTS
Yeah. I was just thinking the same thing. I keep getting the same problem. Looks like it might not work with 4.5.9Ugh...
Did step 1 & step 2... step 3 I can't find handlescreenloads.asm ... only extra screen load and post screen load
I setup the user variable myTimer and set it to 60
then run game and get a million errors in the HandleGamerTimer.asm .. lines 12, 26, 56, 57, 59, 70, 75, 76, 77, 79 ...of the first script
Anybody have any clue how to et this to run in 4.5.9?
...I am not already?You'll be our best friend.