Create Projectile doesn't work in platform module?

ZeGGamer1

New member
Which file is it in, is it "AllSongs_WithSFX.asm" or something else?

And if it is I see code in lines 73 and 74, do I comment them out too?
 

ZeGGamer1

New member
Still nothing.

I'm sorry that this is taking so much work, you have been really helpful though so I appreciate it.
 

dale_coop

Moderator
Staff member
Could you share the content of the HandleHurtMonster.asm script ? I could verify if there is something I can fix.
 

ZeGGamer1

New member
;;; 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 #$00,#$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
BCS notMonsterDeath
DeactivateCurrentObject

;;;;;;;;;;;;;;;;;; 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 #$05 ;; amount of score places?
; STA hudElementTilesToLoad
; LDA DrawHudBytes
; ORA HUD_updateScore
; STA DrawHudBytes

JSR HandleDrops


JMP skipHurtingMonster
notMonsterDeath
STA Object_health,x
skipHurtingMonster:
;; PlaySound #SFX_MONSTER_HURT

skipHurtingMonsterAndSound:
LDX tempx
;; what should we do with the projectile?
DeactivateCurrentObject
INC limitProjectile ;;projectiles limitation related
 

dale_coop

Moderator
Staff member
Your script looks good (exactly like mine). Strange... You still have the game freezing up when the projectile hit an enemy?
And when you didn't have the "limitProjectile" related modifications in your scripts, your game was not freezing?
 

ZeGGamer1

New member
Yes it wouldn't freeze. Then again, It was using the Meele object and not the projectile one so that might mean something.
 

dale_coop

Moderator
Staff member
ZeGGamer1 said:
Yes it wouldn't freeze. Then again, It was using the Meele object and not the projectile one so that might mean something.

Could you check your projectile? is it correctly set (monster's weapon, bounding box, etc... )
 

ZeGGamer1

New member
Wait, does it need to be a monster weapon? I was using a player weapon?

I don't have access to my computer at the moment so that is why I'm asking.
 

dale_coop

Moderator
Staff member
Ah ah, no ;) of course, I wanted to write « player weapon ».
But yeah should check that all your projectile’s details are ok.
 

dale_coop

Moderator
Staff member
OK, could your remove the shootWeapon.asm script from input editor and input scripts... put back the other script you used (CreateSimpleProjectileWithMotion.ASM?). Just that, and check if you still have the problem.
If no problem, share your script, we can compare to see what is the difference and how you can fix that.
 

dale_coop

Moderator
Staff member
ZeGGamer1 said:
I alwaysed used the shootweapon.asm script. I didn't know there was an alternative.

I thought you said you used the melee object as the projectile before... that the reason I supposed you used another script.
I did test again today, with your scripts (shootweapon and Platform_HandleHurtMonster) and it works for me. I can shoot at monsters and kill them (and my projectiles are limited to 2)

Could you share a screenshot of your projectile object details (the "details" tab)? AND your monster object details, too ?
 

ZeGGamer1

New member
It did shoot the Melee object, that was until I updated the code to limit it to two projectiles per shot.

And yes, I will sent some screen shots when I can.
 

dale_coop

Moderator
Staff member
ZeGGamer1 said:
It did shoot the Melee object, that was until I updated the code to limit it to two projectiles per shot.

And yes, I will sent some screen shots when I can.

OK :)

By the way, if you prefer shoot your "melee" object, you can just change the
Code:
	CreateObject temp,temp1,#$03, #$00
by:
Code:
	CreateObject temp,temp1,#$01, #$00
 

ZeGGamer1

New member
Hey, that might help too, I'll try doing that to see if it works, if not I can just send you the screen shots.
 

ZeGGamer1

New member
Progress is made. All We need to do now is get the bullet to damage the enemy.
 

Attachments

  • ScreenRecorderProject17.gif
    ScreenRecorderProject17.gif
    4.6 MB · Views: 2,946

dale_coop

Moderator
Staff member
Your bullet need to be a « player weapon » (not « player », not « persistent », ... just « player weapon ») and have a bounding box ;)
 

ZeGGamer1

New member
The bullets FINALLY WORK! one small bug remains however, when there are bullets on the screen, and I transition to a new screen, I cant shoot anymore because the bullets never destroyed themselves, so the prevent shooting variable never resets.
 
Top Bottom