Screen Trigger for Boss Text

Hey all,

I added the Dale coops code for the text box to appear when the boss monster dies. Works great. But the issue is when NORMAL monster object dies it trigger the code. I added the screen trigger condition but doesn't seem to work. Here is the Code , can anyone see what is stopping the screen trigger from working.

;;; what should we do with the monster?
;;; monster is loaded in x
LDA Object_vulnerability,x
AND #%00000100 ;; is it weapon immune?
BEQ notWeaponImmune
;PlaySound #SFX_MISS
JMP skipHurtingMonsterAndSound
notWeaponImmune:

LDA Object_status,x
AND #HURT_STATUS_MASK
BEQ dontskipHurtingMonster
JMP skipHurtingMonster
dontskipHurtingMonster:
LDA Object_status,x
ORA #%00000001
STA Object_status,x
LDA #HURT_TIMER
STA Object_timer_0,x
;;; assume idle is in step 0
ChangeObjectState #$09,#$02
;;;; unfortunately this recoil is backwards
LDA Object_status,x
AND #%00000100
BNE skipRecoilBecauseOnEdge
LDA Object_vulnerability,x
AND #%00001000
BNE skipRecoilBecauseOnEdge ;; skip recoil because bit is flipped to ignore recoil

LDA selfCenterX
STA recoil_otherX
LDA selfCenterY
STA recoil_otherY
LDA otherCenterX
STA recoil_selfX
LDA otherCenterY
STA recoil_selfY
JSR DetermineRecoilDirection
skipRecoilBecauseOnEdge:
LDA Object_health,x
SEC
SBC #$01
CMP #$01
BCC +
JMP notMonsterDeath
+

DeactivateCurrentObject
PlaySound #SND_SPLAT
;;;;;;;;;;;;;;;;;; ok, so now we also add points to score
;LDY Object_type,x
;LDA ObjectWorth,y
;STA temp
; AddValue #$03, GLOBAL_Player1_Score, temp
;arg0 = how many places this value has.
;arg1 = home variable
;arg2 = amount to add ... places?
;; and this should trip the update hud flag?

;;;;

LDA currentScreen
TriggerScreen #$89

TXA
STA tempy ;;dale_coop

AddValue #$08, myScore, #$01, #$00

;STA hudElementTilesToLoad
; LDA #$00
; STA hudElementTilesMax
; LDA DrawHudBytes
; ora #HUD_myScore
; STA DrawHudBytes
UpdateHud HUD_myScore
LDX tempy ;;dale_coop

JSR HandleDrops
JSR HandleToggleScrolling

CountObjects #%00001000, #$00
LDA monsterCounter
CLC ;;dale_coop
BEQ +
JMP ++
+
.include SCR_KILLED_LAST_MONSTER
++
JMP skipHurtingMonster
notMonsterDeath
STA Object_health,x
skipHurtingMonster:
;PlaySound #SFX_MONSTER_HURT

skipHurtingMonsterAndSound:
LDX tempx
;; what should we do with the projectile?
DeactivateCurrentObject
 

dale_coop

Moderator
Staff member
To trigger a screen:
Code:
TriggerScreen screenType
The parameter is a screen-type value, not a screen id value.
(here, the "screenType" variable contains the type of the current screen)

You can use value directly, if you want to trigger a type that is not your current screen one, for example:
Code:
TriggerScreen #12
for triggering the screens that are screen-type 12
 
To trigger a screen:
Code:
TriggerScreen screenType
The parameter is a screen-type value, not a screen id value.
(here, the "screenType" variable contains the type of the current screen)

You can use value directly, if you want to trigger a type that is not your current screen one, for example:
Code:
TriggerScreen #12
for triggering the screens that are screen-type 12
I went back in to the code made the change. The code compiles right, but it still triggers the text box after a monster is killed. Is the screen type in the correct line in the code. I placed it in before the above as a condition before the "Dale Coops" code
 

dale_coop

Moderator
Staff member
TriggerScreen screenType
triggers the screen (the screen will be no more "normal", but now "triggered") that doesn't open any textbox. You might have another piece of code that opens that text, somewhere.

So... what you need is find where that code is (maybe in your All Monster Killed script?... or in your Handle Object Collision script)?
 
Top Bottom