Attaching Units to Attachpoints

Arkless

New Member
Reaction score
31
Well, I was searching for a way to attach units to other units for quite some time now. And there was no tutorial and nobody was able to help me.
I found a way now so I wanted to share it. I got no time to write a tutorial or stuff like that so I'd like someone to do that for me if possible (I don't need credits, thought I wouldn't mind).

This way is probably pretty crappy, but I'm new to using actors. So here it is:
lp_attachPoint is the attachpoint parameter
Unit is the unit parameter (where you attach to)
Unit2 is the unit which is to be attached

Actor - Create a SiteHosted actor in the scope (Actor scope for Unit) with content parameters lp_attachPoint, "", ""
Actor - Send message "RefSet ::scope.hostsite ::Self" to actor (Last created actor)
Actor - Send message "RefSet ::Host ::LastCreated" to actor (Actor for Unit2)
 

Arkless

New Member
Reaction score
31

Are you sure you read what you just posted?
The attachment is just a mere Actor. As such, it is impossible for it to have a weapon, much less attack.

The method I posted has a flaw, it does not move the unit itself (somehow, dunno why). But all MissileLaunch/Hit effect originate from the Model (wich is moved). So if you move the unit you are attaching to the position of the target unit you can still add behaviours/weapons etc. and they will be shooting from the model you attached.

You can also units that are already in the game (lets say you have a Hero that already got loads of weapons, maybe some attached models etc. ...).
You also have to notice that you can (if not flagged unselectable) still select the attached units, cast abilities with it (problem is the moving again) and stuff like that.
 

Dan

The New Helper.Net gives me great Anxiety... o.O;;
Reaction score
159
to be completely honest, arcanus's guide is VERY small in scope... and the fact that there are sooooo many random attachment fields... I just don't see this getting any easier on us until some mastermind spells out what all this junk is in a nice guide with examples of the different attach methods and actors... etc.

I'm having trouble wrapping my brain around what exactly you did Arkless... It doesn't help that there are so many options for attachment types, sites etc; all which have very little explanations included.
 

Arkless

New Member
Reaction score
31
I'm having trouble wrapping my brain around what exactly you did Arkless...

I created a sitehosted actor for my scope, at a specific attachment point.

Then I set that siehosted actor to be the host of my unit.
 
Reaction score
54
I got no time to write a tutorial or stuff like that so I'd like someone to do that for me if possible (I don't need credits, thought I wouldn't mind).


Hey! It's pretty neat that you figured out how to attach an unit instead of attaching an actor (this is practically what has stopped me from re-creating the uberlisk.)

Let me try breaking the code down and see if I got everything right:

Code:
Actor - Create a SiteHosted actor in the scope (Actor scope for Unit) with content parameters lp_attachPoint, "", ""
This creates a "Host Site?" actor on the unit's scope that takes an attachment point as an argument. Is this analogous to creating a Site Operation (Attachment) actor, assigning it an Attachment Point and then designating it to an unit?

Code:
Actor - Send message "RefSet ::scope.hostsite ::Self" to actor (Last created actor)
I believe this sets the... uhmgf.... this changes the Host Site actor we just created and tells itself to be the Host Site... of the unit? Is the unit affected because the unit and the Host Site are under the same scope, as per defined in the previous trigger? So scope.hostsite refers to the Unit's host site?
In the last action we already attached the Host Site to the unit, what is exactly happening here?

Code:
Actor - Send message "RefSet ::Host ::LastCreated" to actor (Actor for Unit2)
This would change the host of the Unit2 to be the Last Created Actor, which is the Host Site we finished setting in the previous two actions. Hence, this is the message that causes the attachment to complete.


This is pretty good. Do you mind if I add it to the Attachment's tutorial?
 

Arkless

New Member
Reaction score
31
Do you mind if I add it to the Attachment's tutorial?
Not at all, thats what I intended with posting it, making it easier to find! (I was searching for something like that for hours and only found question threads...)

Well, I still have some Problems with it:

1. The Unit itself somehow will not move (just the model) but missiles that are targeting the unit or coming from it will fly to/from the model. (so if you want to attach something like turrets to the uberlisk you'd have to periodically move the unit to the uberlist or they won't attack)
I'm 100% sure there is a way to move a unit via another actor to the right position but I did not have the time (but I will look into it as soon as possible).

2. If you attach multiple units and you turn one, you will turn all (it is not displayed, but it is important in case you use spells which use the unit angle). I am still searching and found no workaround.


Well, it's just the beginning, I am searching for more ways to attach stuff and fix the problem. If you want I can tell you everything I find out so that you can add it to your tutorial.
 

Dan

The New Helper.Net gives me great Anxiety... o.O;;
Reaction score
159
I love you two. I hope we can get some pictures in the tutorial on this once we get it working right. There are inevitably a 100 other things about attachments that can and should be figured out and added to the tutorial. Good start. Keep going!
 

Kildare

New Member
Reaction score
7
This is kinda off-topic, but have any of you guys tried manipulating the "Add-on Unit" values for a unit? The only drawback i can see from this is that the position/angle of the added-on unit is fixed/limited.

Additionally, the "Hangar" ability also makes a good way of attaching units to another unit, just need to tweak it around abit.
 
Reaction score
54
Yeah. I think the Add-On unit is more of a 'spawn unit with offset' than an actual attachment.

How would you go on about with the Hangar ability though? Would it be like the Brood Lord? You might be on to something there!
 

Kildare

New Member
Reaction score
7
With the Hangar ability it's possible but it's very limited in certain ways, such as that you can't have different distances at different angles, and ALL spawned units will face the same direction that the main unit is facing when it is MOVING. However, this ability is perfectly suitable for a single unit with multiple "parts" which acts as a unit, altough it might look slightly weird. Might need some tweaking.
 

Dan

The New Helper.Net gives me great Anxiety... o.O;;
Reaction score
159
those limitations are pretty big though in a lot of ways and we need more than a work around here. The idea is to start putting together some solid info on how to use attachments. The hanger ability is good for a brood lord type unit though.
 

Arkless

New Member
Reaction score
31
I'm having issues getting this to run.
What kind of ID is lp_attachPoint?

I am sorry, I somehow missed that part.
Attach Points is a preset, you can also use a string if you look up the names of the attachment points in the previewer.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top