Jump to content
Baked Ham

Is it possible to attach an object to the unit's weapon?

Recommended Posts

i tried attachTo, and tried many memoryPoints, none of them can make the object rotate and move perfectly with the weapon while the unit is running...

Share this post


Link to post
Share on other sites

AFAIK from my investigations in 2016 there is no memory point or a similar thing which can be used to get a position on ur weapon where you could start from.

The only way I found these days was a complex algorithm which calculates that position backwards.

I don't understand the algorithm nowdays but maybe you are able to extract the needed information from it. The important variable of the script is _perfect_start which is the start point of a beam which is recalculated all the time to get the weapon movement into account:

 

 

  • Thanks 1

Share this post


Link to post
Share on other sites
Quote

Is it possible to attach an object to the unit's weapon?

no.

On 3/24/2019 at 3:07 PM, Baked Ham said:

make the object rotate and move perfectly with the weapon

nope. Can't.

 

 

What kinda object are you trying to attach and for what purpose? You could make a weapon attachment instead maybe.

Share this post


Link to post
Share on other sites
6 hours ago, Dedmen said:

nope. Can't.

this is such rock-solid... 

I would say maybe that It can be done but it's not worth the effort

  • Like 1
  • Thanks 1

Share this post


Link to post
Share on other sites
11 hours ago, sarogahtyp said:

AFAIK from my investigations in 2016 there is no memory point or a similar thing which can be used to get a position on ur weapon where you could start from.

The only way I found these days was a complex algorithm which calculates that position backwards.

I don't understand the algorithm nowdays but maybe you are able to extract the needed information from it. The important variable of the script is _perfect_start which is the start point of a beam which is recalculated all the time to get the weapon movement into account:

 

 

omg, I think I see what I need, this looks really promising, gonna check that out later, appreciate the help!

Share this post


Link to post
Share on other sites

but there is something confusing me after that post, why I can get weapon direction from unit but can't get the weapon itself XD.

 

  • Like 1

Share this post


Link to post
Share on other sites

then what is the selectionName  - "weapon" attached to exactly?

should be the weapon on the back

Share this post


Link to post
Share on other sites

I want to make a gopro gun camera actually, but the camera doesn't cooperate very well, cant find a proper position to attach to....

Share this post


Link to post
Share on other sites

did you try to strip down the last script I posted in the above given thread? It should calculate the position on weapon you just need to strip the drawing part and use the calculated position to set your camera position all the time. A simple one time attachTo will not work.

Share this post


Link to post
Share on other sites
2 hours ago, Baked Ham said:

I want to make a gopro gun camera actually, but the camera doesn't cooperate very well, cant find a proper position to attach to....

Well as I said you can just make it a attachment for the gun instead of a mod.
attachTo will be terrible performance and network load wise anyway.

 

If you want to also stream the video, you can just stream from the players head I think. Or slightly infront of his chest. Don't think anyone will notice much.

  • Like 1

Share this post


Link to post
Share on other sites
4 minutes ago, Dedmen said:

If you want to also stream the video, you can just stream from the players head I think. Or slightly infront of his chest. Don't think anyone will notice much.

true!

Share this post


Link to post
Share on other sites
3 hours ago, sarogahtyp said:

true!

ok then... seems like this is the way..  i still wonder how exactly a weapon fire its laser, i've been looking for some solutions in those config file, but i found nothing since i have no experience in modding, i saw some functions that contain sort of grenade explosion effect, what i don't understand is how they execute and have those parameters defined...

Share this post


Link to post
Share on other sites
1 minute ago, Baked Ham said:

i still wonder how exactly a weapon fire its laser

It's a weapon attachment. That's all done in the engine, can't do that with scripting or just configs.

Share this post


Link to post
Share on other sites
7 minutes ago, Dedmen said:

It's a weapon attachment. That's all done in the engine, can't do that with scripting or just configs.

wow thx for such quick reply.So i think i just stick to attachTo then XD, much appreciated!

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

×