Changing shared meta pointer

Post Reply
User avatar
CaptainPoopface
Posts: 714
Joined: Sat Feb 16, 2008 5:47 am

Changing shared meta pointer

Post 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.
User avatar
Click16
Posts: 1941
Joined: Mon Dec 31, 2007 4:36 am
Location: United States

Re: Changing shared meta pointer

Post 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.
Image
User avatar
troymac1ure
Keeper of Entity
Posts: 1282
Joined: Sat Aug 09, 2008 4:16 am
Location: British Columbia, Canada, eh
Contact:

Re: Changing shared meta pointer

Post 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.
User avatar
XZodia
Staff
Posts: 2208
Joined: Sun Dec 09, 2007 2:09 pm
Location: UK
Contact:

Re: Changing shared meta pointer

Post 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
Image
JacksonCougar wrote:I find you usually have great ideas.
JacksonCougar wrote:Ah fuck. Why must you always be right? Why.
User avatar
troymac1ure
Keeper of Entity
Posts: 1282
Joined: Sat Aug 09, 2008 4:16 am
Location: British Columbia, Canada, eh
Contact:

Re: Changing shared meta pointer

Post 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.
User avatar
CaptainPoopface
Posts: 714
Joined: Sat Feb 16, 2008 5:47 am

Re: Changing shared meta pointer

Post 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.
User avatar
CaptainPoopface
Posts: 714
Joined: Sat Feb 16, 2008 5:47 am

Re: Changing shared meta pointer

Post 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...
User avatar
troymac1ure
Keeper of Entity
Posts: 1282
Joined: Sat Aug 09, 2008 4:16 am
Location: British Columbia, Canada, eh
Contact:

Re: Changing shared meta pointer

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