another entityvisible question

Blitz3D Forums/Blitz3D Programming/another entityvisible question

cash(Posted 2008) [#1]
quick question

I have a level which is a single b3d model with buidings , walls etc.

entityvisible doesnt seem to work in this scenario.

enemies still react even if the player is completely hidden behind a wall or building.

Is it because the complete model does not obcure the views (obscurer is set).

should the buildings and walls be individually loaded and placed for this to work properly.

Does entityvisible get confused with my large entire model ?


GfK(Posted 2008) [#2]
Have you set EntityPickMode to use polygon geometry with the obscurer flag set to True?


Ross C(Posted 2008) [#3]
If you use loadanimmesh, i believe you must set each individual meshes pickmode.


cash(Posted 2008) [#4]
I am using entitypickmode level,2,true

It is not an animmesh

The enemies and player are also pickable (if that is relevant for entityvisible)

basically if the player is visible the enemies can do something.

if not they do something else.

however it seems to ignore this completely and appears as if the player is visible whatever.


GfK(Posted 2008) [#5]
RossC has a point. Try doing a CountChildren on your level mesh. Its been ages since I've done anything with BB3D but I have a feeling that a B3D model might always have at least one child (this is what you need to set as an obscurer).


cash(Posted 2008) [#6]
okay, thanks for the info guys....however I am still having problems and beginning to figure out alternatives...unsuccessfully. I have loaded a cube onto my level and scaled it up so it will completely obscure my player if he is behind it. But is still doesnt stop the enemies doing what they shouldnt.

It is not an animated mesh so I cannot find the child.
(As a side note if I made it an animated mesh with a single joint then my player to level collisions stopped working completely).

I must be doing something wrong but my code is so simple I cant figure out where. For example

if entityvisible (enemy,man)=true then
text 10,10,"HIT"
else
text 10,10,"NOHIT"
endif


jfk EO-11110(Posted 2008) [#7]
Since EntityVisible is about as slow as a linepick I would suggest to use a LinePick in the first place. You may then pick from the enemies eyes to the player, in respect of distance and direction of the enemy etc. Building must be polygonal pickable of course.


GfK(Posted 2008) [#8]
Linepicks are slower over a longer distance. If you're doing hundreds of them across thousands of units then you're going to have performance problems.