Staredit Network > Forums > SC2 Custom Maps > Topic: Tutorial: Attachments onto Units
Tutorial: Attachments onto Units
Mar 16 2012, 5:00 pm
By: Ahli  

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

I do stuff and thingies... Try widening and reducing the number of small nooks and crannies to correct the problem.

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

Post has been edited 4 time(s), last time on Jan 14 2013, 6:53 pm by Ahli. Reason: updated previewer to cutscene editor




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



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?



None.

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

OVERWATCH STATUS GO

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\:
My Overwatch addiction.

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

I do stuff and thingies... Try widening and reducing the number of small nooks and crannies to correct the problem.

Quote from 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.




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



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?



None.

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

OVERWATCH STATUS GO

Quote from 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\:
My Overwatch addiction.

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



...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.



None.

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

I do stuff and thingies... Try widening and reducing the number of small nooks and crannies to correct the problem.

Quote from 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 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:
BunkerOnUltraBack.SC2Map
Hits: 3 Size: 8.07kb




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



Heh, yeah. Thanks. The editor is full of annoying quirks like that...



None.

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



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



None.

Options
  Back to forum
Please log in to reply to this topic or to report it.
Members in this topic: None.
[09:38 pm]
NudeRaider -- Ultraviolet
Ultraviolet shouted: NudeRaider sing it brother
trust me, you don't wanna hear that. I defer that to the pros.
[2024-4-27. : 7:56 pm]
Ultraviolet -- NudeRaider
NudeRaider shouted: "War nie wirklich weg" 🎵
sing it brother
[2024-4-27. : 6:24 pm]
NudeRaider -- "War nie wirklich weg" 🎵
[2024-4-27. : 3:33 pm]
O)FaRTy1billion[MM] -- o sen is back
[2024-4-27. : 1:53 am]
Ultraviolet -- :lol:
[2024-4-26. : 6:51 pm]
Vrael -- It is, and I could definitely use a company with a commitment to flexibility, quality, and customer satisfaction to provide effective solutions to dampness and humidity in my urban environment.
[2024-4-26. : 6:50 pm]
NudeRaider -- Vrael
Vrael shouted: Idk, I was looking more for a dehumidifer company which maybe stands out as a beacon of relief amidst damp and unpredictable climates of bustling metropolises. Not sure Amazon qualifies
sounds like moisture control is often a pressing concern in your city
[2024-4-26. : 6:50 pm]
Vrael -- Maybe here on the StarEdit Network I could look through the Forums for some Introductions to people who care about the Topics of Dehumidifiers and Carpet Cleaning?
[2024-4-26. : 6:49 pm]
Vrael -- Perhaps even here I on the StarEdit Network I could look for some Introductions.
[2024-4-26. : 6:48 pm]
Vrael -- On this Topic, I could definitely use some Introductions.
Please log in to shout.


Members Online: Roy