Tremulous Forum

General => Troubleshooting => Topic started by: Josellis on November 27, 2007, 05:34:16 am

Title: "IF" in binds
Post by: Josellis on November 27, 2007, 05:34:16 am
I was wondering if it is possible to use things like "IF" in the autoexec.cfg and other .cfg files executed.

A few examples would be:
Code: [Select]
IF devmap=1
{
      exec cheat.cfg
}

IF team=humans
{
      exec human.cfg
}

IF team=aliens
{
      exec alien.cfg
}

If the "IF" command is available, what format is it in, and how can it check the condition?

Another thing is to see what are the ways the conditions can be compared.
Code: [Select]
IF cg_wwToggle=1 //if it is equal to this
IF cg_wwToggle!=1 //if it is NOT equal to this
IF cg_wwToggle<1 //if it is smaller then this
IF cg_wwToggle>0 //if it is bigger then this
IF cg_wwToggl=<1 //if it is equal or smaller then 1
IF cg_wwToggle=>0 //if it is equal or bigger then 1


Thank you
Title: Re: "IF" in binds
Post by: Illuminatio on November 27, 2007, 05:38:58 am
There is a client patch by WireDDD which adds "/if, /concat, and /math".
Title: Re: "IF" in binds
Post by: Bunneh on November 29, 2007, 02:33:22 am
How do you go about installing this patch? I Googled for "Wireddd Tremulous" and got his site, which would not open. FireFox kept sending a "x is taking too long to connect" message and I couldn't get anything, but MG's patch tracker had the file in .patch form. I downloaded it, and can't figure out how to set it up.

How do I install this? I'm running the Tremulous .exe from trem.tjw.org, so I don't know if it's compatible. This .exe says it was last modified in '06, so it seems out of date. Do I have to compile new source with this .patch included in it, or is there something I can use to install it to the existing .exe?

Thanks for any help.
Title: Re: "IF" in binds
Post by: Paradox on November 29, 2007, 04:02:06 am
try the MG patch tracker. They have a copy of it.
mercenariesguild.net/patches
Title: Re: "IF" in binds
Post by: benmachine on November 29, 2007, 04:59:57 pm
Do I have to compile new source with this .patch included in it
Yeah, I'm afraid you do. Try:

http://tremulous.net/forum/index.php?topic=3408.0

if you have a free evening :)
Title: Re: "IF" in binds
Post by: Bunneh on November 29, 2007, 11:06:44 pm
Oh joy. I just so happen to have NOTHING to do tonight.

Time to uber-geek out on teh famalee Pee-See!

EDIT:

Okay, I've got the code downloaded using the methods listed there, Step 9, to be exact.

Now, how do I apply the .patch files? Just open the downloaded code with Notepad and add some copy/paste lines?

EDIT 2:

Okay. Found the correct location for this particular patch, svn/qcommon/cmd.c, so where in that file do I put the new code? Just append it to the end of the file?
Title: Re: "IF" in binds
Post by: Death_First on December 01, 2007, 12:26:23 am
to patch a file

open msys

cd to the location of the code
(cd Tremsorce)
run cmd

patch -p0 < (patchfile)
Title: Re: "IF" in binds
Post by: Bunneh on December 01, 2007, 02:00:23 am
to patch a file

open msys

cd to the location of the code
(cd Tremsorce)
run cmd

patch -p0 < (patchfile)

O RLY?!

That's so simple, I'm not surprised I didn't figure it out...let me test it and see if it proceeds smoothly.
Title: Re: "IF" in binds
Post by: Nux on December 01, 2007, 09:25:14 pm
I'm interested to know what values you can lift from the game into your conditional in this patch.