[skip all navigation]

Tutorial: Attachments onto Units

Creator: Ahli
Time: Mar 16 2012, 5:00 pm

Post #1     Ahli Mar 16 2012, 5:00 pm

[Avatar]
Nothing yet! Almost done. Very powerful, very strong.
offlinecontact
Rank: Elite
Attachments onto Units:
I will guide you through the steps needed to attach actors onto units as they spawn with DATA.
At the end of this tutorial, you can find what you need to change, if you want to make the attached actor create/destroyable on the fly ingame.


Steps:
1. Create a new actor with "Model" - "Model Animation Style Continuous (Unit)"(!)
2. Chose the model for the actor.
3. Open actor events
3.1. Right click left area and add an event.
3.2. Select first line (the event) and chose "UnitCreation.MyUnit"(!)
3.3. Select the second line and chose "Create". This will spawn the actor.
3.4. The grey events ones should contain that the actor will be destroyed ingame
(to release the memory usage). If it's missing, add one with a good event like "ActorOrphan -> Destroy".
3.5 Check the bearings host reference. It needs to be "_Selectable:Implicit:Implicit::0" for a unit. If you want to attach something to a missile, you use "_Missile:Implicit:Implicit::0".

NOTE: If you want to reset the a field in the data editor, right click it, chose "reset to parent value"
and always chose the top option.

4. Edit the model flags and untick the "Allow hit test", if you want the attachment not to change the mouse pointer
(it might be huge, if the model file contains a big sphere for that).

5. Add the site operation with the main unit's attachment point as seen in the cutscene editor
(right click the actor and select preview; then select the model in the bottom left area, hit A on the keyboard to see the attachment points,
press shift + D to open the model details window and then have a look into the attachments folder. Sekecting an attachment highlights the attachment on the model).
Make sure that it is the correct attachment point as it needs to be existent on the unit (!).
For example there are a few attachment points with weapon, but only the correct attachment methods can be used.

5.1 If the attachment points are missing, duplicate a site operation (it's an actor) which is like the one you want
(like a hardpoint attachment).
5.2 Open Attachment Query, set the Method to "Direct" and chose the point type you need.
Then set the index (no index number in previewer means 0).
5.3 Use that as your hosted site operation.

6. Test the document.

Troubleshooting:
7. If your attachment doesn't spawn at all, check your actor type as seen in step 1.
8. If your attachment still doesn't spawn at all, check the actor events.

Further notes:
- You can use behaviors to create and destroy the attachment. This way you can dynamically add attachments to units.
- You can duplicate site operations and edit them to make the model not rotate with the unit for example.
This would need to have an enabled "soft attach" in the site operation.

Alternatives to make it dynamically:
- Use a behavior to enable and disable the attachment. The only differences are the actor events that create and destroy the unit need to be changed to Behavior.MyBehavior.On->Create and Behavior.MyBehavior.Off->Destroy.t spawn at all, check the actor events.

Further notes:
- You can use behaviors to create and destroy the attachment. This way you can dynamically add attachments to units.
- You can duplicate site operations and edit them to make the model not rotate with the unit for example.
This would need to have an enabled
This post was edited 4 times, last edit by Ahli: Jan 14 2013, 6:53 pm.  Reason given: updated previewer to cutscene editor

(user posted image)
Top

Post #2     ImagoDeo Apr 12 2012, 4:10 pm

[Avatar]
Back! Maybe.
offlinecontact
Rank: Regular
This is mostly clear and helpful, but I'm confused as to how step 5 works. Which data values are we changing, and are they on the actor we're attaching, or the unit we're attaching it to?

"We live, as we dream - alone..."
-Marlow, Heart of Darkness
Top

Post #3     DevliN Apr 12 2012, 6:27 pm

[Avatar]
SOMETHING STATUS GO
offlinecontact
Rank: Administrator
Step 5 is about using the Host Site Operations to actually determine the point on the actor where the attachment should be placed. Modify "Hosting - Host Site Operations +" on the Actor of the unit that the model is being attached to.

I also wrote a similar tutorial on GalaxyWiki if it helps.

:devlin: CURRENTLY WORKING ON :devlin:
Invasion: Ares | OMG TEH ZOMBIES!!!
Summoner | Infection
Top

Post #4     Ahli Apr 12 2012, 6:34 pm

[Avatar]
Nothing yet! Almost done. Very powerful, very strong.
offlinecontact
Rank: Elite
Quote from HCM™ImagoDeo
This is mostly clear and helpful, but I'm confused as to how step 5 works. Which data values are we changing, and are they on the actor we're attaching, or the unit we're attaching it to?
The Attachment Model will be attached to the point you specify in the site operation. If you chose WeaponLeft, it will be attached to WeaponLeft.

(user posted image)
Top

Post #5     ImagoDeo Apr 12 2012, 7:06 pm

[Avatar]
Back! Maybe.
offlinecontact
Rank: Regular
Quote from DevliN
Modify "Hosting - Host Site Operations +" on the Actor of the unit that the model is being attached to.

That's actually not what your tutorial says, and that's not what worked either. I had to modify that field on the actor I was attaching to the unit's actor. Didn't modify a thing on the unit's actor. Mistype?

"We live, as we dream - alone..."
-Marlow, Heart of Darkness
Top

Post #6     DevliN Apr 12 2012, 7:15 pm

[Avatar]
SOMETHING STATUS GO
offlinecontact
Rank: Administrator
Quote from HCM™ImagoDeo
Quote from DevliN
Modify "Hosting - Host Site Operations +" on the Actor of the unit that the model is being attached to.

That's actually not what your tutorial says, and that's not what worked either. I had to modify that field on the actor I was attaching to the unit's actor. Didn't modify a thing on the unit's actor. Mistype?
Yeah, woops. I ended up confusing myself in the process. :awesome: Meant to say to modify that on the actor that is being attached to the unit's attachment point.

:devlin: CURRENTLY WORKING ON :devlin:
Invasion: Ares | OMG TEH ZOMBIES!!!
Summoner | Infection
Top

Post #7     ImagoDeo Apr 18 2012, 9:01 pm

[Avatar]
Back! Maybe.
offlinecontact
Rank: Regular
...aaand now I'm running into issues attaching a Bunker to an ultralisk's back. The attachment point is Target_06, which doesn't have a SiteOp, so I made a new one but it doesn't work. I can attach the map if you'd like to see it but the steps should be easily reproducible.

"We live, as we dream - alone..."
-Marlow, Heart of Darkness
Top

Post #8     Ahli Apr 18 2012, 9:26 pm

[Avatar]
Nothing yet! Almost done. Very powerful, very strong.
offlinecontact
Rank: Elite
Quote from HCM™ImagoDeo
...aaand now I'm running into issues attaching a Bunker to an ultralisk's back. The attachment point is Target_06, which doesn't have a SiteOp, so I made a new one but it doesn't work. I can attach the map if you'd like to see it but the steps should be easily reproducible.
Quote from HCM™ImagoDeo
...aaand now I'm running into issues attaching a Bunker to an ultralisk's back. The attachment point is Target_06, which doesn't have a SiteOp, so I made a new one but it doesn't work. I can attach the map if you'd like to see it but the steps should be easily reproducible.
You had to create a new attachment site operation.
Strangely the editor didn't like target with index 6, so it reset it to 0 every time, but via raw data mode (ctrl + D) you are able to bypass the editor's stupidity.

Map is attached. :D
Attachments:
sc2map file
BunkerOnUltraBack.SC2Map (8.07 kb)
3 hits.

(user posted image)
Top

Post #9     ImagoDeo Apr 19 2012, 4:35 pm

[Avatar]
Back! Maybe.
offlinecontact
Rank: Regular
Heh, yeah. Thanks. The editor is full of annoying quirks like that...

"We live, as we dream - alone..."
-Marlow, Heart of Darkness
Top

Post #10     Dabbu Jun 29 2012, 8:17 pm

[Avatar]
offlinecontact
Rank: Member
cool thanks for that.

only strange thing in game is once you die the bunker doesnt show up in the fog of war with the rest of the ultra

Top
0 members in this topic (italic members are currently writing a reply): None
+ guest(s)


[01:00 pm]
Devourer -- predator is storng in normal mode as well.
[11:41 am]
NudeRaider -- predator is so imba in midwars after the ult change
[08:15 am]
Sand Wraith -- sen so suck
[07:56 am]
Oh_Man -- sen is the best FTFY
[07:49 am]
Sand Wraith -- sen is the worst
[05:41 am]
Oh_Man -- he's rite
Please log in to shout.