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

[TF2] Custom Weapons 3 (Beta 2)


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

how do custom projectiles work?

HTML Code:
custom projectile model
attribute does nothing but crash the server if you insert a model path in the value
Old Bill is offline
Old Bill
Junior Member
Join Date: Jun 2020
Old 06-29-2020 , 08:42   Re: [TF2] Custom Weapons 3 (Beta 2)
Reply With Quote #242

Quote:
Originally Posted by enderandrew View Post
My server crashes the first time someone takes damage if I have tf_ontakedamage loaded.

I downloaded the source for that here:

https://github.com/nosoop/SM-TFOnTakeDamage

And then compiled with SM 1.10.
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
Old Bill is offline
nosoop
Veteran Member
Join Date: Aug 2014
Old 06-29-2020 , 09:26   Re: [TF2] Custom Weapons 3 (Beta 2)
Reply With Quote #243

Quote:
Originally Posted by Old Bill View Post
how do custom projectiles work?

custom projectile model attribute does nothing but crash the server if you insert a model path in the value
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.
__________________
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
enderandrew
Senior Member
Join Date: Jun 2020
Old 06-29-2020 , 21:05   Re: [TF2] Custom Weapons 3 (Beta 2)
Reply With Quote #244

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 #245

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 #246

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

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 #248

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 #249

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 #250

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
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 11:30.


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