Basic script help

Hi. I’m trying to learn to use the game engine to build gameplay prototypes for a game that I’m sort of involved with. I used to do a lot of flash actionscript stuff about 5 years ago, but nothing since then.

With 2.49 they of course changed the API, so now pretty much all basic tutorials are out of date. I’m trying to follow them as best I can, but I just can’t get the most basic script to work, even when following the tutorial exactly and using deprecated functions.

I want this script to make the turret rotate. Nice and simple, it should just go round and round. I’m trying to use a script for this instead of just an AND controller, because later I want to get it to point at something, but for now, I just want to get it to move. It won’t work, I don’t know what I’m doing wrong, if I’m missing something obvious or what.

use this

rot = spin.dRot




Why couldn’t it just work the way I did it?

Many thanks for your help

I’m looking forward to discovering more of this nonsense as I progress.


Why can’t we directly assign dRot[0]? Why do we have to replace the whole list?

I understand that the setDRot(bla) only took a list, but that doesn’t mean that we have to force a list now that we’ve moved to variables. Isn’t dRot[0] = 1 much easier than monster’s “solution?”

Also… why is it that when I put a .5 into the dRot field (on the actuator itself) and then try and print motion.dRot, it tells me that it’s .43633…?


its something to do with floating point numbers and some computer jargon, but as far as i know is that 1 = 1 but 1.0000 = 0.9999999(or something near that)