Changing Action On Collision

Golde

New member
My goal is to place mines that will explode when monsters or the player collide with one. The mines are game objects that the player places onto the world. So far I've figured out that I probably need to code a new End Action setting that will loop the default animation until a collision occurs, which would trigger the next action step that would be an explosion. My problem is that I don't have much knowledge of Assembly language so I'm not sure where to start with this. I've spent the past couple of days looking for info that could help me figure this out but haven't gotten anywhere with it. Am I going about this the right way and if so how do I code this?
 

dale_coop

Moderator
Staff member
Check the Proximity script... set this action to Action Step 0.... loop. and it will change to Action Step 1, when the player is near.
http://www.nesmakers.com/viewtopic.php?f=40&t=1958

You could modify it to check against a monster, instead of the player.
 

Golde

New member
Thank you! This is definitely the kind of thing I'm looking for. Any idea how to narrow it down so it will only trigger when something is about right on top of the object? I've tried tinkering with the ENEMY_HPROXIMITY and ENEMY_VPROXIMITY constants, and the object either changes state immediately after it's placed or if the constants are smaller the state won't change no matter how close I get. I tried changing the bounding box too to see if that would effect anything and it doesn't really seem to have.
 

Golde

New member
021b9b2952c0c42fc6b7e9f4d531f7c0.png


No explosion when the constants are set to 4, instant explosion when they're set to 5.
 

Attachments

  • minenoexplosion.gif
    minenoexplosion.gif
    1.2 MB · Views: 646
  • mineexplosion.gif
    mineexplosion.gif
    1.2 MB · Views: 646

dale_coop

Moderator
Staff member
Which script do you use (in the topic, if you read every messages on the 1st page, chronicleroflegends shared several ones... but the last script, on "Wed Feb 06, 2019 9:42 pm" he edited, should be the correct one)
 

Golde

New member
This is using the most recent script with the lower section commented out for 4-way checking.
 

dale_coop

Moderator
Staff member
But it's normal, it's exploding... because when you drop it, you are close to it. If you made the value smaller, the calculations will work correctly.
The value should be around 16. But the script NEEDS to be modified if you want to make it explose with monsters and not the Player.

If your coding skills are limited, another (easier) way would be to just make them explode on a timer.
 
Top Bottom