h1

I Was Wrong!

September 15, 2008

Ok, I’m not going to skip to my loo to Java quite yet. After looking at some tutorials, and being completely overwhelmed by the massive amounts of knowledge I will need to pick through, there is no way in hell I could figure out how to do what I want in less than a few months.

 

So, that being said: I recruited my best friend who, among other things, worked for Microsoft at one point, and knows Java like the back of his own hand. Sometime soon he’ll be spending a weekend or two at my house so we can get together and work on my little project. He even said he’d help make a graphic UI for me! Wee!

 

Therefore until that weekend happens, I am stuck with what I know, and I’m coming back on my hands and knees with GlovePIE for another week.

 

On the good side of this I did find a script for GP that lets you:

1) Put a Wiimote in your pocket

2) Start jogging

3) GP recognizes that you are jogging!

It also recognizes walking. So I can use this as my ‘running script’ for creating movement in game. I’d like to thank Rhys Legault for his awesome script creation of magical shinyness! Now if I could only figure out a turning script with the same Wiimote (if you can’t tell by this point, I’m not too bright in the realm of programming) Actually, just thinking about it, it might not be that hard!

 

Here is the running script that I found on Friday (oh and if you can’t tell, I don’t blog on the weekend because I have a life hehe)

 

/*                  Wii R Walking v1.0
***********************************************************
*                 Created by Rhys Legault                 *
*                
rhyslegault@hotmail.com                 *
*             Last Modified: February 19th, 2007          *
***********************************************************
*  Feel free to use, modify and redistribute this script  *
***********************************************************
*
*  About:
*  This script identifies if you are still, walking or running
*
*  Requirements: 1 Wiimote
*
*  Directions:
*  Throw the wiimote into you pocket and start walking or running
*  This can be around the room or on the spot it doesn’t matter.
*  Just don’t run into anything!
*
*  The debug window will show that you are either still, walking or running
*  If required, adjust the threshold values to suit your needs.
*
*  If you want to use this script inside of another script use the
*  Search->Replace tool and replace all Wiimote values to Wiimote2
*  You won’t be able to use any of the buttons the Wiimote while it’s
*  in your pocket so you will require another Wiimote for any button
*  assignments
*
*  Notes:
*  To protect your Wiimote you can put it into the original plastic packaging
*  of an additional Wiimote (not the Wiimote’s packaging in the Wii bundle)
*  It fits perfectly & the buttons will not be pressed while you’re running
*
*/

//Amount of time between calculating movement status
//1 = 25ms, 4 = 100ms, 5 = 125ms, 10 = 250ms, 20 = 500ms, 40 = 1000ms
var.Timing = 20

//Threshold values for Walking & Running
var.WalkingThreshold = 20
var.RunningThreshold  = 60

//Sets the maximum forces applied to the wiimote
if abs(Wiimote.RelAccX) > var.MaxAccX then var.MaxAccX = abs(Wiimote.RelAccX)
if abs(Wiimote.RelAccY) > var.MaxAccY then var.MaxAccY = abs(Wiimote.RelAccY)
if abs(Wiimote.RelAccZ) > var.MaxAccZ then var.MaxAccZ = abs(Wiimote.RelAccZ)

//Adust var.Timing if you want to change how often the TotalForce is calculated
if (PIE.Frame % 40) % var.Timing = 0
   //Calculates the total of the max forces applied to the wiimote
   var.TotalForce = var.MaxAccX + var.MaxAccY + var.MaxAccZ

   //Resets the max forces applied to the Wiimote
   var.MaxAccX = 0
   var.MaxAccY = 0
   var.MaxAccZ = 0
endif

//Displays movement status
if var.TotalForce < var.WalkingThreshold
   debug = “Still”
elseif var.WalkingThreshold < var.TotalForce < var.RunningThreshold
   debug = “Walking”
else
   debug = “Running”
endif

If I could get a decent Mouselook script going, then I would have a perfect Movement/Vision script and at least that portion would be finished. I think this is what I’m going to work on tonight!

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: