Comment in a bind file


Archiviste

 

Posted

I'm currently working on a template for my bind files, in which I'm sorting binds according to... some things. In order to make it look nice, I'd like to add a title to each of my category. Here's an example of what I want to do :

Code:
// Numpad...
NUMPAD1 "powexecname INSERT_POWER"
NUMPAD2 "powexecname INSERT_POWER"
NUMPAD3 "powexecname INSERT_POWER"
NUMPAD4 "powexecname INSERT_POWER"

// Pages up/down
PAGEDOWN "powexecname INSERT_POWER"
PAGEUP "powexecname INSERT_POWER"

// Common for keyboard
1 "powexecname INSERT_POWER"
SHIFT+1 "powexecname INSERT_POWER"
2 "powexecname INSERT_POWER"
SHIFT+2 "powexecname INSERT_POWER"
3 "powexecname INSERT_POWER"
SHIFT+3 "powexecname INSERT_POWER"
4 "powexecname INSERT_POWER"
LSHIFT "powexecname INSERT_POWER"
V "powexecname INSERT_POWER"
X "powexec_name INSERT_POWER"

...
That way, anytime I create a character, or want to change my binds, I'll have a nice file and it'll be easy to make any change I want.

My problem is that the /bindloadfile command seems pretty basic : it reads every line, and then does "/bind $line". Even when line is empty and/or incorrect. That doesn't prevent the bind file to load, but it spams the output.

So my question : is there a way to add a comment in a bind file ? i.e. is there a character that I can put at the begining of a line that will make /bindloadfile ignore that line ?

Thanks.


 

Posted

I'm pretty sure you can type anything after a "/nop" and it'll be ignored by the bindfile processor.
Just replace your "//" operators with "/nop".
Good luck.


Loth 50 Fire/Rad Controller [1392 Badges] [300 non-AE Souvenirs]
Ryver 50 Ele� Blaster [1392 Badges]
Silandra 50 Peacebringer [1138 Badges] [No Redside Badges]
--{=====> Virtue ♀

 

Posted

Thanks for your answer, but /nop is just a command that does nothing. But it still is a command, so it won't work the way I want.

If I start the line with /nop, the bindfile processor will try to bind it, and will execute "/bind /nop", which obviously won't work. I tried it, and that's exactly what happened.


 

Posted

Quote:
Originally Posted by Beber View Post
Thanks for your answer, but /nop is just a command that does nothing. But it still is a command, so it won't work the way I want.

If I start the line with /nop, the bindfile processor will try to bind it, and will execute "/bind /nop", which obviously won't work. I tried it, and that's exactly what happened.
Strange... I've used the "/nop" command as an effective substitute for putting comments in bindfiles for years. Not sure what the difference would be. *shrugs*


Loth 50 Fire/Rad Controller [1392 Badges] [300 non-AE Souvenirs]
Ryver 50 Ele� Blaster [1392 Badges]
Silandra 50 Peacebringer [1138 Badges] [No Redside Badges]
--{=====> Virtue ♀

 

Posted

If I'm not mistaken, you just want to hide the bindspam?

/bindloadfilesilent

should work. Note this command was given when they introduced bindspam and people (like myself) who have characters with rotating binds asked for a way to hide it. So using this over the standard /bindloadfile will produce NO confirmation whatsoever.


Orc&Pie No.53230 There is an orc, and somehow, he got a pie. And you are hungry.
www.repeat-offenders.net

Negaduck: I see you found the crumb. I knew you'd never notice the huge flag.

 

Posted

How about using a "fake" keybinding in order to put your comments ?

I looked at the List of Key Names on ParagonWiki, and since I don't have 8 buttons on my mouse...

Code:
BUTTON8 "nop" -- There is no such thing as a button 8 !

BUTTON8 "nop" -- Numpad...
NUMPAD1 "powexecname INSERT_POWER"
NUMPAD2 "powexecname INSERT_POWER"
NUMPAD3 "powexecname INSERT_POWER"
NUMPAD4 "powexecname INSERT_POWER"

BUTTON8 "nop" -- Pages up/down
PAGEDOWN "powexecname INSERT_POWER"
PAGEUP "powexecname INSERT_POWER"

BUTTON8 "nop" -- Common for keyboard
1 "powexecname INSERT_POWER"
SHIFT+1 "powexecname INSERT_POWER"
2 "powexecname INSERT_POWER"
SHIFT+2 "powexecname INSERT_POWER"
3 "powexecname INSERT_POWER"
SHIFT+3 "powexecname INSERT_POWER"
4 "powexecname INSERT_POWER"
LSHIFT "powexecname INSERT_POWER"
V "powexecname INSERT_POWER"
X "powexec_name INSERT_POWER"

...
It's not too elegant, but it might work (typing this from work, can't try it out myself).



Keep NCSoft from shutting down City of Heroes : http://www.change.org/petitions/ncso...city-of-heroes

 

Posted

Quote:
Originally Posted by Rajani Isa View Post
If I'm not mistaken, you just want to hide the bindspam?

/bindloadfilesilent

should work.
I'm pretty sure that wasn't the question being asked by the OP.


Loth 50 Fire/Rad Controller [1392 Badges] [300 non-AE Souvenirs]
Ryver 50 Ele� Blaster [1392 Badges]
Silandra 50 Peacebringer [1138 Badges] [No Redside Badges]
--{=====> Virtue ♀

 

Posted

Quote:
Originally Posted by Lothic View Post
I'm pretty sure that wasn't the question being asked by the OP.
For what he wants, it seems like the best option.


Orc&Pie No.53230 There is an orc, and somehow, he got a pie. And you are hungry.
www.repeat-offenders.net

Negaduck: I see you found the crumb. I knew you'd never notice the huge flag.

 

Posted

Quote:
Originally Posted by Archiviste View Post
How about using a "fake" keybinding in order to put your comments ?

It's not too elegant, but it might work (typing this from work, can't try it out myself).
I'm pretty sure you don't have to "trick" it like that. Like I said I've used /nop for year as comments in bindfiles. Try it without the slash I guess. Again I don't really know why it's not working like it does for me. *shrugs*


Loth 50 Fire/Rad Controller [1392 Badges] [300 non-AE Souvenirs]
Ryver 50 Ele� Blaster [1392 Badges]
Silandra 50 Peacebringer [1138 Badges] [No Redside Badges]
--{=====> Virtue ♀

 

Posted

Quote:
Originally Posted by Rajani Isa View Post
For what he wants, it seems like the best option.
The OP wants to put comment lines in his/her bindfiles. That has nothing to do whether it's "silent" or not.


Loth 50 Fire/Rad Controller [1392 Badges] [300 non-AE Souvenirs]
Ryver 50 Ele� Blaster [1392 Badges]
Silandra 50 Peacebringer [1138 Badges] [No Redside Badges]
--{=====> Virtue ♀

 

Posted

@Rajani Isa : Thanks, that's not what I was looking for, but that could do the trick. However, I'd rather use comments, since output can be useful (especially when you use custom bind files).

@Archiviste : I thought of that, but it's not really what I'm looking for, since it doesn't make the bind file any easier to read.

@Lothic : I investigated the /nop problem, and here how it works : it can be any argument for any command (like "None" in Python). So if I put it before my "//", it will work. However, it doesn't solve the blank line problem.

In fact, the bind file processor reads blank lines like any other line, and then tries "/bind". Obviously, /bind without any argument won't work. If I add a "nop" on a blank line, it will add on argument to /bind, and do "/bind nop". /bind is still missing an argument, and won't work.

So what I did is I replaced every blank line with "nop -----------------", which is still easy to read, and works perfectly. So thanks for your answer, now I have my nice bind files, that look like that (I'm still working on them actually) :

Code:
nop // Numpad...
NUMPAD1 "powexecname INSERT_POWER"
NUMPAD2 "powexecname INSERT_POWER"
NUMPAD3 "powexecname INSERT_POWER"
NUMPAD4 "powexecname INSERT_POWER"
nop ----------------------------------------------------------------------
nop // Pages up/down
PAGEDOWN "powexecname INSERT_POWER"
PAGEUP "powexecname INSERT_POWER"
nop ----------------------------------------------------------------------
nop // Common for keyboard
1 "powexecname INSERT_POWER"
SHIFT+1 "powexecname INSERT_POWER"
2 "powexecname INSERT_POWER"
SHIFT+2 "powexecname INSERT_POWER"
3 "powexecname INSERT_POWER"
SHIFT+3 "powexecname INSERT_POWER"
4 "powexecname INSERT_POWER"
LSHIFT "powexecname INSERT_POWER"
V "powexecname INSERT_POWER"
X "powexec_name INSERT_POWER"
Thanks everyone !


 

Posted

Quote:
Originally Posted by Beber View Post
Thanks everyone !
Glad it worked out for you. Sorry about thinking it was "/nop" versus "nop" but I was going on memory and it's been a while since I cooked up a bindfile from scratch. You tend to forget details like that when you mostly cut-n-paste from older files.

Take care.


Loth 50 Fire/Rad Controller [1392 Badges] [300 non-AE Souvenirs]
Ryver 50 Ele� Blaster [1392 Badges]
Silandra 50 Peacebringer [1138 Badges] [No Redside Badges]
--{=====> Virtue ♀