Enemy questions?

Hey!
While making some enemies, I thought about using the empty "Action Step Flags". There are some that are there already, like "Ignore collisions", "Invincible" ECT.
There were also "spawn types" and "hurt reactions", which I might be able to use to my advantage.
However, while going through the files in /Gameenginedata/Routines/System/, I was unable to even find where the default Action Step Flags were. If anybody knows where these files/Code is, please let me know.
Thanks :D
 

dale_coop

Moderator
Staff member
I think “Spawn type” and “Hurt reaction” are not used currently (not supported).
 
dale_coop said:
I think “Spawn type” and “Hurt reaction” are not used currently (not supported).
Hm, ok. Thats probably the case. Might look to the Object ram bytes to see if it's in there and see if I can use it to trigger code.
 

jorotroid

Member
I'm not sure if I completely understand your question, but here is an overload of information, that I think is related.

Action Step Flags are set in NESmaker in the Object Details window under the Actions tab. I haven't messed with the Adventure module in 4.1, but here is what I understand the flags are set up to do in the Platformer module:
Action Flag 0: Ignore Main Physics: Honestly, I'm not sure what this is suppose to do. Most of the time it seems to just make objects move down and to the left for me and I haven't figured out how to change an object's behavior. The comments in the code seem to imply that this is for projectiles.
Action Flag 1: No Player Collision: Collisions with the player will be skipped.
Action Flag 2: Immune to Weapon: Collisions with objects flagged as weapons will be skipped.
Action Flag 3: Jump On Kills: Collisions with the player if the player in colliding from above will destroy the object.
Action Flag 4: Ignore Gravity: Disables vertical movement.
Action Flag 5: Not Defined
Action Flag 6: Not Defined
Action Flag 7: Ignore Solids: Object won't be stopped by solid tiles.

When an object switches action states, it will load these flag values from a look up table into Object_vulnerability.

When you said "Invincible," I'm not sure if you were talking about the No Player Collision, Immune to Weapon, or Jump On Kills flags, but there is another context in the code where invincibility comes up. This is when a player or monster has been hurt, and is invincible for a brief period of time. This invincibility is not stored in the object action flags or Object_vulnerabily variable, instead that is kept track by the Object_status variable. Here are what the bits of Object_status are used for that I have been able to determine:
Code:
Bits:
76543210
||||||||
|||||||+- Is the object Invincible?
||||||+-- Is the object Hurt?
|||||+--- If it is the player, Is the object on the ground? If it is not the player, is the object 		 
|||||     at the edge of the screen?
||||+---- Object has been reserved.
|||+------ Not Defined?
||+------ Object is scheduled to be deactivated.
|+------- Object is scheduled to be activated.
+-------- Is the object active?

Everything that I have talked about here is so far hard coded into the different scripts of the module. There is no easy way to change out what sort of effects the bits do because there might be several spots in the code where they are used.

And yeah, as far as I can tell "Spawn Type" and "Hurt Reaction" haven't been hooked up to the code yet. Same goes for "Jump Speed," "Experience," "Strength," and "Defense." I know how to hook up those last 3, but not the others.

I hope something here answered your question. Sorry if it was too much information.
 

dale_coop

Moderator
Staff member
I thought monster object’s « Experience » was used to give score to the player...? (Maybe only in the adventure module?)

And for the flag « ignore main physics », yes, it is used for monsters projectiles (when using « shoot toward the player«  action script, the movement of the projectile has its own behavior, that doesn’t follow the general physics).
 

jorotroid

Member
dale_coop said:
I thought monster object’s « Experience » was used to give score to the player...? (Maybe only in the adventure module?)
Maybe it's hooked up in the adventure module in a way that I'm not expecting. From what I can tell, that code has been commented out in all versions of the HandleHurtMonster code.

dale_coop said:
And for the flag « ignore main physics », yes, it is used for monsters projectiles (when using « shoot toward the player«  action script, the movement of the projectile has its own behavior, that doesn’t follow the general physics).
Ah, yeah. I haven't made monsters with projectiles yet. Thanks for clarifying.
 
Yeah, the experience is used to add to the player's score, but from what I can tell, it's broken. I can't get it to work even with the increase score powerups code ( with modifications of course). The entire HandleHurtMonster.Asm is very finicky, and I can't seem to get much anything outside of the existing code to work with it... I couldn't even get it to set my canFire variable back to zero. Additionally, IDK why, but my game crashes whenever I hit an enemy. I even imported the default sounds and that only made it worse.

Also, in like the second post by Jorotroid (didn't quote because it's really big), You mentioned that its loaded when the object changes states. So, in order to do this, would I add in some code in the HandleUpdateObjects.Asm file? Thanks.
 

dale_coop

Moderator
Staff member
For your game crashing when killing monsters, it might be a sounds problem. Try this fix:
http://nesmakers.com/viewtopic.php?f=23&t=758&p=5591
 

jorotroid

Member
Karakara | Karetro said:
Yeah, the experience is used to add to the player's score, but from what I can tell, it's broken. I can't get it to work even with the increase score powerups code ( with modifications of course). The entire HandleHurtMonster.Asm is very finicky, and I can't seem to get much anything outside of the existing code to work with it... I couldn't even get it to set my canFire variable back to zero. Additionally, IDK why, but my game crashes whenever I hit an enemy. I even imported the default sounds and that only made it worse.

Also, in like the second post by Jorotroid (didn't quote because it's really big), You mentioned that its loaded when the object changes states. So, in order to do this, would I add in some code in the HandleUpdateObjects.Asm file? Thanks.

Do you mean accessing the Object_vulnerability variable in general? If so, you can access it at any time, I was just pointing out that when the Object changes states (err, I guess they are called Action Steps in NESmaker), that it will load up a different set of Action Step Flags into Object_vulnerability. So in action step 1, you might have the object ignore physics, but in action step 2, you might have it ignore gravity for whatever reason. The file where the Action Step change happens is in HandleUpdateObjects.asm, but whether or not you have to put you code in that file really depends on what you are trying to do. For example, the Ignore Physics and Ignore Gravity flags currently get checked in the the Physics script, while the Immune to Weapon and Jump On Kills are checked in the HandleObjectCollision script.
 
Top Bottom