2.49b Third Person Character Control

I know there are other third person control setups out there, but all of them seem too complex to me- either lots of python or lots of logic bricks with states and objects connected to each other with the bricks… So I made one as simply as I could.

Besides the character model, I’m using two empties and a camera. The python script I threw together is 79 lines, but probably 1/4 are either notes or bits I left commented out for future use. No vertical camera control, but it can easily be added if needed.

Feedback on the setup would be great. Feel free to use and modify and whatnot, just give me a little credit and maybe a message about how you used it.

http://www.mediafire.com/?249mndghjx5k891 - Test exe in a self extracting rar

http://www.mediafire.com/?o35qb5152gtqy9p - The blend file
EDIT: Blend file may not work on Linux, check posts below.

Attachments


Hello
your demo makes Blender 2.49 crash?!
Here’s the console message:

ASSERT intern/moto/include/MT_Vector3.inl:19: !MT_fuzzyZero(s) failed.
Trace/breakpoint trap

Debian/Linux/64 OS
Bye

Huh… that’s weird… was that the test program? Try the blend itself.

Oh, wait, not so weird- I’m on Windows. Program probably has to be saved on a Linux box to be compatible… unless someone else corrects me on that.

Well, I’ve tried the blend file!
And tried too to save a different version…no luck!
The demo starts but as soon as I do some keyboard movement, Blender crash!
Bye

Hm… guess that means I have a Python issue, if it’s only after you press something on the keyboard. I’ll take a look.

Just went and commented out a couple of lines that shouldn’t matter, but I have a feeling they were the issue. Your error looked like it was pointing me to Line 19, which was just after I had a function definition with nothing but “pass” in it (for future use). Check the version attached to this post.

Attachments

charcontrol_1a.blend (168 KB)

bump

Anyone else given this a shot yet? I’d like to hear if there are any other errors, thoughts on the one OTO had, or any other comments…

Sorry, same result…and message!

I have the same error, as soon as i start the game
UBUNTU 10.10
i5-760
4GB RAM
GTX 460

Okay… well, once again I went into my python code and cleaned up some loose bits that weren’t used. Specifically, this time I commented out the MathUtils and Vector stuff, since glancing over the rest of the script revealed that I never even bothered using them after calling them. Awesome. :stuck_out_tongue:

Anyway, no idea if that’s the problem. It’s been working fine on the Windows machines I’ve tried it on… any other Windows users tried it?

New version attached to this post.

BTW, if a mod thinks this belongs in “Support and Discussion”, feel free to move it over.

Attachments

charcontrol_1a.blend (168 KB)

Ok, the new version works at least…but its not very robust!
After some time and/or movement,Blender crash, with the usual message!
Very nice setup by the way!
Bye

W00, delayed the crash! Maybe I can eliminate it with another pass over the script…

Thanks for the help and compliment, OTO. :slight_smile:

All the versions worked fine for me- maybe other people were using 2.5?

I hope not, considering the Blender version is in the thread title…

Thanks for testing it out. What OS are you on?

Well, I’m using Blender 2.49b in a Linux 64 OS and Python 2.6.6 version!
Most of the games/demos/scripts work quite well!
Bye

So I was looking through the “2.5 Resources” thread, and saw the posts about ATI cards having issues with numbers not having full decimals (1.0 instead of just 1, for example), and thought to myself, Maybe that’s similar to the issue with my code somehow… hmm…

Just went in and added “.0” after anything that has the possibility of having anything other than zero after the decimal. Probably won’t fix it, but it’s worth a shot.

Attachments

charcontrol_1a.blend (168 KB)

…same problem! And I’ve a gforce 9600 graphics card

Well, guess that possibility is shot down… I doubt the number of zeros I add will have any effect, which is the only other thing I can think to modify in that code…

I did a quick search for what seemed like the important part of that error message (the “fuzzyZero(s)” part) and found this:

 GEN_INLINE MT_Vector3& MT_Vector3::operator/=(MT_Scalar s) {
    MT_assert(!MT_fuzzyZero(s));
    return *this *= MT_Scalar(1.0) / s; 

from https://svn.blender.org/svnroot/bf-blender/trunk/blender/intern/moto/include/MT_Vector3.inl

That section of code popped up on/around the 19th line of the link, so I’m pretty sure the issue has something to do with that. I have no idea how it effects my code tho, and the stuff in the linked page is a little too advanced for me to figure out with my novice-ish level of python knowledge.

Any ideas would be greatly appreciated. So would a link to somewhere I can read about the MT_Vector3/fuzzyZero(s), if there’s anything out there.