AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   TF2Items (https://forums.alliedmods.net/forumdisplay.php?f=146)
-   -   TF2Items - Items with custom attributes. (https://forums.alliedmods.net/showthread.php?t=115100)

asherkin 01-10-2010 06:15

TF2Items - Items with custom attributes.
 
This extension allows the attributes, level and quality of items to be modified per player as they are given by the server.

You can join #tf2items @ irc.gamesurge.net if you need help with the extension.

Download & Source:

Download Builds
The tf2items_manager plugin does not come compiled in these builds, you will need to compile it yourself if you want to use it.

Source Code

Instructions:
  1. Copy all files in the release package to your server maintaining the directory structure
  2. Edit tf2items.weapons.txt (In "addons/sourcemod/configs/") according to who you want to get weapons
  3. Type 'sm exts load tf2items'
  4. Join the server
  5. ???
  6. Profit

Notes:
  • The attributes available for tf2items.weapons.txt are here (ignore min/max values).
  • The first key is the number above the attribute you want, and the second is the value.
  • If you load the extension while on the server, it will attempt to hook using a player in the server, otherwise it will only take effect after the next player joins.
  • To reload the tf2items.weapons.txt file you can use 'tf2items_manager_reload'.
  • The included tf2items.weapons.txt file is an example and was made very randomly.

Quality Colours:


Atributions & Thanks:
  • AzuiSleet - Reversed CScriptCreatedItem and released it publicly, along with writing most of the item editing code below.
  • Damizean - Fixed padding for CScriptCreatedItem in Linux. Wrote the SourcePawn Interface and the SourceMod item manager.
  • Voogru - Inspiring the creation of this. Helped with fixing and improving the CScriptCreatedItem class used after the 119 update.
  • Wazz - Wrote "Shit not be void" in #sourcemod and revealed that GiveNamedItem returned CBaseEntity *. Helped with improving the CScriptCreatedItem class.
  • Psychonic - "How did you write the wearable natives asherkin?" "I got all the code from psychonic, then disregarded it and wrote it from scratch."
  • MatthiasVance - Reminded me to comment out '#define INFINITE_PROBLEMS 1'.
  • Drunken_F00l - Inspiring the creation of this.

:3

CrimsonGT 01-10-2010 06:34

Re: [EXTENSION] TF2Items
 
Nice job, looks well written as well.

Thrawn2 01-10-2010 06:57

Re: [EXTENSION] TF2Items
 
holy cow

cybersquare420 01-10-2010 08:11

Re: [EXTENSION] TF2Items
 
link in first line of notes is broken

TheSpyHunter 01-10-2010 08:23

Re: [EXTENSION] TF2Items
 
Great work,
Few questions though.

What do these relate to?

PHP Code:

            "count"        "5"
            "attributes"
            
{
                
"132"    "0"
                "134"    "4"
                "3"        "0.17"
                "97"    "0.6"
                "106"    "0.5"
            
}
        } 

and how do we know what o change them to?

asherkin 01-10-2010 08:28

Re: [EXTENSION] TF2Items
 
Quote:

Originally Posted by TheSpyHunter (Post 1050259)
Great work,
Few questions though.

What do these relate to?
and how do we know what o change them to?

Quote:

The attributes available for customweps.txt are Here (at the bottom, ignore min/max values).
The first key is the number above the attribute you want, and the second is the value.
Make sure the attribute count is correct, otherwise the server will most likely crash, I do not advise going over 7-11, YMMV.
Quote:

Originally Posted by cybersquare420 (Post 1050254)
link in first line of notes is broken

It's a self-signed SSL cert, I've swapped all links for unsecured ones.

Also, a SourcePawn interface is also being worked on, thanks Damizean :)

Cerise 01-10-2010 09:30

Re: [EXTENSION] TF2Items
 
Nice work mate !

Just a question : If you want to custom ALL weapons for a client, do you need to put a block for every weapons one by one ?

asherkin 01-10-2010 09:33

Re: [EXTENSION] TF2Items
 
At the moment, yes. In the next version I plan to add wildcarding and admin flag checks, bear in mind though that you can only currently edit the attributes of the base weapons, not the unlockables. The quality and level are fine however.
Edit: Turns out you can edit the unlockable's attributes, bear in mind that it completely overwrites existing ones though.

Cerise 01-10-2010 10:11

Re: [EXTENSION] TF2Items
 
Concerning the attribute "134" ( Attach Particle effect ),
where should i find which number corresponds to which effect ?

TheSpyHunter 01-10-2010 10:14

Re: [EXTENSION] TF2Items
 
I copied everything to my server, changed the default id to mine and added another admin (lets call him admin(2)), leaving everything else as default.

I rebooted the server then ran the command, waited for admin(2) to join.

I killed them and no weapon showed, they killed me and no weapon showed.

Running mm1.8 sm 1.3, windows.

Jindo 01-10-2010 10:14

Re: [EXTENSION] TF2Items
 
Quote:

Originally Posted by Cerise (Post 1050329)
Concerning the attribute "134" ( Attach Particle effect ),
where should i find which number corresponds to which effect ?

So far, I think there are only 2:

4.0: Community Sparkle Effect
2.0: Valve Flame Effect

There may be more, but those are the ones I've found.

asherkin 01-10-2010 10:23

Re: [EXTENSION] TF2Items
 
Quote:

Originally Posted by Cerise (Post 1050329)
where should i find which number corresponds to which effect ?

No one knows exactly,
Code:

5 = Halo Glow
4 = Community Sparkles
2 = Valve Fire

1 or 3, cant remember, is a much larger fire. Those are the only known ones atm.

Quote:

Originally Posted by TheSpyHunter (Post 1050333)
I copied everything to my server, changed the default id to mine and added another admin (lets call him admin(2)), leaving everything else as default.

I rebooted the server then ran the command, waited for admin(2) to join.

I killed them and no weapon showed, they killed me and no weapon showed.

Running mm1.8 sm 1.3, windows.

Did you actually have the weapons out though, the example is a Community Pyro Shotgun with added atributes, VALVe Rocket Launcher with the old overpowered attributes and a Community Knife with only level and quality edited. You can disable weapon quick switch to see the names in the list, but the particles on the shotgun and rocket launcher are pretty noticeable.

cybersquare420 01-10-2010 10:31

Re: [EXTENSION] TF2Items
 
a tar ball?... hmmm... so i suppose this isnt ready for a windows host yet?...
too bad if not, i was all ready to deploy this to all five tf2 servers im currently running... if it isnt, do you plan on making it for windows?... please?... lol

i hope so, but if not ill live... maybe it will be the straw that breaks the camels back on my OS choice... Its getting near time to rebuild my host from the ground up[, and i have been considering linux... just to stay sharp with both... :)

TheSpyHunter 01-10-2010 10:32

Re: [EXTENSION] TF2Items
 
Yes I had the weapons out, I killed my foe with them!

asherkin 01-10-2010 10:36

Re: [EXTENSION] TF2Items
 
Quote:

Originally Posted by cybersquare420 (Post 1050354)
a tar ball?... hmmm... so i suppose this isnt ready for a windows host yet?...

It contains both the Linux and Windows versions.

Quote:

Originally Posted by TheSpyHunter (Post 1050356)
Yes I had the weapons out, I killed my foe with them!

This is an intermittent glitch, I have had it happen while testing, it's cause is unknown and may be unrelated to the extension.

TheSpyHunter 01-10-2010 10:43

Re: [EXTENSION] TF2Items
 
Do you have dukehacks installed and if so, what resupply sig do you have?

Could this glitch the weapon not appearing?

Matthias Vance 01-10-2010 10:48

Re: [EXTENSION] TF2Items
 
What makes you think that this extension has something to do with DukeHacks?

TheSpyHunter 01-10-2010 11:20

Re: [EXTENSION] TF2Items
 
I dunno, I'm making a wild guess to why the Weapon Killed by is not showing.

I know that the respply effects quite a few things and was not sure if this was one of those occasions.

So ROLF at me all you want.

asherkin 01-10-2010 11:33

Re: [EXTENSION] TF2Items
 
Quote:

Originally Posted by TheSpyHunter (Post 1050397)
I dunno, I'm making a wild guess to why the Weapon Killed by is not showing.

I know that the respply effects quite a few things and was not sure if this was one of those occasions.

So ROLF at me all you want.

This was developed on both a clean Windows server and with SDKHooks + Sockets + KAC, and then tested on my live Linux sever, with the same plugins/extensions. As I said, this happens intermittently, and I have seen it happen with the default unlockables without the extension, I believe this started when the option to disable the panel in spec was added.
Also, as you can see, my example picture was taken in spectator, since he had the same problem, whereas for the guy I was playing with a few minutes before, it worked fine.

Chris-_- 01-10-2010 12:31

Re: [EXTENSION] TF2Items
 
Quote:

Originally Posted by Matthias Vance (Post 1050370)
What makes you think that this extension has something to do with DukeHacks?

Smooooooth.

Kevin_b_er 01-10-2010 12:44

Re: [EXTENSION] TF2Items
 
This is quite impressive.

TheSpyHunter 01-10-2010 12:50

Re: [EXTENSION] TF2Items
 
Bum goats and die :(

I was trying to be helpful..I bow my head in shame!

asherkin 01-10-2010 12:59

Re: [EXTENSION] TF2Items
 
Quote:

Originally Posted by TheSpyHunter (Post 1050494)
I was trying to be helpful..I bow my head in shame!

As I explained, it's an unrelated issue, I am only trying to be helpful. It's not like it's even a problem, the extension works perfectly, it's VALVe's fault if they break the deathcam intermittently, you just haven't noticed it before because you weren't paying attention to it as much.
Edit: This thread = on topic now, mkay?

noodleboy347 01-10-2010 13:27

Re: [EXTENSION] TF2Items
 
OH MY GOD I LOVE YOU

Cerise 01-10-2010 13:48

Re: [EXTENSION] TF2Items
 
Count is the number of attributes you've set for your weapon(s).

f.e :

PHP Code:

"count" "3"
"attributes"
{
          
"1"     "2"
          "2"     "0.01"
          "3"     "2.0"


Be careful, if "count" doesn't match the number of the attributes you've set, it will crash ( i didn't really look how it was crashing it but i know it does. At least if count > attributes ( i think if count < attributes it wont change anything ).

asherkin 01-10-2010 13:55

Re: [EXTENSION] TF2Items
 
Count not equalling the number of attributes will always crash, I did note this in the Notes section of the first post. I have also changed it to attrib_count in the next version to clarify what it is.

Cerise 01-10-2010 14:02

Re: [EXTENSION] TF2Items
 
Asrkin, do you think it will be possible to do the same for Unique Weapons ?

I tried it ( knowing it wouldn't work ) and it actually changes Name and Level :)

asherkin 01-10-2010 14:06

Re: [EXTENSION] TF2Items
 
Quote:

Originally Posted by asherkin
Turns out you can edit the unlockable's attributes, bear in mind that it completely overwrites existing ones though.

You probably missed the edit I made :)

pheadxdll 01-10-2010 14:40

Re: [EXTENSION] TF2Items
 
Nice job! :up:

Cerise 01-10-2010 14:47

Re: [EXTENSION] TF2Items
 
By The way, what's the difference between rapidfire and slowfire ?

( Espacially for Regen On Hit ) :)

noodleboy347 01-10-2010 14:49

Re: [EXTENSION] TF2Items
 
Quote:

Originally Posted by Cerise (Post 1050649)
By The way, what's the difference between rapidfire and slowfire ?

( Espacially for Regen On Hit ) :)

I would think the difference between the SMG and Rocket Launcher.

Is it currently possible to change the weapon name? Or do we have to wait for the custom item name thing?

Cerise 01-10-2010 16:38

Re: [EXTENSION] TF2Items
 
Do you think it could be possible ( now or later ) to make something like Eyelander attributes ?

Like the more i frag people the more health i'll have ?

Damizean 01-10-2010 16:40

Re: [EXTENSION] TF2Items
 
Probably, all you need to do is to copy the eyelander attributes to the weapon you want.
Edit: The attribute seems to be this one
Code:

                "max health additive penalty"
                {
                    "attribute_class"    "add_maxhealth"
                    "value" "-25"
                }

Wich translated with the attributes table, it is:
Code:

"125"        "-25"

Cerise 01-10-2010 16:44

Re: [EXTENSION] TF2Items
 
Yeah thought about that but that fact is the attributes for tf_weapon_sword are :

PHP Code:

"attributes"
{
"crit mod disabled"
{"attribute_class"    "mult_crit_chance"
"value"    "0"
}
"max health additive penalty"
{
"attribute_class"    "add_maxhealth"
"value" "-25"
}
 } 

And it's not sufficient to have the same effects.
I'm currently reading everything if the tf2 items help page but i can't find what would work to clone the effect :o

EDIT :

Have another 'problem' with my maths ( it begins to getting late ). Here's my prob :

Code lines :

PHP Code:

"73" 
 

 
"name" "weapon burn time increased"
 "attribute_class" "mult_wpn_burntime"
 "attribute_name" "Minor increase to burn time" 
 "min_value" "1.05" 
 "max_value" "1.15" 
 "description_string" 
#Attrib_WpnBurnTime_Increased" 
 
"description_format" "value_is_percentage" 
 "hidden" "0" 
 "effect_type" "positive" 
 


And

PHP Code:

"74" 
 

 
"name" "weapon burn time ireduced"
 "attribute_class" "mult_wpn_burntime"
 "attribute_name" "Minor reduction to burn time" 
 "min_value" "0.95" 
 "max_value" "0.7" 
 "description_string"
#Attrib_WpnBurnTime_Reduced" 
 
"description_format" "value_is_percentage" 
 "hidden" "0" 
 "effect_type" "negative" 
 


I want to put on my weapon an attribute that reduces burning duration by 20% on myself. But when i'm using the attribute 74, it appears like "20% burn duration" in red. ( cant get a -XX% with this one )
When using The attribute 73, it gaves me "+-20% burn duration" in blue. But it means that my target will burn longer if my weapon is a Flamethrower.

So which attribute will i have to use and which value to have on my weapon "-20% burn duration" ( When burning, i'll burn for 20% shorter time )

I perfectly know i would find the clue later after a good night but i have to finish this one tonight :)

Regis 01-10-2010 18:47

Re: [EXTENSION] TF2Items
 
This plugin makes me incredibly happy, ever since voogru and drunkenfool didn't want to release theirs I thought there was no hope.

Thank you for releasing your version. :D

asherkin 01-10-2010 19:45

Re: [EXTENSION] TF2Items
 
Quote:

Originally Posted by Cerise (Post 1050649)
By The way, what's the difference between rapidfire and slowfire ?

Not much except their names and proposed min/max values.
I believe it is left over from when drops were planned to have random attributes, there may be differences in the display on screen.

Quote:

Originally Posted by Cerise (Post 1050750)
Yeah thought about that but that fact is the attributes for tf_weapon_sword are :
And it's not sufficient to have the same effects.

It may be hard-coded into the weapon, a few are like this.

Quote:

Originally Posted by Cerise (Post 1050750)
I want to put on my weapon an attribute that reduces burning duration by 20% on myself.

There is one that makes you immune to receive afterburn, like the pyro, I however know of no VALVe weapon that does what you are after, the attribute may not exist yet, search carefully :).

Quote:

Originally Posted by Regis (Post 1050872)
since voogru and drunkenfool didn't want to release theirs I thought there was no hope.

hehe, The whole reason this was started :D.

voogru 01-10-2010 21:00

Re: [EXTENSION] TF2Items
 
Quote:

Originally Posted by asherkin (Post 1050935)
hehe, The whole reason this was started :D.

And I don't get any credit?

No fair.

I just hope the pay-to-cheat server operators don't abuse this stuff, that was one of the primary reasons why I refused to release mine.

asherkin 01-10-2010 21:09

Re: [EXTENSION] TF2Items
 
Quote:

Originally Posted by voogru (Post 1051015)
And I don't get any credit?

There you go :P.

Quote:

Originally Posted by voogru (Post 1051015)
I just hope the pay-to-cheat server operators don't abuse this stuff, that was one of the primary reasons why I refused to release mine.

Same, stuff like this should be available to everyone though.

noodleboy347 01-10-2010 22:52

Re: [EXTENSION] TF2Items
 
Quote:

Originally Posted by voogru (Post 1051015)
And I don't get any credit?

No fair.

I just hope the pay-to-cheat server operators don't abuse this stuff, that was one of the primary reasons why I refused to release mine.

If that starts happening I'll quit TF2. asherkin, could you put a notice or something in the original post warning against that?

CrimsonGT 01-10-2010 23:32

Re: [EXTENSION] TF2Items
 
Give it a month and every server with be messing with items. Goodluck playing on a server when all the admins, donators, clan members, etc have weapons packed with attributes. Glad I just idle TF2 now, this is basically fakeclients v2 lol.


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

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