<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">

<channel>
	<title>All is Game</title>
	
	<link>http://okita.com/alex</link>
	<description>Philosophy is a game with objectives and no rules. Mathematics is a game with rules and no objectives.</description>
	<lastBuildDate>Tue, 07 Sep 2010 00:01:13 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/AllIsGame" /><feedburner:info uri="allisgame" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><item>
		<title>a bit of conversion.</title>
		<link>http://feedproxy.google.com/~r/AllIsGame/~3/PMvQZzodfQ0/</link>
		<comments>http://okita.com/alex/?p=826#comments</comments>
		<pubDate>Tue, 07 Sep 2010 00:01:13 +0000</pubDate>
		<dc:creator>alexokita</dc:creator>
				<category><![CDATA[Game Design]]></category>
		<category><![CDATA[News]]></category>

		<guid isPermaLink="false">http://okita.com/alex/?p=826</guid>
		<description><![CDATA[So today it took me a few minutes to figure this out, but I thought I&#8217;d share. I wanted to get the Joystick X and Y and turn them into an angle for Unreal, which meant turning it into a rotator value. To do that I take aStrafe and aBaseY and turn them into something [...]]]></description>
			<content:encoded><![CDATA[<p>So today it took me a few minutes to figure this out, but I thought I&#8217;d share.<br />
I wanted to get the Joystick X and Y and turn them into an angle for Unreal, which meant turning it into a rotator value.<br />
To do that I take aStrafe and aBaseY and turn them into something i can read.</p>
<p>	LeftJoyX = aStrafe;<br />
	LeftJoyY = aBaseY;</p>
<p>Like so then I want to use atan2</p>
<p>	MyRadian = Atan2(LeftJoyX,LeftJoyY);</p>
<p>This will give me a radian valuem which is a float. But radians are between 0 and 3.1415 or Pi. To turn this into a number i can use for a rotator I need to convert it into a large int.</p>
<p>	MyYaw = MyRadian * 32768 / PI;</p>
<p>MyYaw is an int which i can then use for setting a rotator like this</p>
<p>	MyRotator.Yaw = MyYaw;</p>
<p>So then I cna just do something like</p>
<p>	MyMesh.SetRotation(MyRotator);</p>
<p>Now MyMesh will be turned in the direction i push the joystick in, Yay!</p>
<img src="http://feeds.feedburner.com/~r/AllIsGame/~4/PMvQZzodfQ0" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://okita.com/alex/?feed=rss2&amp;p=826</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://okita.com/alex/?p=826</feedburner:origLink></item>
		<item>
		<title>Working on some personal kinect projects</title>
		<link>http://feedproxy.google.com/~r/AllIsGame/~3/qWVW2HGyumU/</link>
		<comments>http://okita.com/alex/?p=824#comments</comments>
		<pubDate>Sun, 05 Sep 2010 23:06:51 +0000</pubDate>
		<dc:creator>alexokita</dc:creator>
				<category><![CDATA[Game Design]]></category>
		<category><![CDATA[News]]></category>
		<category><![CDATA[Photoblog]]></category>

		<guid isPermaLink="false">http://okita.com/alex/?p=824</guid>
		<description><![CDATA[Sitting at a coffee shop setting up a project in unreal. Ill be using a regular xbox dpad to test each limb one at a time. When i get to my camera at work ill be able to test with a full skeleton.]]></description>
			<content:encoded><![CDATA[<p><img style="display:block;margin-right:auto;margin-left:auto;" alt="image" src="http://okita.com/alex/wp-content/uploads/2010/09/wpid-wp-1283727958689.jpg" /></p>
<p>Sitting at a coffee shop setting up a project in unreal. Ill be using a regular xbox dpad to test each limb one at a time. When i get to my camera at work ill be able to test with a full skeleton.</p>
<img src="http://feeds.feedburner.com/~r/AllIsGame/~4/qWVW2HGyumU" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://okita.com/alex/?feed=rss2&amp;p=824</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://okita.com/alex/?p=824</feedburner:origLink></item>
		<item>
		<title>The courtyard at my office</title>
		<link>http://feedproxy.google.com/~r/AllIsGame/~3/LbcwIRLlP8Q/</link>
		<comments>http://okita.com/alex/?p=822#comments</comments>
		<pubDate>Wed, 25 Aug 2010 22:47:39 +0000</pubDate>
		<dc:creator>alexokita</dc:creator>
				<category><![CDATA[Art]]></category>

		<guid isPermaLink="false">http://okita.com/alex/?p=822</guid>
		<description><![CDATA[Sitting outside thinking about code&#8230;]]></description>
			<content:encoded><![CDATA[<p><img style="display:block;margin-right:auto;margin-left:auto;" alt="image" src="http://okita.com/alex/wp-content/uploads/2010/08/wpid-wp-1282776405867.jpg" /></p>
<p>Sitting outside thinking about code&#8230;</p>
<img src="http://feeds.feedburner.com/~r/AllIsGame/~4/LbcwIRLlP8Q" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://okita.com/alex/?feed=rss2&amp;p=822</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://okita.com/alex/?p=822</feedburner:origLink></item>
		<item>
		<title>My controller at work</title>
		<link>http://feedproxy.google.com/~r/AllIsGame/~3/fDx4DXveUqE/</link>
		<comments>http://okita.com/alex/?p=819#comments</comments>
		<pubDate>Tue, 24 Aug 2010 23:07:44 +0000</pubDate>
		<dc:creator>alexokita</dc:creator>
				<category><![CDATA[Art]]></category>
		<category><![CDATA[android]]></category>

		<guid isPermaLink="false">http://okita.com/alex/?p=819</guid>
		<description><![CDATA[Wee fun with android!]]></description>
			<content:encoded><![CDATA[<p><img style="display:block;margin-right:auto;margin-left:auto;" alt="image" src="http://okita.com/alex/wp-content/uploads/2010/08/wpid-wp-1282691223351.jpg" /></p>
<p>
<p>Wee fun with android!</p>
<p></p>
<img src="http://feeds.feedburner.com/~r/AllIsGame/~4/fDx4DXveUqE" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://okita.com/alex/?feed=rss2&amp;p=819</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://okita.com/alex/?p=819</feedburner:origLink></item>
		<item>
		<title>E3 this year was amazing. Kinect vs. Move vs. Everything else.</title>
		<link>http://feedproxy.google.com/~r/AllIsGame/~3/ub6B5J3K_qk/</link>
		<comments>http://okita.com/alex/?p=813#comments</comments>
		<pubDate>Sun, 20 Jun 2010 02:37:50 +0000</pubDate>
		<dc:creator>alexokita</dc:creator>
				<category><![CDATA[Game Design]]></category>
		<category><![CDATA[News]]></category>

		<guid isPermaLink="false">http://okita.com/alex/?p=813</guid>
		<description><![CDATA[I&#8217;ll be posting a few photos later on. but really, this year was quite an interesting convergence of the hardcore gamer, and the casual gamer. Looks like hardcore gamers love to hate the casual gamer. As seen on some forums, a lot of the consensus from the hardcore seem to really think that microsoft &#8220;lost&#8221; [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ll be posting a few photos later on. but really, this year was quite an interesting convergence of the hardcore gamer, and the casual gamer. Looks like hardcore gamers love to hate the casual gamer.</p>
<p>As seen on some forums, a lot of the consensus from the hardcore seem to really think that microsoft &#8220;lost&#8221; E3 with crappy lame games and a stupid device (natal/kinect) Sony seems to come up in a tie with Nintendo, both boasting lots of 3D and lots of high quality high production valued titles. But honestly, I see microsoft coming out on top, and here&#8217;s why.</p>
<p>Nintendo&#8217;s audience expanded into the family circle with wii sports, grandparents finally got into the fray with wii bowling and the user interface with the wiimote was obvious in a way that made it accessible to the non hardcore gamer audience, the seniors and older parent audience.</p>
<p>With Kinect, we&#8217;re seeing an even more easily accessible interface device, and now you don&#8217;t even need to hold a remote. Of course this depends on the games made for natal, but everyone knows how to lean, jump, and run in place. Sure the hardcore gamers are already asking if Kinect will work if you&#8217;re sitting on a couch, but that&#8217;s missing the point.</p>
<p>The hardcore gamer is expecting to play street fighter, call of duty, and devil may cry type games using Kinect. Contrast this with the audience this device is perfect for. Your grand parents aren&#8217;t going to play any of those, as a matter of fact they probably resent those games. How does this mean microsoft is doing the right thing with Kinect, and sony is missing out?</p>
<p>Games like farmville, mafia wars and others are pinned in the middle of the casual game market, and they make more money than Killzone, Heavy Rain, or Borderlands, three large production, high expense, high quality games. I&#8217;m not advocating that these games aren&#8217;t worth while titles to invest production dollars into, on the contrary. Heavy Rain introduced the hardcore gamer to story. Killzone shows us more detail than most any other title. Borderlands allows the gamer to roam freely and still have fun basically getting nothing accomplished, but these are things that only the hardcore can appreciate.</p>
<p>The hardcore gamer is a narrow but avid and vocal audience. Once a gamer, you&#8217;re already sold on getting new games based on what&#8217;s on gametrailers.com, and thus will continue to buy and talk about whats coming out. But the Farmville audience doesn&#8217;t know about Kotaku or Joystiq. They don&#8217;t care, as dumbfounding as that might seem, they don&#8217;t know why there is a debate between keyboard and mouse vs. d-pad (im keyboard mouse myself, im old school, and use my laptop for more than writing about games)</p>
<p>Microsoft has expanded their audience several fold by releasing the Kinect. Some humbling numbers, undeniably the wii is a more casual device with nearly 72 million units sold and nearly 500 million games sold they&#8217;re doing rather well. The XBox 360, till now is much more of a core gaming unit, with about 40 million units sold but the audience buys a lot of games at 350 million games sold. Xbox wants to expand into the casual audience. Sure the core gamer buys more games, but adding a new device to grab a wider audience is not a losing proposition.</p>
<p>Here&#8217;s why Sony&#8217;s move isn&#8217;t going to do well against the Kinect. Strangely enough because it&#8217;s more accurate than the Kinect, but not as accurate as a d-pad. It&#8217;s a cool device, and for me I&#8217;m more interested in making games for the Move than the Kinect because it&#8217;s a more hardcore device, but that&#8217;s also its folly.</p>
<p>The move *is* meant for hard-core games, it&#8217;s great for swinging around a sword, it&#8217;s great for aiming a gun, and it&#8217;s great for throwing punches, three things that your grand parents aren&#8217;t interested in. But once in a game, many of the core gaming audience is going to be slow to throw out their halo controls. They&#8217;ve invested many hours in mastering the setup, and most will find that they are more accurate with head-shots with the d-pad than the move.</p>
<p>Now it&#8217;s d-pad vs move vs keyboard/mouse, I&#8217;m leaving out the wiimote and kinect on purpose, they&#8217;re not going to be in that fight since thats not where they&#8217;re supposed to be. Microsoft expanded their market and will overlap with the wii market, good for them. Sony is going to stay right where they are, they might expand a bit because it&#8217;s a cool device, but nothing major.</p>
<p>The only change left is for the Wii to release a super console, something that can shove a billion triangles per frame, more memory than google, and is faster than a Ferrari Enzo. But will they? Do they need to? NO. That would be a move toward the hardcore audience which isn&#8217;t nearly as profitable as where they currently exist.</p>
<p>This was an interesting E3, I saw lots of fun things, and a rather defined distinction between audiences and what each one gets excited about. I&#8217;m excited about both, easier to play games that are fun and accessible, as well as super crazy graphics with ridiculous characters and super powers. Looks like i&#8217;ll get both, but I&#8217;ll have to buy a lot more titles and new hardware.</p>
<img src="http://feeds.feedburner.com/~r/AllIsGame/~4/ub6B5J3K_qk" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://okita.com/alex/?feed=rss2&amp;p=813</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://okita.com/alex/?p=813</feedburner:origLink></item>
		<item>
		<title>whoops.</title>
		<link>http://feedproxy.google.com/~r/AllIsGame/~3/DBY6GlBBiNg/</link>
		<comments>http://okita.com/alex/?p=812#comments</comments>
		<pubDate>Mon, 07 Jun 2010 00:25:41 +0000</pubDate>
		<dc:creator>alexokita</dc:creator>
				<category><![CDATA[News]]></category>
		<category><![CDATA[drupal]]></category>

		<guid isPermaLink="false">http://okita.com/alex/?p=812</guid>
		<description><![CDATA[Looks like drupal upgrades arent one-click ready. just horked my entire drupal test site]]></description>
			<content:encoded><![CDATA[<p>Looks like drupal upgrades arent one-click ready. just horked my entire drupal test site</p>
<img src="http://feeds.feedburner.com/~r/AllIsGame/~4/DBY6GlBBiNg" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://okita.com/alex/?feed=rss2&amp;p=812</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://okita.com/alex/?p=812</feedburner:origLink></item>
		<item>
		<title>Some site updates.</title>
		<link>http://feedproxy.google.com/~r/AllIsGame/~3/uglUWEmqhHM/</link>
		<comments>http://okita.com/alex/?p=809#comments</comments>
		<pubDate>Sun, 25 Apr 2010 09:19:07 +0000</pubDate>
		<dc:creator>alexokita</dc:creator>
				<category><![CDATA[News]]></category>

		<guid isPermaLink="false">http://okita.com/alex/?p=809</guid>
		<description><![CDATA[okay, so the word f@c3B00k tends to attract spam. damnit. anyway, if you&#8217;re really concerned and need to get in touch with me, for whatever reason. just ping me on twitter, i promise i&#8217;ll be more responsive. I just tested new user registration, my mail server might be getting filtered, so check your spam folder [...]]]></description>
			<content:encoded><![CDATA[<p>okay, so the word f@c3B00k tends to attract spam. damnit.</p>
<p>anyway, if you&#8217;re really concerned and need to get in touch with me, for whatever reason. just ping me on twitter, i promise i&#8217;ll be more responsive.</p>
<p>I just tested new user registration, my mail server might be getting filtered, so check your spam folder for a password once its sent to your email address. once you get the new password your comments will be pending approval, but I&#8217;ll get them, so any questions, ask away!!!</p>
<img src="http://feeds.feedburner.com/~r/AllIsGame/~4/uglUWEmqhHM" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://okita.com/alex/?feed=rss2&amp;p=809</wfw:commentRss>
		<slash:comments>2</slash:comments>
		<feedburner:origLink>http://okita.com/alex/?p=809</feedburner:origLink></item>
		<item>
		<title>StaticMesh, the hard way, just to do some learning.</title>
		<link>http://feedproxy.google.com/~r/AllIsGame/~3/DOZ62NBcXac/</link>
		<comments>http://okita.com/alex/?p=799#comments</comments>
		<pubDate>Sun, 18 Apr 2010 23:33:37 +0000</pubDate>
		<dc:creator>alexokita</dc:creator>
				<category><![CDATA[Learning UnrealScript]]></category>
		<category><![CDATA[News]]></category>
		<category><![CDATA[Unrealscript]]></category>
		<category><![CDATA[tutorials]]></category>
		<category><![CDATA[UDK]]></category>

		<guid isPermaLink="false">http://okita.com/alex/?p=799</guid>
		<description><![CDATA[In unreal script there&#8217;s the defaultproperties where you can use Begin Object and then Components.Add(someObject). What is that doing exactly? lets do some stuff the hard way just to see how we can make our objects more dynamic. In a previous tutorial I created a MyActor.uc file with you, and in there we had Begin [...]]]></description>
			<content:encoded><![CDATA[<p>In unreal script there&#8217;s the defaultproperties where you can use Begin Object and then Components.Add(someObject). What is that doing exactly?</p>
<p>lets do some stuff the hard way just to see how we can make our objects more dynamic.</p>
<p>In a previous tutorial I created a MyActor.uc file with you, and in there we had Begin Object in there that created a mesh object and added it to the actor. How else can we do the same thing? lets see using the &#8220;new&#8221; command.</p>
<pre class="brush:java">
class MyActor extends actor
	placeable;

var StaticMeshComponent SMeshComponent;

event PostBeginPlay()
{
	super.PostBeginPlay();

	SMeshComponent = new(self) class'StaticMeshComponent';
	SMeshComponent.SetStaticMesh(StaticMesh'MyObjects.Meshes.MyStaticMesh');
	AttachComponent(SMeshComponent);
}

defaultproperties
{
}
</pre>
<p>Notice that there&#8217;s nothing in the default properties, this is because we&#8217;ve created the mesh in the PostBeginPlay() function. We started by adding a var to the class caled SMeshComponent, which is a StaticMeshComponent type object. To make use of this we fill in the variable in memory with a &#8220;new(self) class&#8217;StaticMeshComponent&#8217;&#8221; this is cool in a number of ways. First, it&#8217;s a new object for &#8220;self&#8221; the &#8220;self&#8221; keyword is a reference to the class that created it. Important because when this class is destroyed the new mesh will know that its parent is the class that created it. Second we now have control over the contents of that variable, and we can manipulate it in a few basic ways.</p>
<p>Comething Creative</p>
<p>Lets add two new variable types, a bool, and a couple of StaticMeshes, and a float for a timer.<br />
our vars should now look like this:</p>
<pre class="brush:java">
var StaticMeshComponent SMeshComponent;
var StaticMesh Mesh1, Mesh2;
var float SwitchDelay;
var bool bMeshSwitch;
</pre>
<p>We&#8217;ll use the SwitchDelay to setup a place to record some WorldInfo.TimeSeconds, and then we&#8217;ll make a bMeshSwitch to keep track of which mesh we&#8217;re going to show. And for good measure we&#8217;ll keep a place in memory for each mesh.</p>
<p>Here&#8217;s some of the code for the timer and the mesh switch logic:</p>
<pre class="brush:java">
event Tick(float DeltaTime)
{
	super.Tick(DeltaTime);
	SwitchMesh();
}

function SwitchMesh()
{
	if( WorldInfo.TimeSeconds > SwitchDelay )
	{
		if( bMeshSwitch )
		{
			SMeshComponent.SetStaticMesh(Mesh1);
			bMeshSwitch = !bMeshSwitch;
		}
		else
		{
			SMeshComponent.SetStaticMesh(Mesh2);
			bMeshSwitch = !bMeshSwitch;
		}
		SwitchDelay = WorldInfo.TimeSeconds + 3;
	}
}
</pre>
<p>So in the tick we&#8217;ve got a call to a SwitchMesh() function. Right under tick we write our function. the first if statement controls how often our switch happens. When the if condition is met it will update the timer with SwitchDelay = WorldInfo.TimeSeconds + 3, so the +3 sets the next time the if statement should execute.<br />
To switch on and off the second mesh, we use bMeshSwitch, and then when the if{}else{} statement is executed the statements will toggle the boolean from one to the other by using bMeshSwitch = !bMeshSwitch, read that as &#8220;bMeshSwitch is Not bMeshSwitch&#8221; also read that as &#8220;set bMeshSwitch to what it is not&#8221;</p>
<p>Now with the previous scene we&#8217;ll get updated with a ball that goes from smooth to spiky every three seconds.</p>
<img src="http://feeds.feedburner.com/~r/AllIsGame/~4/DOZ62NBcXac" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://okita.com/alex/?feed=rss2&amp;p=799</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://okita.com/alex/?p=799</feedburner:origLink></item>
		<item>
		<title>Reading UnrealScript, what’s in Object.uc and Actor.uc?</title>
		<link>http://feedproxy.google.com/~r/AllIsGame/~3/iotPs80Oa60/</link>
		<comments>http://okita.com/alex/?p=787#comments</comments>
		<pubDate>Sun, 18 Apr 2010 21:39:07 +0000</pubDate>
		<dc:creator>alexokita</dc:creator>
				<category><![CDATA[Learning UnrealScript]]></category>
		<category><![CDATA[News]]></category>
		<category><![CDATA[Unrealscript]]></category>
		<category><![CDATA[tutorials]]></category>
		<category><![CDATA[UDK]]></category>
		<category><![CDATA[UnrealEngine3]]></category>

		<guid isPermaLink="false">http://okita.com/alex/?p=787</guid>
		<description><![CDATA[So we&#8217;ve covered a lot of the basics on functions. I thought I&#8217;d go through some of the cooler things that you might find useful in your own projects. To do this I thought that learning how to read code will be the most useful skill for you. So I&#8217;m going to help out by [...]]]></description>
			<content:encoded><![CDATA[<p>So we&#8217;ve covered a lot of the basics on functions. I thought I&#8217;d go through some of the cooler things that you might find useful in your own projects. To do this I thought that learning how to read code will be the most useful skill for you. So I&#8217;m going to help out by providing some simple packages with some objects and the code to make them move around, and possibly do something interesting.</p>
<p>Setup a new project for MyGame, so go into your UTEngine.ini and add EditPackages=MyGame, and add the new path for MyGame\Classes and drop your new code in there. For more information on this take a look at setting up a new project on this <a href="http://okita.com/alex/?page_id=652">Setting up your project</a>.</p>
<p>From this point on out I&#8217;ll be using the MyGame project for the rest of the tutorials.</p>
<p>In case you don&#8217;t want to follow along too closely&#8230;<br />
Put these in Development\Src\<a href="http://j.mp/bRHdeJ">MyGame</a><br />
And put this in UTGame\Content\Packages\<a href="http://j.mp/9mBFtn">MyObjects</a>.upk<br />
And also you&#8217;ll want to put into UTGame\Content\Packages\ <a href="http://j.mp/aSY0r5">MyPawn</a>.upk<br />
Unzip them first of course.</p>
<p>Starting with some basic code reading and some basic implementations.<br />
Let&#8217;s start with the following code.</p>
<pre class="brush:java">
class MyActor extends actor
    placeable;

defaultproperties
{
    Begin Object Class=StaticMeshComponent Name=StaticMeshComponent0
    StaticMesh=StaticMesh'MyActors.Meshes.MyStaticMesh1'
    End Object
    Components.Add(StaticMeshComponent0)
}
</pre>
<p>So we&#8217;re making a new object called &#8220;MyActor&#8221; and we&#8217;re going to inherit actor&#8217;s properties by extending it with our own code.</p>
<p>So next open &#8220;UDK&#8230;\Development\Src\Engine\Classes\Actor.uc&#8221;</p>
<p>It&#8217;s a big file! As of the March 2010 version of UDK, it&#8217;s nearly 4000 lines long! That&#8217;s a lot of programming already done for you, but what can we do with it all? It&#8217;s a bit baffling at first, but they&#8217;re writing UnrealScript just like you are, so don&#8217;t be too intimidated.</p>
<p>Around line 1572 in Actor.uc you&#8217;ll find the following line:</p>
<pre class="brush:java">
    native final function SetHidden(bool bNewHidden);
</pre>
<p>It&#8217;s a super simple function, it&#8217;s a &#8220;native&#8221; function so there&#8217;s C++ code underneath the actor.uc that is supporting this function, and it&#8217;s &#8220;final&#8221;, so you can&#8217;t remove any of the routines that the function has. And its important to see that it&#8217;s looking for a &#8220;bool&#8221; in the parenthesis, so you&#8217;ll want to use it like SetHidden(True) or SetHidden(False), these are the only &#8220;args&#8221; or arguements that you can give to or &#8220;pass&#8221; to this function.</p>
<p>There&#8217;s another important couple of functions in there, namely, &#8220;PostBeginPlay()&#8221;</p>
<pre class="brush:java">
// Called immediately after gameplay begins.
//
event PostBeginPlay();
</pre>
<p>The comment here says this event is called right after the game begins. It&#8217;s an &#8220;event&#8221; so that means that it receives a message from the engine, and it&#8217;s told to execute whatever procedures are written in it. In regards to the comment, we can assume it&#8217;s going to get a message when the game begins. Back in the editor, the &#8220;Actor Classes&#8221; tab in your Content Browser window you&#8217;ll find MyActor, ordered alphabetically. Select it and drop it in the example scene. When you run the game you&#8217;ll simply see a sphere in the level, big whoop. that&#8217;s what everything  will do right? Okay, so let&#8217;s use the SetHidden function. Change the MyActor.uc to:</p>
<pre class="brush:java">
class MyActor extends actor
    placeable;

event PostBeginPlay()
{
    super.PostBeginPlay();
    SetHidden(true);
}

defaultproperties
{
    Begin Object Class=StaticMeshComponent Name=StaticMeshComponent0
    StaticMesh=StaticMesh'MyActors.Meshes.MyStaticMesh1'
    End Object
    Components.Add(StaticMeshComponent0)
}
</pre>
<p>We&#8217;ve added a PostBeginPlay() to our own code, but we added SetHidden(true); right after super.PostBeginPlay(); What did that do?<br />
Calling Super.PostBeginPlay(); means we&#8217;ll do operations found in Actor.uc, then after that we&#8217;ll do our additions to this code, in this case, SetHidden(true); Run the game and you&#8217;ll notice that the sphere isnt there! well, it is there, it&#8217;s just hidden. So what?</p>
<p>Lets add another function that does something when we get near it, like make it visible only when we&#8217;re near it. How do we do that?<br />
Well, since we&#8217;re extending Actor.uc let&#8217;s look at that again! In there we can find some interesting stuff, in this case lets look at:</p>
<pre class="brush:java">
// The actor's position and rotation.
/** Actor's location; use Move or SetLocation to change. */
var(Movement) const vector			Location;

/** The actor's rotation; use SetRotation to change. */
var(Movement) const rotator			Rotation;
</pre>
<p>Hey, these are handy!!!<br />
Location and Rotation, Everything that&#8217;s extending from Actor.uc have a Location and a Rotation. It&#8217;s also important to see that Location is a vector, and Rotation is a rotator, these are variables you can create and use as well. Oh and another important function in Actor.uc is Tick, we&#8217;re going to make use of that as well.</p>
<p>adding to our MyActor.uc again!</p>
<pre class="brush:java">
class MyActor extends actor
    placeable;

event PostBeginPlay()
{
    super.PostBeginPlay();
    SetHidden(true);
}

event Tick(float DeltaTime)
{
    super.Tick(DeltaTime);
    `log(Location);
}

defaultproperties
{
    Begin Object Class=StaticMeshComponent Name=StaticMeshComponent0
    StaticMesh=StaticMesh'MyObjects.Meshes.MyStaticMesh1'
    End Object
    Components.Add(StaticMeshComponent0)
}
</pre>
<p>We added event Tick(float DeltaTime), we have to match how Actor.uc wrote their function if we&#8217;re going to inherit it correctly. likewise, super.Tick(DeltaTime); doesnt need to have float added to it because rather than writing a function we&#8217;re calling it. What&#8217;s the difference?</p>
<p>Writing &#8220;event Tick( stuff )&#8221; means we&#8217;re starting a new function with what are called arguments where &#8220;stuff&#8221; is. Anything added between the ()&#8217;s means we&#8217;re creating an input to the function. DeltaTime is a special keyword, every Actor inherits a DeltaTime. So, when we call Tick, we need to feed it DeltaTime, so it can be called every frame of the game. Thus super.Tick(DeltaTime). If this is still a big foggy we&#8217;ll get back to it later.</p>
<p>Now we&#8217;re going to add `log(Location); and we&#8217;re going to run the game with a -log window open.<br />
try this when you open up UDK.exe from the windows start menu open cmd or the command prompt, navigate to your UDK directory. in my case, im using</p>
<p><code><br />
c:\UDK\UDK-2010-03\Binaries\Win32\UDK.exe test_map -log -windowed -resx=800 -resy=600<br />
</code></p>
<p>This will tell UDK top play the game in a window and a script log will open along side it, quite handy. This is how we&#8217;ll watch for the `log(Location); Run the game with the MyActor placed in the level, in the Log window you&#8217;ll see someting like:</p>
<p><code><br />
...<br />
ScriptLog: 132.35,-86.83,-417.50<br />
ScriptLog: 132.35,-86.83,-417.50<br />
ScriptLog: 132.35,-86.83,-417.50<br />
ScriptLog: 132.35,-86.83,-417.50<br />
ScriptLog: 132.35,-86.83,-417.50<br />
...<br />
</code></p>
<p>your coordinate positions will be different from mine, but you&#8217;ll get the idea, that&#8217;s the tick running `log(Location); every frame. Great, your actor knows where it is in the world! Now we need to know where the player is! Now lets look for how we find out where other stuff is in the game. For that we&#8217;ll need to look at WorldInfo.uc found in Development\Engine\Classes\. In there we find the following:</p>
<pre class="brush:java">
/** returns all Pawns in the PawnList that are of the specified class or a subclass
* @note: useful on both client and server; pawns are added/removed from pawnlist in PostBeginPlay (on clients, only relevant pawns will be available)
* @param BaseClass the base class of Pawn to return
* @param (out) P the returned Pawn for each iteration
* @param (optional) TestLocation is the world location used if
*        TestRadius > 0
* @param (optional) TestRadius is the radius checked against
*        using TestLocation, skipping any pawns not within that
*        value
*/
native final iterator function AllPawns(class
BaseClass, out Pawn P, optional vector TestLocation, optional float TestRadius);
</pre>
<p>ooo, &#8220;iterator&#8221; what&#8217;s that?<br />
basically, iterator means we can use a ForEach keyword to use it. There are other iterator functions there, AllActors, AllControllers, AllNavigationPoints, etc.  Now take a look at how to use that and add to MyActor.uc</p>
<pre class="brush:java">
class MyActor extends actor
    placeable;

var MyPawn Player;

event PostBeginPlay()
{
    super.PostBeginPlay();
}

event Tick(float DeltaTime)
{
    local MyPawn P;

    super.Tick(DeltaTime);

    ForEach WorldInfo.AllPawns(class'MyPawn', P)
    {
        Player=P;
    }
    `log(Location);
    `log(Player.Location);
}

defaultproperties
{
    Begin Object Class=StaticMeshComponent Name=StaticMeshComponent0
    StaticMesh=StaticMesh'MyObjects.Meshes.MyStaticMesh1'
    End Object
    Components.Add(StaticMeshComponent0)
}
</pre>
<p>We&#8217;ve added a var or variable for the player, and we added ForEach WorldInfo.AllPawns(class&#8217;MyPawn, P); and a variable in the function Tick called local MyPawn P;<br />
With this Tick will search the scene for Every pawn that matches the class MyPawn, tell P that it&#8217;s that pawn, (by the way, that&#8217;s called casting, like an actor filling a role) and then we&#8217;re going to set the var Player to P.<br />
So var mypawn player, is a role, and the role is being filled by P, or P is cast to Player. If there were more than 1 MyPawn in the scene player would be cast to one then the other in each tick.</p>
<p>After all that, we can make use of Player, because now it&#8217;s been filled in with some data. So now we&#8217;ve got a log for both the location of the actor, and the location of the player.<br />
Check out the log and move the player around, you&#8217;ll see one of the numbers flying thought he script log changing as you move the player, thats YOU! More important is to remember that it&#8217;s the actor in the scene that knows your position, its watching you <img src='http://okita.com/alex/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p>I&#8217;ve also taken out the SetHidden, so we can see where the actor is, because we&#8217;re going to need to know. Now lets do something useful with these two vectors (the player vector and the actor vector.)<br />
lets first get rid of the two logs, and combine them. Change the two logs in tick to `log(Player.Location &#8211; Location); so now we&#8217;ve got some vector math going!</p>
<p>Here&#8217;s a question, why dont we just write &#8220;ForEach AllPawns(class&#8217;MyPawn&#8217;, P)&#8221; ?<br />
Well, AllPawns(); isnt going to work, that will only work if MyActor.uc had a function called AllPawns in it. However, WorldInfo.uc does have that in it, and we can call WorldInfo from any object in the world, that&#8217;s good to know. So to use functions found inside of WorldInfo we need to write &#8220;WorldInfo.AllPawns()&#8221; because AllPawns is a function found inside of WorldInfo.</p>
<p>still, not so useful unless we want to do some more clever tricks. luckily, Object.uc has plenty of clever tricks built into it. For instance, VSize(  vector A ); Vsize is asking for one vector, and by subtracting player.location from location we get one vector as a result. so now we&#8217;ll take a look at how VSize works.<br />
change the log to the following:</p>
<pre class="brush:java">
    `log( VSize( Player.Location - Location ) );
</pre>
<p>Run the game again and your script log will have a single value streaming through, and as you get close to the MyActor object that number gets smaller, when you&#8217;re further away that number gets bigger, that&#8217;s the number for Unreal Units between the player pawn and the actor, sweet!</p>
<p>okay, now let&#8217;s update Tick again with:</p>
<pre class="brush:java">
event Tick(float DeltaTime)
{
    local MyPawn P;

    super.Tick(DeltaTime);

    ForEach WorldInfo.AllPawns(class'MyPawn', P)
    {
        Player=P;
    }

    if( VSize(Player.Location - Location) < 100 )
    `log(WorldInfo.TimeSeconds@"player is close!");
}
</pre>
<p>Rather than logging that position im saying "if" the number from VSize(Player.Location-Location) is less than 100, `log("player is close!") so lets compile this and run it again! Oh I also added WorldInfo.TimeSeconds just so that we dont see player is close! over and over again, which isnt too obvious when it shuts off, anyway run the game and see the log to check out what I mean. WorldInfo has a lot of useful things, I suggest that you go through that and find some more useful variables.</p>
<p>now we can change that if statement to</p>
<pre class="brush:java">
    if( VSize(Player.Location - Location) < 100 )
    SetHidden(true);
    else
    SetHidden(false);
</pre>
<p>now when you get close to the object it hides itself! woah, it's interactive. Sure it's not so exciting, but you can use any other function in place of SetHidden.</p>
<img src="http://feeds.feedburner.com/~r/AllIsGame/~4/iotPs80Oa60" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://okita.com/alex/?feed=rss2&amp;p=787</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://okita.com/alex/?p=787</feedburner:origLink></item>
		<item>
		<title>messing with the iPad…</title>
		<link>http://feedproxy.google.com/~r/AllIsGame/~3/vOCmQIFb9RQ/</link>
		<comments>http://okita.com/alex/?p=784#comments</comments>
		<pubDate>Sat, 17 Apr 2010 06:20:41 +0000</pubDate>
		<dc:creator>alexokita</dc:creator>
				<category><![CDATA[Art]]></category>
		<category><![CDATA[iPad]]></category>

		<guid isPermaLink="false">http://okita.com/alex/?p=784</guid>
		<description><![CDATA[So I was forking around using sketchbook pro on my iPad. I was at a coffee shop for the profile image and waiting for a pizza in the other. Oh yea&#8230; I&#8217;m also posting this using the word pad app on hit iPad. Not bad.]]></description>
			<content:encoded><![CDATA[<p>So I was forking around using sketchbook pro on my iPad. I was at a coffee shop for the profile image and waiting for a pizza in the other. Oh yea&#8230; I&#8217;m also posting this using the word pad app on hit iPad. Not bad.</p>
<p><a href="http://okita.com/alex/wp-content/uploads/2010/04/p_1024_768_F7A13ED9-CDD0-4341-9C18-AA6BCDCA289B.jpeg"><img src="http://okita.com/alex/wp-content/uploads/2010/04/p_1024_768_F7A13ED9-CDD0-4341-9C18-AA6BCDCA289B.jpeg" alt="" class="alignnone size-full" /></a></p>
<p><a href="http://okita.com/alex/wp-content/uploads/2010/04/p_1024_768_E6E118C9-94D9-428B-98A5-26186545D70A.jpeg"><img src="http://okita.com/alex/wp-content/uploads/2010/04/p_1024_768_E6E118C9-94D9-428B-98A5-26186545D70A.jpeg" alt="" class="alignnone size-full" /></a></p>
<img src="http://feeds.feedburner.com/~r/AllIsGame/~4/vOCmQIFb9RQ" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://okita.com/alex/?feed=rss2&amp;p=784</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://okita.com/alex/?p=784</feedburner:origLink></item>
	</channel>
</rss>
