Announcement

Collapse
No announcement yet.

Showing the player 3D character in a "character stats" screen (REVISITED)

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Showing the player 3D character in a "character stats" screen (REVISITED)

    I asked about this a while ago and got some ideas from a few other developers.

    What I am trying to do... is what all RPG's usually have... When you click on Character stats - you see your character in 3d form with his/her gear on. (you can rotate if you want, etc.)


    Anyway still working on this... Some suggestions were...


    "create a separate camera and point it towards a 3d model of the character"


    Do I spawn the model and 2nd camera somewhere (like vector 200000,20000,20000 - so its totally out of the map?) and delete the model and 2nd camera everytime they toggle on character stats?

    Then copy the camera's view to a material (how do you do that?) and then I guess just do a "canvas.drawtile" onto the character screen.

    Sounds easy... but Not sure if this is the best way to do this?


    Any suggestions on what might be the best solution for this?

    Thanks

    #2
    I haven't built one yet, but I've been mulling on the same thing a bit. My best guess would be to attach an empty pawn copy to a point on your canvas/hud/scaleform menu. Like I said, I haven't tried this but I don't think it'd be too hard; for example, if you look at guild wars menu system, whenever you pop open your inventory it will instantly pop up and a copy of your player model will fade in. This makes it kind of apparent that their code has it set up to load the player's character model after the menu loads up, double that with the fact that you can grab the menu and wiggle it around and the pawn moves with it, it makes me think that it's attaching itself to the menu, or it's faking it with efficiency. If you're going for a fixed menu tho, you could probably get pretty elaborate with a mini-scene. Still, this is just an assumption.

    Comment


      #3
      Thanks for the reply...

      However not quite sure how to "attach an empty pawn copy to a point on your canvas"

      More research leads me to believe I need to use something along these lines....

      Code:
      function DrawHUD(){
      	
      	Canvas.SetPos( 20,50 );
      	Canvas.DrawTexture( ToriaPawn( PlayerOwner.Pawn ).getPortrait(), 1 );
      
      }

      Code:
      class ToriaBasicPawn extends GamePawn notplaceable config(Toria);
      
      var private TextureRenderTarget2D pTexturePortrait;
      var private SceneCapture2DComponent pCaptureComponent;
      
      
      function TextureRenderTarget2D getPortrait(){
      	if( pTexturePortrait == none ){
      		pCaptureComponent = new class'SceneCapture2DComponent';
      		pTexturePortrait = class'TextureRenderTarget2D'.static.Create( 256,256 );
      		pCaptureComponent.SetCaptureParameters( pTexturePortrait,80,50,1000 );
      		pCaptureComponent.SetView( self.Location, self.Rotation );
      		AttachComponent(pCaptureComponent);
      	}
      
      	return pTexturePortrait;
      }

      Does this sound correct?

      Thanks

      Comment

      Working...
      X