Getting a Bullsquid to fire Barnacle tongue

Bullsquid have a ranged attack.
I want to make a giant bullsquid with a second ranged attack, that can pull the player in.
The mod that has Bullsquid ([reupload] half life renaissance reconstructed) also has a Barnacle weapon.
This weapon pulls the user towards the target hit by the tongue fired.

My question is, really: Where would I even start with making a tweaked version of the Barnacle weapon an inherent ability of a Bullsquid?

Firstly you should learn how to add an alternate attack to the bullsquid in general. Even a simple one so you can get it to behave how you would want the barnacle to ( maybe even just fire a bullet for now )

Then you’ll want to read into the barnacle swep and learn how that works. Figure out what functions are doing the pulling, how the tongue effect is created, etc

Finally you put it in the place of your bullsquid’s alternate attack. So remove the things relating to the swep and only plug in the pull and tongue code.

If you don’t want it to be exactly like the barnacle and do a simple high velocity pull, you can set the target’s velocity to be towards the bullsquid and just draw the tongue particle effect

There’s no real way to learn where to start unless you just jump and see how the thing works first. Best of luck

There’s a problem with that though.
It’s seriously complicated code, with countless points that rely on it being used by a weapon.
For example, “self.bInAttack” is used before it is first defined, thus it must be an inherent variable of SWEPs.
Also, “SWEP:OnThink()” is an important function.

I could perhaps get it to work, except now that I’m trying to make a copy of the Bullsquid, I’m finding that this code is an absolute mess.
Something in this code must add the Bullsquid to the list of spawnable NPCs, but what? It’s not made easier by there being code files which look like they came from a completely unrelated mod.