Could anyone please awnser my questions, I also have a few other question:
how do I get text to show up in my game?
when I play my game on my computer the materials come out wrong (wrong colorurs) but when I play on my brother’s computer the materials are showing up how they’re supposed to, so how do I get the same result on both computers?
For a digital speedometer, you can use this tutorial, and have a python script which uses the functions that coudano mentioned (getLinearVelocity() and getVelocity(point)) to change the text property which controls the text (you’ll understand that part if you read the tutorial).
For a dial speedometer, make your needle and just set rotation ipos at your minimum and maximum speed (though if your dial goes over 180 degrees you will need multiple ipos). Set your keyframes at a 1:1 ratio to your speed. Have the keyframes on the needle object controlled by a property (whose value you will have to transfer from the car).
I think the only place where I’ve experienced problems with materials not showing up right is if I transfer a .blend file to another computer, but don’t transfer the textures (or haven’t packed the textures). Then an object which is missing a texture (UV) shows up ugly pink. If this is not the case (it doesn’t sound like it is), then its probably a graphics problem with your computer. I’ve never had a proper graphics card, so I have no experience installing drivers and such. I think my next computer will change that, though.
oh… that explains a whole lot… my bootleg computer sucks
P.S. I need some help with the program that makes the ttf fonts into tga, I keep getting an error and the python highlights “import os” what is wrong???
A really simple way to make a speedometer would be to actually use the distance from the objects current position to its previous position.
for example, you could attach this to your text object:
o = GameLogic.getCurrentController().getOwner()
obj = GameLogic.getCurrentScene().getObjectList()
#### Name of object you want to measure the speed of ###
Name = "Cube"
### how fast is the cube going if it travels 1 unit
### per frame?
unit = 10
Z = (posi)-(pos)
Y = (posi)-(pos)
X = (posi)-(pos)
return math.sqrt((X)*(X) + (Y)*(Y) + (Z)*(Z))
pos = obj["OB"+Name].getPosition()
if not hasattr(o, "init"):
o.init = 1
GameLogic.pos = pos
o.Text = dist(pos, GameLogic.pos)*unit
GameLogic.pos = pos
I have no experience here. I always just stick with the basic arial font in the text tutorial that I cited earlier. Maybe it is possible to download the font you are looking for somewhere else in the proper .tga format?