Enemy self destructs (not intentional)

red moon

Member
Hello,
I wanted to see if anyone has encountered this before. I sent an an enemy to shoot a projectile at the player using the settings in the 20 min shooter tutorial. (I used the settings for the boss at the end)
My enemy does not shoot at the player, instead it kills itself and burns up. Interesting...

I captured screens showing the setup. Thank you for looking!

https://youtu.be/XaDURxSzVco
 

Attachments

  • selfD1.jpg
    selfD1.jpg
    630.4 KB · Views: 1,303
  • selfD2.jpg
    selfD2.jpg
    645.2 KB · Views: 1,303
  • selfD3.jpg
    selfD3.jpg
    664.7 KB · Views: 1,303
  • selfD4.jpg
    selfD4.jpg
    697.1 KB · Views: 1,303
  • selfD5.jpg
    selfD5.jpg
    684.3 KB · Views: 1,303
  • selfD6.jpg
    selfD6.jpg
    684.7 KB · Views: 1,303

dale_coop

Moderator
Staff member
Check your "OBJ_MONSTER_PROJECTILE" constant in the "Project Settings > User Constant" and make sure the value is "11" (the object you are using as Monster Projectile).
 

red moon

Member
I see, it should correspond with its place in the game object list. Thanks Dale, I will check what it is at present....
 

red moon

Member
Odd, I posted a reply to this last night and it disappeared!

Dale, that did enable the projectile to appear and fly at the player, however it is releasing 4 or more at a time!

Is this because of the object properties settings? I copied what was present for the shooting boss which only released one at a time.

https://www.youtube.com/watch?v=VtQKPJhlQvo
 

dale_coop

Moderator
Staff member
this Is strange...
Could ne the shootAtPlayer script that is not correct (if you modified it).
Or could be your screen that has an issue (if you place4 monsters on that screen initially. And have removed 3)
In that scenario, just do a right click « reset all placements » (and place agin your monster) should fix that.
 

red moon

Member
Hey Dale,
Thank you for giving this some thought. I tried the screen reset and replacing the shooting enemy and still ended up with the same results. I have not made any changes to the enemy projectile script; I can post it here if it will help...
 

red moon

Member
Code:
;; shoot towards player.

	TXA
	STA tempx
	
	;; get offset
    LDA Object_x_hi,x
	;CLC
	;ADC #$04 ;; arbitrary...would put an 8x8 proj in the center of a 16x16 object
    STA temp1
	
    LDA Object_y_hi,x
	CLC
	ADC #$10
    STA temp2
	LDA Object_scroll,x
	STA temp
    CreateObject temp1, temp2, #OBJ_MONSTER_PROJECTILE, #$00, temp ;; maybe use a different state for ignore physics?
	LDA #$00
	STA Object_movement,x
	;; we will skip traditional movement 
	;; and use direct speed instead.
	;; will this cause deacceleration?
	;; what we need is a bit to "ignore physics engine" which will ignore acc/dec
	
	LDA Object_x_hi,x
	sec
	sbc xScroll

	STA temp
	LDA Object_y_hi,x

	STA temp2
	TXA
	STA tempz ;; store the newly created object's x
	;; shoot at player one - if there are two players, will we randomize somhow?
	LDX player1_object
	LDA Object_x_hi,x
	sec
	sbc xScroll
	STA temp1
	LDA Object_y_hi,x
	STA temp3
	LDX tempz ;; restore newly created projectile object.

	JSR MoveTowardsPlayer 
	LDX tempz

	LDA myHvel
	
	STA Object_h_speed_lo,x
	LDA #$00
	STA Object_h_speed_hi,x
	LDA myVvel
	STA Object_v_speed_lo,x
	LDA #$00
	STA Object_v_speed_hi,x
	
	
gotVAimSpeeds:	
	
	
	LDX tempx
 

dale_coop

Moderator
Staff member
Your script seems corr correct.
Or maybe because your Player's action Step 1 timer is "0"? (it should not be a problem... but try putting a value like "1" to see of there is a difference).
 

red moon

Member
Thanks Dale,
I did try changing the timer on this particular enemy and it did not seem to make a difference. I could zip everything up and send it later in the week if you have some time to look at it later.
I hope all is well!
 

red moon

Member
Thanks Dale,
I zipped up the files and sent them your way earlier in the day. Let me know if you have everything you need.
 

dale_coop

Moderator
Staff member
Found ;)

2019-11-20-14-30-56-Monster-Animation-Info.png


You set your projectile object to shoot at player... a projectile, that creates a projectile (..that creates a projectiles... that cr ...)
 

red moon

Member
Thanks Dale
It dawned on me last night after and I ended up doing the slim projectile collision right after I sent you a message last night! This helps for sure and makes it easier to jump over for now.
I am posting here so others can see the update.
I turned on ignore gravity and set it to move random L and R

https://www.youtube.com/watch?v=txv5LDvym1w
 

Attachments

  • example.jpg
    example.jpg
    256.8 KB · Views: 843

dale_coop

Moderator
Staff member
acaudel said:
This was super helpful! I was having the same problem! I've fixed it now.
Thanks dale_coop!

I am glad it helped :)

(it's the reason, I always try to convince members who send me their issues by PM to share on the forum, because it can be helpful for other prople in same situation... one day)
 
Top Bottom