Raised This Month: $ Target: $400
 0% 

[TF2] Custom Weapons 2 (Beta 2, Mar 12 2014)


Post New Thread Reply   
 
Thread Tools Display Modes
Dr. Jekyll
Member
Join Date: Sep 2015
Old 10-19-2015 , 02:42   Re: [TF2] Custom Weapons 2 (Beta 2, Mar 12 2014)
Reply With Quote #691

Question about keeping track of attributes:

I'm making an attribute to limit the level that an engineer can upgrade their buildings to. Can I just use the player index instead of the weapon's entity index to index the array? Will Custom Weapons still remove the attribute if the player switches weapons?
Dr. Jekyll is offline
Chdata
Veteran Member
Join Date: Aug 2012
Location: Computer Chair, Illinois
Old 10-19-2015 , 08:49   Re: [TF2] Custom Weapons 2 (Beta 2, Mar 12 2014)
Reply With Quote #692

Or you guys can realize that I'm going to be pushing what I did here eventually.

https://www.youtube.com/watch?v=_URFAYgA4dY

Code:
	"sound"
	{
		"player"
		{
			"onspinup"		"vehicles/v8/v8_firstgear_rev_loop1.wav"
			"onspindown"	"vehicles/v8/v8_stop1.wav"
		}
	}


enum
{
    SFXMethod_Ignore = 0,   // "ignore"             Don't actually use this sound, it's in the config for no damn reason
    SFXMethod_Replace,      // "find" "replace"     Overwrite the sound, if possible. Generally this might entail simply playing the sound on the same channel which gets rid of the old sound
    SFXMethod_PlayOver,     // "find" "playover"    Plays during emitsound, on top of that sound
    SFXMethod_Indexer,

    SFXMethod_OnFire,       // "onfire"             Play the sound at the time of TF2_CalcIsAttackCrit
    SFXMethod_OnSpinUp,     // "onspinup"           These 4 related to Heavy's minigun. Since only one sound can play per each of these, these are actually unused in the enum
    SFXMethod_OnSpinDown,   // "onspindown"
    SFXMethod_OnHeavyFire,  // "onheavyfire"
    SFXMethod_OnRev         // "onrev"
    
}
__________________

Last edited by Chdata; 10-19-2015 at 08:50.
Chdata is offline
Chdata
Veteran Member
Join Date: Aug 2012
Location: Computer Chair, Illinois
Old 10-19-2015 , 08:51   Re: [TF2] Custom Weapons 2 (Beta 2, Mar 12 2014)
Reply With Quote #693

Quote:
Originally Posted by Dr. Jekyll View Post
Question about keeping track of attributes:

I'm making an attribute to limit the level that an engineer can upgrade their buildings to. Can I just use the player index instead of the weapon's entity index to index the array? Will Custom Weapons still remove the attribute if the player switches weapons?
Make your plugin remove the attribute. customweaponstf doesn't do it for you at all. You can manage it however you want. I always do it by client and weaponslot (34 * 3 = 102), rather than by 2049 entities.

However I still have to push a forward that is called before attributes are added to a weapon, custom or not, to properly allow you to initialize the weapon's variables if you index by weapon slots. So far it's working perfectly but I'm seeing bizarre glitches from time to time.

You could even use an adt_array to allow using the same attribute 5 times on the same weapon to add 5 different TFConds on kill with a weapon, or something.
__________________

Last edited by Chdata; 10-19-2015 at 10:03.
Chdata is offline
Dr. Jekyll
Member
Join Date: Sep 2015
Old 10-19-2015 , 14:44   Re: [TF2] Custom Weapons 2 (Beta 2, Mar 12 2014)
Reply With Quote #694

Quote:
Originally Posted by Chdata View Post
Make your plugin remove the attribute. customweaponstf doesn't do it for you at all. You can manage it however you want. I always do it by client and weaponslot (34 * 3 = 102), rather than by 2049 entities.

However I still have to push a forward that is called before attributes are added to a weapon, custom or not, to properly allow you to initialize the weapon's variables if you index by weapon slots. So far it's working perfectly but I'm seeing bizarre glitches from time to time.

You could even use an adt_array to allow using the same attribute 5 times on the same weapon to add 5 different TFConds on kill with a weapon, or something.
Aren't there a total of 7 weapon slots though? Shouldn't it be 7 * 34?

And how do you deal with players leaving the server and other ones joining?

Last edited by Dr. Jekyll; 10-19-2015 at 14:45.
Dr. Jekyll is offline
xXDeathreusXx
Veteran Member
Join Date: Mar 2013
Location: pPlayer->GetOrigin();
Old 10-19-2015 , 15:14   Re: [TF2] Custom Weapons 2 (Beta 2, Mar 12 2014)
Reply With Quote #695

Quote:
Originally Posted by Dr. Jekyll View Post
Aren't there a total of 7 weapon slots though? Shouldn't it be 7 * 34?

And how do you deal with players leaving the server and other ones joining?
OnClientPutInServer(iClient), OnClientConnect(iClient), OnClientDisconnect(iClient),

There's a Post version of Disconnect, PutInServer is called when the client is actually in the "active" state, which is to say he can see the game world and the players, Connect is called on the immediate connect when the console says "So-so connected"

I might have PutInServer and Connect backwards, but that's how it goes either way

As for weapon slots, slot 4 and slot 5 are for engies pda and destroy tool, and those can't be modified last I recall, at least not without alot of hassle, and slot 4 is spies disguise kit, slot 6 isn't technically a slot, but it's used to select the grappling hook while the hook is an action item, where the hell did you get 7?

I believe Chdata is going with the general assumption you will never make weapons for those, or the attributes he made cannot be put on them
__________________
Plugins|Profile
Requests closed

I'm a smartass by nature, get used to it

Last edited by xXDeathreusXx; 10-19-2015 at 15:20.
xXDeathreusXx is offline
alexde5
Junior Member
Join Date: Nov 2014
Location: Florida
Old 10-19-2015 , 18:15   Re: [TF2] Custom Weapons 2 (Beta 2, Mar 12 2014)
Reply With Quote #696

I was testing custom weapons with TF2items, and my friends and I found something.

If you die and pick up the weapon as that class, other people can see it!

and the best part of it, the attributes still remain! just excellent!... I guess.
alexde5 is offline
Theray070696
Senior Member
Join Date: Sep 2014
Old 10-19-2015 , 19:00   Re: [TF2] Custom Weapons 2 (Beta 2, Mar 12 2014)
Reply With Quote #697

Quote:
Originally Posted by alexde5 View Post
I was testing custom weapons with TF2items, and my friends and I found something.

If you die and pick up the weapon as that class, other people can see it!

and the best part of it, the attributes still remain! just excellent!... I guess.
Has been known since gun mettle. Custom models won't work though and last I checked, custom attributes are lost on pickup.
__________________
Theray070696 is offline
404UserNotFound
BANNED
Join Date: Dec 2011
Old 10-19-2015 , 19:39   Re: [TF2] Custom Weapons 2 (Beta 2, Mar 12 2014)
Reply With Quote #698

Quote:
Originally Posted by Theray070696 View Post
last I checked, custom attributes are lost on pickup.
Kind of. Particle effects still remain. I've dropped a custom Valve RL before and the particle effect persisted. I think the attributes also persisted after the drop as well though I may be mistaken.
404UserNotFound is offline
Mr.Orion
Senior Member
Join Date: Apr 2012
Location: In my microwave.
Old 10-19-2015 , 19:51   Re: [TF2] Custom Weapons 2 (Beta 2, Mar 12 2014)
Reply With Quote #699

Quote:
Originally Posted by abrandnewday View Post
Kind of. Particle effects still remain. I've dropped a custom Valve RL before and the particle effect persisted. I think the attributes also persisted after the drop as well though I may be mistaken.
From what I saw, Valve's attributes stay, but not custom ones.
__________________
Mr.Orion is offline
Theray070696
Senior Member
Join Date: Sep 2014
Old 10-19-2015 , 20:03   Re: [TF2] Custom Weapons 2 (Beta 2, Mar 12 2014)
Reply With Quote #700

Quote:
Originally Posted by Mr.Orion View Post
From what I saw, Valve's attributes stay, but not custom ones.
That's what I was saying
__________________
Theray070696 is offline
Reply



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 01:06.


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