PlayerPawn input grabbing?
- Saya-chan
- Adept
- Posts: 446
- Joined: Mon Jun 02, 2008 10:46 am
- Personal rank: Former UT99 modder
- Location: Vigo, Galicia
- Contact:
PlayerPawn input grabbing?
So I'm here making some new mutator that does special actions based on the keyboard & mouse input from the player, and, besides having some other problems, I can't grab player input through the typical 'getting the values of Axis variables on PlayerPawn or the states of bPressedJump or bDuck' (bDuck works, though). Is there any real way to check if player is pressing forward/backward keys or looking around (Or even getting ANY of the inputs from keyboard & mouse)?
I know you can get key presses and stuff directly in a Console object, though...
I know you can get key presses and stuff directly in a Console object, though...
~♥~ Bless the Cute Emperor ~♥~
- Saya-chan
- Adept
- Posts: 446
- Joined: Mon Jun 02, 2008 10:46 am
- Personal rank: Former UT99 modder
- Location: Vigo, Galicia
- Contact:
Re: PlayerPawn input grabbing?
Uhm... Wouldn't that actually require to replace all the previous bindings for player movement? (so, for example, pressing Forward key would call 'MoveForward|Mutate MovedForward', or something like that)
~♥~ Bless the Cute Emperor ~♥~
Re: PlayerPawn input grabbing?
I don't know if it'd work like that, since mutate can't have "autofire" I guess.
The main problem of input is that most is processed client-side, so I guess that those thing can be checked if you put an item that reads these inside a client-side only function ( netmod != dedicated ).
Some of them I use easily, like the bduck, I guess it just works fine even without it.
I still have to improve these stuff, so I'd gladly be looking for an alternate answer as well.
The main problem of input is that most is processed client-side, so I guess that those thing can be checked if you put an item that reads these inside a client-side only function ( netmod != dedicated ).
Some of them I use easily, like the bduck, I guess it just works fine even without it.
I still have to improve these stuff, so I'd gladly be looking for an alternate answer as well.
Re: PlayerPawn input grabbing?
I believe what you seach for is covered pretty good in this topic: http://wiki.beyondunreal.com/Legacy:Key ... teractions
Retired.
- Saya-chan
- Adept
- Posts: 446
- Joined: Mon Jun 02, 2008 10:46 am
- Personal rank: Former UT99 modder
- Location: Vigo, Galicia
- Contact:
Re: PlayerPawn input grabbing?
@TheDane: Then I think this function might help.
And to make 'button-like' commands it should be "<SomeCommand>|OnRelease <SomeCommand>" AFAIK.
Code: Select all
function int AttachCommand(string Key, string Command)
{
local string temp, temp2;
temp = ConsoleCommand("get input"@Key);
if ( Left(Temp,21) ~= "Unrecognized property" )
return -1;
if ( Left(Temp,Len(Command)) ~= Command )
return 0;
temp2 = ConsoleCommand("set input"@Key@Command$"|"$temp);
if ( Left(Temp,21) ~= "Unrecognized property" )
return -1;
return 1;
}
~♥~ Bless the Cute Emperor ~♥~
Re: PlayerPawn input grabbing?
Interaction is not available in UEngine 1.0. If you want to grab player input using uscript you need to replace the console or the hud (not 100% sure about the latter, you should check it yourself). Mutators CAN read the state of certain keys by checking the bFire, bAltFire, ... values in the playerpawn object. Keep in mind that a serverside method is in no way reliable though because it suffers from latency and network congestion.
- Saya-chan
- Adept
- Posts: 446
- Joined: Mon Jun 02, 2008 10:46 am
- Personal rank: Former UT99 modder
- Location: Vigo, Galicia
- Contact:
Re: PlayerPawn input grabbing?
Hmm, yes. I thought now of writing a new console object, since I just investigated a bit and input variables only work on the playerpawn, not on inventory items, unlike exec functions. Obviously, changing the HUD is indeed not reliable, as it would require making different versions of the same HUD for all GameTypes (and would make mods that change the HUD incompatible). Now, how can I replace the console object of a player in-game?
Oh, and all my mods are only clientside. Replication coding simply just can't get into my head.
Oh, and all my mods are only clientside. Replication coding simply just can't get into my head.
~♥~ Bless the Cute Emperor ~♥~
Re: PlayerPawn input grabbing?
Take a look at the CSHP4+ sourcecode or the XConsole source (not sure if the latter is available). Either way, it's not an easy job.
- Saya-chan
- Adept
- Posts: 446
- Joined: Mon Jun 02, 2008 10:46 am
- Personal rank: Former UT99 modder
- Location: Vigo, Galicia
- Contact:
Re: PlayerPawn input grabbing?
CSHP4+ has what I want, it does replace the console at run-time. XConsole, though, requires you to select the console on advanced options. Thanks for your help, now I'll get back to work.
~♥~ Bless the Cute Emperor ~♥~
Re: PlayerPawn input grabbing?
Or you could replace the Console value under [Engine.Engine]. Another runtime possibility is to "hook" the console. Replace it with a wrapper that only modifies the functions you need and redirects everything else to the original console. It's not that hard to do and it has little side effects (unless you're going to do that during online play on a server with UTPure).
Re: PlayerPawn input grabbing?
Well I'm not sure what your goal is but XConsole does work with UTPure
- Saya-chan
- Adept
- Posts: 446
- Joined: Mon Jun 02, 2008 10:46 am
- Personal rank: Former UT99 modder
- Location: Vigo, Galicia
- Contact:
Re: PlayerPawn input grabbing?
Hmmm, I've done the hook thingy. Now I just have to find out why when I press Esc the screen just goes white, or why can't I access the console window at all.
Edit: Forget it, I fixed that. The whole thing is getting real now. Bad thing is it depends on some functions that prevent it from ever becoming net-compatible.
Edit: Forget it, I fixed that. The whole thing is getting real now. Bad thing is it depends on some functions that prevent it from ever becoming net-compatible.
~♥~ Bless the Cute Emperor ~♥~