AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Extensions (https://forums.alliedmods.net/forumdisplay.php?f=134)
-   -   [TF2] Patch for player attachments (MM:S and SM) (https://forums.alliedmods.net/showthread.php?t=126577)

voogru 05-11-2010 01:04

[TF2] Patch for player attachments (MM:S and SM)
 
Update: THIS EXTENSION DOES NOT WORK ANY MORE, DO NOT POST ABOUT TRYING TO INSTALL IT

As promised, I have release a patch for attached entities.

Restrictions:

Do not use any official valve item models, period! I am in the process of trying to see if we can get the policy relaxed, working around the system will ensure that they decide to ban all attachments.

Valve already knows exactly how this patch is working and it's trivial for them to fix. So, cheat the system, lose everything.

I asked Robin for permission to do this patch, and got the okay, but if you want to keep the ability to use attachments the usage of their content needs to be as close to zero as possible. I do not want to see any communities running cloned content, period. Valve never said anything about the use of their models before, so nobody really knew what they felt about it, now we know better. I hope most server operators on this forum are honorable enough to respect this.

This plug-in will try to prevent uses of valves models.

Also, the plug-in is designed in such a way that updates will regularly break it, I will update it manually after updates, and I will ensure that any cloned content I find, gets broken along with it. So if you like remaking cloned content every update, this is the way to go.

Discussion of any kind of workaround of the system on this forum will be ruthlessly deleted (and the poster potentially banned), we're not going to help anybody cheat the system and I hope the people on here will honor that. Remember, It is very easy for valve to break this, let's try and show them that the use of their content isn't going to be as widespread as they thought it would be and perhaps we can get a relaxation of the policy so that this workaround becomes obsolete.

With that said, there is no promise of how long this patch will work, they might fix it tomorrow (even though I got the okay).

If you see any servers running cloned content, please PM me the IP of the servers so I can have a count of rogue servers for statistics and perhaps a wall of shame. If the model is not made from scratch by a modeler, or it looks just like one of valves models, it's a clone. So even if you re-make a Sam & Max hat from scratch, you're still cloning. Don't do it. Be original. You would not remake ctf_2fort.


While all the above points about why using Valve's content is bad still apply, all restrictions in this plugin have been removed due to certain people selling a version that has no restrictions.

Valve are aware of this, and will probably enact tighter control over attachments soon.


Usage:

In MM:S:

Code:

#define ATTACHABLE_INTERFACE "ATTACHABLE_INTERFACE_002"
 
class IAttachable
{
public:
    virtual bool HookEntity( CBaseEntity *pEntity ) = 0; //need to call this RIGHT after CEBN.
    virtual void UnhookEntity ( CBaseEntity *pEntity ) = 0; //special cases, you should never have to do this.
    virtual bool IsHooked ( CBaseEntity *pEntity ) = 0;    //is it special? :)
};
 
IAttachable *g_pAttachable = (IAttachable *)g_SMAPI->MetaFactory(ATTACHABLE_INTERFACE, NULL, NULL);

SM:

Code:

new iEntityOtherPlayersGetToOodleAt = Attachable_CreateAttachable(iClient, false);
SetEntityModel(iEntityOtherPlayersGetToOodleAt, "path/to/model/and/do/not/use/valve/models/mmk");

CreateAttachable creates an entity (a prop_physics to be exact), applies the patch, and then parents it to the player. The entity that it creates is not sent to the parent. Why? The nature of the patch has an issue where the player cannot see his wearable about 60-70% of the time, so I went ahead and ensured it's not sent 100% of the time. This means if you want them to be able to see their attachment, you will have to make another tf_wearable_item which as it is now, only they see that entity. So every hat becomes two entities if you need the parent player to see it.

You should only do these things to the resulting entity:
  1. Change its model. (Do not change it to a valve model! DO NOT TAUNT HAPPY FUN BALL)
  2. Change effects / such as removing BONEMERGE if required for your attachments.
  3. Delete it.

Do not call DispatchSpawn, the entity will be deleted if this happens on it.

In order to test it locally you will need to assign the attachment to a bot or another player.

Due to the nature of this plug-in, the SourceMod extension is open source, but the business end of it, which is in a Metamod plug-in, will remain closed source.

My whole experience with valve after the petition is extremely friendly (and yes they saw my petition), they are not out to hurt mods or ban custom content to have a monopoly on attachments, they just want their content to be special and if it's instantly available to every player on every server the whole item drop system becomes kind of pointless, this is mainly about wearables and promo content, and I have no objection to this policy, they just want to protect the value of their items.

Arg! 05-11-2010 02:00

Re: Patch for player attachments (MM:S and SM)
 
once again, voogru saves the day. Fantastic work.

Is there a way in Sourcemod to detect the extension and use it only if its available? This would be good so i can keep compatibility with other games for one of my plugins.

Also to install this do we need to install the sourcemod extension AND the metamod plugin?

voogru 05-11-2010 02:06

Re: Patch for player attachments (MM:S and SM)
 
Quote:

Originally Posted by Arg! (Post 1177047)
once again, voogru saves the day. Fantastic work.

Is there a way in Sourcemod to detect the extension and use it only if its available? This would be good so i can keep compatibility with other games for one of my plugins.

Also to install this do we need to install the sourcemod extension AND the metamod plugin?

You need both, yes. As far as detecting whether or not the extension is loaded I'm not sure because I'm not familiar enough with SourceMod (really, I had someone cook up the extension for me)

Arg! 05-11-2010 02:10

Re: Patch for player attachments (MM:S and SM)
 
I just found this

http://docs.sourcemod.net/api/index....d=show&id=611&

Which would suggest yes, it is possible.

Code:

if ( GetExtensionFileStatus( "attachables.ext.2.ep2v" ) == 1 )



according to that document, i believe that would apply if the extension is present and loaded correctly.

asherkin 05-11-2010 06:10

Re: Patch for player attachments (MM:S and SM)
 
Just use
Code:

LibraryExists("Attachables");
I had planned for that case and had it register a lib name.

Afronanny 05-11-2010 06:23

Re: Patch for player attachments (MM:S and SM)
 
Quote:

Originally Posted by Arg! (Post 1177050)
I just found this

http://docs.sourcemod.net/api/index....d=show&id=611&

Which would suggest yes, it is possible.

Code:

if ( GetExtensionFileStatus( "attachables.ext.2.ep2v" ) == 1 )



according to that document, i believe that would apply if the extension is present and loaded correctly.

None of this is coded in SourcePawn, silly. It's all C++

asherkin 05-11-2010 06:42

Re: Patch for player attachments (MM:S and SM)
 
Quote:

Originally Posted by Afronanny (Post 1177119)
None of this is coded in SourcePawn, silly. It's all C++

It can be used from an SM plugin though, which is what he was talking about.

scopesp 05-11-2010 08:27

Re: Patch for player attachments (MM:S and SM)
 
hiii,,

stay all invisible for me :( i use equipment manager plugin

psychonic 05-11-2010 08:30

Re: Patch for player attachments (MM:S and SM)
 
Quote:

Originally Posted by scopesp (Post 1177206)
hiii,,

stay all invisible for me :( i use equipment manager plugin

All plugins with attachments on TF2 will need to be adapted to use this plugin/extension combo. You cannot just drop it in and it automatically fix all plugins.

scopesp 05-11-2010 08:34

Re: Patch for player attachments (MM:S and SM)
 
ah thx for info :) thats mean need wait for someone who update equipment manager ?


All times are GMT -4. The time now is 01:23.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.