Change object action step in Object Collision script

Atarath

Member
I obviously don't have a grasp on the fundamentals of asm. I'm trying to put a roof on a house that hasn't been built.

That said, I'm trying to change the action step of a monster object. I placed my code in the Handle Object Collision script under the otherIsNotAcollectable label

Code:
otherIsNotAcollectable:
LDA Object_ID,x
CMP #25
BNE +
ChangeObjectState #$00, #$01
+

My thought is that I would check the id to see if it equals the monster I want. BNE would imply it would jump to the + if not equal, meaning the code in between would run, right? It's not working lol.
 

dale_coop

Moderator
Staff member
Don't know what is the behaviour you want to add... but if you want to check a monster, you need to check his "type":
Code:
LDA Object_type,x
CMP #25
BNE +
ChangeObjectState #$00, #$01
+
 

drexegar

Member
dale_coop said:
Don't know what is the behaviour you want to add... but if you want to check a monster, you need to check his "type":
Code:
LDA Object_type,x
CMP #25
BNE +
ChangeObjectState #$00, #$01
+

What is the difference between Object type and Object ID?
Is type still the number of the monster, or determines its a player, object or monster?
 

Atarath

Member
dale_coop said:
Don't know what is the behaviour you want to add... but if you want to check a monster, you need to check his "type":
Code:
LDA Object_type,x
CMP #25
BNE +
ChangeObjectState #$00, #$01
+

I did try object_type, and I just did again but it doesn't seem to work. If that code should work then the problem must be where the code is placed? Specifically, I'm trying to get the action step of a monster to change upon collision with the player. It's placed in the otherIsNotAcollectable label in handle object collision after it seems to run though all the other object flags.
 

dale_coop

Moderator
Staff member
You want to change the monster’s action step on Collision with a monster...?
When your player hurt a monster or when a monster hurt the player?

And you want to set action step 0? It’s not already the behavior?
 
Top Bottom