collision?
Blitz3D Forums/Blitz3D Beginners Area/collision?
| ||
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? |
| ||
does anyone know how to fix this? |
| ||
Strange. Have you set the terrain's collision rules? |
| ||
yes. i even gave the player an entityradius of 2.20 |
| ||
trust me, the entityradius works for everything BUT terragen 3d objects.. |
| ||
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. |
| ||
it's a heightmap that creates a 3d mountain |
| ||
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. |
| ||
yes, it does. |
| ||
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?) |
| ||
no its not.... the character acts like he's falling and he cant touch the ground.... not one bit... |
| ||
thats because you have to position your character at highest Y point on its current X/Z position..as already mentioned.. |
| ||
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. |
| ||
so how can i use terrainy to tell it to stop being so screwed up? |
| ||
it uses QTS_LoadTerrain() Isnt that the same thing? If not, how can I fix it? |
| ||
apparently, QTS_Terrain is NOT a terrain.. oO how can i fix it?.... |
| ||
how do u get the ground height of an entity mesh, not a terrain mesh? and dont say entityY. i tried that already... |
| ||
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... |
| ||
ok. i did. now it's still having the sliding problem though. only not as bad. here is the code: |
| ||
Use a line pick straight down |
| ||
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. |
| ||
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 |
| ||
still doesnt work.... |
| ||
dy is the distance down or upwards FROM the starting x,y,z location. |
| ||
downwards |
| ||
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. |
| ||
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 |
| ||
Oh my. |
| ||
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. |
| ||
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. |
| ||
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. |
| ||
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. |
| ||
um, no. its a createmesh(), not a terrain |
| ||
Well, post some code. We have no idea why it isn't working if we can't see it. |
| ||
um, i cant. im using some VERY OLD code back from the blitz terrain days |
| ||
Very old code, posts the same as brand new code. |
| ||
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. |
| ||
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. |
| ||
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! |
| ||
Pancake. |
| ||
U KNOW WHAT?! SCREW U, ROSS! IM THROUGH W/ PPL MAKING FUN OF ME! BACK THE HELL OFF! |
| ||
What you gonna do about it? See, i can randomly threaten people too. |
| ||
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. |
| ||
SCREW U ROSS! |
| ||
Um, yea matty i have |
| ||
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. |
| ||
Same old, same old. I'm away to sleep. |
| ||
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! |
| ||
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. |
| ||
ADD is not a disability >_> |
| ||
However, as always, we digress. Now back to the problem you originally posted.... |
| ||
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 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. |
| ||
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! |
| ||
However, as always, we digress. Now back to the problem you originally posted.... Regards, |
| ||
ok. so, the character is still slipping and sliding even on flat parts of the terrain |
| ||
Latest code purleeze. |
| ||
im using blitz terrain EDIT: sorry about the format. the codebox automatically formatted it for some reason |
| ||
No problem. Ok, where is the character placement (control)? |
| ||
if u mean the position of the player, that uses an xml file to load, position and rotate my player |
| ||
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. |
| ||
u watch ur mouth! u dont just go around and push people when u feel like it! |
| ||
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 |
| ||
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. |
| ||
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. |
| ||
ill say no more when u quit messing w/ ppl. END OF STORY! THE END! |
| ||
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. |
| ||
here: |
| ||
Hmm, not what I meant. Where is the player movement code. |
| ||
o i c. sorry mate.... ill get it right away |
| ||
here: EDIT: Again, sorry for the format... >< idk why it does that x_x |
| ||
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. |
| ||
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? |
| ||
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 |
| ||
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. |
| ||
also, i cant get it so it positions him only when he lands on it |
| ||
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 |
| ||
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. |
| ||
no. he touches the ground in the modeling program. |
| ||
the model is fine. its the code making him slide |