Team Spartan Cookies & Milk Forums
GUI interaction in a vehicle - Printable Version

+- Team Spartan Cookies & Milk Forums (https://teamscm.co.uk)
+-- Forum: Garry's Mod (https://teamscm.co.uk/forum-4.html)
+--- Forum: Expression 2 (https://teamscm.co.uk/forum-6.html)
+--- Thread: GUI interaction in a vehicle (/thread-2469.html)



GUI interaction in a vehicle - TheEnigma - 07-10-2017

After looking through google i haven't found a solution to this; I want to be able to use an EGP screen while inside a vehicle but it won't allow me and when i pressed e it just ejects me. I've tried using a pod controller and wiring "allow buttons" to 1 but it still doesnt work. Anyone know how to do this?


RE: GUI interaction in a vehicle - Kosmos - 07-10-2017

The pod controller has an input called "Lock", if the convar allows it you can use it to lock people inside vehicles, causing the E button to not eject them.
I'm fairly sure that's disabled though, because it is by default and I don't see why person would enable it.
So no, unless you have a special UI that allows using the mouse buttons you can't do what you want.


RE: GUI interaction in a vehicle - mariofludd - 08-10-2017

If you're talking about wire buttons, you need to left click, if you're talking about sf/egp buttons, try what kossy said


RE: GUI interaction in a vehicle - TheOneAndOnlyTee - 08-10-2017

if it's an E2? depending on the coder you'll want to look for something pointing to driver():keyUse() and switch that out for keyAttack1() iirc, fairly easy if they're using the same system that blackhawk's screens use.

otherwise if it's an SF it gets a little trickier because you'd have to switch out hooks to change the button used.


RE: GUI interaction in a vehicle - TheEnigma - 17-10-2017

I've tried doing that but for some reason it's less responsive than if "use" key is used. What I mean is that for example, mouse1 rarely works when pressing a button but "use" key always works.

I'm not sure if it's a bug or not


RE: GUI interaction in a vehicle - Kosmos - 17-10-2017

Are you saying the game prioritizes use (e.g. opening a door) over firing your weapon?
I'm sure it's a bug, but of course there's nothing I can do if you fail to provide code samples.
Side note: if you wire whatever button from your Pod Controller to the E2 you can avoid having to poll it once per tick, because the value change will trigger execution of the chip (which you can detect using "clk(<input>)").