D2F Discussion
Forums > D2F Discussion (Archives) > Scripting and modding help needed.Search | New Thread
Thread Locked. You cannot edit or reply to any messages.
Scripting and modding help needed.
 
Page 1, 2, 3 | Next Page
Crate Hoarder
P: 08/06/2017 14:19 EST
E: 08/06/2017 14:19 EST
   
Poll: Will you help me?
Go back to tf2 you cunt (11%)
Agreed with option #4 (11%)
I shit all over tf2 24/7 (22%)
I'm actually here to help this guy. (44%)
Both games aren't that bad guys... (11%)
Screw people who choose option #3
Poll has ended (it ran for 7 days). 9 total votes.
So. I'm pretty new to TFC (just above 60 hours played), and I've tried to add a lagless grenade timer because I tend to have high ping without any luck or success. Same with modding TFC. I've tried to download this mod:

http://gamebanana.com/skins/110605

but couldn't because I am plain stupid when it comes to things such as modding half-life games and mods.
  
omni.AI
Super Regular
Soldier Flag
Defense

P: 08/06/2017 17:25 EST
E: 08/06/2017 17:25 EST
    Our resident supercool supernerd has posted an absolutely brilliant DIY scripting/modding guide in the form of replies to the following thread: http://www.lunaticrage.com/drippy/forum.php?a=vt&f=1&t=15715
It is a must-read for your particular wants, CrateHoarder. Spoofer lays down all the need-to-know in easy-to-understand language. I highly recommend you read all of Spoofer's posts in that thread. Hope this helps =)
  
Ignorant_Florist
Daycare Manager
Pipebomb Monkey

P: 08/06/2017 17:31 EST
    I've got to second what Omni said. Spoofer knows his shit.

Also, Crate Hoarder seems like a really nice guy. I was showing him some "skill" related stuff yesterday. So, if you see him in game, definitely give him a hand. He's very interested in learning, and I think he'll be a good addition to the community.
  
Spoofer
Super Regular
WMD Creator

P: 08/06/2017 20:15 EST
E: 08/09/2017 21:40 EST
    /supernerd

I recommend that anyone who customizes their game do the following:

1) Check the "Allow custom addon content" in the TFC Video Options and hit ok

2) Create a folder in Steam/steamapps/common/Half-Life and name it "tfc_addon" (it should be there alongside "tfc" and "tfc_downloads", and all your other HL mods)

3) Put all your custom content in the tfc_addon folder, with the same directory structure as in the original tfc folder. You'll probably want to move (not copy) your userconfig.cfg (if you have one), and all class and map .cfg files (like scout.cfg and 2fort.cfg, etc.) from tfc to tfc_addon as well.

tfc_addon has higher priority than the base tfc folder (TFC will use everything in tfc_addon before it looks to use stuff in tfc). This is a great way to keep the base installation and all your custom stuff separate and organized, in case you want to easily backup your customs, or if there's a problem to easily revert back to the vanilla game.

So, for those custom grenade models (or whatever), they should probably go directly into the tfc_addon/models folder (you'll need to create the models folder).

Note that if a server enforces model consistency (mp_consistency 1), you won't be able to join it with grenade models different from the default. Though, since Steam is dumb and activates the "Enable HD models if available" for TFC (they're not intended for TFC, and they're simply a legacy option intended for Half-Life itself), that alone is enough to stop a player from joining those particular servers. Most servers don't enforce consistency in part due to that particular problem, so custom grenade models would probably be okay most places.
  
Spoofer
Super Regular
WMD Creator

P: 08/06/2017 20:42 EST
    For a lagless grenade timer, first copy timer.wav from tfc/sound/weapons, and paste a copy into both tfc_addon/sound/weapons and tfc_addon/sound/vox (assuming you've set up tfc_addon like I mentioned before). Edit the copy inside tfc_addon/sound/weapons with a text editor (notepad or notepad++ or whatever), and just delete everything inside the text file and save it, so that it's essentially just an empty 0kb .wav file.

Then in your userconfig.cfg in tfc_addon (create a userconfig.cfg file if you don't have one), paste the following:

// hold grenades lag-free
alias +gren1LF "+gren1; spk timer"
alias -gren1LF "-gren1"
alias +gren2LF "+gren2; spk timer"
alias -gren2LF "-gren2"

bind f "+gren1LF"
bind g "+gren2LF"
Replace f and g with whatever keys you want the grenade bound to.

That's if you want lag-free versions where you hold the key to prime, and let go to toss. If you want lag-free two-touch grenades (press once to prime, press again to throw), then use this instead:

// two-touch grenades lag-free
alias gren1LF "gren1LFPrime"
alias gren1LFPrime "primeone; spk timer; alias gren1LF grenLFThrow; alias gren2LF grenLFThrow"
alias gren2LF "gren2LFPrime"
alias gren2LFPrime "primetwo; spk timer; alias gren1LF grenLFThrow; alias gren2LF grenLFThrow"
alias grenLFThrow "throwgren; alias gren1LF gren1LFPrime; alias gren2LF gren2LFPrime"

bind f "gren1LF"
bind g "gren2LF"
Lag-free two-touch grenades are a bit more complicated to use, since you have to keep track of whether the script thinks you're priming or if it thinks you've already thrown. For instance, if you die while holding a grenade, the next time you press the key the script will think you want to throw a grenade (which you probably don't have priming), rather than priming a new one. So you have to pay attention. There are ways to assist you to keep track of whether the script thinks you're priming or throwing, but I imagine it's way too complex for most players here to bother with, so I won't bother posting how to go about it unless someone really really wants to know / bother with it.
  
Nug
P: 08/06/2017 22:17 EST
    I've never been able to get the lagless time to work, but haven't tried your method before. Would be useful for me playing from the UK. Have followed all the instructions and got to this bit below:

// hold grenades lag-free
alias +gren1LF "+gren1; spk timer"
alias -gren1LF "-gren1"
alias +gren2LF "+gren2; spk timer"
alias -gren2LF "-gren2"

bind f "+gren1LF"
bind g "+gren2LF"

Can I put this in my class config files instead of userconfig? It's just my nade keys differ depending on class.
  
Spoofer
Super Regular
WMD Creator

P: 08/06/2017 22:44 EST
    Yeah, though I'd put the aliases in the userconfig.cfg, and the binds in each class cfg. That way if you ever wanted to make changes to the script itself you'd only have to do it in one place instead of 9.  
kilmov
P: 08/07/2017 08:46 EST
   
Nug wrote:
I've never been able to get the lagless time to work, but haven't tried your method before. Would be useful for me playing from the UK. Have followed all the instructions and got to this bit below:

// hold grenades lag-free
alias +gren1LF "+gren1; spk timer"
alias -gren1LF "-gren1"
alias +gren2LF "+gren2; spk timer"
alias -gren2LF "-gren2"

bind f "+gren1LF"
bind g "+gren2LF"

Can I put this in my class config files instead of userconfig? It's just my nade keys differ depending on class.
Nugg you pommy b .
  
Crate Hoarder
P: 08/07/2017 11:52 EST
E: 08/07/2017 11:57 EST
   
Spoofer wrote:
For a lagless grenade timer, first copy timer.wav from tfc/sound/weapons, and paste a copy into both tfc_addon/sound/weapons and tfc_addon/sound/vox (assuming you've set up tfc_addon like I mentioned before). Edit the copy inside tfc_addon/sound/weapons with a text editor (notepad or notepad++ or whatever), and just delete everything inside the text file and save it, so that it's essentially just an empty 0kb .wav file.

Then in your userconfig.cfg in tfc_addon (create a userconfig.cfg file if you don't have one), paste the following:

// hold grenades lag-free
alias +gren1LF "+gren1; spk timer"
alias -gren1LF "-gren1"
alias +gren2LF "+gren2; spk timer"
alias -gren2LF "-gren2"

bind f "+gren1LF"
bind g "+gren2LF"
Replace f and g with whatever keys you want the grenade bound to.

That's if you want lag-free versions where you hold the key to prime, and let go to toss. If you want lag-free two-touch grenades (press once to prime, press again to throw), then use this instead:

// two-touch grenades lag-free
alias gren1LF "gren1LFPrime"
alias gren1LFPrime "primeone; spk timer; alias gren1LF grenLFThrow; alias gren2LF grenLFThrow"
alias gren2LF "gren2LFPrime"
alias gren2LFPrime "primetwo; spk timer; alias gren1LF grenLFThrow; alias gren2LF grenLFThrow"
alias grenLFThrow "throwgren; alias gren1LF gren1LFPrime; alias gren2LF gren2LFPrime"

bind f "gren1LF"
bind g "gren2LF"
Lag-free two-touch grenades are a bit more complicated to use, since you have to keep track of whether the script thinks you're priming or if it thinks you've already thrown. For instance, if you die while holding a grenade, the next time you press the key the script will think you want to throw a grenade (which you probably don't have priming), rather than priming a new one. So you have to pay attention. There are ways to assist you to keep track of whether the script thinks you're priming or throwing, but I imagine it's way too complex for most players here to bother with, so I won't bother posting how to go about it unless someone really really wants to know / bother with it.
So I did everything except for the last step. I don't have usercpnfog.cfg, and wanted to ask how can I create usercpnfig for it to actually be a cfg file? I'm sure naming it doesn't do the job... right?
And also I bind my grenades to my mouse (primary to mouse 1, secondary - mouse 4)
How can I do that?
  
Ignorant_Florist
Daycare Manager
Pipebomb Monkey

P: 08/07/2017 13:52 EST
    Actually, naming a basic Notepad file config.cfg will work just fine.  
Nug
P: 08/07/2017 15:28 EST
   
Spoofer wrote:
Yeah, though I'd put the aliases in the userconfig.cfg, and the binds in each class cfg. That way if you ever wanted to make changes to the script itself you'd only have to do it in one place instead of 9.
Makes sense. Got it working but it'll take a while to get used to as I've been compensating for my ping for so long. One slightly annoying thing is that the timer sound plays if you hit a nade key when you don't have any nades, but I guess that shouldn't be an issue too often.
  
Nug
P: 08/07/2017 15:30 EST
   
So I did everything except for the last step. I don't have usercpnfog.cfg, and wanted to ask how can I create usercpnfig for it to actually be a cfg file? I'm sure naming it doesn't do the job... right?
And also I bind my grenades to my mouse (primary to mouse 1, secondary - mouse 4)
How can I do that?
Just create a notepad called userconfig.cfg. And for your second question,

// hold grenades lag-free
alias +gren1LF "+gren1; spk timer"
alias -gren1LF "-gren1"
alias +gren2LF "+gren2; spk timer"
alias -gren2LF "-gren2"

bind MOUSE2 "+gren1"
bind MOUSE4 "+gren2"

(I'm assuming you meant mouse2 not mouse 1, as surely nobody uses mouse 1 for nades instead of shooting their weapon.
  
Crate Hoarder
P: 08/07/2017 17:07 EST
    Yeah, I meant to say mouse2. Thanks for the help everyone!  
Spoofer
Super Regular
WMD Creator

P: 08/07/2017 21:00 EST
E: 08/07/2017 21:33 EST
    EDIT: Did I imagine a post from you asking a couple more questions? Or you deleted it in the time it took me to answer, haha... Either way, np, I'll leave this info up.

Make sure you have "userconfig.cfg" rather than just "config.cfg". They serve different functions, and userconfig.cfg is the one you want to put your custom stuff into. On Windows, just right click on the file and choose either Open With (Notepad or whatever text editor program you wish), or Edit, or... idk, whatever works, heh. Or you could just open Notepad, choose Open from its menu, then navigate to the file.

As for the .wav file in tfc_addons/sound/weapons, you don't delete the file itself, but you open it with a text editor to delete all of its contents and then save it as an empty 0kb .wav file. This is the timer file that TFC normally plays when your prime a grenade, but since it doesn't sync with the actual explosion when you factor in lag, it's detrimental and you want to make it silent (hence, deleting all of its file content). If you delete the file itself (in the original tfc heirarchy), Steam will probably just redownload it or otherwise make it so you can't load TFC properly.

Copying the original timer file into tfc_addons/sound/vox allows the timer to instead be played by the spk (speak) command, which syncs to the explosion no matter what. But, if you left the original timer in /weapons alone, the sound would basically play twice, once automatically when you primed (which would be off when taking into account lag), and once via the script where you tell your game to speak it.

If that makes sense.

(tldr: just delete the contents of the /weapons version of the file like I explained originally XD)
  
Crate Hoarder
P: 08/07/2017 21:11 EST
E: 08/07/2017 21:21 EST
    I did everything just fine, and figured out what I didn't understand thanks to Nug and someone else (sorry, don't remember your name!) helped me out. during the process I accidentally moved tfc folder out and cant find it now (though I for sure know that it's not deleted). Will that be a problem?
And yes I did ask more questions, but figured them out.

Edit: yes. yes it does. in fact, you cant play the game without it.

I did everything. But now that I time a grenade, there is no sound. The soundfile is in vox, and I deleted the stuff inside the file only in sound/weapons. At this point, I have no idea what could've gone wrong.
  
Page 1, 2, 3 | Next Page
Forums > D2F Discussion (Archives) > Scripting and modding help needed.