Author Topic: VSTR Build Problem [SOLVED]  (Read 6236 times)

p1337e

  • Posts: 11
  • Turrets: +0/-0
VSTR Build Problem [SOLVED]
« on: January 25, 2009, 09:13:39 pm »
My build binds dont work, and I just made them. Ive checked everything, but nothing worked.
Every time I pressed the button, all that comes up is "Unknown command medistat"
Please help.
Im using koticz hud.

Code: [Select]
bind "h" "vstr build"
set build "build reactor;bind h vstr build1"
set build1 "build telenode;bind h vstr build2"
set build2 "build mgturret;bind h vstr build3"
set build3 "build repeater;bind h vstr build4"
set build4 "build medistat;bind h vstr build"

bind "g" "vstr builda"
set builda "build overmind;bind h vstr buildb"
set buildb "build eggpod;bind h vstr buildc"
set buildc "build acid_tube;bind h vstr buildd"
set buildd "build barricade;bind h vstr builde"
set builde "build booster;bind h vstr builda"
« Last Edit: January 26, 2009, 09:18:46 pm by p1337e »

Bissig

  • Posts: 1309
  • Turrets: +103/-131
Re: VSTR Build Problem
« Reply #1 on: January 25, 2009, 10:51:56 pm »
bind h "vstr builder"

set build "build reactor; set builder vstr build1"
set build1 "build telenode; set builder vstr build2"
set build2 "build mgturret; set builder vstr build3"
set build3 "build repeater; set builder vstr build4"
set build4 "build medistat; set builder vstr build"

set builder "vstr build"

This should work.


Hmm, ok, but this one works *g*:

bind h "vstr builder"
set build0 "build reactor; echo ^3 Building Reactor; set builder vstr build1;"
set build1 "build telenode; echo ^3 Building Telenode; set builder vstr build2;"
set build2 "build mgturret; echo ^3 Building Turret; set builder vstr build3;"
set build3 "build repeater; echo ^3 Building Repeater; set builder vstr build4;"
set build4 "build medistat; echo ^3 Building Medistation; set builder vstr build0;"
vstr build0

It doesnt like variable names that are already used internally, thus "build" can not work. Also, I don't know why it needs those semicolons at the end of each vstr...
« Last Edit: January 26, 2009, 02:49:29 am by Bissig »

p1337e

  • Posts: 11
  • Turrets: +0/-0
Re: VSTR Build Problem
« Reply #2 on: January 25, 2009, 11:44:31 pm »
hmm
i tried that, but it still comes up with unknown command medistat

lol, now it says unknown cmd medistat

Roanoke

  • Posts: 260
  • Turrets: +20/-22
Re: VSTR Build Problem
« Reply #3 on: January 26, 2009, 12:22:47 am »
Try these (my build binds)
Code: [Select]
//Build binds
//This handles the one-key cycling. H=Cycle
bind h "vstr strucs;"
set node "build telenode; set strucs vstr ret;" //Telenode
set ret "build mgturret; set strucs vstr arm;" //Turret
set arm "build armoury; set strucs vstr medi;" //Armory
set medi "build medistat; set strucs vstr rep;" //Medistation
set rep "build repeater; set strucs vstr tesla;" //Repeater
set tesla "build tesla; set strucs vstr dcc;" //Tesla
set dcc "build dcc; set strucs vstr rc;" //DCC
set rc "build reactor; set strucs vstr node;" //RC
vstr node
I also recommend separating alien and human binds for simplicity's sake.

p1337e

  • Posts: 11
  • Turrets: +0/-0
Re: VSTR Build Problem
« Reply #4 on: January 26, 2009, 12:37:52 am »
thanks roanake
Could you explain what was wrong? i might need to make more binds, and that would be helpful
BTW can u fix the alien one as well? Thanks

KARMA COOKIE
(if i knew how)
« Last Edit: January 26, 2009, 12:39:31 am by p1337e »

Lakitu7

  • Tremulous Developers
  • *
  • Posts: 1002
  • Turrets: +120/-73
Re: VSTR Build Problem
« Reply #5 on: January 26, 2009, 01:25:40 am »

Bissig

  • Posts: 1309
  • Turrets: +103/-131
Re: VSTR Build Problem
« Reply #6 on: January 26, 2009, 02:54:45 am »
thanks roanake
Could you explain what was wrong? i might need to make more binds, and that would be helpful
BTW can u fix the alien one as well? Thanks

KARMA COOKIE
(if i knew how)

The vstr in your first post just keeps replacing until it hits the last line. Thats why you need two variables.

From Roanake:

"vstr strucs" is the variable storing the lines for you. Each time you press h one of the vstrs is wrapped up in "strucs". The first command is issued and the next vstr is being stored in "structs" but not executed yet. Next time you press x, the content which is executable gets executed and then the next vstr is stored in "structs".

Whereas your first attempt is like a snail snake eating its tail until nothing of it is left. Thats when it exits the loop and fails.
« Last Edit: January 27, 2009, 01:19:35 am by Bissig »

p1337e

  • Posts: 11
  • Turrets: +0/-0
Re: VSTR Build Problem
« Reply #7 on: January 26, 2009, 03:08:47 am »
I get it, i think......

if thats the case, how come thuis one works fine?

Code: [Select]
bind "." "vstr camp"
set camp "say ^1CAMPERS, ^2CAMPERS, ^3CAMPERS, ^4CAMPERS, ^5CAMPERS, ^6CAMPERS, ^7CAMPERS; bind . vstr camp1"
set camp1 "say ^2CAMPERS, ^3CAMPERS, ^4CAMPERS, ^5CAMPERS, ^6CAMPERS, ^7CAMPERS, ^8CAMPERS; bind . vstr camp2"
set camp2 "say ^3CAMPERS, ^4CAMPERS, ^5CAMPERS, ^6CAMPERS, ^7CAMPERS, ^8CAMPERS, ^9CAMPERS; bind . vstr camp"

Bissig

  • Posts: 1309
  • Turrets: +103/-131
Re: VSTR Build Problem
« Reply #8 on: January 26, 2009, 03:14:04 am »
I get it, i think......

if thats the case, how come thuis one works fine?

Code: [Select]
bind "." "vstr camp"
set camp "say ^1CAMPERS, ^2CAMPERS, ^3CAMPERS, ^4CAMPERS, ^5CAMPERS, ^6CAMPERS, ^7CAMPERS; bind . vstr camp1"
set camp1 "say ^2CAMPERS, ^3CAMPERS, ^4CAMPERS, ^5CAMPERS, ^6CAMPERS, ^7CAMPERS, ^8CAMPERS; bind . vstr camp2"
set camp2 "say ^3CAMPERS, ^4CAMPERS, ^5CAMPERS, ^6CAMPERS, ^7CAMPERS, ^8CAMPERS, ^9CAMPERS; bind . vstr camp"

Because in this case you "rebind" it on-the-fly.

So first "." is bound with "say ^1CAMPERS, ^2CAMPERS, ^3CAMPERS, ^4CAMPERS, ^5CAMPERS, ^6CAMPERS, ^7CAMPERS". Next time you press the button it is bound with "say ^2CAMPERS, ^3CAMPERS, ^4CAMPERS, ^5CAMPERS, ^6CAMPERS, ^7CAMPERS, ^8CAMPERS". Whereas with the vstrs, you only have the vstr struct bound. And the CONTENTS of struct change. But, if there is no "stop sign" then vstrs are followed and replaced until the last one is hit. That's why the first one did not work. It worked its way through to the last vstr.

It's difficult to explain. It is mostly the way it is handled internally that changes.

zybork

  • Posts: 400
  • Turrets: +68/-72
Re: VSTR Build Problem
« Reply #9 on: January 26, 2009, 06:19:21 am »
Hm... Everything in your first post seems to be correct except that you should rather use

   bind h ...

then

   bind "h" ...

I think it is the quotes that ruin the command.

Also, I made the experience that Tremulous sometimes just behaves strange. The code basis appears a bit unclean from time to time, I once had bindings that created an advanced granger with the avatar of a battle suit :o Until this very day, I did not find out why, or how I did it, it just appeared for a time and then never again.

You may try out to leave out the quotes around the key identifier tough.
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.

p1337e

  • Posts: 11
  • Turrets: +0/-0
Re: VSTR Build Problem
« Reply #10 on: January 26, 2009, 09:17:00 pm »
Quote
Tremulous sometimes just behaves strange

true.......

anyway... the binds work perfectly, thank you all for your help.
Apparently i just dont let the worm eat its own tail and ill be fine :booster: ;)
Thanks again