Raised This Month: $52 Target: $400
 13% 

[TF2] Custom Weapons 3 (Beta 2)


Post New Thread Reply   
 
Thread Tools Display Modes
enderandrew
Senior Member
Join Date: Jun 2020
Old 06-29-2020 , 21:05   Re: [TF2] Custom Weapons 3 (Beta 2)
Reply With Quote #241

Quote:
Originally Posted by Old Bill View Post
i suggest getting the pre-compiled version just in case you are doing something wrong
https://github.com/nosoop/SM-TFOnTak.../tag/1.1.2-pre
Yeah, I grabbed a pre-compiled one for testing as well. I think it may have been a conflict with another plugin potentially even though SM said it was Blaming OnTakeDamage.

In the end I got OnTakeDamage working and I'm able to run the basic CW3 with the small sample Custom Weapons pack, but I still can't run NoSoop's Custom Attribute pack. There are two attribute plugins that don't load on Windows (which is a known issue) but even with some basic brief testing with bots, four other attribute plugins were constantly throwing errors in the SM error logs so I removed them for now.
enderandrew is offline
ScrapEngineer
Member
Join Date: Oct 2016
Location: The fourth worst country
Old 07-01-2020 , 08:12   Re: [TF2] Custom Weapons 3 (Beta 2)
Reply With Quote #242

Quote:
Originally Posted by nosoop View Post
I think server operators use a plugin-based implementation. No code is publicly available that uses the game's own attribute for that.

The main reason, besides TF2Attributes not having code to support it, is that string attributes don't support being assigned at runtime / being networked; setting them on the server only isn't well-tested.
Yeah, most servers use a plugin-based implementation, as most projectile entities have the m_nModelIndexOverrides property, it's fairly simple to have a plugin check for a custom CW3 attribute and apply it to the projectile that the weapon the attribute is attached to, I'd probably share my own solution but it's mixed in with a bunch of other stuff in a plugin, I'd have to create a new plugin for it, plus then the world could see my (probably) horrendously flawed coding and I don't think I want to let people judge it.
__________________
Amateur coder and sentient lemon.
ScrapEngineer is offline
Old Bill
Junior Member
Join Date: Jun 2020
Old 07-05-2020 , 16:04   Re: [TF2] Custom Weapons 3 (Beta 2)
Reply With Quote #243

would anyone happen to know why you get stripped of your cosmetics every time you select a custom weapon?
Old Bill is online now
enderandrew
Senior Member
Join Date: Jun 2020
Old 07-05-2020 , 19:44   Re: [TF2] Custom Weapons 3 (Beta 2)
Reply With Quote #244

I decided to try this out again, but I'm getting several errors at start-up about dhook with detours.

I've got this installed. Do I need to be using a different version? Or does DHook with detours perhaps not work with SM 11 dev builds? I know there is an earlier version there and the SM 10 version. I'm running that.

Code:
L 07/05/2020 - 14:47:51: [SM] Blaming: custom-attr-starter-pack\attr_group_overheal_uber.smx
L 07/05/2020 - 14:47:51: [SM] Call stack trace:
L 07/05/2020 - 14:47:51: [SM]   [0] DHookEnableDetour
L 07/05/2020 - 14:47:51: [SM]   [1] Line 70, attr_group_overheal_uber.sp::OnPluginStart
L 07/05/2020 - 14:47:51: [SM] Unable to load plugin "custom-attr-starter-pack\attr_group_overheal_uber.smx": Error detected in plugin startup (see error logs)
L 07/05/2020 - 14:48:07: [SM] Exception reported: Invalid Handle 0
L 07/05/2020 - 14:48:07: [SM] Blaming: custom-attr-starter-pack\joke_medigun_mod_drain_health.smx
L 07/05/2020 - 14:48:07: [SM] Call stack trace:
L 07/05/2020 - 14:48:07: [SM]   [0] DHookEnableDetour
L 07/05/2020 - 14:48:07: [SM]   [1] Line 67, joke_medigun_mod_drain_health.sp::OnPluginStart
L 07/05/2020 - 14:48:07: [SM] Unable to load plugin "custom-attr-starter-pack\joke_medigun_mod_drain_health.smx": Error detected in plugin startup (see error logs)
L 07/05/2020 - 14:48:08: [SM] Exception reported: Invalid Handle 0
L 07/05/2020 - 14:48:08: [SM] Blaming: custom-attr-starter-pack\keep_disguise_on_attack.smx
L 07/05/2020 - 14:48:08: [SM] Call stack trace:
L 07/05/2020 - 14:48:08: [SM]   [0] DHookEnableDetour
L 07/05/2020 - 14:48:08: [SM]   [1] Line 19, keep_disguise_on_attack.sp::OnPluginStart
L 07/05/2020 - 14:48:08: [SM] Unable to load plugin "custom-attr-starter-pack\keep_disguise_on_attack.smx": Error detected in plugin startup (see error logs)
L 07/05/2020 - 14:48:11: [SM] Exception reported: Invalid Handle 0
L 07/05/2020 - 14:48:11: [SM] Blaming: custom-attr-starter-pack\lunchbox_override_pickup_type.smx
L 07/05/2020 - 14:48:11: [SM] Call stack trace:
L 07/05/2020 - 14:48:11: [SM]   [0] DHookEnableDetour
L 07/05/2020 - 14:48:11: [SM]   [1] Line 25, lunchbox_override_pickup_type.sp::OnPluginStart
L 07/05/2020 - 14:48:11: [SM] Unable to load plugin "custom-attr-starter-pack\lunchbox_override_pickup_type.smx": Error detected in plugin startup (see error logs)
L 07/05/2020 - 14:48:22: [SM] Exception reported: Invalid Handle 0
L 07/05/2020 - 14:48:22: [SM] Blaming: custom-attr-starter-pack\spontaneous_explode.smx
L 07/05/2020 - 14:48:22: [SM] Call stack trace:
L 07/05/2020 - 14:48:22: [SM]   [0] DHookEnableDetour
L 07/05/2020 - 14:48:22: [SM]   [1] Line 64, spontaneous_explode.sp::OnPluginStart
L 07/05/2020 - 14:48:22: [SM] Unable to load plugin "custom-attr-starter-pack\spontaneous_explode.smx": Error detected in plugin startup (see error logs)
L 07/05/2020 - 15:25:50: [SM] Exception reported: Array index out-of-bounds (index -1, limit 2049)
enderandrew is offline
nosoop
Veteran Member
Join Date: Aug 2014
Old 07-05-2020 , 21:29   Re: [TF2] Custom Weapons 3 (Beta 2)
Reply With Quote #245

Quote:
Originally Posted by enderandrew View Post
I decided to try this out again, but I'm getting several errors at start-up about dhook with detours.

I've got this installed. Do I need to be using a different version? Or does DHook with detours perhaps not work with SM 11 dev builds? I know there is an earlier version there and the SM 10 version. I'm running that.

Code:
L 07/05/2020 - 14:47:51: [SM] Unable to load plugin "custom-attr-starter-pack\attr_group_overheal_uber.smx"
L 07/05/2020 - 14:48:07: [SM] Unable to load plugin "custom-attr-starter-pack\joke_medigun_mod_drain_health.smx"
L 07/05/2020 - 14:48:08: [SM] Unable to load plugin "custom-attr-starter-pack\keep_disguise_on_attack.smx"
L 07/05/2020 - 14:48:11: [SM] Unable to load plugin "custom-attr-starter-pack\lunchbox_override_pickup_type.smx"
L 07/05/2020 - 14:48:22: [SM] Unable to load plugin "custom-attr-starter-pack\spontaneous_explode.smx"
L 07/05/2020 - 15:25:50: [SM] Exception reported: Array index out-of-bounds (index -1, limit 2049)
In order:
  • Multiple detours.
  • #28
  • #21
  • #22
  • Related to #10
  • The error is below that phrase.

Also see Troubleshooting.

Make sure you've downloaded the latest gamedata, as game updates tend to break things. You may also want to consider building from source as there are a number of fixes since the last release.

I've gone ahead and generated a new release package as well.
__________________
I do TF2, TF2 servers, and TF2 plugins.
I don't do DMs over Discord -- PM me on the forums regarding inquiries.
AlliedModders Releases / Github / TF2 Server / Donate (BTC / BCH / coffee)

Last edited by nosoop; 07-06-2020 at 08:18.
nosoop is offline
SirBlockles
Junior Member
Join Date: Mar 2017
Location: /home/muddy
Old 07-07-2020 , 20:54   Re: [TF2] Custom Weapons 3 (Beta 2)
Reply With Quote #246

I wrote a custom wearable dispenser weapon with its own custom attribute, and it all works fine on that front, but... The default attributes refuse to work. It seems that making the weapon a wearable makes it not considered "worn." It has the attribs applied - the dispenser part still works just fine - yet none of the stock attributes work. If I change the weapon to any other class, like buff_item, the passive effects are fully functional. The problem is that I don't want the weapon selectable in any fashion, pressing the 2 slot should do nothing. Am I doing something wrong here?
Code:
"The Provisioner"
{
	"classes"
	{
		"engineer"		"1"
	}
	"baseclass"			"wearable"
	"baseindex"			"642" //cozy camper
	"nobots"			"0"
	"quality"			"6"
	"logname"			"dispenser_backpack"
	"description"		"<trimmed so my post isn't 50 feet wide>"
	"cw3_attributes"
	{
		"mod is worn dispenser"
		{
			"plugin"	"muddysattribs"
			"value"		"1"
		}
		"is_passive_weapon"
		{
			"plugin"	"tf2attributes"
			"value"		"1"
		}
		"engy dispenser radius increased"
		{
			"plugin"	"tf2attributes"
			"value"		"2.15"
		}
		"health from healers reduced"
		{
			"plugin"	"tf2attributes"
			"value"		"0.3"
		}
		"move speed penalty"
		{
			"plugin"	"tf2attributes"
			"value"		"0.90"
		}
	}
}
__________________
SirBlockles is offline
Send a message via Skype™ to SirBlockles
nosoop
Veteran Member
Join Date: Aug 2014
Old 07-08-2020 , 01:39   Re: [TF2] Custom Weapons 3 (Beta 2)
Reply With Quote #247

Quote:
Originally Posted by SirBlockles View Post
I wrote a custom wearable dispenser weapon with its own custom attribute, and it all works fine on that front, but... The default attributes refuse to work.
The CW3 plugin interface has issues applying attributes to non-weapon entities. Had to make a note of that for Custom Attributes myself.

Not sure since actually using CW3 is out of my expertise, but you may need to do one of the following:
  • Use the "attributes" section instead of "cw3_attributes". Internally CW3 determines the entity to apply the attribute to using GetPlayerWeaponSlot, which doesn't work on non-weapon entities (the Buff Banner counts as a weapon). CW2-style attributes operate on entities directly.
  • Use wearable_razorback for the item. I'm less certain about this one, but I'd reason it to be due to wearables normally occupying non-weapon slots.
__________________
I do TF2, TF2 servers, and TF2 plugins.
I don't do DMs over Discord -- PM me on the forums regarding inquiries.
AlliedModders Releases / Github / TF2 Server / Donate (BTC / BCH / coffee)
nosoop is offline
SirBlockles
Junior Member
Join Date: Mar 2017
Location: /home/muddy
Old 07-08-2020 , 15:33   Re: [TF2] Custom Weapons 3 (Beta 2)
Reply With Quote #248

Quote:
Originally Posted by nosoop View Post
The CW3 plugin interface has issues applying attributes to non-weapon entities. Had to make a note of that for Custom Attributes myself.

Not sure since actually using CW3 is out of my expertise, but you may need to do one of the following:
-snip-
I tried these out - using attributes over cw3_attributes didn't seem to help, and wearable_razorback is considered a null item.

HOWEVER, I did find a solution, at least in my specific use case (writing here in case anyone else wants a passive worn item):

Make the item a builder, and DO NOT include the weapon_is_passive attribute. If you keep the passive attribute, it switches the player from his primary to his melee constantly (since tf_weapon_builder is the weapon for the engy toolbox/spy sapper and proabably thinks you just built something), but this is not a problem if the weapon isn't passive.

As a result from using this, if the player tries using the weapon in this slot, the viewmodel will flash invisible for like a single game frame and his weapon won't change, and in third person their arms will twitch as they try to pull out a toolbox for a split second, but I've found that this effect is completely clientside and doesn't even show for anyone else. Also, when hauling an already-deployed building (but interestingly, not while placing one from scratch), the toolbox viewmodel is invisible, but not the building's blueprint.

The only downside aside from the minor visual bugs, is that a weapon equipped in this fashion eats mousewheel scrolls to switch weapon, meaning you have to scroll hard enough to "push past it." But, for people who use the keyboard to swap weapons, this shouldn't be a huge issue.

This method works for all classes except the Spy, who believes the weapon to be a Sapper.
__________________

Last edited by SirBlockles; 07-08-2020 at 15:33.
SirBlockles is offline
Send a message via Skype™ to SirBlockles
nosoop
Veteran Member
Join Date: Aug 2014
Old 07-09-2020 , 07:35   Re: [TF2] Custom Weapons 3 (Beta 2)
Reply With Quote #249

Quote:
Originally Posted by SirBlockles View Post
I tried these out - using attributes over cw3_attributes didn't seem to help, and wearable_razorback is considered a null item.
On further inspection it doesn't look like CW3 handles wearable_razorback correctly (it only has specific cases for wearable and wearable_demoshield). That would explain the null item issue; CW3 is rather dated.

Using the attributes section name with the wearable baseclass works for me on CW3, though, or at least I'm seeing the move speed penalty and no secondary weapon is showing up in the weapon buckets. Here's the config for reference.
__________________
I do TF2, TF2 servers, and TF2 plugins.
I don't do DMs over Discord -- PM me on the forums regarding inquiries.
AlliedModders Releases / Github / TF2 Server / Donate (BTC / BCH / coffee)
nosoop is offline
Old Bill
Junior Member
Join Date: Jun 2020
Old 07-16-2020 , 08:08   Re: [TF2] Custom Weapons 3 (Beta 2)
Reply With Quote #250

is there a way to use a game existing model but override its textures for a custom weapon? like make an Australium weapon instead of making the client redownload the model again just override the textures with the custom ones instead.
Old Bill is online now
Reply


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 20:49.


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