Inside object?

Blitz3D Forums/Blitz3D Beginners Area/Inside object?

Guy Fawkes(Posted 2010) [#1]
How can I use EntityDistance() or some other function to detect whether or not my player is inside an object?




Yasha(Posted 2010) [#2]
Define "inside".


Guy Fawkes(Posted 2010) [#3]
i want the game to be able to tell if my player is standing inside of an object such as a cube or sphere or outside.


Ross C(Posted 2010) [#4]
You need to decide on the shape. The only way i can think of, is to create a flip copy of the mesh. Then cast a linepick outwards, the length of the widest dimension from the players position, in a random direction. If you pick the flipped copy, your inside the mesh. If not, your outside it. This assumes your mesh is closed, and doesn't have any missing tri's, or delibrate holes in it.


Guy Fawkes(Posted 2010) [#5]
I need help fixing this. it SORTA detects if the player is poking through the object.



the problem is in entityinobb().


Guy Fawkes(Posted 2010) [#6]
think of it as a mouse poking his head out of a hole. when he pokes it out, then he's inside the hole because only his head is poking out. but if he runs out of the hole, he's outside the hole because his entire "mesh" body is outside of the hole.


Ross C(Posted 2010) [#7]
I have no idea how that works. How about trying the linepick option i suggested. Seems simplier.


Guy Fawkes(Posted 2010) [#8]
not for me. as u noticed im having a problem w/ linepicks in my other thread. so how can i use line pick to do something like this?


Ross C(Posted 2010) [#9]
You need to sit down with some code and actually get to grips with how linepick works.

LinePick x,y,z,dx,dy,dz


x,y,z is the location in 3d space, where the linepick starts.

dx,dy,dz is the vector that the line will travel along/to.

LinePick 0,0,0, 0,0,10


Would send a linepick FROM 0,0,0 to 0,0,10, because the linepick dz is 10 ahead of the start co-ords.

If you wanted to send a linepick DOWN the Y axis, 10 units, you would do:

LinePick 0,0,0, 0,-10,0


If your starting location was 20,20,20 and you wanted your linepick to go 10 units left of that location, then:

LinePick 20,20,20, -10,0,0


Now, if you knew the start co-ords and the finish co-ords of your linepick, then you'd need to work out the distance between the two points in space, and provide the vector information from that. So, say you want to go from 20,20,20 to 30,30,30, you subtract the 2nd co-ords, from the 1st.

So:


Start_X = 20
Start_y = 20
Start_Z = 20
Finish_X = 30
Finish_Y = 30
Finish_Z = 30

dx = Finish_X - Start_X
dy = Finish_Y - Start_Y
dz = Finish_Z - Start_Z

LinePick Start_X, Start_Y, Start_Z, dx,dy,dz



So remember, the last three co-ords are NOT the end co-ords of your pick, rather the direction and distance you want the pick to move.


Yeshu777(Posted 2010) [#10]
I responded to your LinePick problem in the other thread.


Guy Fawkes(Posted 2010) [#11]
why cant i just modify the function i used? im tired of all this heavy math stuff. i mean, if there is more than one way to do it, would it not be more logical to do that so I learn?


Ross C(Posted 2010) [#12]
What heavy math? Your substracting a number. Linepick doesn't a tremendous amount of math for you. Have you seen the code in that snippet you posted? If you can't make sense of what i posted, you must be completely lost with that code.

Always go with the simplier solution.


i mean, if there is more than one way to do it, would it not be more logical to do that so I learn?



But your avoiding doing it this way, so your not actually learning anything.


Guy Fawkes(Posted 2010) [#13]
I would just like to go w/ the simple solution please. I'm tired of people telling me what to do and what to use. It may be better, or faster, but did you ever stop to think that maybe I didn't WANT to use formulas?


Guy Fawkes(Posted 2010) [#14]
i want you to list what is wrong with using the above code and tweaking it a bit. and i bet u CAN'T list anything other than "formulas are faster or better"


Ross C(Posted 2010) [#15]
Your not making any sense. If you can't subtract two numbers, you really have no business programming at all.

You'd rather use a piece of code, you have NO idea how it works, than create something, you do? I've shown you the simple solution. It's up to you to try and code it. I really am trying to help you here, by not giving you the answer, yet giving you the idea, so you can code your own solution.


GfK(Posted 2010) [#16]
It may be better, or faster, but did you ever stop to think that maybe I didn't WANT to use formulas?
If you don't want to use formulae, then as a programmer, you're pretty much knackered.
I'm tired of people telling me what to do and what to use
You, my friend, have a serious attitude problem. You are spouting bile at the people who are trying to help you. You don't deserve their help.


Guy Fawkes(Posted 2010) [#17]
yea. yea. ur right. i would rather use something I KNOW HOW to learn, rather than use something im unfamiliar with and DONT KNOW HOW to learn.


Guy Fawkes(Posted 2010) [#18]
Shut up, gfk! u dont deserve to live! so shut ur dang mouth and LEAVE ME ALONE!


Guy Fawkes(Posted 2010) [#19]
Maybe I have an attitude because instead of teaching me the way I KNOW how to learn, you instead teach me the unknown. WHICH IS ALWAYS GOING TO BE UNKNOWN! There's a REASON I'd rather not use formulas!


Guy Fawkes(Posted 2010) [#20]
o, and where in THE hell do u see a linepick() example in the help of blitzbasic? I DONT! SO BACK OFF!


Ross C(Posted 2010) [#21]
I have shown you how to use the command. It's very simple to use. You have a start location, and a distance you want the pick to travel.


i would rather use something I KNOW HOW to learn



Jesus man... You have no idea how that code works. You have more chance of understanding a simple pick command, then a huge chunk of code.

I've seen you write code, whereby you've added number together. Remember that code you did with the box, moving with the arrow keys?

If i can explain the LinePick command any further, please let me know and i will do so.


GfK(Posted 2010) [#22]
yea. yea. ur right. i would rather use something I KNOW HOW to learn, rather than use something im unfamiliar with and DONT KNOW HOW to learn.
Isn't the whole purpose of learning something, because you don't know how to do it?

I've seen your threads on here for months now, and it strikes me that you just want people to write your code for you with as little effort as possible on your part.

Anyway - if all you're going to do is get abusive because you don't understand how to do things, then nobody is going to bother trying to help you any more. Its no good having a temper tantrum every time things don't go your way. And if you must, do it on the floor behind the sofa - like I do.

[edit]
Shut up, gfk! u dont deserve to live! so shut ur dang mouth and LEAVE ME ALONE!
Oh my. You really are a nasty piece, aren't you?


Guy Fawkes(Posted 2010) [#23]
Ok. show me an EXACT REPLICA example of what I'm trying to do. o, and also, my level's y-position is at -10000.


Guy Fawkes(Posted 2010) [#24]
DAMN RIGHT! I've been PUSHED around my WHOLE life! and im DONE BEING PUSHED AROUND, Gfk! So if ur here to push me around, gfk, just leave me alone, and never come back!


Ross C(Posted 2010) [#25]
[EDITED in hindsight]


Guy Fawkes(Posted 2010) [#26]
edit


Guy Fawkes(Posted 2010) [#27]
IM DONE BEING PUSHED AROUND BY ALL OF U!!!!!!!!!! I HAVE BEEN PUSHED AROUND MY WHOLE LIFE, AND IM DONE!


Drak(Posted 2010) [#28]
Rez what is the matter with you? You ask for help on how to do different things then get mad when people show you how to do them? That's not how help works. If you ask for help, people will be more than glad to help you, so long as you don't say we cram it down your throat.


Ross C(Posted 2010) [#29]
Indeed Gfk...

Bring back patisawesome. All good food, do not include Rez. Or potatoes.


GfK(Posted 2010) [#30]
Ross: Nobody is worth getting banned for - trust me.


Ross C(Posted 2010) [#31]
Aye, edited. Cheers.


Guy Fawkes(Posted 2010) [#32]
whats wrong with me? WHATS WRONG W/ ME?! ILL TELL YOU WHATS WRONG WITH ME! WHATS WRONG WITH ME IS IM DONE BEING PUSHED AROUND ALL MY LIFE! THATS WHATS WRONG W/ ME!


Ross C(Posted 2010) [#33]
*RossC wonders what that buzzing sound is*

Get over yourself. As i've said before, we on the forums are here to help. Sometimes to forcing you in the right direction. You throw it all back. Your should see a mental health doctor, and maybe a few print outs of your posts on here.

Oh and see that big button on the front of your PC? You can't switch it off using that. So the big bad people on the internet can't push you around.


LineOf7s(Posted 2010) [#34]
If it's any consolation, I've not coded any 3D stuff yet (so I've not needed to know), but when the time comes to use the LinePick() command, I'll know exactly how it works thanks to Ross' fine explanation above.

Thanks Ross. :o)



Buhbye Rez.


Ross C(Posted 2010) [#35]
Nps. Just make sure it's a completely closed mesh, or it could fail :)


LineOf7s(Posted 2010) [#36]
Whoa! Back off Einstein! I don't need any of your 'closed mesh' mumbo jumbo! ;o)


Ross C(Posted 2010) [#37]
Like my new sig?


LineOf7s(Posted 2010) [#38]
Actually, since you've asked, no. Really (REALLY) don't need to be reminded of this whole sordid affair every time you post.


Yeshu777(Posted 2010) [#39]
I just find it bizarre how every discussion turns out the same, maybe it's
because I'm Welsh and can only fathom sheep.


LineOf7s(Posted 2010) [#40]
Aaah, so you call it "fathoming" now? ;o)


Yeshu777(Posted 2010) [#41]
Yes, the Welsh have learnt to confuse the English with complicated words.

ie, more than 4 letters.

8o)


stayne(Posted 2010) [#42]
learnt - Pronunciation: \lernt\
chiefly British past and past participle of learn

*rolls eyes and continues drinking Franziskaner Hefeweizen*

:D


_Skully(Posted 2010) [#43]
whats wrong with me? WHATS WRONG W/ ME?! ILL TELL YOU WHATS WRONG WITH ME! WHATS WRONG WITH ME IS IM DONE BEING PUSHED AROUND ALL MY LIFE! THATS WHATS WRONG W/ ME!


Whoa ho ho!!... WOW... oh come on where are the cameras? is this Just for Laughs? Dude... take a Karate class or something... or find somewhere else to vent your insanity... if you bite the hand that feeds you like you bite at those that are trying to help you... your in for a hard life.

{popcorn}


Midimaster(Posted 2010) [#44]
to Rez

Hi Rez, its Midimaster! Do you remember? We had a long communication on german blitzforum chat!

Your problem is, that you always think somebody here in the forum wants to push you! It may be, that in former times in your life bad poeple pushed you around. But be sure: Inside this forum you are among friends. Nobody would "push" you, we all help together to live a good community.

If somebody writes you a tipp, how to solve the problem xy, and the answer is not what you were looking for, he did not do that to make you angry. he did that, because he thought, it might help. Now you should aks again or define, how you need the help. An if now no answer comes back, be sure, this is not to make you angry, this is because he has no answer or he is not online.

If we all suggest you, better to learn the programming in a fundamantal way... If we all suggest you not always ask for ready code... This is not because we want to push you. This is because we are convinced, that this would bring you more forward. We all see, how you were struggling and how intensiv you like programming. We all can see, that this is very important for you. So we are very interested to get you on a experienced level like many of us. They way is: making your experiences with the code, try and error, but also knowing a lot about the relationship between commands.

Here nobody wants to do you something bad, nobody wants to push you, all these people recognize your situation and although we do not exactly know, what happened to you, we know that we should help you and we will!

As a respect to all the other members, could you please think twice about a post you wrote in future before sending it? You may discuss hard, and postulate heavy, you can critisize everyone, and tell him, that this did not help etc.. But can you please stop writing such BAD words? This offends so hard. And primarily you know how it hurts!

I was once like you, I trusted nobody, always thought he will hurt me. I was impatient and hurted everybody, because my childhood was very bad. But new friends showed me the new way. Today I trust in my friends! I never bark anymore, I never hurt anybody. I'm patient. What happened? Today I always think twice about the intention of a communication partner, because I know today, my first (agressiv) impression is always wrong (a result of the old experiences) and if I think twice, I find a better answer to react. This could be a solution for you.

We all would be very happy, if we could help you finding a new personality. And we offer you the friendship of this community. You are welcome! Maybe some others can write some additional line to that?

to all younger ones in the forum:
Rez has a real problem, you should also be patient with him and not write too fast aswers. Please think twice too! Do not joke with him. Answer him as a friend.


(sorry for my bad english)


Ginger Tea(Posted 2010) [#45]
well said

we all have a delete key, we should all learn how to use one, ive thought of a dozzen responses to numerous posts but chose not to write them, they were either just off topic or served no real use to this thread and none were cheap shots at res

but i will say this in all honesty, if this is how you act around people in real life, i fear for your future employment
ive worked in meanial jobs just to make ends meet and my last one was just so i had enough money to move, i like alot of people, was asked to get a left handed hammer "oh har har" this might have worked if i was a teenager but as i was almost 30 it was a bit flat. i got on well with the people because we could be rude and obnoxious to each other as we were a small unit and didnt have to worry about public interaction
but we had a yts guy start in the main building and he was helping out in the yard, i went up to him and said "your still in school, there is a chance for you, learn something, dont end up stuck here." oh and i think i did send him off for a left handed hammer too ;)

the point of that block of text?
well seeing as i dont know what your quallifications are, if you were working some dead end job, someone might say something (not neccessarily about your add) and you explode like you do in the forums, i think you might find yourself out of a job more times than not

sure when your at school you get tonnes of people out to get the odd few (i know i got my more than fair share of stick when i changed schools), but when you meet someone new, like here, we dont know you have add (untill you told us way back when) all we see is someone who flies off the handle cos the square peg code given wont fit the round hole of your code

so knowing nothing about you aside from you used to be called dark shadow wing and you say you have add, we know very little about you except you are rude and ill mannered
if you have the chance to start again take it, you would have progressed further as more people would have been willing to help you if you deleted the all caps swearathon you would have posted

now you have a fit just because ja2 posts a smilie and nothing else (unless he edited his comments by the time i saw it)

to quote pulp fiction "personality goes along way"


Ross C(Posted 2010) [#46]
Edited my posts. Sorry guys. Rez just really gets to me. He may have a problem, but shouting swearing, and lying about the reasons why he can't do something doesn't help anyone. If you are honest about it Rez, then people on here can help you progress.


Guy Fawkes(Posted 2010) [#47]
now.. how INSTEAD of all that complex stuff, can i use the function stated in the 1st post to check if the player is inside of an object?


PowerPC603(Posted 2010) [#48]
I agree with all of you guys here. Rez is always throwing all tips and pointers back at the ones who are trying to help him, including me.

He always wants others to give the perfect solution for his application, while we don't even know his entire code.

Rez, things won't ever come the way you like it. Learn to accept it.

During my Arkanoid3D clone, I've learned that you simply cannot use Text on textures for example.
On some computers it might work, but it doesn't on others.

I had to use a workaround to solve it: draw the Text on an image and copyrect the image to a texture.
This wasn't exactly the way I wanted it, but WHO CARES?
The fact is: I used a workaround and that works.

And for your math problems (you don't want to use formulaes), then I suggest you don't program at all.
Just positioning a mesh is math too.

It took me 3 days how to figure out how to deflect a ball of the blocks in Arkanoid3D.
I even used up to 10 sheets A4-format to draw the block, the ball and to calculate (on paper) how the ball should be deflected.
If you don't have the patience to do such things, then don't proceed.

Even the most simple game will use math somewhere.
Like my Arkanoid3D game. Nothing as simple as launching a ball, and when it hits a block, destroy the block and deflect the ball.

But as I said, it took 3 days to figure out one formulae for deflecting the ball.

And when someone helps you out by giving example code, try to understand it and don't throw it back at them, demanding the perfect code for the problem you're facing.
Don't get angry because you don't understand it right away. Give it time, investigate why people give the code they give you and try to understand how each line of the code works and what it does.

If you can't do that, you'll end up with no help at all, simply because you don't try to understand it.



On topic:

The explanation of Ross C about doing a linepick is the most simple thing you can get.

Or you can try to create square rooms with the center of the room litterally in the center of the room.
And know the outer limits of the room (width and depth).

Example:
Your room is 20 units wide (from wall to wall).
The center is exactly in the center of the room.
Then the maximum distance from the center to a wall is only 10 units.

Then simply check the distance of your player to the center of the room.
If the distance is larger than 10 units, then your player is outside the room.
If the distance is smaller than 10 units, then your player is inside the room.

But you'll end up using math after all, because the player can be in a corner of the room.
Using math, you'll find that the corner of the room is 14.14 units from the center.

Or another solution:
Make a separate floor for each room.
Always do a linepick straight down and check the entity returned.
If it's the floor of the room, you're inside the room.
When you got an entity that's not the floor of the room, you're outside the room.
Then there is no math involved.

To use LinePick at your player's coordinates and straigth down:
LinePick EntityX#(p\Objects\Entity), EntityY#(p\Objects\Entity), EntityZ#(p\Objects\Entity), 0, -10, 0



Guy Fawkes(Posted 2010) [#49]
u know what powerpc, give as many speeches as u want, but IDGAF ANYMORE!


PowerPC603(Posted 2010) [#50]
Read my post again, and you'll find 2 possible solutions to your problem.
One with math involved, the other doesn't use math at all.
I've even given you the EXACT way to use linepick in your code.

If you need still help from me, please tell me. Or you won't hear any advice from me ever again.


Guy Fawkes(Posted 2010) [#51]
yes i might. but just a minute, im testing the above


Guy Fawkes(Posted 2010) [#52]
ok. here's what i have so far:



now, what i need to do, is find out if the player is inside the object, no matter what size the object is


Guy Fawkes(Posted 2010) [#53]
using ur version of linepick, IsInside = LinePick(EntityX#(p\Objects\Entity), EntityY#(p\Objects\Entity), EntityZ#(p\Objects\Entity), 0, -10, 0) only works when my player jumps off the ground and lands back on to the ground


Ross C(Posted 2010) [#54]
I no i said i wouldn't but... You can't use LinePick this way. Linepick simply sends a pick. You need to use PickedEntity, and compare it against an entity:

If PickedEntity() = inside_shape then
   ;do stuff
End if



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




Ross C(Posted 2010) [#56]
No, you can't use Linepick that way.

LinePick shouldn't be used that way. Just call LinePick:

Linepick x,y,z,dx,dy,dx

Then use PickedEntity() to determine what entity, if any, it has hit.


Guy Fawkes(Posted 2010) [#57]
ok, now here is what i have so far, for some reason however, the sphere is always green o.o. i thought i had this right...



Now i have:




Yeshu777(Posted 2010) [#58]
Bascially LinePick does not return anything, but (I imagine) populates a structure in memory which can then be accessed via the Pick-X- commands.


Guy Fawkes(Posted 2010) [#59]
so that is what i have so far. am i close? or no coffee?


Yeshu777(Posted 2010) [#60]
Again, LinePick does not return anything.

Assuming you're testing that the player is inside ZoneSphere1

Try...


For p.tPlayer = Each tPlayer

IsInside = ZoneSphere1;

LinePick(EntityX#(p\Objects\Entity), EntityY#(p\Objects\Entity), EntityZ#(p\Objects\Entity), MeshWidth(IsInside ), 0, MeshWidth(IsInside ))
		
		If (PickedEntity() = IsInside) Then
			EntityColor ZoneOBB, 0, 255, 0
		Else
			EntityColor ZoneOBB, 255, 0, 0
		EndIf
            Next




Guy Fawkes(Posted 2010) [#61]
Now it's returning red no matter if im in OR out of the object


Yeshu777(Posted 2010) [#62]
Where are you creating ZoneSphere1?

When you create it you'll need to make it 'pickable'.

eg.

EntityPickMode(zone_sphere_name, 1);


Guy Fawkes(Posted 2010) [#63]
Global zonesphere1 = Object_Zone_Create(0.0, 15.0, 0.0, 100, 100, 100, 1) EntityPickMode zonesphere1, 2

it still didnt work


Yeshu777(Posted 2010) [#64]
Shouldn't it be

EntityPickMode(zonesphere1,1);

1 is for spheres according to the docs.


Guy Fawkes(Posted 2010) [#65]
i tried that. it didnt work


Yeshu777(Posted 2010) [#66]
Ok..

What else have you tried so I am not posting something that already you know doesn't work?


Guy Fawkes(Posted 2010) [#67]
ive tried the different parameters of pickmode. thats all


Yeshu777(Posted 2010) [#68]
ok, so it's not that.

Without full code to try anything it's a little like pulling teeth, so
have you tried adding debug info on the screen for:

EntityX#(p\Objects\Entity)
EntityY#(p\Objects\Entity)
EntityZ#(p\Objects\Entity)
MeshWidth(IsInside )
PickedEntity()

It'll give you an idea of the parameters your checking and whats being returned.


Guy Fawkes(Posted 2010) [#69]
yes, and they all return something


Yeshu777(Posted 2010) [#70]
How about posting what they return here.


Guy Fawkes(Posted 2010) [#71]
um,

X: Player's X
Y: Player's Y
Z: Player's Z
PickedEntity(): Picked ID of ZoneSphere1
MeshWidth(ZoneSphere1): 2.0 for some reason but it's supposed to be 100.0. I rescaled it using ScaleEntity()


Yeshu777(Posted 2010) [#72]
[edit]
OK, so you are saying that the Pick is correct and the sphere is being detetced.


Guy Fawkes(Posted 2010) [#73]
to write down the actual coordinates would be impossible. reason is because the coordinates are always changing. i CAN get pickedentity() and we already know meshwidth(ZoneSphere1) = 100.0, same for height / depth. they are both 100.0.


Yeshu777(Posted 2010) [#74]
Suggestion.

Could you knock up a simple demo (using create cube etc).. but using the above elements that are causing problems?

At least I can then run the code myself and test it.


Guy Fawkes(Posted 2010) [#75]
i cant tell u picked entity and zonesphere1's ids cuz they both change everytime i play the game. i CAN however tell u that the 1st 4 numbers in both ids match each other. Example: 1059 is the 1st for numbers in ZoneSphere1's id, so pickedentity() also has 1059 for the 1st 4 numbers in the id.


Guy Fawkes(Posted 2010) [#76]
yes, ill try


Yeshu777(Posted 2010) [#77]
Please do, we can then use that as a test bed for any future problems.

Here's something I just quickly knocked up with the Blitz Demo.

I created a sphere under the floor that I LinePick downwards to check I'm in the zone.

The second sphere is just to show where the zone is.



Seems to work.


Guy Fawkes(Posted 2010) [#78]
i too knocked up a demo of what is going on.

here:




Guy Fawkes(Posted 2010) [#79]
and i need to be able to tell whether or not my player is inside the object. whether it be a sphere, cube, mesh, etc..


Yeshu777(Posted 2010) [#80]
Will have a look now.


Guy Fawkes(Posted 2010) [#81]
missing something... the problem is, i need to detect whether or not my player is inside the object whether it be a cube, sphere, etc.. the PROBLEM is it has to be able to detect if it's in the zone sphere no matter WHERE it IS in the sphere, and no matter what position the zonesphere has


Yeshu777(Posted 2010) [#82]
Seems to work better with...

LinePick(EntityX#(Camera), EntityY#(Camera), EntityZ#(Camera), MeshWidth(zonesphere1)*5, 0, MeshWidth(zonesphere1)*5)



Guy Fawkes(Posted 2010) [#83]
so does it work now? regardless of size or shape of the zone sphere?


Guy Fawkes(Posted 2010) [#84]
where did u get 5 from? and how can i use a variable to make it so it works like that everytime?

space key for wireframe, enter for pause/unpause z/a to move up/down arrow keys to move

also, here's a demo fix, can u confirm if it is entirely correct?




Yeshu777(Posted 2010) [#85]
I just plucked 5 out of thin air.

Will have a look at the demo shortly.


Guy Fawkes(Posted 2010) [#86]
ok, now why is this staying green? it should be green and change the footstep sound when inside the green sphere. but when outside, it should change the sound to normal, and back to red.




Yeshu777(Posted 2010) [#87]
Simply because...

	If PickedEntity() = IsInside
		
		zonetype = 2
		
	EndIf


You are not reseting zonetype.

Once zonetype is set to 2, there is nothing to set it otherwise.

How would you solve this?


Guy Fawkes(Posted 2010) [#88]


?


Who was John Galt?(Posted 2010) [#89]
Why the '?' ? Why not actually type the extra line in and see what it does rather than wait for another reply.

In the code you posted, zonetype will always end up as 0, as even if picked entity is inside, you still go ahead and reset zonetype to 0.


Yeshu777(Posted 2010) [#90]
Ok, basically..

You're checking that the player is inside the zone and then never reseting it.

IF... Then ... Else


If PickedEntity() = IsInside
		
     zonetype = 2
Else
     zonetype = Null
End If		



This will set zonetype to a "non parameter" that your Select statement will ignore when not in a zone.


Guy Fawkes(Posted 2010) [#91]
ok, it sorta works. for some reason, if my player is say under a ledge, or an object that isnt open, it changes back to red. o.o


Yeshu777(Posted 2010) [#92]
Well I can't test that here, are the objects obscuring the LinePick?

ie. is LinePick returning the ledge instead of the zone?


Guy Fawkes(Posted 2010) [#93]
no. whats going on is that when player is under a ledge, the line pick cant see the sphere, causing it to turn red


Ross C(Posted 2010) [#94]
Can't you post an .exe of the application for people to test?


Yeshu777(Posted 2010) [#95]
Have you tried setting the pickmode of the ledge to 0?


_PJ_(Posted 2010) [#96]
Use debuglog

90% of your problems will be a lot clearer to you and others if you track variables and handles using some form of output.

Shouldn't IsInside and zonetype be global if you're not using the ZoneUpdate() function?

It seems odd to me that you have
IsInside = zonesphere1
	
	For p.tPlayer = Each tPlayer
		
		LinePick(EntityX#(p\Objects\Entity), EntityY#(p\Objects\Entity), EntityZ#(p\Objects\Entity), MeshWidth(zonesphere1)*150, MeshWidth(zonesphere1)*150, MeshWidth(zonesphere1)*150)
		
	Next
	
	If PickedEntity() = IsInside
		
		zonetype = 2
		
	EndIf


Why not just:

	For p.tPlayer = Each tPlayer
		
		LinePick(EntityX#(p\Objects\Entity), EntityY#(p\Objects\Entity), EntityZ#(p\Objects\Entity), MeshWidth(zonesphere1)*150, MeshWidth(zonesphere1)*150, MeshWidth(zonesphere1)*150)
		
	Next
	
	If PickedEntity() = zonesphere
		
		zonetype = 2
else
zonetype=0
		
	EndIf


Also, you might want to prevent a new linepick if p or any of the nested types, are Null.


Guy Fawkes(Posted 2010) [#97]
well why is it acting weird under ledges?


Who was John Galt?(Posted 2010) [#98]
I'm expecting Jeremy Beadle to jump out any second.....


_PJ_(Posted 2010) [#99]

well why is it acting weird under ledges?



The honest answer is:

because you have used code and functions that you do not (or have not tried to) understand, therefore, you are using them in a way that doesn't reflect what you want it to achieve.

Computer code rarely does things 'weirdly', unless there's a bug in B3D, then any weirdness you find is the program doing exactly what you've programmed it to do. The weirdness then, is in your programming.


Guy Fawkes(Posted 2010) [#100]
um, no, it's b/c linepick is SLOW and FAILS ><


LineOf7s(Posted 2010) [#101]
Okay, I actually LOLed that time.


Guy Fawkes(Posted 2010) [#102]
yea.... so did i...


LineOf7s(Posted 2010) [#103]
There's a subtle difference though, concerning targets of LOL.


Guy Fawkes(Posted 2010) [#104]
i take that as an offense, so i direct that "LOL" to you


stayne(Posted 2010) [#105]
lol


Guy Fawkes(Posted 2010) [#106]
and u. and anyone else who decides to be a jackass


Amon(Posted 2010) [#107]
Rez? Learn this behaviour and it will do wonders for you. Pretend in your mind you could behave anyway you wanted and didn't have to behave the same way all the time.

Now close your eyes and learn the following behaviour and practice it.

[BEHAVIOUR]

When people cuss or make fun of me or say anything to me to attack me I will let it all and their words bounce off my ego like bullets off Superman.

[ENDBEHAVIOUR]

Master that as well as ignoring people and you'll find that you end up the champ. :)


Guy Fawkes(Posted 2010) [#108]
screw that. i shouldnt have to take it, and nor should u.


Who was John Galt?(Posted 2010) [#109]
LOL!


Amon(Posted 2010) [#110]
You don't have to take it though. It's you chosing to take it. The same behaviour that makes you chose to take it then reply like you do you could sort of reformat, In Your Mind Now, and change it to ignore people instead.

Like I said if you learn that sticks and stones will break your bones but words will never hurt you then you'll be happier and get on better on this forum.

Is the stress of taking in everything people say and retaliating less or more than you would get if you ignored them?

Sometimes, Rez, the stress you get in to because of a situation isn't worth what the situation was about in the first place.

Imagine peoples words as the bullets and You Are Superman And THEY Bounce off you.

Don't let people dictate how you behave. Dictate yourself how you behave.

Just some friendly advice from a grashopper. :)


Guy Fawkes(Posted 2010) [#111]
yea. i know. and ill start by ignoring john galt. idrgaf if it ticks him off or not.


Who was John Galt?(Posted 2010) [#112]
*HOT TIP* If you're ignoring someone, don't announce it. I know this advice will bounce off your cranium like all the other good advice you have been given here.

There are plenty of noobies on here asking remedial questions, but they don't get any stick. So ask yourself, why do you get stick? Perhaps it's because you are ungrateful, show no wish to learn, and swear at people?

If you want to change your world, first change yourself. This is an honest piece of advice. Do yourself a favour and do not deflect it by considering it an insult.


Who was John Galt?(Posted 2010) [#113]
Another piece of advice.. if you are serious about the ADD, try this:

www.emofree.com

You can download a free document on emotional freedom technique and be up and applying it within an hour. Many people have had success with it. If attention deficit causes you problems in sitting down and learning it, get someone to guide you through it.


Ginger Tea(Posted 2010) [#114]
emo free sounds like a campaign to get rid of a musical genre ;)


_PJ_(Posted 2010) [#115]

um, no, it's b/c linepick is SLOW and FAILS ><

Oh then it MUST be a blitz3D bug.


Guy Fawkes(Posted 2010) [#116]
John Galt, Shut ur damn mouth! IVE HAD it with u ppl tormenting ppl w/ disabilities!


Who was John Galt?(Posted 2010) [#117]
Do yourself a favour and do not deflect it by considering it an insult.

I thought you were ignoring me? As for tormenting you, take a look at emofree.com. It's not a wind-up or a joke, but a possible path to some help for you.

[edit]Disclaimer: I am not a qualified professional in the field. It's just a recommendation based on personal experience.