Homing Attack
- Target your enemies with the famous Homing Attack and build up chain combos! -

Information - Components - Modding Guide - Creating Targets

Information
Action Type: Attack and Movement.

Trigger Key: Jump.

Usage: Press Jump in midair to attack. Nearby targets will automatically be locked-on.

Based On: Sonic Adventure 2 and Sonic Generations.

Components

Action Module (HUD Module)
This module should be attached to your Action System HUD.
Click it to enable or disable the action.

Spin Actions (Attachment)
This is the attachment where all of the scripts and effects are stored.
It attaches to your Avatar Center.


Modding Guide

This guide uses the Personal Action System as an example. Your Homing Attack may differ slightly.

 

When modding the Homing Attack it is always recommended to turn on the Highlight Transparent feature (Control + Alt + T).

Always rez Action System objects on the ground when modding rather than wearing them.
This not only makes them easier to edit but will ensure that changes will not be lost when detaching them.

 

Modding Colours

The Homing Attack uses the Spin Jump Ball Effect and Spin Actions Shared Trail Effect. Changing the colours of these effects will alter the Spin Jump, Spin Dash and Boost colours.

1. Select the Spin Jump Prim as highlighted here:

2. Open the Texture tab in the Build Tools window and click on the Color box.

3. Pick a colour and press Ok.

4. Select the Shared Trail Effect Prim as highlighted here:

5. Open the Texture tab in the Build Tools window and click on the Color box.

6. Pick a colour and press Ok.

7. Select the Homing Attack Painter Prim as highlighted here:

8. Take the object back in to your inventory.

9. Right-click on it and choose Add.

10. Try out your new colours!

Back to Modding Guide

 

Modding Settings

Every action includes a Settings script in its Root Prim. These scripts allows you to change various behaviour parameters, sounds, volumes and animations. In addition, almost every other script is moddable so you can change all of the effects too.

1. Select the Root Prim as highlighted here:

2. Open the Content tab in the Build Tools window and open the script called Homing Attack Settings.

3. Find the // Parameters section of the script near the top.

These are the behaviour parameters:

Parameter Name Description Options
param_homing_attack_mode* Determines which mode the Homing Attack operates on. Must be 0, 1, 2, 3, 4 or 5.
param_homing_attack_painter Determines if the target lock effects will trigger when locked on. Must be TRUE or FALSE.
param_homing_attack_trail Determines if a prim trail appears when performing a Homing Attack. Must be TRUE or FALSE.
param_homing_attack_chains Determines if chain effects play when sequentually attacking targets using the Homing Attack. Must be TRUE or FALSE.
param_homing_attack_tricks Determines if a trick animation is played after performing a Homing Attack on a target. Must be TRUE or FALSE.
param_air_attack_speed Determines the velocity of the Air Attack (a Homing Attack with no target). Must be between 0.0 and 3.0.
param_air_attack_trail Determines if a prim trail appears when performing an Air Attack. Must be TRUE or FALSE.
param_air_attack_spin_effects Determines if Spin Jump effects appear when performing an Air Attack. (Excludes animation, effects only.) Must be TRUE or FALSE.

* See the Creating Targets section for more information about this parameter.

You do not need any scripting experience to alter these settings. The orange text next to each parameter tells you what it does and how to change it. The first parameter requires further explanation, so let's look at the second parameter as an example:

integer param_homing_attack_painter = TRUE;// Determines if the target lock effects will trigger when locked on. Must be TRUE or FALSE.

If we break up this line we can see how it is structured:

integer

Ignore this
param_homing_attack_painterr

Name of the parameter
=

=
TRUE

Value
// Determines if the target lock effects will trigger when locked on.

Tells you what the parameter does.
Must be TRUE or FALSE.

Tells you how to change it.

This parameter controls if a targeting effect is triggered when locked-on to a target. It is currently set to TRUE. The orange text says it can be TRUE or FALSE. For example, setting it to FALSE will make the Homing Attack act like it does in Sonic Adventure!

You can change all of the parameters in the same way. Just make sure you set the values as indicated in the yellow text above.

Do not change or delete any speech marks [ " ], semi-colons [ ; ] or equal signs [ = ].

4. Change the parameters as you please.

5. Save and close the script.

6. Take the object back in to your inventory.

7. Right-click on it and choose Add.

8. Try out your tweaked Boost!

Back to Modding Guide

 

Modding Animations

Changing animations is done the same way as changing settings and sounds.

1. Select the Root Prim as highlighted here:

2. Open the Content tab in the Build Tools window and open the script called Homing Attack Settings.

3. Find the // Animations section of the script near the top.

The Homing Attack has three animation slots. One animation can be assigned to each slot. Animations will start and stop depending on the current state of the Homing Attack.

These are the animation states:

Slot Name Description Looping
anim_homing_attack Plays when performing a Homing Attack. MUST be looped.
anim_homing_trick_1 Plays after attacking a target. Selected randomly. Looping optional.
anim_homing_trick_2 Plays after attacking a target. Selected randomly. Looping optional.
anim_air_attack // Plays when performing an Air Attack. MUST be looped.

You do not need any scripting experience to change animations. The orange text next to each animation slot tells you when it plays and if it must be looped. Let's look at the first animation slot as an example:

string anim_homing_attack = "THW Anim - Homing Attack";// Plays when performing a Homing Attack. MUST be looped.

If we break up this line we can see how it is structured:

string

Ignore this
anim_homing_attack

Animation slot
=

=
"THW Anim - Homing Attack"

Name of the assigned animation
// Plays when performing a Homing Attack.

When the animation plays
MUST be looped.

Looping info

This animation slot is used when you are performing a Homing Attack towards a target. The description says that the animation MUST be looped.

4. Find an animation in your inventory that you want to assign to an animation slot.

5. Click and drag the animation from your inventory in to the Contents area of the Build Tools window.

6. Replace the currently assigned animation with the exact name of the new animation next to the animation slot.

string anim_homing_attack = "Your animation";// Plays when performing a Homing Attack. MUST be looped.

Do not change or delete any speech marks [ " ], semi-colons [ ; ] or equal signs [ = ].

7. Save and close the script.

8. Take the object back in to your inventory.

9. Right-click on it and choose Add.

10. Try out your new animations!

Back to Modding Guide

 

Modding Sounds

Changing animations is done the same way as changing settings and animations.

1. Select the Root Prim as highlighted here:

2. Open the Content tab in the Build Tools window and open the script called Homing Attack Settings.

3. Find the // Sounds section of the script near the top.

The Boost has two sound slots. One sound can be assigned to each slot.

These are the sound slots:

Slot Name Description Looping
sound_homing_attack_fire Plays when performing a Homing Attack. MUST NOT be looped.
sound_homing_attack_painter Plays when valid Homing Attack target is in range. MUST NOT be looped.
sound_air_attack_fire Plays when performing an Air Attack. MUST NOT be looped.
sound_attack_chain_1 Plays after hitting two targets in a Homing Attack chain. MUST NOT be looped.
sound_attack_chain_2 Plays after hitting three targets in a Homing Attack chain. MUST NOT be looped.
sound_attack_chain_3 Plays after hitting four targets in a Homing Attack chain. MUST NOT be looped.
sound_attack_chain_4 Plays after hitting five targets in a Homing Attack chain. MUST NOT be looped.
sound_attack_chain_5 Plays after hitting six targets in a Homing Attack chain. MUST NOT be looped.
sound_attack_chain_max Plays after hitting the maximum number of targets in a Homing Attack chain. MUST NOT be looped.

You do not need any scripting experience to change sounds. The orange text next to each sound slot tells you when it plays and if it must be looped. Let's look at the first sound slot as an example:

string sound_homing_attack_fire = "b8ad345d-8fb9-325d-5d26-c4a3634fbeb6";// Plays when performing a Homing Attack. MUST NOT be looped.

If we break up this line we can see how it is structured:

string

Ignore this
sound_homing_attack_fire

Sound slot
=

=
"b8ad345d-8fb9-325d-5d26-c4a3634fbeb6f"

Name or UUID of the assigned sound.
// Plays when performing a Homing Attack.

When the sound plays.
MUST NOT be looped.

Looping info

This sound slot is used when you perform a Homing Attack. The description says that the sound MUST NOT be looped.

4. Find a sound in your inventory that you want to assign to an sound slot.

5. If you have a UUID of a sound, copy it and paste it in place of the original sound in the sound slot.

Alternatively if you have a sound file in your inventory (with copy permissions), click and drag it from your inventory in to the Contents area of the Build Tools window.

Change the UUID in the sound slot to the exact name of your sound.

7. Scroll down and find the // Volumes section of the script.

Each sound slot has its own volume setting. You can alter the volume of each sound by changing the variable (number).

You must select a number between 0.0 and 1.0. An example is 0.5 which is equivilant to 50%.

8. Save and close the script.

9. Take the object back in to your inventory.

10. Right-click on it and choose Add.

11. Try out your new sounds!

Back to Modding Guide

Modding Effects

This is the Spin Actions attachment. It uses prim effects and particle systems.

Spin Ball (Prim Effect) Origins
How to edit: Select the highlighted prim and open the Spin Jump Effects + Particles script. Adjust the variables to your liking.
Note: Changing this effect will alter the Spin Jump action.

 

Shockwave (Particle Effect) Origin
How to edit: Select the highlighted prim and open the Homing Attack Shockwave Effect script. Adjust the variables to your liking. Colouring: This particle effect is scripted to use the prim's colour.

 

Shared Trail (Prim Effect) Origin
How to edit: Select the highlighted prim and open the Trail Effect script. Adjust the variables to your liking.

 

Target Painter (Particle Effect) Origin
How to edit: Select the highlighted prim and open the Homing Attack Painter Effect script. Adjust the variables to your liking.
Colouring: This particle effect is scripted to use the prim's colour.

Back to Modding Guide


Creating Targets

The Homing Attack can lock-on to both avatars and objects. Avatars are easy for scripts to indentify, but objects are different.
Most game engines can define different types of objects such as powerups, enemies and platforms. Unfortunately, all objects in Second Life are considered the same thing. Scripts can detect many things about objects such as if they are physical or scripted, but not if they are powerups, enemies or platforms.

The Hedgehog Workshop uses two methods that allow objects to be seperated in to types. This system can be difficult and complicated to understand, so please read this guide carefully and slowly.

The Code method checks the description of an object to see if it contains a special code. This table shows all available codes:

Code What it means Object Examples
THW-LOCKON-A-A This tells the system that the object is a standard target. Avatars will perform tricks when using the Homing Attack on them. Enemies or balloons.
THW-LOCKON-A-B This is the same as the above, but will not make avatars perform tricks. Springs.
THW-NOLOCK This code is for objects that need to temporarily disable being detected using the code method. Enemies that have been destroyed and are waiting to respawn.

The Detection method searches for scripted objects that were not made for the Action System. Only scripts that are actively doing something can be detected. For example, if you see a moving badnik that was created by someone else, the Homing Attack will be able to lock-on to it for you to attack.

This method is disabled by default. To enable it, open the Homing Attack Settings script and locate this variable:

integer param_homing_attack_mode = 1; // Determines which mode the Homing Attack operates on. Must be one of the following numbers:
// 0 - Targets nothing. Only Air Attacks can be performed.
// 1 - (DEFAULT) Targets avatars and special objects* only.
// 2 - Targets avatars only.
// 3 - Targets special objects* only.
// 4 - Targets avatars, special objects* and standard scripted objects (must be actively doing something).

Set it to 4 and save the script. The Homing Attack will now search for active scripted objects.

With this knowledge, you can now create viable Homing Attack targets.

Example

Copy and paste the code below in to a new script. Place the script in a simple object to test.
Note: The formatting will be lost when pasted in to Second Life.

default
{
// We want to reset the target each time the object is rezzed or this script is changed.

on_rez(integer rez)// When the object is rezzed...
{
llResetScript(); // Reset the script.
}

state_entry()// When the script starts...
{
llSetStatus(STATUS_PHANTOM, FALSE);// Make the object solid.
llSetObjectDesc("THW-TARGET-A-A");// Put the special code in the description.
llSetLinkAlpha(LINK_SET, 1.0, ALL_SIDES);// Make the entire object visible.
}

collision_start(integer num_detected)// When something hits the object...
{
llSleep(0.2);// Allow time for the Homing Attack to read the target sub-code.
llSetStatus(STATUS_PHANTOM, TRUE);// Make the object phantom.
llSetObjectDesc("THW-NOLOCK");// Remove the special code from the description.
llSetLinkAlpha(LINK_SET, 0.0, ALL_SIDES);// Make the entire object invisible.

// At this point the target has been "destroyed".

llSleep(5);// Wait for five seconds.

// We now want the target to "respawn".

llSetStatus(STATUS_PHANTOM, FALSE);// Make the object solid.
llSetObjectDesc("THW-TARGET-A-A");// Put the special code in the description.
llSetLinkAlpha(LINK_SET, 1.0, ALL_SIDES);// Make the entire object visible.

// The target is now ready to be attacked again.
}
}

If you have scripting experience you can adapt this script to work with more complex objects, such as enemies or moving targets.

Back to Top


Sonic the Hedgehog® and related characters, assets and logos are registered trademarks of SEGA Corporation.
The Hedgehog Workshop is not affiliated, licensed, or endorsed by SEGA Corporation in any way.
All products created by The Hedgehog Workshop are un-official and are always treated as such.