Tremulous Forum

General => Feedback => Topic started by: Roanoke on January 17, 2009, 10:36:07 pm

Title: Buy conflicts
Post by: Roanoke on January 17, 2009, 10:36:07 pm
How about a client side option that changes how buying conflicts are resolved. Currently, if I try to buy a bsuit with a battpack on, I won't be able to. However, there should be an option to make it so that the battpack is sold, but only if I can afford the bsuit. This will really help me out when making buy binds that attempt to buy bsuits, but could fail. If they do fail, I'd like them to keep any backpacks I have on.
Title: Re: Buy conflicts
Post by: Hendrich on January 17, 2009, 10:53:47 pm
Sorry Raonoke, but that sounds difficult to code for a simple problem. I understand, it happened to me too before I fixed my binds, especially when I wanna buy a b-suit but I have a helm on in the heat of a battle. The solution is to fix up your binds, make it so when you buy a b-suit that you sell your light armor and helmet too. Heres an example of doing this:

bind z "sell larmour; sell helmet; buy bsuit"

Try copying the above code and fix it up in your configs, cheers.
Title: Re: Buy conflicts
Post by: FreaK on January 17, 2009, 11:43:41 pm
sell upgrades works as well
Title: Re: Buy conflicts
Post by: Roanoke on January 18, 2009, 12:41:08 am
I know that works, but I integrate that into my weapon binds. It sells upgrades and then tries to buy bsuit, larmour, and helmet in that order. However, I will lose any backpacks in this if I can't afford a bsuit.
Title: Re: Buy conflicts
Post by: KillerWhale on January 18, 2009, 01:27:32 am
You may be looking for:

Code: [Select]
bind key "sell weapons; sell upgrades; buy bsuit; buy larmour; buy helmet; buy prifle; buy battpack; buy rifle; itemact prifle"
It will buy you a battlesuit if you have enough cash, if not, you get a light armour+helmet+battpack.
If you do not have enough money for the weapon, you get a rifle instead of a blaster.

I hope this helps you.

Sorry if I misunderstood,
Whales
Title: Re: Buy conflicts
Post by: Urcscumug on January 18, 2009, 01:32:11 am
In all fairness, scripting binds would become much better if there was support for testing the success of a previous command. An example is how the Linux bash shell accomplishes this, using && and || separators in addition to semicolons. && would mean "proceed if previous command was successful", while || would do the opposite. ; could continue to do what it does now.
Title: Re: Buy conflicts
Post by: Archangel on January 18, 2009, 01:37:12 am
I believe there is a patch for ioq3 that adds very simplistic bash-style scripting to the console.
Title: Re: Buy conflicts
Post by: kevlarman on January 18, 2009, 04:09:38 am
I believe there is a patch for ioq3 that adds very simplistic bash-style scripting to the console.
but none of the commands have return values (and can't, they're asyncronous)
Title: Re: Buy conflicts
Post by: Roanoke on January 18, 2009, 04:33:56 am
You may be looking for:

Code: [Select]
bind key "sell weapons; sell upgrades; buy bsuit; buy larmour; buy helmet; buy prifle; buy battpack; buy rifle; itemact prifle"
It will buy you a battlesuit if you have enough cash, if not, you get a light armour+helmet+battpack.
If you do not have enough money for the weapon, you get a rifle instead of a blaster.

I hope this helps you.

Sorry if I misunderstood,
Whales
You did misunderstand, what if I have a jet? The script can't figure out what backpack I had before the selling. This is why I am making this suggestion.
Title: Re: Buy conflicts
Post by: Bissig on January 18, 2009, 05:04:18 am
Just put jetpack and battpack on an exclusive bind and toggle between them.
Title: Re: Buy conflicts
Post by: zybork on January 18, 2009, 01:28:09 pm
Yep. Why not use something like

Code: [Select]
/bind J "sell battpack; buy ammo; buy jetpack; itemact jetpack;"
/bind B "sell jetpack; buy battpack;

You just need two additional keys, B and J, and that's it. Works perfectly for me.
Title: Re: Buy conflicts
Post by: benmachine on January 18, 2009, 01:59:06 pm
It wouldn't be hard to code a default action of selling everything that conflicts with your purchase, but it's questionable if it is what you want, and it could be confusing to newbies who buy a battlesuit lasgun and battpack and then HEY WHAT HAPPENED TO MY BATTLESUIT THIS GAME SUCKS.

Perhaps yet another userinfo cvar would do the trick.
Title: Re: Buy conflicts
Post by: Samurai.mac on January 18, 2009, 03:40:50 pm
Personally I have three binds which cycle through: 1. Weapon 2. Armour 3. Helmet and a fourth bind to buy all that when I'm at an armoury. It doesn't tell you how much money they cost, or give you warnings conflicts, but it does allow you to set up any combination on the move, and provided you know what you can and can't have it works flawlessly.
Title: Re: Buy conflicts
Post by: Roanoke on January 18, 2009, 05:59:03 pm
Just put jetpack and battpack on an exclusive bind and toggle between them.
Well, yes, that's possible, but it's an extra step.
It wouldn't be hard to code a default action of selling everything that conflicts with your purchase
Well, that's what I'm talking about here. However, it only sells it if you can afford whatever conflicts. This could be disabled by default.
Title: Re: Buy conflicts
Post by: UniqPhoeniX on January 18, 2009, 06:38:08 pm
A new command (forcebuy?) would be better, so you don't have to use it on all binds.