collision?

Blitz3D Forums/Blitz3D Beginners Area/collision?

Guy Fawkes(Posted 2010) [#1]
Why does my character slide, not being able to walk, and sometimes falls through the level on a terragen 3d mountain, but when he's on a b3d, x, or 3ds level, he's fine? how can i fix this?


Guy Fawkes(Posted 2010) [#2]
does anyone know how to fix this?


Streaksy(Posted 2010) [#3]
Strange. Have you set the terrain's collision rules?


Guy Fawkes(Posted 2010) [#4]
yes. i even gave the player an entityradius of 2.20


Guy Fawkes(Posted 2010) [#5]
trust me, the entityradius works for everything BUT terragen 3d objects..


Matty(Posted 2010) [#6]
Is the terrain a mesh or loaded from a heightmap using the 'loadterrain' command. If so then you should be able to get away with simply using the terrainy() command.


Guy Fawkes(Posted 2010) [#7]
it's a heightmap that creates a 3d mountain


Matty(Posted 2010) [#8]
Yes but is it loaded using "load terrain"?
If so simply use the "terrainy" command - it tells you the height of the terrain at a specific x/z position.


Guy Fawkes(Posted 2010) [#9]
yes, it does.


Ross C(Posted 2010) [#10]
Yep, a heightmap is a heightmap, regardless of which application produced it. So it WILL work the same way in blitz. All it's doing is generating a terrain from rgb values (or from the R value, as i remember?)


Guy Fawkes(Posted 2010) [#11]
no its not.... the character acts like he's falling and he cant touch the ground.... not one bit...


Naughty Alien(Posted 2010) [#12]
thats because you have to position your character at highest Y point on its current X/Z position..as already mentioned..


Ross C(Posted 2010) [#13]
Yes it is. A heightmap generate by blitz, is the exact sam eas any, regardless of which program created the height map, as it's just reading RGB values. The mesh generated doesn't change at all.


Guy Fawkes(Posted 2010) [#14]
so how can i use terrainy to tell it to stop being so screwed up?


Guy Fawkes(Posted 2010) [#15]
it uses QTS_LoadTerrain() Isnt that the same thing? If not, how can I fix it?


Guy Fawkes(Posted 2010) [#16]
apparently, QTS_Terrain is NOT a terrain.. oO how can i fix it?....


Guy Fawkes(Posted 2010) [#17]
how do u get the ground height of an entity mesh, not a terrain mesh? and dont say entityY. i tried that already...


JA2(Posted 2010) [#18]
Use a line pick straight down from your players xyz position. Assuming that you've set the terrain mesh as pickable then you can retrieve the pickedx, pickedy (the bit you want), and pickedz of the linepick...


Guy Fawkes(Posted 2010) [#19]
ok. i did. now it's still having the sliding problem though. only not as bad.

here is the code:




JA2(Posted 2010) [#20]
Use a line pick straight down



Ross C(Posted 2010) [#21]
The key words being straight down. Reading the command reference, the docs state that the last three parameters are vectors. So, 0,-5,0 will send the pick downwards, 5 units.


Guy Fawkes(Posted 2010) [#22]
here's what i have:

i changed it to only affect the y values. but it still didnt work. also, it's positioning my player at the pickedy() position when u 1st play, not where he usually starts


Guy Fawkes(Posted 2010) [#23]
still doesnt work....


Ross C(Posted 2010) [#24]
dy is the distance down or upwards FROM the starting x,y,z location.


Guy Fawkes(Posted 2010) [#25]
downwards


Ross C(Posted 2010) [#26]
eh? Look at what you've written for the linepick command. It's wrong. the first co-ords are the x,y,z from where the pick will start. The second set of x,y,z are the vectors. Your wanting to go straight down, so your Y vector is minus a distance your want to pick to go. How far you want it to travel. In blitz units.


Guy Fawkes(Posted 2010) [#27]
Is that right? And I dont want it to position the player when he 1st starts, I want it to detect if the player is ON the terrain THEN do it


LineOf7s(Posted 2010) [#28]
Oh my.


GfK(Posted 2010) [#29]
You seriously need to look at your own code before relentlessly complaining "it doesn't work.... it doesn't work... it still doesn't work..."

Look at the documentation for LinePick. Look at your code. Listen to what people here are repeatedly telling you. You are not using Linepick correctly. If you are not willing to learn how to do things and won't even attempt to find out what's wrong for yourself, people are going to get fed up of trying to help you.

Getting help is one thing - expecting to be nursemaided through every little step is entirely something else.


Yeshu777(Posted 2010) [#30]
picked = LinePick(x2#,y2#,z2#,0,dy#,0)


Just hazarding a guess here but after quickly looking at the docs, but shouldn't the second parameter (dy#) be a negative value?

From the docs "Returns the first entity between x,y,z to x+dx,y+dy,z+dz"

From that I'd infer that if you're using the terrain height as dy# then it'll be picking what's above you.

Also, I'd make the value (dy#) a set distance eg. -20, independent of the terrain height..

eg.. what would happen if the terrain Y is 1 unit and you're 5 above it?

I would gather LinePick wouldn't find it.

Try...

picked = LinePick(x2#,y2#,z2#,0,-20,0)


Apologies in advance if wrong, I don't have much cause to program in B3D and only have the demo, however whatever language you program in common sense is universal.


Guy Fawkes(Posted 2010) [#31]
that didnt work.. still falling through even though collision is on it. and still sliding on the terrain instead of being able to walk on it.


Drak(Posted 2010) [#32]
Whoa whoa whoa, he said it's a blitz terrain already. You can use terrainy() at the player's position as stated like 6 times already by 6 different people.


Guy Fawkes(Posted 2010) [#33]
um, no. its a createmesh(), not a terrain


Drak(Posted 2010) [#34]
Well, post some code. We have no idea why it isn't working if we can't see it.


Guy Fawkes(Posted 2010) [#35]
um, i cant. im using some VERY OLD code back from the blitz terrain days


Ross C(Posted 2010) [#36]
Very old code, posts the same as brand new code.


Drak(Posted 2010) [#37]
Yeah I asked my mechanic to fix my car once without seeing it. Guess what, he laughed.

You best adjust your attitude as well. I'm on my last leg with you and your very rude remarks towards people who try to help you.


stayne(Posted 2010) [#38]
edit: nevermind, i had a read through your posts. seems you have pretty much ruined things for yourself here and i think the best thing is for you to do is take a long break from coding. you are suffering from overload, seems you have ADD and can't do things in moderation. that's not a personal jab, just some advice.


Guy Fawkes(Posted 2010) [#39]
o now ur making FUN OF ME BECAUSE I HAVE ADD?! WELL LET ME TELL U SOMETHING UR DAMN RIGHT I HAVE ADD! BUT BECAUSE OF IT, I MAY NOT BE A WIZ AT CODING, BUT I AM A GENIUS WHEN IT COMES TO EARTH-SPACE SCIENCE AND UFO STUDYING, SO U KNOW WHAT, BACK OFF!


Ross C(Posted 2010) [#40]
Pancake.


Guy Fawkes(Posted 2010) [#41]
U KNOW WHAT?! SCREW U, ROSS! IM THROUGH W/ PPL MAKING FUN OF ME! BACK THE HELL OFF!


Ross C(Posted 2010) [#42]
What you gonna do about it? See, i can randomly threaten people too.


Matty(Posted 2010) [#43]
Just out of curiousity Rez - but have you looked at the castle demo in the blitz3d samples folder. It covers much of what you ask about in each of your queries.


Guy Fawkes(Posted 2010) [#44]
SCREW U ROSS!


Guy Fawkes(Posted 2010) [#45]
Um, yea matty i have


Yeshu777(Posted 2010) [#46]
Err. calm down guys.

Res.

I think what people are trying to say is that you're constantly asking for answers without showing that you've learnt from the advice people have given you previously.

I can understand you're trying to achieve something, but it personally would mean very little to myself unless I'd done the majority of work myself.

This is not a criticism, merely some helpful advice.


Ross C(Posted 2010) [#47]
Same old, same old. I'm away to sleep.


Guy Fawkes(Posted 2010) [#48]
No, u know what Yeshu?! Im NOT going to calm down. because Ross just made fun of my ADD! I can have u in DEEP SHIT for making fun of someone with a disability, SO BACK OFF!


Yeshu777(Posted 2010) [#49]
And in responding like that you're proving them right.



I can have u in DEEP SHIT for making fun of someone with a disability, SO BACK OFF!




Without wanting to sound pedantic you would have show they had prior knowledge of your disability and that was the grounds for their discrimination.


GIB3D(Posted 2010) [#50]
ADD is not a disability >_>


Yeshu777(Posted 2010) [#51]
However, as always, we digress.

Now back to the problem you originally posted....


Who was John Galt?(Posted 2010) [#52]
U KNOW WHAT?! SCREW U, ROSS! IM THROUGH W/ PPL MAKING FUN OF ME!
How can you be through with people making fun? The situation is not under your control. Do you have a persecution complex or something? Are you totally oblivious to the fact that your attitude is the reason people lose patience with you?

I suggest you help out with 'Light of Dreams'. You and Xylvan would get on like a house on fire. You are a pair of chips off the same block.


Ross C(Posted 2010) [#53]
*Ross scans the forum* nope. I never once said "Hahaha, you have ADD". Frankly i don't care, either. I don't care much for people you treat others like the way you do, ADD or not, so you can take your claims that people are bullying you, PUSHING you around. I seriously think you need to see a doctor about your issues. And i'm not making fun, or insulting you. Swearing at people and telling them to die, ISN'T a symptom of ADD.

I will edit my earlier post and apologise if it caused any offense. However, I won't in the future be attempting to help you, till you can resist the urge to tell other forum members to die.


Guy Fawkes(Posted 2010) [#54]
You know what, ross? Shut ur damn mouth while ur at it! I'm SO sick of ppl like u who make fun of people w/ disabilities! People like u shouldn't exist!


Yeshu777(Posted 2010) [#55]
However, as always, we digress.

Now back to the problem you originally posted....

Regards,


Guy Fawkes(Posted 2010) [#56]
ok. so, the character is still slipping and sliding even on flat parts of the terrain


Yeshu777(Posted 2010) [#57]
Latest code purleeze.


Guy Fawkes(Posted 2010) [#58]
im using blitz terrain


EDIT: sorry about the format. the codebox automatically formatted it for some reason


Yeshu777(Posted 2010) [#59]
No problem.

Ok, where is the character placement (control)?


Guy Fawkes(Posted 2010) [#60]
if u mean the position of the player, that uses an xml file to load, position and rotate my player


Ross C(Posted 2010) [#61]
My dad had muscular dystrophy. I know a hell of alot about folk with disablities actually, far worse than what you have, so watch your mouth.


Guy Fawkes(Posted 2010) [#62]
u watch ur mouth! u dont just go around and push people when u feel like it!


Naughty Alien(Posted 2010) [#63]
Rez..Ross is one of the most gentle fellas around, and im here long time(relatively) so i know that for sure..i dont know how come things turned badly, but 'bitching' will not help anyone, right? So, just stick to the topic and lets make some fun out of this, rather then unpleasant place to be/read.. cheersss guyyysssssss


Guy Fawkes(Posted 2010) [#64]
ill stop when people understand not to push around people. ESPECIALLY if they have a disability. I would be disgusted if i were that person.


Ross C(Posted 2010) [#65]
I'm all for that man. He just keeping baiting me back, with more abuse. If he says no more, i'm gone from here.


Guy Fawkes(Posted 2010) [#66]
ill say no more when u quit messing w/ ppl. END OF STORY! THE END!


Yeshu777(Posted 2010) [#67]
Sorry ,

I meant where is the code whereby you place the player on the terrain.

You've shown me where you load the terrain, but not where the player interacts with it.


Guy Fawkes(Posted 2010) [#68]
here:




Yeshu777(Posted 2010) [#69]
Hmm, not what I meant.

Where is the player movement code.


Guy Fawkes(Posted 2010) [#70]
o i c. sorry mate.... ill get it right away


Guy Fawkes(Posted 2010) [#71]
here:



EDIT: Again, sorry for the format... >< idk why it does that x_x


Yeshu777(Posted 2010) [#72]
Don't worry, will take a look at it in a mo.

{edit} bit hard to tell whats going on without seeing the code in it's entirety.


Guy Fawkes(Posted 2010) [#73]
well, i cant do that. im using a ton of code.... i wish i could. is there something else i can show u that would help?


Yeshu777(Posted 2010) [#74]
Hazarding yet another guess..


For p.tPlayer = Each tPlayer
			x2# = EntityX(p\Objects\Entity)
			y2# = EntityY(p\Objects\Entity)
			z2# = EntityZ(p\Objects\Entity)
			dx# = EntityX(QTS_Terrain2)
			dy# = EntityY(QTS_Terrain2)
			dz# = EntityZ(QTS_Terrain2)
			LinePick(x2#,y2#,z2#,0,-20,0)
			PositionEntity(p\Objects\Entity, x2#, PickedY(), z2#)
		Next




Guy Fawkes(Posted 2010) [#75]
that sorta worked. the problem now is the player still cant land on the actual terrain he just sorta acts like hes still in the air. if i use pickedx() pickedy() pickedz() to position him, it works, and he doesnt fall through but sometimes he gets stuck in some areas.


Guy Fawkes(Posted 2010) [#76]
also, i cant get it so it positions him only when he lands on it


Guy Fawkes(Posted 2010) [#77]
now the only problems are he gets stuck sometimes in the terrain, and he cant physically walk on it. he can only "fly" and he gets positioned to the terrain BEFORE he touches the terrain


Drak(Posted 2010) [#78]
Just throwing this out... If the player flies over the terrain like this, is the player actually touching the ground in the modeling program? If he's not, he will appear to be flying like that. It might be worth checking to make sure that's not the flight problem.


Guy Fawkes(Posted 2010) [#79]
no. he touches the ground in the modeling program.


Guy Fawkes(Posted 2010) [#80]
the model is fine. its the code making him slide