python to control player rotation?
python to control player rotation?
Is it possible to use python to send data to change in-game player orientation (pitch, yaw and roll)? If so, is there an example of such thing?
Re: python to control player rotation?
Python is just another scripting language; if such would work with Python, it would also work with Perl, VBS or any other scripting language - Python has no special relationship to Unreal.
And manipulating Unreal's objects while it is running is possible by hooking system calls for example, but you need access to the computer where Unreal is running. But better ask a hacker for this. ^^
And manipulating Unreal's objects while it is running is possible by hooking system calls for example, but you need access to the computer where Unreal is running. But better ask a hacker for this. ^^
"Multiple exclamation marks," he went on, shaking his head, "are a sure sign of a diseased mind." --Terry Pratchett
Re: python to control player rotation?
It is possible to do this if you spawn a UDP / TCP receiver class to interpret the rotation calls.
- SilverSound
- Adept
- Posts: 344
- Joined: Fri Nov 06, 2015 10:12 am
- Personal rank: Curious
- Location: St. Cloud, Florida
Re: python to control player rotation?
Why would you need such a thing in the first place? I'm just curious.
"Woah what?! I wish I was recording that...."
- papercoffee
- Godlike
- Posts: 10447
- Joined: Wed Jul 15, 2009 11:36 am
- Personal rank: coffee addicted !!!
- Location: Cologne, the city with the big cathedral.
- Contact:
Re: python to control player rotation?
This↑SilverSound wrote:Why would you need such a thing in the first place? I'm just curious.
It sounds highly suspicious.
-
- Godlike
- Posts: 3774
- Joined: Fri Jan 14, 2011 1:53 pm
- Personal rank: -Retired-
Re: python to control player rotation?
I wouldn't jump too hard on OP for asking. There's a ton of things to be done with UEngine and a virtual reality headset (for example). UT's simplicity would allow a pretty easy connection to a VR rig.
I'm curious too Silver but probably for different reasons.
I'm curious too Silver but probably for different reasons.
So long, and thanks for all the fish
Re: python to control player rotation?
I am just trying to send rotation data from my android to control player orientation.
@schwap do you know where do I found more info about UDP / TCP integration?
@Barbie I thought in making python save a file containing the info I need in game, then, in game, I read the file contents every tick. But problems may occur when concurrent operations of write/read take place. Yes, I have control over client machine =D
@schwap do you know where do I found more info about UDP / TCP integration?
@Barbie I thought in making python save a file containing the info I need in game, then, in game, I read the file contents every tick. But problems may occur when concurrent operations of write/read take place. Yes, I have control over client machine =D
Re: python to control player rotation?
BTW, I am already passing data through web sockets over local address: 192.168.1.14:8000
Is there a way to Unreal capture the data direct from that address?
Is there a way to Unreal capture the data direct from that address?
- sektor2111
- Godlike
- Posts: 6410
- Joined: Sun May 09, 2010 6:15 pm
- Location: On the roof.
Re: python to control player rotation?
You can stop multiple posting withing 24 hours and do use EDIT button instead.
Re: python to control player rotation?
museeeii wrote: @schwap do you know where do I found more info about UDP / TCP integration?
The thing you're trying to do has been done already (external program to modify rotation) - and theres a neat example on BeyondUnreal by Matthieu29.
It is actually made for UT2003.. but I guess it'll work on UT99 just fine. (might need a few changes, didn't check)
-> https://wiki.beyondunreal.com/Legacy:UDP_Server_Sample <-
For more informations have a look at these classes:
- https://github.com/Slipyx/UT99/blob/mas ... UdpLink.uc
https://github.com/Slipyx/UT99/blob/mas ... TcpLink.uc
If you get it done, a video where you control the pawns rotation with your smartphone would be neat.
Re: python to control player rotation?
If the intention is using another device than keyboard and mouse for player control: why not using the existing interface? The VR controller could simply simulate mouse and keyboard events...
Transferring data though a file as interface is limited by mass storage speed and UScript's inability reading data from a file (except a corresponding INI file).museeeii wrote:I thought in making python save a file containing the info I need in game, then, in game, I read the file contents every tick.
"Multiple exclamation marks," he went on, shaking his head, "are a sure sign of a diseased mind." --Terry Pratchett
Re: python to control player rotation?
Thank you very much for your reply guys!
I am very excited because I just have done the script that rotates the player to a specified orientation, and its working! uhuu
@schwap thanks for the links. I will start read it after now. I will try to understand those uc files and try to implement it
I am very excited because I just have done the script that rotates the player to a specified orientation, and its working! uhuu
Sure I will post a video here to share with you guys. And the source code will be in my GitHub as well the Mutator for download.If you get it done, a video where you control the pawns rotation with your smartphone would be neat.
@schwap thanks for the links. I will start read it after now. I will try to understand those uc files and try to implement it
My real intention is to make a VR Cyberith treadmill-like platform for UT99, one you can walk, run, jump, turn, shot and so on.If the intention is using another device than keyboard and mouse for player control: why not using the existing interface? The VR controller could simply simulate mouse and keyboard events...
-
- Godlike
- Posts: 3774
- Joined: Fri Jan 14, 2011 1:53 pm
- Personal rank: -Retired-
Re: python to control player rotation?
And now I'm REALLY interested....
So long, and thanks for all the fish
- SilverSound
- Adept
- Posts: 344
- Joined: Fri Nov 06, 2015 10:12 am
- Personal rank: Curious
- Location: St. Cloud, Florida
Re: python to control player rotation?
That's amazing to think about isn't it? Just think about what it would look like to do BT with that sort of set up.JackGriffin wrote:And now I'm REALLY interested....
"Woah what?! I wish I was recording that...."
Re: python to control player rotation?
I finally did it folks!
Much thanks for @schwap to point me to a great UDP resource
Yes, the player is now controlled by my Android phone (only orientation so far) and the result was a great ... CRAP...
oh man, it is so frustrating
Just to get you know, I got two problems now:
The player rotation gets really laggy since the data is transfered through UDP socket. But I dont really know if it's because UDP. But the result of rotation in game happens only after a second or two;
The second problem is the camera being shaking, even if the phone is completely in rest over the table. Looks like the player got Parkinson's
I am using the magnetometer (Compass) to capture Android orientation and it is always oscilating from a range up to 10 degrees. I know I can try to smooth these oscilations but...
Much thanks for @schwap to point me to a great UDP resource
Yes, the player is now controlled by my Android phone (only orientation so far) and the result was a great ... CRAP...
oh man, it is so frustrating
Just to get you know, I got two problems now:
The player rotation gets really laggy since the data is transfered through UDP socket. But I dont really know if it's because UDP. But the result of rotation in game happens only after a second or two;
The second problem is the camera being shaking, even if the phone is completely in rest over the table. Looks like the player got Parkinson's
I am using the magnetometer (Compass) to capture Android orientation and it is always oscilating from a range up to 10 degrees. I know I can try to smooth these oscilations but...