Fortress Forever

Go Back   Fortress Forever > Help & Technical > FF Technical Support

Reply
 
Thread Tools Display Modes
Old 10-15-2014, 09:30 PM   #1
Hotterspur
 
Join Date: Oct 2014
Gametype: Capture the Flag
Posts Rated Helpful 0 Times
Fortress Forever Scripting Question

OK, so I'm a bit stumped. I've come up with the following bit of code which allows me to hit the Alt key and change to a different set of key bindings then hit the Alt key again to change it back. Here is the code I'm using for my engineer:

alias Switch+ "bind F5 aimsentry; bind 1 detdismantlesentry; bind 2 dismantledispenser; bind 3 detdispenser; wait; alias Switch Switch-"
alias switch- "bind F5 slot1; bind 1 slot2; bind 2 slot3; bind 3 slot4; wait; alias Switch switch+"
alias Switch "Switch+"

bind "ALT" "Switch"

This code works flawlessly for my engineer. However, when I use the same kind of code for my spy it completely malfunctions. Here's the code for the spy:

alias Switch+ "bind F5 E-demoman; bind 1 E-engineer; bind 2 E-hwguy; bind 3 E-medic; wait; bind 4 E-pyro; bind 5 E-scout; bind TAB E-sniper; bind ENTER E-soldier; wait; bind BACKSPACE E-spy; bind UPARROW F-demoman; bind HOME F-engineer; bind PGUP F-hwguy; wait; bind W F-medic; bind LEFTARROW F-pyro; bind [ F-scout; bind ] F-sniper; bind RIGHTARROW F-soldier; wait; wait; wait; wait; wait; wait; alias Switch Switch- wait; wait; wait; wait; wait; wait"
alias switch- "wait; wait; wait; wait; wait; wait; bind F5 slot1; bind 1 slot2; bind 2 slot3; bind 3 slot4; wait; bind 4 slot5; bind 5 impulse 100; bind TAB Scoreboard; bind ENTER +attack2; wait; unbind BACKSPACE; bind UPARROW +forward; bind HOME discard; bind PGUP changeteam; wait; bind W impulse 201; bind LEFTARROW +moveleft; bind [ crouch; bind ] dropitems; bind RIGHTARROW moveright
; wait; alias Switch switch+ wait; wait; wait; wait; wait; wait"
alias Switch "Switch+"

bind "ALT" "Switch"

When I Press the Alt key the first time it switches over to the disguise bindings as it should. When I Press it the second time it restores the bindings just as it should. However, when I pressed it again nothing happens.

You'll notice that the spy code contains more wait commands. This is my attempt to slow things down a bit because someone suggested that it might be too much to do in such a short time. I'm not even sure if that's the problem. Any help would be appreciated.
Hotterspur is offline   Reply With Quote


Old 10-18-2014, 07:20 PM   #2
oaties
 
Join Date: Nov 2010
Gametype: Capture the Flag
Posts Rated Helpful 38 Times
Just from quickly looking at it, if you haven't already found it out by now.

Your error appears to be where you stated (The very last line of the spy script):

Code:
 wait; alias Switch switch+ wait; wait; wait; wait; wait; wait" alias Switch "Switch+"
I don't understand what those extra waits are for before you call alias switch "switch+" again. Didn't you already state that before all the waits?

Also, I believe switch+ in that line should have quotation marks around it. Note the part that I bolded - I'm not sure if its needed, but it seems that you forgot the semicolon to seperate each statement.

Last edited by oaties; 10-18-2014 at 07:21 PM.
oaties is offline   Reply With Quote


Old 10-18-2014, 08:20 PM   #3
Hotterspur
 
Join Date: Oct 2014
Gametype: Capture the Flag
Posts Rated Helpful 0 Times
Thanks for your input! I don't really understand the waits either. It was my understanding that they create a momentary pause between command executions. This is based on code from a crouch toggle script that someone once gave me. All I did was substitute some words and add some bind commands but essentially everything seemed to be in the right place. When I shorten this code it seems to work just fine. It occurred to me the other day that I only need half of those binds because I don't really need to disguise myself as someone from my own team. So, instead of 18 binds I only need nine. This seems to solve the problem. I wouldn't at all be surprised if I missed a semicolon or that I forgot quotes either. I am notoriously a typo artist. I actually have it working now. Thanks again for your help.
Hotterspur is offline   Reply With Quote


Old 10-19-2014, 12:43 AM   #4
oaties
 
Join Date: Nov 2010
Gametype: Capture the Flag
Posts Rated Helpful 38 Times
When making scripts, you should always try to keep them organized. The script you posted looked like a block of text to me, and I wouldn't be surprised if you missed a ; or two

On the topic of friendly disguises, they are actually quite useful. Jumping into the enemies base while disguised as a friendly medic can make them think there isn't a spy (while you feign and redisguise elswehere). I also find it quite fun to disguise as a friendly scout and backstab people, they usually never expect you to suddenly stop and backstab and will continue to try to lead ahead of you.
oaties is offline   Reply With Quote


Old 10-20-2014, 02:55 AM   #5
Hotterspur
 
Join Date: Oct 2014
Gametype: Capture the Flag
Posts Rated Helpful 0 Times
The strange thing is that I actually tried to neaten that script up but when I do it by adding hard returns so that I can make sense when I read it the script no longer functions. I just assumed that those hard returns interfere with the script function but I suppose it's also possible I made yet another typo.

See, when you talk about your strategy with friendly disguises it makes me remember how much I sucked at the game. Doing what you're talking about would absolutely get me fragged though I'm sure you were good at it. My strategy was always to appear as a non threat to walk amongst them and cause havoc from within. I like to cloak and make my way slowly across the map to their base and once inside start using various enemy disguises to back stab and sabotage. Then again that's just my particular playing style. Perhaps I can try that if the Fortress Forever player base grows again. Anyway, thanks again for your help
Hotterspur is offline   Reply With Quote


Reply

Tags
script, scripting


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 

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. The time now is 06:23 AM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2024, vBulletin Solutions, Inc.