ui menu buttons

Post your scripting questions / solutions here

Moderator: Moderators

nuggets
General
Posts: 1006
Joined: Fri Feb 28, 2003 2:57 am
Location: U-england-K (england in the UK) :P
Contact:

Post by nuggets »

also waiting on answer here BD, i don't use sever/client based mods only things i know will be player specific or map specific if need be... HELP!!
hope this helps, prob not cos it's all foreign 2 me :-/
User avatar
bdbodger
Moderator
Posts: 2596
Joined: Tue Feb 25, 2003 7:34 am
Location: canada
Contact:

Post by bdbodger »

The only way I can see is if you start the game as a dedicated server and somehow put the rcon password and address into the script . Then put stuffcommand "rcon floor_select 1" on the button for floor 1 for example . Then join your own server to play by starting mohaa as a client . If you don't want to make it a dedicated server you need rcon for other players and non rcon commands for yourself .
Image
User avatar
tltrude
Chuck Norris
Posts: 4774
Joined: Sun Jul 07, 2002 4:03 am
Location: Oklahoma, USA
Contact:

rcon

Post by tltrude »

I think I see what you're saying, but isn't there some other way we can get this to work? There must be other options to get the player's input form the button menu to the server. When a player selects a team or a weapon with his mouse, the info is sent to the server and the server relays that info to all clients.

Would it be better to put the menu control thread in a global script? I know there is a trigger called "relay", but I don't really know what its used for.

When I use the trigger now, my mouse pointer pops up and I can not use mouse look until I select a floor and the menu closes. Would it be possible to use keyboard inputs to select the floor--just like the controls for a vehicle? That way the menu pop up would only be for information on which keys to press.

Anyway, I hope this whole idea in not a bust, because popup control panels would be a great addition to the game.
Tom Trude,

Image
User avatar
bdbodger
Moderator
Posts: 2596
Joined: Tue Feb 25, 2003 7:34 am
Location: canada
Contact:

Post by bdbodger »

All you can do with menus is what you could do by typeing stuff into your console . Like setting cvars and commands like kill or say . If you want to show a menu you can try ui_addhud menuname and ui_removehud menuname . Those will still let you move with the menu showing I think .
Image
nuggets
General
Posts: 1006
Joined: Fri Feb 28, 2003 2:57 am
Location: U-england-K (england in the UK) :P
Contact:

Post by nuggets »

how about

parm.other stufftext "pushmenu test_widget"

i can't test MP :(
hope this helps, prob not cos it's all foreign 2 me :-/
nuggets
General
Posts: 1006
Joined: Fri Feb 28, 2003 2:57 am
Location: U-england-K (england in the UK) :P
Contact:

Post by nuggets »

i'm hoping now but this sounds right

Code: Select all

parm.other stufftext "pushmenu_dm test_widget"
hope this helps, prob not cos it's all foreign 2 me :-/
User avatar
tltrude
Chuck Norris
Posts: 4774
Joined: Sun Jul 07, 2002 4:03 am
Location: Oklahoma, USA
Contact:

stufftext

Post by tltrude »

parm.other stufftext "pushmenu test_widget" ...seems to work, but haven't tried it with two players.

Bdbodger thinks that if we can get the buttons to activate triggers in the map, the server will know what button the client pushed. But I can't get the script to trigger a trigger_use!!!!!!!! I even put fakeplayer script_origins next to each trigger, but the triggers wont fire.

trigger $("fakeplayer" + level.floor_select) // no good
trigger $("f" + level.floor_select + "_trigger") // no good
$("fakeplayer" + level.floor_select) trigger $("f" + level.floor_select + "_trigger") // no good
etc, etc...

The triggers are named "f1_trigger" thru "f4_trigger" and the script_origins are named "fakeplayer1" thru "fakeplayer4". The fakeplayer entities are right next to their triggers and target them. The triggers work just fine when a player triggers them.

We need triggers on every floor to call the elevator anyway, but getting the ui buttons to fire them in the script is not working.
Tom Trude,

Image
User avatar
bdbodger
Moderator
Posts: 2596
Joined: Tue Feb 25, 2003 7:34 am
Location: canada
Contact:

Post by bdbodger »

No I guess this is a good idea for a single player game but no matter what you do the menu will always get the server cvar I think , even if the client uses the menu . If you want you can send me what you have and I can see what I can do if I have time .
Image
User avatar
bdbodger
Moderator
Posts: 2596
Joined: Tue Feb 25, 2003 7:34 am
Location: canada
Contact:

Post by bdbodger »

Well forget about what I said about your idea not working in multi player I got it to work . Not exactly as we where talking about though . What I did was use JV's morse code idea . I used the menu to do +use - use commands followed by a popmenu 0 and it worked . I think there may still be a lag issue with this but at least we got something to work . Thats the good part about haveing two computers you get to test stuff out online with yourself :)
Image
User avatar
tltrude
Chuck Norris
Posts: 4774
Joined: Sun Jul 07, 2002 4:03 am
Location: Oklahoma, USA
Contact:

test_buttons

Post by tltrude »

Here is a test map for the method bdbodger is talking about. It still has a small problem if the user closes the menu with his escape key and trys to reopen it--without walking away and coming back.

http://pages.sbcglobal.net/tltrude/Temp ... uttons.zip
Tom Trude,

Image
kai0ty
Brigadier General
Posts: 507
Joined: Fri Mar 19, 2004 1:45 am

Post by kai0ty »

heres a thought. how bout dling a copy of disolution 4. they use buttons and the server definitely doesnt know lol. u cud look at them, or even talk to virus or error if they wanna help.
There are only 10 kinds of people in this world; those who know what binary is, and those who don't.
User avatar
bdbodger
Moderator
Posts: 2596
Joined: Tue Feb 25, 2003 7:34 am
Location: canada
Contact:

Post by bdbodger »

Not sure what you mean . We want the server to know what menu button was pressed by the client .
Image
kai0ty
Brigadier General
Posts: 507
Joined: Fri Mar 19, 2004 1:45 am

Post by kai0ty »

lol that part was a joke. i really just meant it for the buttons to see how to set variables.
There are only 10 kinds of people in this world; those who know what binary is, and those who don't.
Gizmo
Corporal
Posts: 29
Joined: Thu Feb 12, 2004 7:57 am

Post by Gizmo »

Correct me if I'm wrong, but with this script, every player is checked on "sending a morse code signal"

Code: Select all

for(local.i=1;local.i<= $player.size;local.i++)
		{
			if($player[local.i].monitor != 1)
			$player[local.i] thread monitor
		}
That means, when someone manually pops the elevator menu, he can set the level.floor_select variable from anywhere in the map and therefore the destination of the elevator as soon as the trigger is pushed.

The person who pushes the elevator button will get the menu, but the elevator will also instantly move to the preset destination.

BTW: Nice work with the morse code stuff, seems useheld and fireheld can be used for multiple purphoses. I believe this way of work will be seen in many elevators from now on.

Greetingzzz...
Gizmo
User avatar
bdbodger
Moderator
Posts: 2596
Joined: Tue Feb 25, 2003 7:34 am
Location: canada
Contact:

Post by bdbodger »

Well gizmo I didn't want to say that out loud if you know what I mean :) this is more of an idea than anything else . There are ways to try and control that and the elevator won't do anything unless it stops moveing first . For example if you set the trigger that pops the menu open to activate the elevator for example that may help a bit . Maybe makeing sure a player is within a certain distance of one of the elevator triggers before that player can set the floor is another way .
Image
Post Reply