Tuesday, March 19, 2013
Researching and GameType Scripting
This week I was doing some more researching to start my UnrealScript portion for the game. We have assigned the major tasks to each individual person for our statement of work, but still need to clarify some additional tasks. I'm in charge of the game type, player controller, and the game play programming. There are many concepts that I want to be careful about when implementing. This is the first type that I am programming with an iOS device, so there are many concepts that I want to make sure are applied correctly like the camera implementation and game type class. I visited the the UDK forums constantly over the week and have looked in many documentations like the UDN Mobile Input System.
I also looked at the Camera Technical Guide for help on how to set up the camera. I know our camera needs to be in a fixed position, but we are not sure if we are displaying the entire level or only parts of it for the view.
What I did notice is that many things have changed with the iOS programming from when I did some exercises before using the Beginning iOS 3D Unreal Games Development book. The mobile aspect of UDK is more integrated now into UDK itself as a whole instead of a separate entity now. Some variables types have changed or have just been omitted. The following function deciphers the user's input.
function bool SwipeZoneCallback(MobileInputZone Zone, float DeltaTime, int Handle, ETouchType EventType, Vector2D TouchLocation)
{
local bool retVal;
local Actor PickedActor;
local Vector HitLocation;
local TraceHitInfo HitInfo;
retVal = true;
if (EventType == Touch_Began)
{
// if screen touched then pick actor
PickedActor = PickActor(TouchLocation, HitLocation, HitInfo);
// Display coordinates of user touch and if actor selected
WorldInfo.Game.Broadcast(self, "TouchLocationX = " @ TouchLocation.X @ "TouchLocationY = " @ TouchLocation.Y);
WorldInfo.Game.Broadcast(self, "PICKED ACTOR = " @ PickedActor @ ", HitLocation = " @ HitLocation @ ", Zone Touched = " @ Zone);
}
/*else if (EventType == ZoneEvent_Update)
{
}
else if (EventType == ZoneEvent_UnTouch)
{
}*/
return retVal;
}
In the example above, the "ETouchType" variable was a new thing for me. For the longest time, I was trying to make this function work and discovered that the variable I was using no longer existed. Instead the set up was changed to how you see it above.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment