You are viewing our Forum Archives. To view or take place in current topics click here.
need a little help writing your own mods?
Posted:

need a little help writing your own mods?Posted:

lxnauticaxl
  • Challenger
Status: Offline
Joined: Jul 10, 201212Year Member
Posts: 136
Reputation Power: 5
Status: Offline
Joined: Jul 10, 201212Year Member
Posts: 136
Reputation Power: 5
i've decided i'm going to help people out by sharing a few things about modding left 4 dead. please note that i WILL NOT write your mods for you, DO NOT ASK. i WILL however look over them for you if i find myself in a generally decent mood.

binding
simple enough, tell a button what to do. this is restricted to one word commands tho. "alias" will remedy that, but that comes later...

bind "A_BUTTON" "command"
- first, i want you to know that you don't need all those quotations, you can get away with doing just something as follows:

bind A_BUTTON "command
- i use this, it's MUCH simpler than the hassle of getting buried in quotations. give it a whirl when throwing together a layout, you may find that it's a handy thing to know. it will also be what i use in my examples below, so i HOPE you've read this part versus trying to correct me...

bind A_BUTTON "command"
- notice, the quotation marks are only around the command, 2 less "s to keep track of but still doesn't feel as efficient than the above example.



toggle
toggle is a BEAUTIFUL command, it allows you to turn on&off a command with just one button. commands that have a 0 and 1 argument DON'T NEED THE 0 OR 1 PRESENT but it doesn't hurt. for instance any of these will work:


bindtoggle A_BUTTON "god

alias gd1 "god
bindtoggle A_BUTTON "gd1

alias gd2 "toggle god 1 0
bind A_BUTTON "gd2

alias gd3 "toggle god
bind A_BUTTON "gd3



alias
i did a little bit of this just above but alias is the godsend of modding because it allows you to assign more than one command at a time to a single button, branch out your layout and [something i find incredibly helpful which is essentially] toggling between other alias. (i know that last part sounds a bit confusing, but i'll come back to that)
**note: DON'T MAKE AN ALIAS THE SAME AS AN ACTUAL COMMAND, IT WON'T WORK**

an example of of what i mean is as follows:
(yes)
alias gd "toggle god

(no)
alias god "toggle god

notice the missing O in "god", now an alias title can be anything, it doesn't HAVE to be related to the command being used, but it does help to keep track of commands being used when binding later. now if you're new to modding you're probably saying to yourself, "okay, but how am i suppose to apply it?"
alias are meant to be bound, so you would do something like this:

alias gd "toggle god

bind A_BUTTON "gd

- you can throw in commands that toggle together as well but i don't particularly recommend it, if you're in a game where you're not the host and they have god off but infinite ammo on then you go and host you're own game you'll just be swtiching the two back forth where god will be on and infinite ammo is off. for this reason i strongly recommend that you don't toggle those particular 2 together.

remember, you can put more than one command into an alias. for instance:

alias sword "give katana;give machete
*i put these two together because they're not found on the same levels with the exception on ColdStream*

*note that the commands are separated by a semicolon ( ; ) and i DID NOT SPACE AFTER THE SEMICOLON, while you CAN use a space and not ruin the command, it won't hurt. i just want you guys to know that is NOT a typo.

now let's say i wanna throw a toggle command and a regularly executed command together, it's totally doable but know your limits:
(yes)
alias cheats "toggle sv_cheats;vocalize smartlook

are cheats on? yes - turn them off and call out whatever you're looking at unless you're the infected
are cheats off? yes - turn them on and call out whatever you're looking at unless you're the infected
*quick note, the vocalize command doesn't work anymore but isn't flagged as a cheat either, the only vocalize command i know to work is "vocalize smartlook" which is the default left thumbstick.

(no)
alias nc "noclip;give katana

anytime you go into noclip you'll spawn a katana. this is only potentially useful the first 4 times when your teammates all want katanas but now every time you go into and out of noclip you'll spawn a completely useless melee weapon.



branching an alias
i like this method of alias modding. first and foremost keep a default layout, it's VERY convenient:

alias cheats "toggle sv_cheats;vocalize
alias lyt "impulse 100

alias def "bind A_BUTTON +jump;+menuAccept;bind B_BUTTON +reload;bind X_BUTTON +use;bind Y_BUTTON lastinv;bind L_SHOULDER +duck;bind BACK togglescores;bind START gameui_activate;bind STICK1 cheats;bind STICK2 +zoom;bind UP lyt;bind RIGHT slot4;bind DOWN slot5;bind LEFT slot3;bind S1_DOWN +menuDown;bind S1_UP +menuUp;bind L_TRIGGER +attack2;bind R_TRIGGER +attack;bind R_SHOULDER +md1

**you'll notice that i have the flashlight command as an alias as well, remember binding is restricted to one word commands, that space in "impulse 100" throws it off. don't believe me? skip this note, lose the ability to use your flashlight and a perfectly good default button. you'll also notice that i've got "+md1" for my right bumper/shoulder this is where branching comes in. that plus sign (+) indicates that i want to hold that button down to use a different alias. so my +md1 alias would look something like:

//A
alias c1 "command
//B
alias c2 "command
//X
alias c3 "command
//Y
alias ak "give rifle_ak47;give pistol_magnum
//UP
alias c5 "command
//DOWN
alias c6 "command
//LEFT
alias c7 "command
//RIGHT
alias c8 "command
//S1
alias c9 "command
//S2
alias c10 "command
//BACK
alias c11 "command
//Rtrig
alias c12 "command
//Ltrig
alias c13 "command

alias +md1 "bind A_BUTTON c1;bind B_BUTTON c2;bind X_BUTTON c3;bind Y_BUTTON ak;bind UP c5;bind DOWN c6;bind LEFT c7;bind RIGHT c8;bind STICK1 c9;bind STICK2 c10;bind BACK c11;bind R_TRIGGER c12;bind L_TRIGGER c13;bind L_SHOULDER +md2

- what happens here is that i no longer have my quickturn/180 spin ability, what DOES happen however is when i hold down my right bumper and press Y i give myself an ak47 and a magnum. this applies with various other commands for the other buttons. please take note that "R_SHOULDER" doesn't appear in this layout, it CAN'T be used because it's already being used to initiate this alias. also take notice of the "bind L_SHOULDER +md2" this branches me out to a subset alias where if i continue to hold the right bumper and then hold the left bumper i'll do another set of commands. this is branching. the game wont read the "//A" and that helps a lot when setting your binds and keeping everything organized.



onto my "+md3" alias



//A
alias c14 "command
//B
alias c15 "command
//X
alias c16 "command
//Y
alias sword "give katana;give machete
//UP
alias c18 "command
//DOWN
alias c19 "command
//LEFT
alias c20 "command
//RIGHT
alias c21 "command
//S1
alias c22 "command
//S2
alias c23 "command
//BACK
alias c24 "command
//Rtrig
alias c25 "command


alias +md2 "bind A_BUTTON c14;bind B_BUTTON c15;bind X_BUTTON 16;bind Y_BUTTON sword;bind UP c18;bind DOWN c19;bind LEFT c20;bind RIGHT c21;bind STICK1 c22;bind STICK2 c12;bind BACK c24;bind R_TRIGGER c25;bind L_TRIGGER +md3

- now when holding right bumper and left bumper and press Y i'll give myself either a katana or machete (depending on the campaign). this pattern will continue to my left trigger and onto my right trigger. remember all of this initiates when i hold right bumper, then left bumper, then left trigger and finally right trigger (in that order).

alright, now please tell me you noted what i said about the plus (+) sign. no? well scroll back up. refreshed your memory? good. because now we've gotta tell the game that when i let go of those initiating buttons that i wanna go back to my default layout that's where [you guessed it] the minus (-) sign comes into play. now this is simple enough whenever i let go of my right bumper i wanna reinstate my "default" layout, i do that with this:

alias -md1 "def
alias -md2 "def
etc

notice that i didn't use "+def" THIS IS NOT A TYPO. it's simple, don't use the plus (+) sign. the bottom of my layout looks something like this:

alias -md1 "def
alias -md2 "def
alias -md3 "def
alias -md4 "def
bindtoggle STICK1 sv_cheats
bind A_BUTTON "+jump;+menuAccept
bind R_SHOULDER "+md1
bind S1_DOWN "+menuDown
bind S1_UP "+menuUp
joy_cfg_preset "0"
joy_inverty "0"
joy_legacy "0"
joy_movement_stick "0"
joy_pitchsensitivity "-0.8"
joy_yawsensitivity "-2.25"
option_duck_method "1"

the default layout "def" will initiate after letting go of right bumper, none of your initial controls working? don't freak out, tap right bumper and you're good to go.



toggling alias in an "md#" layout and wait
for my next trick i've gotta introduce you to the "wait" command. wait tells the game how many frames will pass before executing the next command in an alias. a wait is almost instantaneous, so you don't have to sit there and think "is it done waiting now?" you can multiply a wait by adding a space and a number after it "wait 5" (still almost instantaneous)

now remember when i said something about toggling between alias; that would be where we are now. taking everything i've taught you so far we're gonna build on it; i wanna toggle between alias and to do this i have to go from a-to-b b-to-c and c-to-a. so it'll use this formula:

alias a "command1;wait 5;bind button b
alias b "command2;wait 5;bind button c
alias c "command3;wait 5;bind button a

bind button "a

now i would use THIS formula in any of my "+md#" sets (i've got a different formula to use in the "def" layout and we'll get to that)
what this does is when i tap the button once i'll do A, twice i'll do B, three times i'll do C, and the fourth time will bring me back to A and continue to loop

**if you wanna just stop at C then your C alias should look like a "regular" alias"
alias c "command3

a real world example of this is let's say i wanna use right bumper+Y to give myself a pipebomb, then (while continuing to hold right bumper) tap Y again for a boomer bile then (while STILL continuing to hold right bumper) tap Y again for a molly and continue that loop, it will look something like this.

alias pipe "give pipe_bomb;wait 5;bind Y_BUTTON bile
alias bile "give vomit_jar;wait 5;bind Y_BUTTON molly
alias molly "give molotov;wait 5;bind Y_BUTTON pipe

remember, if i wanna stop the loop of tapping all i have to do is have alias C be:
alias molly "give molotov

**this loop will stop once i let go of right bumper and take me back to a pipebomb once i hold my right bumper again. for instance, if i hold right bumper and tap Y twice i'll get a pipebomb,then a boomer bile. if i let go of my right bumper and press it again pressing Y will give me a pipebomb all over again, double tap for a boomer bile, triple tap for a molly and fourth time will loop back to pipebomb until i let go of right bumper. if you already have a grenade on you, the one you had will fall to your feet and the one you "give" will take its place.

it's relatively important to track these properly you don't wanna go from A to C and C to C then find that you can't get to B at all and have effectively (kinda) removed A from the loop because you lost track of your bindings.


toggling alias in "def" layout
now you find yourself saying "hey that's pretty neat, what if i wanna do that within my "def" layout. i've already taken the liberty of working that out. it's pretty simple as well once you make "wait" work in your favor. i've got a way around the whole vocalize thing where i have a taunt that i can use (don't ask, i WON't tell) but i've got it coupled with my slot3 (grenade) so while that formula above will work, i don't wanna have to try and remember if pressing LEFT will pull out my grenade or taunt. so what i've gotta do is the following:

alias a "command1;wait 5;bind button;wait 100;bind button command1
alias b "command2;wait 5;bind button a

in my particular instance i have it as such:
alias nade "slot3;wait 5;bind LEFT taunt;wait 100;bind LEFT nade
alias taunt "tauntcommand;wait 5;bind LEFT nade

what happens here is i press LEFT and pull out my grenade/projectile and i don't have to remember the next time i pick up a grenade if pressing LEFT will taunt or not, but if i simply doubletap LEFT i vocalize my taunt.



well, that's pretty much all i've got to share for now, use it wisely. and please, i don't care if you share this somewhere else, but don't copy&paste this on another site without giving "nautica" credit. i took the time to write this out and give the community something that seems to still manage to escape their grasp and understanding and help clear things up a bit. post any questions you might have, if i can/am willing to help then i will...
#2. Posted:
REAPEROWNSYOU
  • Junior Member
Status: Offline
Joined: Dec 12, 200914Year Member
Posts: 60
Reputation Power: 1
Status: Offline
Joined: Dec 12, 200914Year Member
Posts: 60
Reputation Power: 1
Good job on this.A little confusing if you are a beginner but you explained it and broke it down


-The wait command tells the game to delay the next command in the script by one physics frame "wait 50", telling the game to wait fifty frames before the alias continues(so wait 500 is roughly five seconds if you are on a server that runs at a 100 frames per second)
#3. Posted:
Dvar
  • TTG Contender
Status: Offline
Joined: Jul 23, 201113Year Member
Posts: 3,869
Reputation Power: 174
Status: Offline
Joined: Jul 23, 201113Year Member
Posts: 3,869
Reputation Power: 174
This should be sticky, very helpful.
#4. Posted:
CRACKbomber_v6
  • New Member
Status: Offline
Joined: Jan 05, 201311Year Member
Posts: 10
Reputation Power: 0
Status: Offline
Joined: Jan 05, 201311Year Member
Posts: 10
Reputation Power: 0
Actually the wait command on the Xbox has issues being precise. Since the Xbox clamps the FPS at 60 or so, the source engine really didn't account for that. So the wait command is derpy as hell, especially when you are dealing with the function Think() in vscripting doesn't operate at 1ms/cpu tick instead it's about 4 or 5ms/cpu tick.
#5. Posted:
lxnauticaxl
  • Challenger
Status: Offline
Joined: Jul 10, 201212Year Member
Posts: 136
Reputation Power: 5
Status: Offline
Joined: Jul 10, 201212Year Member
Posts: 136
Reputation Power: 5
oh you see, i don't screw with vscripting, that's all you.
#6. Posted:
REAPEROWNSYOU
  • Junior Member
Status: Offline
Joined: Dec 12, 200914Year Member
Posts: 60
Reputation Power: 1
Status: Offline
Joined: Dec 12, 200914Year Member
Posts: 60
Reputation Power: 1
I'm trying to learn vscript but haven't got a chance to really sit down and learn much cause of busy life(not a lot to go on for learning anyway)...I really want to create some cool vscript stuff.
Jump to:
You are viewing our Forum Archives. To view or take place in current topics click here.