legal thingamagigs


Some friends and I are working on making a 1st person puzzle game like myst, but walking like Unreal Tournament. I am rapidly finding out that logicbricks aren’t really what I want, also; I get ice-skating effects and I can’t climb an incline of more than 15 degrees or so. Squish the Bunny is almost exactly what I want for walking around, but I don’t know if I can just steal the python script and just give recognition in the credits and that can be that, or what else I’ll need to do.

Could I get some legal advice? If anything, could I borrow some insight as to how I’d go about making a normal walking model? If anyone’s interested, I whipped this up in a very short ammount of time, so don’t scream too loudly about how bad it looks :


P.S.: By the by, the controls are wasd with arrowkeys and tab for 3rd person

there are other mouse scripts here that ought to work too

or, hell, you need a specific one many people here can write it.

I have one which I created for a racing game (which I didn’t get the controls working too well on, and haven’t messed with for a while) which I may adjust some to a fps view and post

I like mine because you don’t have to have multiple objects for the two axes of rotation, it rotates one object using setOrientation

I guess it is a bit involved the setup for this one (must set the properties right for one)

# rotate the linking object depending on how the mouse moved
# also, constraints for rotation around on x axis (can limit how far can look up/down)
# setup:
# link to mouse movement sensor
# give object these properties:
#  Timer: now =  0.0
#  Float: ago = -1.0
#  Float: sx  =  0.0
#  Float: sz  =  0.0
#  Float: cx  =  1.0
#  Float: cz  =  1.0
#### NOTE ####
# the rotation is based on global axes, so this is not suitable
# directly for a camera, it could be modified for one though, 
# probably involving only changes to the last 4 lines (o.setorentation...)
# public domain, not copyrighted

import GameLogic
import Rasterizer
from math import sin, cos

midx = Rasterizer.getWindowWidth()/2
midy = Rasterizer.getWindowHeight()/2

# move the cursor back to the center
Rasterizer.setMousePosition(midx, midy)

c = GameLogic.getCurrentController()
mouse = c.getSensors()[0] # change to specify name of sensor if you connect multiple sensors to this script
o = c.getOwner()

# initilization
if o.ago < 0.0:
	Rasterizer.showMouse(0) # hide the cursor
	Rasterizer.setMousePosition(Rasterizer.getWindowWidth()/2, Rasterizer.getWindowHeight()/2)
	deltax = 0
	deltay = 0
	deltax = midx - mouse.getXPosition()
	deltay = midy - mouse.getYPosition()

# based on the cursor's movement, and the constraints, rotate this object
# (and how much time passed)

dt = - o.ago # dt = time passed to this frame
o.ago =

#o.setOrientation([ \
#	[1.0, 0.0, 0.0], \
#	[0.0, 1.0, 0.0], \
#	[0.0, 0.0, 1.0] ])

# create copies of the values, then calculate the new ones
## z axis rotation (no constraints)
osz =
ocz =
zrot = (3.141592654 * -0.10) * dt* deltax # adjust non-pi constant for sensitivity
szrot = sin(zrot)
czrot = cos(zrot) = -osz*szrot + ocz*czrot =  osz*czrot + ocz*szrot

# x axis rotation (there are constraints)
osx =
ocx =
xrot = (3.141592654 * -0.10) * dt* deltay # adjust non-pi constant for sensitivity
sxrot = sin(xrot)
cxrot = cos(xrot) = -osx*sxrot + ocx*cxrot =  osx*cxrot + ocx*sxrot

if < 0.0: # prevent looking past top or bottom = ocx = osx

o.setOrientation([ \
	[,*,* ], \
	[,*,* ], \
	[    0,,   ] ] )

the specified properties will rotate the object as if rotation would be cleared on it, if you care to mess with them the sx cx sz cz are the sine and cosine of the rotations around those axes

and I have a .blend

That looks really efficient, I needed something that can rotate to any position any time, do you mind if I try to adapt this and use it myself?

not at all