View Full Version : Swipe event
Xander112
12-20-2010, 08:54 PM
Hey everybody,
I have been trying to get mobile input events using unrealscript, i have managed a simple touch using the MobileMenuScene but I dont see how i can catch a swipe event. Anybody have an idea how to do this?
Greetings,
Xander
Revlite
12-21-2010, 05:19 PM
Same question D:
Is it only possible to register the swiping with KISMET or is it possible by code?
ffejnosliw
12-21-2010, 05:41 PM
Swipes can be registered with a trackball input zone. These can be hooked up to keybinds that drive properties. This is how the non-joystick controlled looking in EpicCitadel is done.
Or, you can use the OnInputTouch delegate in MobilePlayerInput to handle the input anyway you want.
delegate OnInputTouch(int Handle, EZoneTouchEvent Type, Vector2D TouchLocation, float DeviceTimestamp);
With that, you need to write your own logic for registering the input events, but it is certainly possible to detect swipes with the information provided.
Xander112
12-21-2010, 05:43 PM
Ok, I have found that delegate. Maybe a noob question but how to I use that delegate, if tried the following but that doesnt work:
event OnInputTouch(int Handle, EzoneTouchEvent Type, Vector2D TouchLocation, float DeviceTimestamp){
`log("Touched: X: " $ TouchLocation.X $ ", Y: " $ TouchLocation.Y $ "EventType: " $ Type $ ", TimeStamp: " $ DeviceTimestamp);
}
ffejnosliw
12-21-2010, 05:46 PM
Lots of info on how to use delegates:
http://udn.epicgames.com/Three/UnrealScriptDelegates.html
http://udn.epicgames.com/Three/MasteringUnrealScriptDelegates.html
Xander112
12-21-2010, 06:34 PM
ok i read those but i still dont totaly get it. So delegate OnInputTouch in not like an event that gets called when you touch your ipad. I have a class extending MobilePlayerInput and i want a function to be executed when somebody touches the screen so i can get the touch location. If i look at the delegates examples you just gave me it appears to me that is a like a function not an event.
Blade[UG]
12-21-2010, 06:39 PM
I think you want to do
function InputTouch(int Handle, EzoneTouchEvent Type, Vector2D TouchLocation, float DeviceTimestamp)
{
`log("Touched: X: " $ TouchLocation.X $ ", Y: " $ TouchLocation.Y $ "EventType: " $ Type $ ", TimeStamp: " $ DeviceTimestamp)
}
event Initialized()
{
OnInputTouch = InputTouch;
}
Xander112
12-21-2010, 06:48 PM
Yes that is what i would want, but its not working yet, this should also work with the mouse clicks while testing on a pc right?
ffejnosliw
12-21-2010, 07:15 PM
Yes, the mouse should register as touch input, at least when you run the Mobile Previewer.
deacis
01-27-2011, 05:44 PM
Does anyone know how to set this up? In Kismet -new even - Mobile Simple Swipe? Even a simple screen capture of the set up would be great!
Thanks
ffejnosliw
01-27-2011, 06:46 PM
How to set what up exactly? There is an example of using that event to do simple player movement here:
http://udn.epicgames.com/Three/MobileInputSystem.html#Handling Kismet Touch Input Events
I setup a top down game similar to jazz example (controls and camera) and added the swipe to get my pawn to move in the Z direction (up and down).
I followed the mobileinput tech info from epic... it looks like the attached image at the bottom of this post
hopefully that helps... it is pretty much the same as theirs except maybe altered to affect the z coordinate.
and yes i can mouse swipe up and down for testing purposes in the mobile previewer, and I didn't alter any script.
deacis
01-29-2011, 06:02 PM
Hey Guys! Thanks a ton! I totally missed the link of that stuff ffejnosliw! And Thanks also
m00t! You guys rule! If you have time I made another post about anim trees and using the right and left sticks for aiming poses. I made a recent post for tutorial -deacis. Would appreciate it if you could possibly point me in the right direction there also. I am having a blast with this stuff.
Cheers!! DM
Insipidus
04-08-2011, 04:05 PM
I had a question for those in this thread (and others of course), if anyone had a moment. I am trying to do just a simple "up" swipe in the z-direction in UDK Mobile utilizing kismet. I've followed both examples given by ffejnosliw and m00t, and I cannot get the desired result.
For ffejnosliw's example, I can get a swipe up, but the object also moves in the 'x' direction, seemingly due to the 'X Float' in the example, and it just stays in the air at it's final location. Gravity does not pull the object back down.
For m00t's example, I cannot get anything to work at all. I've even incorporated the "down swipe" as well, just like in m00t's example, but nothing seems to work. Not sure why.
The only differences that I have with each kismet setup are that I'm just extending from the "swipe up" node on Mobile Simple Swipes instead of every node in ffejnosliw's example and both the swipe up and swipe down nodes in m00t's example. I am also trying it with a mobile placeable pawn, but I've also tried with a static mesh and have had no luck.
Finally, if you notice the Mobile Simple Swipes in March UDK Mobile has seemed to have lost a couple nodes. Not sure if there's something in there that I'm missing. Oh, and I changed floats around to represent 'Z' instead of 'X', since that is the desired swipe direction, but that didn't seem to help much either.
Curious if anyone else is having the issues I am? I am getting reads/comments on screen all the way through my kismet setups and I've tried to alter collision settings (BlockAll, TouchAll, etc.) as well. Maybe fresh eyes might see something I've missed or someone else has had success with the newest beta.
Thanks in advance to anyone that might have some input.
PS - Shot_01 attachment is following ffejnosliw's example and Shot_02 attachment is following m00t's.
definitely works for me, I still have that incorporated. I did notice as difference, my tolerance is set to 60, and my min distance also has a value of 60. also I have that other float connected through the downswipe - i'm sure you know that and have it disconnected just for presentation here. Also my delay is a result of right clicking on the output node of the simpleswipes - not a standalone delay.
my mobile simple swipes does look different than yours though seems I have more lower nodes (touch location x, touch location y, and timestamp).
i'm also player only checked, and have it routed through a mobileplaceable pawn, as you can imagine I use it for my object that goes upwards (; it has worked routing through a vehicle as well.
i'm not sure why you would have trouble with it. I should mention that i'm somewhat set up in a jazz-jackrabbit fashion so maybe in a 1st person view or something it may not work as such(?)
I had a question for those in this thread (and others of course), if anyone had a moment. I am trying to do just a simple "up" swipe in the z-direction in UDK Mobile utilizing kismet. I've followed both examples given by ffejnosliw and m00t, and I cannot get the desired result.
For ffejnosliw's example, I can get a swipe up, but the object also moves in the 'x' direction, seemingly due to the 'X Float' in the example, and it just stays in the air at it's final location. Gravity does not pull the object back down.
For m00t's example, I cannot get anything to work at all. I've even incorporated the "down swipe" as well, just like in m00t's example, but nothing seems to work. Not sure why.
The only differences that I have with each kismet setup are that I'm just extending from the "swipe up" node on Mobile Simple Swipes instead of every node in ffejnosliw's example and both the swipe up and swipe down nodes in m00t's example. I am also trying it with a mobile placeable pawn, but I've also tried with a static mesh and have had no luck.
Finally, if you notice the Mobile Simple Swipes in March UDK Mobile has seemed to have lost a couple nodes. Not sure if there's something in there that I'm missing. Oh, and I changed floats around to represent 'Z' instead of 'X', since that is the desired swipe direction, but that didn't seem to help much either.
Curious if anyone else is having the issues I am? I am getting reads/comments on screen all the way through my kismet setups and I've tried to alter collision settings (BlockAll, TouchAll, etc.) as well. Maybe fresh eyes might see something I've missed or someone else has had success with the newest beta.
Thanks in advance to anyone that might have some input.
PS - Shot_01 attachment is following ffejnosliw's example and Shot_02 attachment is following m00t's.
Insipidus
04-08-2011, 10:21 PM
Yeah, I'm really not sure. I think it might be like you said, because Jazz is somewhat a "top down" view, where what I'm trying to accomplish is more of a first person camera view. I could rotate everything and see if it'd work, but then I'd have to mess with gravity and whatnot. I wasn't getting any response from your setup though m00t. No idea why.
Just for testing purposes, I was able to implement a button press to get the desired movement, but it's not what I want as an end result. Hopefully someone can figure out what I've done incorrectly here.
m00t, have you brought this into March's UDK? I don't think that's the issue, but it may be (for whatever reason). Man, all I want to do is one simple swipe up in the z direction, and I can't even do that :/
yeah I generally port everything over with each build (get's tiring ... but who could resist the march build :P)
I imagine your problem lies with the 1st person view and camera system for that (in that you are for lack of a better description the camera system!). that setup seems to be uniquely different than the 3rd person driving a mobileplaceablepawn. I really wish I understood more of the differences. a few weeks back people were going batty over a good 3rd person camera system that i'm not sure ever got solved, I know somebody shared a good deal of code towards that effort though.
if you are in 1st person you wouldn't be driving a mobileplaceablepawn would you? so I would say that would be where your control issues are. you'd have to look in the uc's and see what is being driven by the ubersticklookzone and uberstickmovezone in those default maps, and link your z-swipes up to that rather than the MpP.
i'm still pretty newb to this stuff, so hopefully solid snake or some guru pops by for ya.
ffejnosliw
04-09-2011, 12:50 AM
I wasn't able to actually gather what it is you are trying to do. Maybe you could explain it in more detail, perhaps with some images.
Insipidus
04-09-2011, 01:55 AM
I'm still pretty new with everything too, m00t. I think you're right though. The setup does seem to be used for a view that is from above. But I could be wrong of course. The way I implemented it, which was following the examples that were given, seems to only affect the X and Y axis. I tried to change it to the Z axis, but it didn't work. Sure I did something wrong or missed a step. I'm going to mess around with kismet a little bit longer, but I might go at it in code just because. It'd probably be better in code in the long run anyway.
ffejnosliw, all I'm attempting to do is use kismet to do a swipe that moves a character and/or an object in the positive z direction. I've attached a pic of Jazz to show you. After the swipe, I'd prefer for him to fall back down due to gravity. Kind of as if he's hopping in place. I've done this with a button, but I don't feel that it's ideal and would prefer a swipe action. I would also prefer it if the "swipee" if you will couldn't hold Jazz in the air, but could only swipe him up and once he hit his height limit, he began to fall back down. Only when he hit the ground again, could he be swiped back up into the air. Hopefully this helps explain what I'm trying to do, but please don't hesitate to ask more questions if it's still too vague.
Thank you guys for the help and input. Trudging through this is bumpy at times, so I really appreciate everything :)
Powered by vBulletin® Version 4.2.0 Copyright © 2013 vBulletin Solutions, Inc. All rights reserved.