Author Topic: Buy conflicts  (Read 6527 times)

Roanoke

  • Posts: 260
  • Turrets: +20/-22
Buy conflicts
« 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.

Hendrich

  • Posts: 898
  • Turrets: +168/-149
    • TremCommands
Re: Buy conflicts
« Reply #1 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.

FreaK

  • Posts: 295
  • Turrets: +45/-59
Re: Buy conflicts
« Reply #2 on: January 17, 2009, 11:43:41 pm »
sell upgrades works as well

Roanoke

  • Posts: 260
  • Turrets: +20/-22
Re: Buy conflicts
« Reply #3 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.

KillerWhale

  • Spam Killer
  • *
  • Posts: 469
  • Turrets: +63/-26
Re: Buy conflicts
« Reply #4 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

Urcscumug

  • Posts: 278
  • Turrets: +18/-7
    • Wraths Newbie Server
Re: Buy conflicts
« Reply #5 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.
New to Tremulous? Look up the Wraths Newbie Server in the in-game server list.

Archangel

  • Guest
Re: Buy conflicts
« Reply #6 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.

kevlarman

  • Posts: 2737
  • Turrets: +291/-295
Re: Buy conflicts
« Reply #7 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)
Quote from: Asvarox link=topic=8622.msg169333#msg169333
Ok let's plan it out. Asva, you are nub, go sit on rets, I will build, you two go feed like hell, you go pwn their asses, and everyone else camp in the hallway, roger?
the dretch bites.
-----
|..d| #
|.@.-##
-----

Roanoke

  • Posts: 260
  • Turrets: +20/-22
Re: Buy conflicts
« Reply #8 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.

Bissig

  • Posts: 1309
  • Turrets: +103/-131
Re: Buy conflicts
« Reply #9 on: January 18, 2009, 05:04:18 am »
Just put jetpack and battpack on an exclusive bind and toggle between them.

zybork

  • Posts: 400
  • Turrets: +68/-72
Re: Buy conflicts
« Reply #10 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.
I have retired from Tremulous. Definetely. If you play a game just because it has become a habit, but u'r only feeling like a kindergarten teacher - well, maybe I am just getting too old (hell, I was a teenager when DukeNukem3D was *new*) - it's probably not a bad idea to just let it be. And I do.

Don't take this personally. Have fun, guys.

benmachine

  • Posts: 915
  • Turrets: +99/-76
    • ben's machinery
Re: Buy conflicts
« Reply #11 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.
benmachine

Samurai.mac

  • Posts: 317
  • Turrets: +18/-17
Re: Buy conflicts
« Reply #12 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.

Roanoke

  • Posts: 260
  • Turrets: +20/-22
Re: Buy conflicts
« Reply #13 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.

UniqPhoeniX

  • Spam Killer
  • *
  • Posts: 1376
  • Turrets: +66/-32
Re: Buy conflicts
« Reply #14 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.