Keep in mind that the deployables would be a different (but related) system from the buildable system, although it looks like we would have some deployables that would correspond in behavior to some similar buildables.But what primarily distinquishes deployabales from buildables is that deployables are more portable in form (i.e. smaller), have a relatively temporary life, don’t require any construction time (just buy them intact, carry, and drop), and cost credits instead of bp.
Ah, you mentioned this to me today, but I thought that you were just refering checking if there is anything blocking the “line of sight” between the player and mine, to check if the mine is actually in the field of view of the player, besides using a line trace, you would also have to do a conical range test, similar to what is done with the trapper range.
//only allow a narrow field of "vision"
VectorNormalize( distance ); //is now direction of target
if( DotProduct( distance, self->s.origin2 ) < LOCKBLOB_DOT )
Basically it would involve generating a unit direction vector pointing from the player to the mine, taking the the dot product between that vector, and the forward view vector of the player, and checking that it is less than a certain arccosine value.
In that example code above, instead of
self->s.origin2 , which is the unit vector pointing in the direction that a buildable faces, you are going to want to find the forward view vector for the player as follows:
AngleVectors( self->client->ps.viewangles, forward, NULL, NULL );
I was thinking of that as a possible deployable. I know that some trem mods had a jump pad buildable, like rcz unlimited. A fun additional feature I already added is that jump pads work on buildables that are built on them, I did that because in default trem if you built a buildable on a cannon (for example) it would just annoyingly and continuously trigger the launch sound, until the buildable is removed by a player. So perhaps a jump pad deployable could be used to aid in building, to get a buildable in an otherwise hard to reach place .