Raised This Month: $12 Target: $400
 3% 

TF2Items - Items with custom attributes.


Post New Thread Closed Thread   
 
Thread Tools Display Modes
Snaggle
AlliedModders Donor
Join Date: Jul 2010
Location: England
Old 07-24-2011 , 22:44   Re: TF2Items - Items with custom attributes.
#1001

Sure, here is a snippet.
Code:
[tf2items_manager.smx]   Entry
[tf2items_manager.smx]   {
[tf2items_manager.smx]     Used by:
[tf2items_manager.smx]     "STEAM_0:0:326XXXXX"
[tf2items_manager.smx] 
[tf2items_manager.smx]     Item: 65535
[tf2items_manager.smx]     {
[tf2items_manager.smx]       Preserve Attributes: true
[tf2items_manager.smx]       Attribute[0] : 134 / 2.000000
[tf2items_manager.smx]       Attribute[1] : 6 / 0.500000
[tf2items_manager.smx]       Flags: 110000
[tf2items_manager.smx]       Admin: (none)
[tf2items_manager.smx]     }
[tf2items_manager.smx]   }
[tf2items_manager.smx]   Entry
[tf2items_manager.smx]   {
[tf2items_manager.smx]     Used by:
[tf2items_manager.smx]     "STEAM_0:1:309XXXXX"
[tf2items_manager.smx] 
[tf2items_manager.smx]     Item: 65535
[tf2items_manager.smx]     {
[tf2items_manager.smx]       Preserve Attributes: true
[tf2items_manager.smx]       Attribute[0] : 134 / 17.000000
[tf2items_manager.smx]       Attribute[1] : 6 / 0.500000
[tf2items_manager.smx]       Flags: 110000
[tf2items_manager.smx]       Admin: (none)
[tf2items_manager.smx]     }
[tf2items_manager.smx]   }
[tf2items_manager.smx] }
I also tried moving the wildcard to different places, but this is the config I was using that worked before the update.
Snaggle is offline
PAL-18
AlliedModders Donor
Join Date: Jul 2010
Old 07-25-2011 , 00:18   Re: TF2Items - Items with custom attributes.
#1002

Does this replace players items with the ones with custom attributes, or can players choose them?
PAL-18 is offline
FlaminSarge
Veteran Member
Join Date: Jul 2010
Old 07-25-2011 , 04:40   Re: TF2Items - Items with custom attributes.
#1003

This uses a cfg file to set certain people (or global) to have certain weapons modified. The cfg file is serverside.
__________________
Bread EOTL GunMettle Invasion Jungle Inferno will break everything. Don't even ask.

All plugins: Randomizer/GiveWeapon, ModelManager, etc.
Post in plugin threads with questions.
Steam is for playing games.
You will be fed to javalia otherwise.
Psyduck likes replays.
FlaminSarge is offline
Velture
Senior Member
Join Date: Jan 2011
Location: Poland, Warsaw
Old 07-25-2011 , 10:27   Re: TF2Items - Items with custom attributes.
#1004

Quote:
Originally Posted by PAL-18 View Post
Does this replace players items with the ones with custom attributes, or can players choose them?
Player can only enable/disable the special weapons with a console command.
__________________
Velture is offline
asherkin
SourceMod Developer
Join Date: Aug 2009
Location: OnGameFrame()
Old 07-25-2011 , 13:58   Re: TF2Items - Items with custom attributes.
#1005

Quote:
Originally Posted by Snaggle View Post
Sure, here is a snippet.

I also tried moving the wildcard to different places, but this is the config I was using that worked before the update.
Oh god this was an epic bug, silly code made assumptions about type sizes, don't even go there.

FlaminSarge has been bugging me about releasing this update for a while, so just rolled in the fix for wildcards and here you go.

Changes:
  • FORCE_GENERATION flag replaces the implicit force param, makes more weapons work, as long as you set it at the correct time.
  • Fixed bug with item wildcards.
  • Increased bounds on quality to include Strange.
  • Removed upper bound on level.
  • Removed localization debug spew.
__________________
asherkin is offline
Pawn 3-pg
Senior Member
Join Date: Jul 2009
Old 07-25-2011 , 14:27   Re: TF2Items - Items with custom attributes.
#1006

Quote:
Originally Posted by asherkin View Post
FORCE_GENERATION flag replaces the implicit force param, makes more weapons work, as long as you set it at the correct time.
How do we use FORCE_GENERATION? I see it defined in the .inc, but I don't see where I would use it. Am I correct to assume that this will allow us to replace a weapon at TF2Items_OnGiveNamedItem and have the player successfully spawn with it?

Quote:
Originally Posted by asherkin View Post
Increased bounds on quality to include Strange.
Will this fix the Strange weapons not tracking kills? Or does it just allow us to create Strange weapons?
Pawn 3-pg is offline
asherkin
SourceMod Developer
Join Date: Aug 2009
Location: OnGameFrame()
Old 07-25-2011 , 14:38   Re: TF2Items - Items with custom attributes.
#1007

Quote:
Originally Posted by Pawn 3-pg View Post
How do we use FORCE_GENERATION? I see it defined in the .inc, but I don't see where I would use it. Am I correct to assume that this will allow us to replace a weapon at TF2Items_OnGiveNamedItem and have the player successfully spawn with it?
You use it just like any of the other item flags.
Actually, the trick to getting replacing weapons in OnGiveNamedItem is to /not/ use it. Prior to 1.4.3 (when bug 18 was "fixed"), force was always set to false, after it, it was always set to true. Now, it's only set if the flag is.

Some examples:
Give a weapon with the classname "saxxy":
With force: game will try and create an item with the classname "saxxy" and fail.
Without force: game will lookup the correct classname per-class and use that, it'll work fine.
Give a bottle to a soldier:
With force: will work fine.
Without force: game will lookup correct classname, and give a shovel instead.

You'll just need to experiment to find out when it's needed. Generally, not using it is better.

Quote:
Originally Posted by Pawn 3-pg View Post
Will this fix the Strange weapons not tracking kills? Or does it just allow us to create Strange weapons?
What issues are there with Strange weapons tracking kills?
Yes, but created strange weapons will not level up. I really don't advise adding the kill count item attribute to created strange weapons, or the game will try and inform the backend whenever a kill is made, which could be disastrous since the weapon doesn't really exist.
__________________
asherkin is offline
FlaminSarge
Veteran Member
Join Date: Jul 2010
Old 07-25-2011 , 15:17   Re: TF2Items - Items with custom attributes.
#1008

You need to use force_generation for any weapon that is shared between classes, in order to either get it into the correct slot or get it to show up at all for classes that don't use that item. It's bug 18.
__________________
Bread EOTL GunMettle Invasion Jungle Inferno will break everything. Don't even ask.

All plugins: Randomizer/GiveWeapon, ModelManager, etc.
Post in plugin threads with questions.
Steam is for playing games.
You will be fed to javalia otherwise.
Psyduck likes replays.
FlaminSarge is offline
napalm00
Veteran Member
Join Date: Jun 2011
Location: Italy, sadly
Old 07-25-2011 , 16:09   Re: TF2Items - Items with custom attributes.
#1009

1.4.7 YES! YES!
many thanks
__________________
napalm00 is offline
Pawn 3-pg
Senior Member
Join Date: Jul 2009
Old 07-25-2011 , 16:17   Re: TF2Items - Items with custom attributes.
#1010

Quote:
Originally Posted by asherkin View Post
What issues are there with Strange weapons tracking kills?
Yes, but created strange weapons will not level up. I really don't advise adding the kill count item attribute to created strange weapons, or the game will try and inform the backend whenever a kill is made, which could be disastrous since the weapon doesn't really exist.
I am not attempting to create my own Strange weapons.

If a player is using the Strange version of a weapon that is defined in tf2items.weapons.txt, the weapon will stop tracking kills (because the kill count attribute is removed). I was hoping that your newest update would help this situation.

Is there a way to tell what the weapon quality is before replacing it? That way I can add the kill count attribute when it is needed and leave it off when it isn't.
Pawn 3-pg is offline
Closed Thread


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


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


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