colisions problems

Blitz3D Forums/Blitz3D Beginners Area/colisions problems

MR:Satanist(Posted 2005) [#1]
hi! i need help whit colision

my cod is


EntityType tank1,1
EntityType camera,1
EntityType terrain1,2

Collisions 1,2,2,1


and i dont know why it dosent work :S


David819(Posted 2005) [#2]
have you got updateworld() in the loop, you need it or collision wont work.


xmlspy(Posted 2005) [#3]
like Goober said, updateworld in your main loop

renderworld()
updateworld()
flip


MR:Satanist(Posted 2005) [#4]
yes i got it :S
and one more question
i want to get my mesh to move from 50,0,10--->10,0,0
how to do?


David819(Posted 2005) [#5]
do you mean as in motion, if so you will need the moveentity command in the loop and some checks, if not use positionentity before the loop.


MR:Satanist(Posted 2005) [#6]
well i am but i wont work

While Not KeyDown(1)

MoveEntity tank1, 10,0,0



If KeyDown(32)=True Then TurnEntity camera,0,-1,0
If KeyDown(30)=True Then TurnEntity camera,0,1,0
If KeyDown(31)=True Then MoveEntity camera,0,0,-0.1
If KeyDown(17)=True Then MoveEntity camera,0,0,0.1

UpdateWorld
RenderWorld
Flip
Wend
End

:S


MR:Satanist(Posted 2005) [#7]
well i am but i wont work

While Not KeyDown(1)

MoveEntity tank1, 10,0,0



If KeyDown(32)=True Then TurnEntity camera,0,-1,0
If KeyDown(30)=True Then TurnEntity camera,0,1,0
If KeyDown(31)=True Then MoveEntity camera,0,0,-0.1
If KeyDown(17)=True Then MoveEntity camera,0,0,0.1

UpdateWorld
RenderWorld
Flip
Wend
End

:S


David819(Posted 2005) [#8]
well what you have done wrong if by putting moveentity tank1,10,0,0 your telling the program to move the entity (tank1) at the speed of 10 across the x axis, so it wil be moving at a constand speed of 10. explain in more detail what you are trying to do and i'll try and help.


_PJ_(Posted 2005) [#9]
I'm guessing that because it will take just 4 program loops to move the tank to this new location, that it is moving so quick that it's not noticed as the program runs, therefore, it appears to remain stationary, although in actuality it has already moved.

I would check the tank location with this:




MR:Satanist(Posted 2005) [#10]
well i know that but i want it to stop on 5,0,1


Naughty Alien(Posted 2005) [#11]
Satanist..you really cool :))


MR:Satanist(Posted 2005) [#12]
yah i rock \m/-_-\m/


David819(Posted 2005) [#13]
MR:Satanist, are you trying to get it to move to a certain point before the player gains control, sort of like an intro to the level?


Ross C(Posted 2005) [#14]
Yeah. You'll need to be more specific about what your trying to acheive. Do you want to instantly move the mesh to that location? Or are you wanting it to move there over time?

The less specific you are, the less likely people will be to help you.


MR:Satanist(Posted 2005) [#15]
yes im trying to move a mesh to a certain position
from antother


_PJ_(Posted 2005) [#16]
so... er... what's the prob?


David819(Posted 2005) [#17]
Ok, so it a motion you want, well if you want to do that you first need to decide what speed it's going to travel at say a speed value of 1 in the x and z axis, when it is moveing using the moveentity command you need to do two checks one on the x axis and one on the y. the x axis check may look something like this:
if entityx(tank1)=10 then moveentity tank1,SpX#*0,SpY#,SpZ#

and z simular:
if entityz(tank1)=0 then moveentity tank1,SpX#,SpY#,SpZ#*0

REmember though as you stated above you wanted the mesh to move from 50,0,10 to 10,0,0 so the the SpX# and SpZ# will look like this: (placed outside the loop)
Spx#=1
Spz#=1
and in the loop the moveentity command will go below the checks and look something like this:
moveentity tank1,-SpX#,SpY#,-Spz#
it has the "-" sign because you are wanting the entity to move to a distance behind it (as you pobably already noticed).
Hope this makes sense.
if it doesn't the just say and i'll try and pogram something for you. And before i go there is two ways which you can do this movement either as one movement of two, if you are wanting two then please stat, what i mean by two movements is that it will move in say the x axis first till it reaches 10 and then move the entity to 0 after.
hope i have been of some help.