Resource icon

[VScript] give_tf_weapon GTFW is now Retired

Yaki

aa
Sep 3, 2018
422
261
Yaki updated [VScript] give_tf_weapon with a new update entry:

3.2

  • Updates tables.nut
    • Removed all ID2's from every weapon entry that had null in them.
    • Made any unique stock weapon into it's own entry. Each stock weapon is another entry named "Unique <weapon>".
      • Some promos were also made into another entry (Vintage Lugermorph, Genuine Huo-Long Heater, etc)
    • Removed Festives class (removed bc it was a dupe)
      • Moved all entries into TF_WEAPONS class + TF_WEAPONS_ALL array
    • Fixed...

Read the rest of this update entry...
 

ImNotSimon

L1: Registered
Dec 2, 2022
6
2
i've been wondering, how do i use additive-value attributes? for example, this stat that's probably a MvM one: "attack projectiles"
 

Yaki

aa
Sep 3, 2018
422
261
i've been wondering, how do i use additive-value attributes? for example, this stat that's probably a MvM one: "attack projectiles"
Heya! Attributes like "attack projectiles" work additively, so that means it adds a number instead of multiplies it.
For reference, Leezo compiled a list of all the attributes that work in Hammer. Keep in mind this was before VScript, but it does still have relevant info for how attributes work here
 

GregoryTheGamer1112

L1: Registered
Mar 6, 2016
30
6
I'm not sure why but the Golden Frying Pan renders as the Regular Frying Pan when I give it to a player? Is there any way to fix this or am I missing something?
 

Yaki

aa
Sep 3, 2018
422
261
I'm not sure why but the Golden Frying Pan renders as the Regular Frying Pan when I give it to a player? Is there any way to fix this or am I missing something?
Yeah, I'm actually not really sure either. It has the correct index in the tables.nut.
I tried applying "item style override" but that didn't work either. :confused:

If I knew what attributes an actual Gold Frying Pan had, I could add it to the script.
 

GregoryTheGamer1112

L1: Registered
Mar 6, 2016
30
6
I probably missed something but can you use custom models for your weapons? (like the viewmodel uses that custom model and such, provided you have the necessary models in your files?) or are you only allowed to use the in-game weapons? I just wanna make sure that is something I could do? Also on a similar case could I make it so a weapon that uses projectiles uses a custom model for them? (I believe it could be done given the Air Strike exists but idk how that is handled exactly?)
 

Yaki

aa
Sep 3, 2018
422
261
I probably missed something but can you use custom models for your weapons? (like the viewmodel uses that custom model and such, provided you have the necessary models in your files?) or are you only allowed to use the in-game weapons? I just wanna make sure that is something I could do? Also on a similar case could I make it so a weapon that uses projectiles uses a custom model for them? (I believe it could be done given the Air Strike exists but idk how that is handled exactly?)
Yes, RegisterCustomWeaponEx() has a parameter for changing custom world models and custom view models.
And the projectile model could be changed with the attribute "custom projectile model". I'm saying could because we can't use strings in attribute using vscript yet.
 

GregoryTheGamer1112

L1: Registered
Mar 6, 2016
30
6
Yes, RegisterCustomWeaponEx() has a parameter for changing custom world models and custom view models.
And the projectile model could be changed with the attribute "custom projectile model". I'm saying could because we can't use strings in attribute using vscript yet.
Alright so uh for some reason the little view of your character in third person (that's near the health on the hud) doesn't seem to make use of the custom model, they just hold whatever the normal version of the weapon that is being used is (so for example if you use a Saxxy as the base, they just hold the Saxxy instead of the model you defined) idk if there's a way to fix this or its just a limitation of the script
Edit: Going into thirdperson shows both the custom weapon model, and the original model at the same time, that means both models are being rendered in third person for some reason, idk how to fix this?
 
Last edited:

SnickerPuffs

(*single chuckle*)
aa
Apr 10, 2014
1,325
1,866
Would it be possible to set up a consecutive shot bonus, like how the Gunslinger's three-hit-crit works?

I'm working with someone to design weapon concepts and test them out in-game using this VScript, and one of our ideas is a pistol that ignites victims after every 9th consecutive shot.
 

Yaki

aa
Sep 3, 2018
422
261
Yaki updated [VScript] give_tf_weapon with a new update entry:

3.2.4

  • Trying to get it compatible with MvM / upgrade stations.
    • Added variable CVAR_GTFW_OVERWRITE_WEAPONS under _master.nut
      • true by default
      • true = weapon in slot is deleted before making the new weapon (via GiveWeapon)
      • false = weapon in slot is not deleted. Instead, the item definition index is changed so the weapon can store upgrades from upgrade stations. It supports custom weapons, too!
        • (it's recommended to reset the stats by...

Read the rest of this update entry...
 

Yaki

aa
Sep 3, 2018
422
261
Yaki updated [VScript] give_tf_weapon with a new update entry:

3.3.0 MvM Compatibility Update

  • Updated "RegisterCustomWeapon".
    • Removed "RegisterCustomWeaponEx" code because it was redundant
      • It still works, however.
    • Fixed bug where registering through console threw an error
  • Updated "GiveWeapon".
    • Added extra switches and parameters for custom weapons.
    • GiveWeapon (weapon_name, bool force_overwrite, bool force_clear_stats, bool force_custom, function force_stats_function, string...

Read the rest of this update entry...
 

Yaki

aa
Sep 3, 2018
422
261
Yaki updated [VScript] give_tf_weapon with a new update entry:

3.3.2

  • (from 3.3.0) Fixed gunslinger being removed on GTFW_Cleanup()
  • (from 3.3.1) Fixed new forced_function overrides not working
  • Fixed custom weapons being visible during losing states (still probably visible during stuns, however)
  • Fixed bug in MvM/upgrade stations with custom weapons where buying a body upgrade buys several at no cost
  • To fix arrays/tables clearing after rebooting the script, added move_rope "magic rope" entity that auto-loads give_tf_weapon .nut files (which...

Read the rest of this update entry...
 

Yaki

aa
Sep 3, 2018
422
261
Yaki updated [VScript] give_tf_weapon with a new update entry:

4.0.0 "The Upgrade" Update

1681095799630.png


New functions
  • CTFPlayer.AnnounceWeapon( weapon , int quality , string/int prefix , string has_string)
    • Display in chat a weapon a player has found!
    • weapon can be a handle, item definition index, string name, slot number (in negative), or classname. Just as long as the weapon is registered and has a valid display name, it's good!
    • quality is from a pre-made list (documented in...

Read the rest of this update entry...
 
Last edited:

Yaki

aa
Sep 3, 2018
422
261
Yaki updated [VScript] give_tf_weapon with a new update entry:

4.0.1

  • Removed ClearEventCallbacks() from _master.nut
  • Fixed weapons reappearing when switching to other weapons
  • Removed "GTFW_" prefix for functions GTFW_LoadLoadout, GTFW_SaveLoadout, GTFW_DeleteLoadout.
    • Named LoadLoadout(), SaveLoadout(), DeleteLoadout(), respectively
    • (GTFW_LoadLoadout, GTFW_SaveLoadout, GTFW_DeleteLoadout still work though)
  • Added "ReturnWeaponTable()" (works like CTFPlayer.ReturnWeaponTable() but without player handle)...

Read the rest of this update entry...
 

Yaki

aa
Sep 3, 2018
422
261
Yaki updated [VScript] give_tf_weapon with a new update entry:

v5.0.0

NOTE BEFORE UPDATING:
  • Both RegisterCustomWeapon() and GiveWeapon() have different parameters, and are incompatible with previous versions. Please update your code so it works with this update!
  • A lot of other functions (like ReturnWeaponTable()) have had their name changed. In this case, ReturnWeaponTable() is now GetWeaponTable().

I'll try my best to not have y'all revise your own scripts constantly...

Read the rest of this update entry...
 
Last edited:

Yaki

aa
Sep 3, 2018
422
261
Yaki updated [VScript] give_tf_weapon with a new update entry:

5.1.0

Special thanks @Unicake and @SpookyToad for bug reports.

Changelog
  • Fixed not being able to hit Engineer buildings if you give "Engy Toolbox" and have a wrench
  • Fixed Demo shields deleting themselves on respawn
  • Updated "Example Half-Life Shotgun.nut"
    • Fixed alt-fire animations not matching class
    • Fixed throw error
  • Updated "Example Horsemann's Hex.nut"
    • Fixed using an undefined variable
    ...

Read the rest of this update entry...