Jump to content
A 2021 backup has been restored. Forums are closed and work in progress. Join our Discord server for more updates! ×
SoaH City Message Board

Homing Attack in Worlds 1.4.3


InfinityAlex

Recommended Posts

So, I'm trying to do a homing attack in Worlds 1.4.3, but I've no idea where to start. I only want springs, badniks and monitors to be "homable", if you will, so I know that I will need to assign them an extra qualifier for the homing attack, but beyond that, I've not a clue what to do.

 

Please help...

Link to comment
Share on other sites

OK, guys, I'm getting desperate now, so here's the deal.

If you can make a fully working homing attack in Worlds 1.4.3, I will buy you a Steam game of your choice priced at a maximum of £10*.

Please, guys, I really need this. This is what I'm willing to do for it.

Good luck.

 

*about $17 at the time of writing, but values may differ and this bounty is only applicable to digital purchases.

Link to comment
Share on other sites

So you were asking about how to target an object by shortest distance in the Skype chat. Attached is an MMF2 tutorial for doing just that in a simple two event fashion.

 

Learn to use the fixed value and fall in love with it as any respectable MMF2 programmer should.

 

Instructions: Movement of the teal sensor is done by drag and drop.  The closest enemies group object will get hit by the targeting reticule.

Note that you don't have to run this loop every frame. Instead, you can just run it once when you activate the homing attack. Then if the target is -1 at the end of the loop, you do your jump-dash style homing attack and if it's >= 0, you do your homing attack logic by selecting that enemy by fixed value.

 

You can also apply additional restrictions to the selection logic by editing the for each loop event to exclude targets that are say... above the player.  You can limit the maximum distance of selection by providing a different squared distance value as I described in the comment.

simple_targeting.mfa

Link to comment
Share on other sites

I tried copy-pasting this into Worlds, adjusting it so that it was relevant to the player, but it didn't work. Besides, my offer is to those who are able to code a fully working homing attack into Worlds, not just a reticle.

 

I appreciate that you're trying to help and I don't mean to blow you off, but sorry. :(

Link to comment
Share on other sites

I actually wouldn't have accepted the bounty anyway. I provide programming help to SFGHQ members out of altruism.

 

Anyway, you can't just copy and paste that code.  You have to make sure the events are applied to the objects that are actually a part of your simulation.

 

I provided the targeting alone because a homing attack is a very personal thing. It's not like the spindash where we have several consistent examples of how it worked in the original Sonic games.  There are no two Sonic games which have the homing attack follow the same behavior. This is one of the main reasons we've never put a homing attack in Sonic Worlds in the first place. Targeting on the other hand is a necessary component no matter how you choose to implement the homing attack. This is where you get to be creative.

 

Once you have the target chosen, you have the ability to implement that behavior without much effort. You simply change the action of your player to an unused action value for the homing attack action and then add logic for when the player is in that action to have the speeds set in a way that would constantly move the player towards that target. Add in some logic so that if you hit a wall or a floor or something like that, you'll switch either to the normal action or the jumping action.

Link to comment
Share on other sites

I don't like to do stuff like this via Skype.  It's better to have a record of the assistance so that if people come along in the future, they have a resource to look through for help.

 

The following example isn't in any way meant to be complete... but because it's frequently requested, I've made a Delta 1.4.3 build with a homing attack in it. It's crude and I'm sure there are bugs that need to be addressed, but it should provide at the minimum a stage for getting started.

SonicWorldsDeltaV1.4.3_homing.zip

Link to comment
Share on other sites

I got to feeling extra creative this evening and made some significant improvements on this example.  Now it has the traditional homing attack bouncing and resets the instashield and homing attack abilities on impact, it targets the enemies a little higher on their bodies, it works much better on Metal Sonic, it has a time limiter on the homing attack portion to prevent getting the player stuck in a homing attack state, and even comes with a fancy blue glow.

 

EDIT:  Also attached executable for people who just want to try it out.

SonicWorldsDeltaV1.4.3_homing_v2.zip

SonicWorldsDeltaV1.4.3_homing_v2_exe.zip

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...