Page 1 of 1

Changing shared meta pointer

Posted: Wed Dec 26, 2012 8:03 pm
by CaptainPoopface
I want to make my needler semi-automatic. Unfortunately, that makes several other automatic weapons fire semi-automatic because they share meta, which is not what I want. How can I make the needler share its meta with another semi-automatic gun like the shotgun? Where is that pointer or offset in the weap tag, or is it somewhere else (mp_shared)?

By the way, it is very helpful to see shared meta identified in red in Entity's Meta Editor Plus. :wonder:

Note that I am strenuously avoiding duplicating/internalizing meta. At this point, I would prefer to share meta instead of internalizing it.

Re: Changing shared meta pointer

Posted: Thu Dec 27, 2012 4:21 am
by Click16
The way I would do it, is by changing the raw pointer (hex) to that of the source meta. If you would like some help doing this, I could make an app that does it, or I'll write a tutorial.

EDIT:
I would parse-duplicate the Needler weapon tag. Doing this will internalize all the meta, then if you want other weapons to do this, change the raw pointer to that of the needler's.

Re: Changing shared meta pointer

Posted: Thu Dec 27, 2012 5:55 am
by troymac1ure
First off, I never know if the Entity I release will be my last release. That out of the way..

This is on my list of things to add. I have an idea for accomplishing it that I think would work easily, unfortunately, it's on a list and not by itself on things to do. Now that Christmas is gone, I may be able to find some time here and there to work on some more ideas.

Re: Changing shared meta pointer

Posted: Fri Dec 28, 2012 2:34 am
by XZodia
well you can change the pointer by editing your plugin, replace the struct with 2 int's the first is the chunk count the second is the pointer, copy the pointer from the meta you want to share with

Re: Changing shared meta pointer

Posted: Sat Dec 29, 2012 10:22 am
by troymac1ure
XZodia wrote:well you can change the pointer by editing your plugin, replace the struct with 2 int's the first is the chunk count the second is the pointer, copy the pointer from the meta you want to share with
Thanks for the easy idea! Referencing reflexives now added as another option into the next release of Entity.

Re: Changing shared meta pointer

Posted: Sat Dec 29, 2012 10:28 pm
by CaptainPoopface
I'm a bit embarrassed I didn't think of that... :oops: I already do this in several other tags (effe, jmad, hlmt...) and have a separate plugin set to load for sharing certain chunks. Don't know why I didn't think to do the same thing for the shared part of the weap meta.

On the plus side, it would be nice to do this natively in Entity, although the plugin sets feature also makes it much easier than before.

Thanks.

Re: Changing shared meta pointer

Posted: Fri Jan 25, 2013 11:41 pm
by CaptainPoopface
When there are multiple chunks pointed to, is it possible to share only one of them, or some other subset? For example, if I want to give the shotgun another trigger and barrel, but keep its original trigger and barrel reflexives. It seems possible if I could determine the size of one of the chunks being pointed to, then offset by that amount from the offset of the first chunk. Actually that makes me think it's not possible, unless I get very lucky and the chunks I want are contiguous in memory...

Re: Changing shared meta pointer

Posted: Sat Jan 26, 2013 1:07 am
by troymac1ure
I think your last idea was on the right track. (I think this would work)
If you cloned the shotgun's trigger and barrel, then kept the cloned copy values the same as the shotgun's original values, you could take a second weapon and point it's trigger and barrel to the shotguns, then hex modify (or change the plugin) the count on the second weapon to only one trigger and barrel.
This way you could modify the first trigger and barrel and have it modify both weapons, but the shotgun would also use the second barrel and trigger as well.