Binding keys via menu


(Meyerinchains) #1

Ok, this one seems so simple, but I just can’t find anything here about it.

I’m making a menu for our mod and there’s a few new commands that I would like to be able to let players bind via the menu rather than just the console. But it won’t work. I click on the “???” to bind a key, then hit the key and it doesn’t do anything.

What’s even weirder, is if I bind that command via the console, it shows that key is binded to that command in my menu, but if I click on it to change it, it unbinds it and leaves “???”.

	BIND( 8, 76, (SUBWINDOW_WIDTH)-4, 10, "Drop Weapon:", .2, 8, "dropweapon", "" )
	BIND( 8, 90, (SUBWINDOW_WIDTH)-4, 10, "Slash Kill:", .2, 8, "kill", "" )

Here is a couple of commands I’ve tried to bind, but they don’t work. I’ve also tried using +dropweapon and +kill and they don’t work either.


(Jaquboss) #2

very well, maybe it sounds ugly , but binding keys must be listed in UI code…
Almost no ET mod really depends on its UI part ( there is mostly just added mod filter and few special binds ) sou you may try it
BTW: ET doesn’t have dropweapon :nag:


(Meyerinchains) #3

I know ET doesn’t have dropweapon. That’s one of the new commands in our mod which I would like to be able to bind through our options menu.


(Jaquboss) #4

yeah but you have to add code for it, i suggest to browsing falckonet source there is all you need for it , even definition needed for binding
edit:here is what you need
http://stealthy.foolishgames.net/forum_viewtopic.php?8.752


(kamikazee) #5

Well, isn’t it so that if you can run it from a client, you can bind it as well?
Or am I missing something here?


(Jaquboss) #6

not certain, because it is most probably shared with cg and ui, i won’t check it today


(Meyerinchains) #7

Well, isn’t it so that if you can run it from a client, you can bind it as well?
Or am I missing something here?

When our mod is running, I can type /dropweapon in the console and it works.
I can type /bind j dropweapon and then hit j and it works.
If I go to the menu and try to bind a key to it through that, it doesn’t work.
Also, I type /bind j dropweapon then go to my menu, it shows me that J is binded to Drop Weapon. I click on it to change the key and it unbinds the J and it leaves “???” meaning its not binded to anything. Which is weird.

But like Jaquboss said, I have to add code for it. And I think I found something in ui_shared.c. So I’ll let you know if it works, thanks :slight_smile:

I’ll be sure to check out the falckonet source, thanks.


(KillerWhale) #8

You must add the command to the g_bindings table which can be found in ui_shared.c. I tumbled into that as well the first time I made a mod.

In WhaleClient and etpub_client I changed the code a little so it supports commands which are not in g_bindings table, which probably is nice for people who want to do their own menu mods. If you want the code for that, it’s part of etpub changeset 918 (http://linespeed.net/projects/etpub/changeset/978).


(Jaquboss) #9

oh , and one thing: what mod you are working on :P?


(Meyerinchains) #10

Right now, the working title is the “No Quarter” mod. It’s basically a fun mod aimed at new weapons and new skills. Theres other stuff too, but our aim is to keep it fun and make it still feel like the ET everyone has grown to love.

http://www.shitstorm.org/viewtopic.php?t=4375&start=0 is a topic about our new weapons

and if you feel like going through 21 pages of posts to read about our mod from concept to now, read this:
http://www.shitstorm.org/viewtopic.php?t=1796&start=0

We don’t have a website up for it yet, nor do we don’t have a beta for anyone to download. We are in the process of writing a manual showing all the new features and everything you need to know. Some nasty bugs in it now that need to be fixed before it can be publicly released as a beta. Our team is very small, so be patient :slight_smile:


(jet Pilot) #11

just how small is it?


(Meyerinchains) #12

you should know :nag:


(EB) #13

I can’t get those links to open…it redirects me back to the main page. (I am registered)


(jet Pilot) #14

If you can’t open the links, most are located in the Community section of the forum. Also, use the search feature for ‘mod’ or something similar. Try these, if they dont work, you may have to open them manually from the forums.
New Weapons Overview Thread
Origins Thread (21 pages)


(EB) #15

@jet pilot, your links work…that is weird.
-Thanks


(nUllSkillZ) #16

Have had the same weird problem.
Yesterday as I’ve registered only the forum index appeared klicking the links.
Today everything works fine.
Strange.


(EB) #17

…Exactly.


(Meyerinchains) #18

Sorry for the trouble guys :weird:


(Harle) #19

I´m working on a little menu to help new et-players optimizing their et. But i dont found the file ui_shared.c wich u guys are talking about. And the FalckonET forum dosen´t have any content for me :frowning:


(kamikazee) #20

You’ve got to register to read the FalckonET forums. :wink:
(I thought it said “you need to log in to view this page” somewhere)