Author Topic: Request: boolean logic in config  (Read 2242 times)

Superchu

  • PGP
  • Posts: 17
Request: boolean logic in config
« on: January 15, 2014, 09:15:09 AM »
This may be too difficult to implement... BUT I kinda like the idea of the config being able to have if/then/else logic statements. It would expand the utility of the config files, but it may just be too overpowered. what do you guys think?

jitspoe

  • Administrator
  • Autococker
  • Posts: 18802
Re: Request: boolean logic in config
« Reply #1 on: January 15, 2014, 01:33:52 PM »
A config file just stores settings that get initialized on load.  What would you do with this logic?

JMR

  • Map Committee
  • Autococker
  • Posts: 574
Re: Request: boolean logic in config
« Reply #2 on: January 15, 2014, 03:38:36 PM »
A config file just stores settings that get initialized on load.  What would you do with this logic?

I think he basically means, the ability to make some sort of 'script' to trigger functions/commands based off of some variables.

I'm not sure how hard that would be to implement though. I'm guessing it would be really good for UI creators though, advanced menu options that allow you to tick things like. 'Use this name for this server'
As well as logic statements, logic operators like '||' for or and '&&' for 'and'.
Also, along with this, some more variables would be good.



Depending on how long a scripting system would take, it could be worth it but could also be a waste of time.
I think it would open a huge doorway for people creating their own UI/config mods though.



To be honest, at the moment, 'customization' features should not be high on priority. But it's a cool idea.

Superchu

  • PGP
  • Posts: 17
Re: Request: boolean logic in config
« Reply #3 on: January 15, 2014, 05:30:32 PM »
I think he basically means, the ability to make some sort of 'script' to trigger functions/commands based off of some variables.
^this.
only problem is, the scripts may get advanced... like aimbots. but it would be nice for logic and a console prompt command (for text input into the scripts so instead of this:
alias crs13 "crosshair 13;bind 9 crs1;echo 13"
alias crs12 "crosshair 12;bind 9 crs13;echo 12"
alias crs11 "crosshair 11;bind 9 crs12;echo 11"
alias crs10 "crosshair 10;bind 9 crs11;echo 10"
alias crs9 "crosshair 9;bind 9 crs10;echo 9"
alias crs8 "crosshair 8;bind 9 crs9;echo 8"
alias crs7 "crosshair 7;bind 9 crs8;echo 7"
alias crs6 "crosshair 6;bind 9 crs7;echo 6"
alias crs5 "crosshair 5;bind 9 crs6;echo 5"
alias crs4 "crosshair 4;bind 9 crs5;echo 4"
alias crs3 "crosshair 3;bind 9 crs4;echo 3"
alias crs2 "crosshair 2;bind 9 crs3;echo 2"
alias crs1 "crosshair 1;bind 9 crs2;echo 1"

we could have:
bind 9 "echo crosshair #?;prompt crosshair"
and you just type which one you want, and it sets the crosshair to that value. just to cut the amount of typing in the script and even the console.

jitspoe

  • Administrator
  • Autococker
  • Posts: 18802
Re: Request: boolean logic in config
« Reply #4 on: January 15, 2014, 05:47:21 PM »
bind 9 "menu my_crosshair_menu"

Then create a dialog menu called my_crosshair_menu.txt in the menus directory with an editbox for the crosshair cvar.


Superchu

  • PGP
  • Posts: 17
Re: Request: boolean logic in config
« Reply #5 on: January 15, 2014, 08:15:42 PM »
bind 9 "menu my_crosshair_menu"

Then create a dialog menu called my_crosshair_menu.txt in the menus directory with an editbox for the crosshair cvar.


that was just an example.... there are a lot of ways you could make a crosshair changer... I was just sayin' prompt might come in handy. also you still haven't given your opinion on logic statements, what do you think, jits?

not_payl_obviously

  • 68 Carbine
  • Posts: 415
Re: Request: boolean logic in config
« Reply #6 on: January 16, 2014, 07:33:20 AM »
"if" command could be useful, but I think jitspoe has more important things to do, and this probably can be done within source that is published.
I thought about implementing this myself, but theres no need to hate Clipz, I won't break word I gave.

not_payl_obviously

  • 68 Carbine
  • Posts: 415
Re: Request: boolean logic in config
« Reply #7 on: January 22, 2014, 09:29:14 AM »
Bump. I wrote simple external library that uses my old scripting language as syntax for if command. For now it's just experimental software that I used to hack into Paintball b40, but if anyone is interested in it, feel free to ask me here or PM, if enough people will want it, I'll add some support for OR/AND/NOT etc. and then release it on Payl's Corner, if not then it's not worth my time.