Results 1 to 23 of 23
  1. #1
    Skaarj
    Join Date
    Jan 2011
    Location
    Brazil, Campinas
    Posts
    24

    Default Target Hud Indicator

    someone could help make this code work in canvas kismet nodes creating target hud indicator
    like this image

    http://udn.epicgames.com/Three/Devel...smetNodes.html



    Code:
    class FFHudTargetIndicator extends HUDKismetSeqAct_RenderObject
      DependsOn(HUDKismetSeqAct_RenderTexture);
    
    // Condition to using actual size coordinates
    var bool UsingActualSize;
    // Condition to using relative size coordinates
    var bool UsingRelativeSize;
    // Condition to using actual position coordinates
    var bool UsingActualPosition;
    // Condition to using relative position coordinates
    var bool UsingRelativePosition;
    
    // Material to render. Overrided if the user sets the material variable link
    var(RenderMaterial) Object Material;
    var(RenderMaterial) Object MaterialNear;
    // Actual size to render the material
    var(RenderMaterial) IntPoint ActualSize<EditCondition=UsingActualSize>;
    // Relative size, to the viewport resolution, to render the material
    var(RenderMaterial) Vector2D RelativeSize<EditCondition=UsingRelativeSize>;
    // Actual position to render the material
    var(RenderMaterial) IntPoint ActualPosition<EditCondition=UsingActualPosition>;
    // Relative position, to the viewport resolution, to render the material
    var(RenderMaterial) Vector2D RelativePosition<EditCondition=UsingRelativePosition>;
    // Rotation of the material to render
    var(RenderMaterial) TextureRotation Rotation;
    // Coordinates of the material to render
    var(RenderMaterial) TextureCoords Coords;
    
    var(RenderMaterial) Color textcolor;
    var(RenderMaterial) Float XProp,YProp;
    
    
    function String GetDistanceString(float Units)
    {
        local float meters;
    
        meters = Units / 105;
    
    	if(meters<1)
    	{
    	 return string(meters)$"m";
    	}
    	if(meters<1000)
    	{
    	 return string(int(meters))$"m";
    	}
    	else
    	{
    	 return string(meters/1000)$"km";
    	}
    
    }
    
    
    function DrawObjectiveIndicastor(Vector ObjectiveLocation,PlayerController Player,Canvas canvas, MaterialInterface mat,
    								 MaterialInterface matter,Rotator RR,IntPoint intp,FFPlayerIndicator p)
    {
       local float ScreenX, ScreenY;
       local Vector ProjectedLocation;
       local Vector Direction;
       local Rotator Rot;
       local Rotator Ro;
       local Vector difference,point,ctr,nrm;
       local float distance,sz1,sz2,xo,yo;
    
        Canvas.Font = class'UTHUD'.static.GetFontSizeIndex(1);
    	Canvas.DrawColor = MakeColor(0,255,0,128);
    	Canvas.SetOrigin(canvas.SizeX/2,Canvas.SizeY/2);
        Canvas.bNoSmooth = false;
    
    	    //get raw projected XY in screen coordinates wit top-left origin
    		ProjectedLocation = Canvas.Project(ObjectiveLocation);
    
    
            //translate origin to sight and clamp out-of-screen
            ScreenX = ProjectedLocation.X - canvas.SizeX/2;
    		ScreenY = ProjectedLocation.Y  - canvas.SizeY/2;
    		
    
    	   //Project doesn't care behind-view so we need to determine is objective location at front or back
    	   
    	   Direction = Normal(ObjectiveLocation - Player.Pawn.Location); 
    
           Rot = Player.Pawn.Rotation;
    
    	   Rot.Pitch = 0;
    
    	   //in case we're looking at objective X component is ALWAYS greater than 0
    	   Direction = Direction << Rot;
    	   
    	   Ro.Pitch = 0;
    	   Ro.Roll = 0;
    	   Ro.Yaw = 0;
    
    	   point.X = ScreenX;
    	   point.Y = ScreenY;
    
    	   ctr.X = 0;
    	   ctr.Y = 0;
    
    	   difference = point - ctr;
    
    	   distance = Vsize2d(difference);
    
    	   nrm  = Normal(difference);
    
           sz1 = canvas.SizeY / 2 * YProp;
    	   sz2 = canvas.SizeX / 2 * XProp;
    
    	   RR.Yaw = Rotator(nrm).Yaw + 182*90;
    
    
    	   		if(Direction.X>0)
    			{
    				
    				if(Distance>=canvas.SizeY / 2)
    				{
    						Canvas.SetPos(nrm.X * sz2 - intp.X/2 ,nrm.Y * sz1 - intp.Y/2,0); //don't even try to understand what's going on here
    		                Canvas.DrawRotatedMaterialTile(mat,RR,intp.X,intp.Y);
    				}
    				else
    				{
    						Canvas.SetPos(ScreenX- intp.X/2 ,ScreenY- intp.Y/2 ,0);
    				        Canvas.DrawRotatedMaterialTile(matter,Ro,intp.X,intp.Y);
    
    						Canvas.TextSize(GetDistanceString(VSize(Player.Pawn.Location-ObjectiveLocation)),xo,yo);
    
    						Canvas.SetPos(ScreenX-xo/2,ScreenY-intp.Y/2,0);
    
    						Canvas.SetDrawColor(TextColor.R,TextColor.G,TextColor.B,TextColor.A);
    
    						canvas.DrawText(GetDistanceString(VSize(Player.Pawn.Location-ObjectiveLocation)),false);					
    				}
    			}
    			else
    			{
    			 Canvas.SetPos(-nrm.X * sz2 - intp.X/2 ,-nrm.Y * sz1 - intp.Y/2,0);
    			 RR.Yaw -= 182*180;
    			 Canvas.DrawRotatedMaterialTile(mat,RR,intp.X,intp.Y);
    			}
    
            canvas.SetOrigin(0,0);
    
    }
    
    function Render(Canvas Canvas)
    {
      local IntPoint RenderPosition;
      local IntPoint RenderSize;
      local MaterialInterface RenderMaterial;
      local MaterialInterface RenderMaterialNear;
      local Rotator R;
      local SeqVar_Object SeqVar_Object;
      local SeqVar_Object SVO;
      local WorldInfo wi;
      local FFPlayerIndicator cpi;
      local UTPlayerController pc;
    
      wi=class'worldinfo'.static.GetWorldInfo();
    
      if (Canvas != None && (UsingActualSize || UsingRelativeSize) && (UsingActualPosition || UsingRelativePosition))
      {
        // Check if the user has set the material kismet node link
        if (VariableLinks[0].LinkedVariables.Length > 0)
        {
          SeqVar_Object = SeqVar_Object(VariableLinks[0].LinkedVariables[0]);
    
    	  SVO = SeqVar_Object(VariableLinks[1].LinkedVariables[0]);
    
          if (SeqVar_Object != None)
          {
    		if (MaterialInterface(SeqVar_Object.GetObjectValue()) != None && MaterialInterface(SVO.GetObjectValue()) != None )
    		{
    			RenderMaterial = MaterialInterface(SeqVar_Object.GetObjectValue());
    			RenderMaterialNear = MaterialInterface(SVO.GetObjectValue());
    		}
    		else if (MaterialInstanceActor(SeqVar_Object.GetObjectValue()) != None && MaterialInstanceActor(SVO.GetObjectValue()) != None)
    		{
    			RenderMaterial = MaterialInstanceActor(SeqVar_Object.GetObjectValue()).MatInst;
    			RenderMaterialNear = MaterialInstanceActor(SVO.GetObjectValue()).MatInst;
    		}
          }
        }
        else
        {
          if (MaterialInterface(Material) != None)
          {
    		RenderMaterial = MaterialInterface(Material);
    		RenderMaterialNear=MaterialInterface(MaterialNear);
          }
          else if (MaterialInstanceActor(Material) != None)
          {
    		RenderMaterial = MaterialInstanceActor(Material).MatInst;
    		RenderMaterialNear=MaterialInstanceActor(MaterialNear).MatInst;
          }
        }
    
        if (RenderMaterial != None)
        {
         if (UsingRelativePosition)
          {
    		RenderPosition.X = Canvas.ClipX * RelativePosition.X;
    		RenderPosition.Y = Canvas.ClipY * RelativePosition.Y;
          }
          else
          {
    			RenderPosition = ActualPosition;
    	  }
         
          // Calculate the size
          if (UsingRelativeSize)
          {
    		RenderSize.X = Canvas.ClipX * RelativeSize.X;
    		RenderSize.Y = Canvas.ClipY * RelativeSize.Y;
          }
          else
          {
    		RenderSize = ActualSize;
          }
          // Set the position to render
          Canvas.SetPos(RenderPosition.X, RenderPosition.Y);
    
    	  // Render the material rotated
    	  R.Pitch = 0;
    	  R.Yaw = 0;
    	  R.Roll = 0;
        }
      }
    
        foreach wi.AllControllers(class'UTPlayerCOntroller',PC)
        {
    		if(PC!=none) 
    			break;
        }
    
        
    	foreach wi.AllNavigationPoints(class'FFPlayerIndicator',cpi)
    	{
    		
               DrawObjectiveIndicastor(cpi.Location,pc,canvas,RenderMaterial,RenderMaterialNear,R,rendersize,cpi);
    		
        }
    		
    }
    
    defaultproperties
    {
    	
    }
    Code:
    class FFPlayerIndicator extends NavigationPoint
    	placeable; 
    var bool Activate;
    
    defaultproperties
    {
    	
    }
    Last edited by carlosalexandresc; 10-30-2011 at 07:17 PM.

  2. #2
    Skaarj
    Join Date
    Jan 2011
    Location
    Brazil, Campinas
    Posts
    24

    Default

    anyone can help?

  3. #3
    Redeemer
    Join Date
    Jul 2011
    Location
    London, UK
    Posts
    1,789

    Default

    I am quite new to unrealscript but what exactly is your problem ? how can i help, i will try i am not a pro,

  4. #4
    Skaarj
    Join Date
    Jan 2011
    Location
    Brazil, Campinas
    Posts
    24

    Default

    my material does not appear in my hud like this image

  5. #5
    Redeemer
    Join Date
    Jul 2011
    Location
    London, UK
    Posts
    1,789

    Default

    alright so this image on top is when you were using the gem script ? alright have you tried to see if you forgot to add a function on your script ? also did you create the kismet sequence in kismet ?

  6. #6
    MSgt. Shooter Person
    Join Date
    Oct 2010
    Posts
    333
    Gamer IDs

    Gamertag: Lord aZzy

    Default

    Code:
    bUseClassicHUD=true
    In your gametype file.

    Thats if your using canvas.
    aZtekk Productions.

    Stuck? Give [UDKC] a visit!

  7. #7
    MSgt. Shooter Person
    Join Date
    Oct 2011
    Location
    Georgia,Tbilisi
    Posts
    43

    Default

    WTF ?

    who gave you this Code !!!

    This Is my Code!! my Object !!!! From My Game!!!

    this picture is from The Game Police and The Source Code Is From There you Have just Changed some Names And add FF like FFHudTargetIndicator !!!!


    http://forums.epicgames.com/threads/...olice-Part-II/
    Last edited by Dollche; 11-01-2011 at 04:18 AM.

  8. #8
    MSgt. Shooter Person
    Join Date
    Oct 2010
    Posts
    333
    Gamer IDs

    Gamertag: Lord aZzy

    Default

    Now i was going to say im sure i have seen similar graphics and the ammo counter.

    The code is somewhat similar to UDN in some areas, but im curious to see where this code has come from.
    aZtekk Productions.

    Stuck? Give [UDKC] a visit!

  9. #9
    Redeemer
    Join Date
    Jul 2011
    Location
    London, UK
    Posts
    1,789

    Default

    Wow Dollche your game seems wonderful did you publish it yet or are you still working on it ?

  10. #10
    Skaarj
    Join Date
    Jan 2011
    Location
    Brazil, Campinas
    Posts
    24

    Default

    Quote Originally Posted by Dollche View Post
    WTF ?

    who gave you this Code !!!

    This Is my Code!! my Object !!!! From My Game!!!

    this picture is from The Game Police and The Source Code Is From There you Have just Changed some Names And add FF like FFHudTargetIndicator !!!!


    http://forums.epicgames.com/threads/...olice-Part-II/
    all your source code here as textbuffer and please keep the most closely guarded

    http://www.megaupload.com/?d=O2GYC8JG

  11. #11
    Redeemer
    Join Date
    Jul 2011
    Location
    London, UK
    Posts
    1,789

    Default

    Quote Originally Posted by carlosalexandresc View Post
    all your source code here as textbuffer and please keep the most closely guarded

    http://www.megaupload.com/?d=O2GYC8JG
    Carlos is right in a way if you didn't want people to steal your source code you should have kept it closely guarded or on the top of your source code you could have write a comment saying that you authorise people to use it but they should say that it is yours well you choose for yourself but that's just an example,

  12. #12
    MSgt. Shooter Person
    Join Date
    Oct 2011
    Location
    Georgia,Tbilisi
    Posts
    43

    Default

    we are working on 3 part of this game !!!!

  13. #13
    Skaarj
    Join Date
    Sep 2010
    Location
    Tbilisi, Georgia
    Posts
    27
    Gamer IDs

    Gamertag: IkaBika PSN ID: Abnormalia

    Default

    It was reverse engineered. I've seen sources multimillion AAA titles on net.

    Is it possible to somehow protect sources ?

  14. #14
    MSgt. Shooter Person
    Join Date
    Oct 2011
    Location
    Georgia,Tbilisi
    Posts
    43

    Default

    good luck with sources

  15. #15
    Palace Guard

    Join Date
    Jun 2007
    Location
    Christchurch
    Posts
    3,781

    Default

    This is actually written by me. I wrote the development kit gem, and its purpose is to help everyone who uses UDK. There is little reason to actively with hold Unrealscript code, besides Epic is giving you all of theirs.

    Source code like the one posted on the UDN solves things which can be done in many ways. There is always a huge possibility that I may have just written it in way similar to yours.

  16. #16
    MSgt. Shooter Person
    Join Date
    Oct 2011
    Location
    Georgia,Tbilisi
    Posts
    43

    Default

    Solid Snake

    Canvas.SetPos(nrm.X * sz2 - intp.X/2 ,nrm.Y * sz1 - intp.Y/2,0); //don't even try to understand what's going on here

    this is your Code yes ?
    Last edited by Dollche; 11-01-2011 at 07:03 AM.

  17. #17
    Redeemer
    Join Date
    Jul 2011
    Location
    London, UK
    Posts
    1,789

    Default

    Quote Originally Posted by Dollche View Post
    Solid Snake

    Canvas.SetPos(nrm.X * sz2 - intp.X/2 ,nrm.Y * sz1 - intp.Y/2,0); //don't even try to understand what's going on here

    this is your Code yes ?
    So your source code was actually reverse engineered ? by the way i wanted to ask you did you release your game in english yet ? if no doesn't matter i am going to download it in georgian anyway : )

  18. #18
    Skaarj
    Join Date
    Sep 2010
    Location
    Tbilisi, Georgia
    Posts
    27
    Gamer IDs

    Gamertag: IkaBika PSN ID: Abnormalia

    Default

    We already released patch 1.1

    English version is planned after release of part 3.

  19. #19
    MSgt. Shooter Person
    Join Date
    Oct 2011
    Location
    Georgia,Tbilisi
    Posts
    43

    Default

    if anyone wants to use our source please, but saying that it isn't our is a lie !!!!

    the game is not released in English.we all want to make some subtitles. we will work on that. ALL THE SOURCES ARE WRITTEN BY 4 DEVELOPERS !!! nothing is taken from other projects.

  20. #20
    Redeemer
    Join Date
    Jul 2011
    Location
    London, UK
    Posts
    1,789

    Default

    Quote Originally Posted by Dollche View Post
    if anyone wants to use our source please, but saying that it isn't our is a lie !!!!

    the game is not released in English.we all want to make some subtitles. we will work on that. ALL THE SOURCES ARE WRITTEN BY 4 DEVELOPERS !!! nothing is taken from other projects.
    I agree with you it would be better to say that for example i need help with this source code all credits to the creators of GeoPolice this is their source code,
    so that you know that it is yours,

    it's wonderful Dollche keep up the good work : )

  21. #21
    MSgt. Shooter Person
    Join Date
    Oct 2011
    Location
    Georgia,Tbilisi
    Posts
    43

    Default

    thx all of you who appraised our work !!! :* :* :*

  22. #22
    Palace Guard

    Join Date
    Jun 2007
    Location
    Christchurch
    Posts
    3,781

    Default

    To clarify, what I said was that I wrote the code for the development kit gem. Not so much that I had written what the original poster "wrote".

    Canvas.SetPos(nrm.X * sz2 - intp.X/2 ,nrm.Y * sz1 - intp.Y/2,0); //don't even try to understand what's going on here
    Without context it is hard to tell, but that is just positioning some where in the Canvas. Seems to be an icon of some sort, and suggests that intp is the size of the icon as the code is offsetting by half the width and height. In terms of the first part, I have no clue because I have no context. I could assume that the first part is offsetting against zero based coordinates using a angle and a size. But that is just a guess.

    Point is, code is just code. There is no actual point in trying to protect it. You cant prevent it from being used by other people. If you really want to protect it, start hiring lawyers.
    Last edited by Solid Snake; 11-03-2011 at 12:00 PM.

  23. #23
    MSgt. Shooter Person
    Join Date
    Oct 2010
    Posts
    79

    Default

    Code:
    Canvas.SetPos(nrm.X * sz2 - intp.X/2 ,nrm.Y * sz1 - intp.Y/2,0); //don't even try to understand what's going on here
    As a quick guess, is it an objective locator, displayed on the screen as a sprite, which moves according to the objective and relative to the player direction, and resizes with the distance from the objective?

    Just a guess mind you?


 

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Copyright ©2009-2011 Epic Games, Inc. All Rights Reserved.
Digital Point modules: Sphinx-based search vBulletin skin by CompletevB.com.