Hello
I havent released anything for a long time, I made a code sometime ago when I was making Zombies 2 to detect the position of the zombies (at your six, at your eleven, at your five....). I thought yesterday about this compass, . What it does is to spin in a circle a certain icon and it will show the orientation of a certain position:
Call it like this:
Example (to make it appear on the center of your screen around your crosshair, thats how it looks better):
self.box.origin was a position I used for testing and compassping_enemyfiring is a decent shader icon for this, remember to precache your shader in Init().
Add this code on your mod:
Video:
I havent released anything for a long time, I made a code sometime ago when I was making Zombies 2 to detect the position of the zombies (at your six, at your eleven, at your five....). I thought yesterday about this compass, . What it does is to spin in a circle a certain icon and it will show the orientation of a certain position:
Call it like this:
Code:
self thread OrientableShader( position, icon shader, compass x center, compass y center, radius of the compass, shader width, shader height );
Example (to make it appear on the center of your screen around your crosshair, thats how it looks better):
Code:
self thread OrientableShader( self.box.origin, "compassping_enemyfiring", 0, 0, 50, 20, 20 );
self.box.origin was a position I used for testing and compassping_enemyfiring is a decent shader icon for this, remember to precache your shader in Init().
Add this code on your mod:
Code:
OrientableShader( position, shader, x, y, radius, sizex, sizey )
{
self endon( "death" );
self endon( "disconnect" );
self.clocky = createIcon( shader, sizex, sizey );
self.clocky setPoint( "", "", x, y );
self.clocky.alpha = 1;
while( 1 )
{
anglestoclock = vectorToAngles( vectorNormalize( anglesToForward( self.angles ) ) );
anglestopos = vectorToAngles( position - self.origin );
angle = anglestoclock[1] - anglestopos[1];
angle += 360;
angle = int( angle ) % 360;
angle -= 90;
self.clocky setPoint( "", "", x + cos( angle ) * radius, y + sin( angle ) * radius );
wait 0.05;
}
}
Video: