alien56
20th October 2007, 06:44
Hello,
here is my CrossHair and ESPCross for RO(non Texture Import style). This way seems at times to be a little laggy with ESP part of things(maybe not caused by this, Im not sure), But I would Advise to setup the ESPCross in a Seperate Function and then Call it in your ESP. Im not 100% certain if that would have an effect on lagg, maybe somebody more knowlegeable about how the UnrealEngine functions could Clerify that. Anyways here it is.
Declares/DefaultProperties:
var config float xhairsize, espcrosssize;
defaultproperties
{
xhairsize=14; //or however big you want it
espcrosssize=3;//or .....
Now with the xhairsize and espcrosssize floats you can create a Scalling function for ingame size selection via KeyEvent, Execfunction, or MouseMenu for example. I also plan on doing a Color scale.
PostRender:
function MyPostRender (Canvas Canvas)
{
MyController = ViewportOwner.Actor;
Me = MyController.Pawn;
Canvas.Style = 3;
Canvas.bCenter = False;
Canvas.bNoSmooth = True;
//Main Cross
Canvas.SetDrawColor(0, 255, 0, 25);
//xHair Right Side
Canvas.SetPos((Canvas.SizeX / 2) + 1, (Canvas.SizeY / 2));
Canvas.DrawTile(Texture'Engine.WhiteSquareTexture' , xhairsize, 2, 0, 0, 2, 2);
//xHair Left Side
Canvas.SetPos((Canvas.SizeX / 2) - xhairsize, (Canvas.SizeY / 2));
Canvas.DrawTile(Texture'Engine.WhiteSquareTexture' , xhairsize - 0.6, 2, 0, 0, 2, 2);
//xHair Down
Canvas.SetPos((Canvas.SizeX / 2), (Canvas.SizeY / 2) + 1);
Canvas.DrawTile(Texture'Engine.WhiteSquareTexture' , 2, xhairsize, 0, 0, 2, 2);
//xHair Up
Canvas.SetPos((Canvas.SizeX / 2), (Canvas.SizeY / 2) - xhairsize);
Canvas.DrawTile(Texture'Engine.WhiteSquareTexture' , 2, xhairsize, 0, 0, 2, 2);
if (!botactive || MyController == None || Me == None || Me.PlayerReplicationInfo == None)
{
Return;
}
PawnRelated(Canvas);
}
PawnRelated:
function PawnRelated(Canvas Canvas)
{
local Pawn Target;
foreach Me.Level.AllActors(Class'Pawn', Target)
{
if (ValidTarget(Target))
{
ESPCross(Target, Canvas);
}
}
}
ValidChecks/TeamCheck:
function bool ValidTarget (Pawn Target)
{
if ((Target != None) &&
(!Target.bHidden) &&
(Target.Health > 0) &&
(!Target.IsInState('Dying')) &&
(!Target.IsA('StaticPawn')) &&
(Target.PlayerReplicationInfo != None) &&
(!Target.PlayerReplicationInfo.bIsSpectator) &&
(!Target.PlayerReplicationInfo.bWaitingPlayer) &&
(Target.PlayerReplicationInfo != Me.PlayerReplicationInfo))
{
Return True;
}
else
{
Return False;
}
}
function GetTeamColor(Pawn Target, Canvas Canvas)
{
if(Target.PlayerReplicationInfo.Team != Me.PlayerReplicationInfo.Team)
{
Canvas.SetDrawColor(255,0,0,0);
}
else
Canvas.SetDrawColor(0,255,0,0);
}
And the ESP Function:
function ESPCross(Pawn Target, Canvas Canvas)
{
local vector MyLocation;
local vector TargetLocation;
local vector DiffLocation;
local vector X,Y,Z;
local float ScreenPosX;
local float ScreenPosY;
MyLocation = Me.Location;
MyLocation.Z += Me.EyeHeight;
TargetLocation = Target.Location;
TargetLocation.Z += Target.CollisionHeight / 2;
DiffLocation = TargetLocation - MyLocation;
GetAxes(Normalize(Me.GetViewRotation()),X,Y,Z);
if (DiffLocation Dot X > 0.70)
{
ScreenPosX = (Canvas.ClipX / 2) + ( (DiffLocation Dot Y)) * ((Canvas.ClipX / 2) / Tan(MyController.FovAngle * Pi/360)) / (DiffLocation Dot X);
ScreenPosY = (Canvas.ClipY / 2) + (-(DiffLocation Dot Z)) * ((Canvas.ClipX / 2) / Tan(MyController.FovAngle * Pi/360)) / (DiffLocation Dot X);
Canvas.Style = 3;
Canvas.bCenter = False;
Canvas.bNoSmooth = True;
GetTeamColor(Target, Canvas);
//xHair Right Side
Canvas.SetPos(ScreenPosX + 1, ScreenPosY);
Canvas.DrawTile(Texture'Engine.WhiteSquareTexture' , espcrosssize, 2, 0, 0, 2, 2);
//xHair Left Side
Canvas.SetPos(ScreenPosX - espcrosssize, ScreenPosY);
Canvas.DrawTile(Texture'Engine.WhiteSquareTexture' , espcrosssize, 2, 0, 0, 2, 2);
//xHair Down
Canvas.SetPos(ScreenPosX, ScreenPosY + 1);
Canvas.DrawTile(Texture'Engine.WhiteSquareTexture' , 2, espcrosssize, 0, 0, 2, 2);
//xHair Up
Canvas.SetPos(ScreenPosX, ScreenPosY - espcrosssize);
Canvas.DrawTile(Texture'Engine.WhiteSquareTexture' , 2, espcrosssize, 0, 0, 2, 2);
}
}
Credits:
Me(I decided to start over from scratch and made this from viewing the Canvas.uc source file, Starting with the simplest and work my back up again since I deleted my Source when Reinstalling the game.)
whoever first created the ESP ScreenView Func(I just pulled it from one of Helios's UT2003 examples, and also from AAO bots)
selig who Inspired me to create it.
here is my CrossHair and ESPCross for RO(non Texture Import style). This way seems at times to be a little laggy with ESP part of things(maybe not caused by this, Im not sure), But I would Advise to setup the ESPCross in a Seperate Function and then Call it in your ESP. Im not 100% certain if that would have an effect on lagg, maybe somebody more knowlegeable about how the UnrealEngine functions could Clerify that. Anyways here it is.
Declares/DefaultProperties:
var config float xhairsize, espcrosssize;
defaultproperties
{
xhairsize=14; //or however big you want it
espcrosssize=3;//or .....
Now with the xhairsize and espcrosssize floats you can create a Scalling function for ingame size selection via KeyEvent, Execfunction, or MouseMenu for example. I also plan on doing a Color scale.
PostRender:
function MyPostRender (Canvas Canvas)
{
MyController = ViewportOwner.Actor;
Me = MyController.Pawn;
Canvas.Style = 3;
Canvas.bCenter = False;
Canvas.bNoSmooth = True;
//Main Cross
Canvas.SetDrawColor(0, 255, 0, 25);
//xHair Right Side
Canvas.SetPos((Canvas.SizeX / 2) + 1, (Canvas.SizeY / 2));
Canvas.DrawTile(Texture'Engine.WhiteSquareTexture' , xhairsize, 2, 0, 0, 2, 2);
//xHair Left Side
Canvas.SetPos((Canvas.SizeX / 2) - xhairsize, (Canvas.SizeY / 2));
Canvas.DrawTile(Texture'Engine.WhiteSquareTexture' , xhairsize - 0.6, 2, 0, 0, 2, 2);
//xHair Down
Canvas.SetPos((Canvas.SizeX / 2), (Canvas.SizeY / 2) + 1);
Canvas.DrawTile(Texture'Engine.WhiteSquareTexture' , 2, xhairsize, 0, 0, 2, 2);
//xHair Up
Canvas.SetPos((Canvas.SizeX / 2), (Canvas.SizeY / 2) - xhairsize);
Canvas.DrawTile(Texture'Engine.WhiteSquareTexture' , 2, xhairsize, 0, 0, 2, 2);
if (!botactive || MyController == None || Me == None || Me.PlayerReplicationInfo == None)
{
Return;
}
PawnRelated(Canvas);
}
PawnRelated:
function PawnRelated(Canvas Canvas)
{
local Pawn Target;
foreach Me.Level.AllActors(Class'Pawn', Target)
{
if (ValidTarget(Target))
{
ESPCross(Target, Canvas);
}
}
}
ValidChecks/TeamCheck:
function bool ValidTarget (Pawn Target)
{
if ((Target != None) &&
(!Target.bHidden) &&
(Target.Health > 0) &&
(!Target.IsInState('Dying')) &&
(!Target.IsA('StaticPawn')) &&
(Target.PlayerReplicationInfo != None) &&
(!Target.PlayerReplicationInfo.bIsSpectator) &&
(!Target.PlayerReplicationInfo.bWaitingPlayer) &&
(Target.PlayerReplicationInfo != Me.PlayerReplicationInfo))
{
Return True;
}
else
{
Return False;
}
}
function GetTeamColor(Pawn Target, Canvas Canvas)
{
if(Target.PlayerReplicationInfo.Team != Me.PlayerReplicationInfo.Team)
{
Canvas.SetDrawColor(255,0,0,0);
}
else
Canvas.SetDrawColor(0,255,0,0);
}
And the ESP Function:
function ESPCross(Pawn Target, Canvas Canvas)
{
local vector MyLocation;
local vector TargetLocation;
local vector DiffLocation;
local vector X,Y,Z;
local float ScreenPosX;
local float ScreenPosY;
MyLocation = Me.Location;
MyLocation.Z += Me.EyeHeight;
TargetLocation = Target.Location;
TargetLocation.Z += Target.CollisionHeight / 2;
DiffLocation = TargetLocation - MyLocation;
GetAxes(Normalize(Me.GetViewRotation()),X,Y,Z);
if (DiffLocation Dot X > 0.70)
{
ScreenPosX = (Canvas.ClipX / 2) + ( (DiffLocation Dot Y)) * ((Canvas.ClipX / 2) / Tan(MyController.FovAngle * Pi/360)) / (DiffLocation Dot X);
ScreenPosY = (Canvas.ClipY / 2) + (-(DiffLocation Dot Z)) * ((Canvas.ClipX / 2) / Tan(MyController.FovAngle * Pi/360)) / (DiffLocation Dot X);
Canvas.Style = 3;
Canvas.bCenter = False;
Canvas.bNoSmooth = True;
GetTeamColor(Target, Canvas);
//xHair Right Side
Canvas.SetPos(ScreenPosX + 1, ScreenPosY);
Canvas.DrawTile(Texture'Engine.WhiteSquareTexture' , espcrosssize, 2, 0, 0, 2, 2);
//xHair Left Side
Canvas.SetPos(ScreenPosX - espcrosssize, ScreenPosY);
Canvas.DrawTile(Texture'Engine.WhiteSquareTexture' , espcrosssize, 2, 0, 0, 2, 2);
//xHair Down
Canvas.SetPos(ScreenPosX, ScreenPosY + 1);
Canvas.DrawTile(Texture'Engine.WhiteSquareTexture' , 2, espcrosssize, 0, 0, 2, 2);
//xHair Up
Canvas.SetPos(ScreenPosX, ScreenPosY - espcrosssize);
Canvas.DrawTile(Texture'Engine.WhiteSquareTexture' , 2, espcrosssize, 0, 0, 2, 2);
}
}
Credits:
Me(I decided to start over from scratch and made this from viewing the Canvas.uc source file, Starting with the simplest and work my back up again since I deleted my Source when Reinstalling the game.)
whoever first created the ESP ScreenView Func(I just pulled it from one of Helios's UT2003 examples, and also from AAO bots)
selig who Inspired me to create it.