Resource icon

[VScript] give_tf_weapon GTFW is now Retired

Yaki

aa
Sep 3, 2018
422
261

Yaki

aa
Sep 3, 2018
422
261
Last edited:

ImNotSimon

L1: Registered
Dec 2, 2022
6
2
is it possible to use v_models? since i've seen that being done with vscript-made custom weapons.
 

Yaki

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

2.2 Readability Update

  • give_tf_weapon.nut: Added more documentation, reorganized the function order and improved readability across the entire document.
  • Added more error messages and cancellations of functions if an error occurred.
  • Fixed bug where weapon wouldn't actually update the draw sequence nor arms correctly
  • Fixed bug with giving a weapon to a class with a weapon that was in a slot that didn't already have a weapon
  • Added new CVAR to enable global debug messages
    • ...

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:

2.3

  • Removed all instances of needing draw sequences
    • All weapon's models use SetCustomViewModel() now!
    • Note to users with RegisterCustomWeaponEx(): No longer needs draw sequnce param at the end.
  • Updated GiveWeapon() viewmodels to use v_models, and world models to use w_models (if both aren't just c_models)

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:

2.4

  • Reverted previous v_model/w_model change in 2.3 because it broke all unintended weapon viewmodels
  • Fixed bug where using GiveWeapon would bug the draw animation when switching to it for the first time.
  • Added support for all-class shotgun.
    • Medic, Spy, and Scout use shotgun in primary
    • the rest use it in secondary
    • Use "Soldier Shotgun" or similar to give specific shotgun types/arm models
  • Added support for all-class pistol.
    • All classes...

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

ImNotSimon

L1: Registered
Dec 2, 2022
6
2
Do you mean using two different models for custom weapons? Like viewmodel would use v_model, and world models use w_model?
yeah, could be done with a different GiveWeapon which asks for a v_model and a world model and replaces the script caller's current weapon's v_model and world model, delete them when a weapon switch occurs (unless you know how to make it permanent) and re-add them when the caller switches to the custom weapon
 

Yaki

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

2.6

  • Added a way to set custom weapon view model for custom weapons. (Requested by @ImNotSimon )
    • Set it using RegisterCustomWeaponEx()
    • The weapon model parameters will copy over to one another if the other is blank.
    • For example, if world model isn't set, but viewmodel is, it'll use the viewmodel for both world model and view model. Works vice-versa.
  • Fixed Scout's Bat being an invalid index for GiveWeapon/ReturnWeaponTable
  • Got rid...

Read the rest of this update entry...
 

Yaki

aa
Sep 3, 2018
422
261

Yaki

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

2.8

  • Updated CTFPlayer.SwitchToActive(weapon)
    • Finds the best weapon to switch to and switches to it.
    • If null, switches to the any valid gun, or if no gun is found, switches to melee, or else, any.
  • Added more error checks
  • Custom/Unintended weapons for classes now set by netprop m_iItemIDHigh
    • If m_iItemIDHigh bit 5 set, it's unintended for the class.
    • If m_iItemIDHigh bit 6 set, it's a custom weapon.
  • Turned off...

Read the rest of this update entry...
 

Yaki

aa
Sep 3, 2018
422
261

Yaki

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

3.0 Reorganized Params! Must read if using this script!

REORGANIZED PARAMETERS OF RegisterCustomWeapon() and RegisterCustomWeaponEx()!
  • New param order for RegisterCustomWeapon():
( item_name, baseitem, use_original_stats, stats_function, custom_arms_model, custom_weapon_model )​
  1. Added: use_original_stats = bool. If true, uses the original stats of the weapon. If false, wipes it clean (as if stock)...

Read the rest of this update entry...
 

>:FrozenDragon:<

L1: Registered
Dec 13, 2022
3
2
Awesome Script, although for some reason I can't turn into the headless horseman even after using the commands listed for them:
script GetListenServerHost().GiveWeapon("Hell-Maker")

Is there something I'm missing?
 

Yaki

aa
Sep 3, 2018
422
261
Awesome Script, although for some reason I can't turn into the headless horseman even after using the commands listed for them:
script GetListenServerHost().GiveWeapon("Hell-Maker")

Is there something I'm missing?
I forgot to update the name in other places. I renamed it to "Horsemann's Hex".
 

Yaki

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

3.1

  • Added support for tf_bots using this script (thanks Mr.Burguers)
  • Added descriptions in tables.nut
  • Fixed Liberty Launcher saying it had 60 ammo reserve
  • Fixed Quickiebomb Launcher saying it had 72 reserve ammo
  • Fixed weapon's ammo reserve multiplying if weapon had an ammo reserve bonus (i.e. Rocket Jumper)
  • Fixed clip size attributes not applying correctly

Read the rest of this update entry...