Results 1 to 4 of 4
  1. #1
    Palace Guard
    Join Date
    Jan 2010
    Location
    Germany
    Posts
    3,940

    Default Outdated code on UDN

    This article: http://udn.epicgames.com/Three/RootMotion.html

    At the bottom is a code snippet that performs some operations that have changed in newer UDK versions and would be rejected by the compiler.
    Namely:

    Code:
    simulated event OnAnimEnd(AnimNodeSequence SeqNode)
    got it's header changed to
    Code:
    simulated event OnAnimEnd(AnimNodeSequence SeqNode, float PlayedTime, float ExcessTime)
    and

    Code:
       // Turn on Root Motion on Animation node
       SeqNode.RootBoneOption[0] = RBA_Translate;
       SeqNode.RootBoneOption[1] = RBA_Translate;
       SeqNode.RootBoneOption[2] = RBA_Translate;
    
       […]
    
       // Discard root motion. So mesh stays locked in place.
       // We need this to properly blend out to another animation
       SeqNode.RootBoneOption[0] = RBA_Discard;
       SeqNode.RootBoneOption[1] = RBA_Discard;
       SeqNode.RootBoneOption[2] = RBA_Discard;
    are no longer possible because the array is declared to be constant in UnrealScript, so you have to use a native setter function
    Code:
       // Turn on Root Motion on Animation node
       SeqNode.SetRootBoneAxisOption(RBA_Translate, RBA_Translate, RBA_Translate);
    
       […]
    
       // Discard root motion. So mesh stays locked in place.
       // We need this to properly blend out to another animation
       SeqNode.SetRootBoneAxisOption(RBA_Discard, RBA_Discard, RBA_Discard);
    Also, why is that code accessing the mesh with Pawn.Mesh, despite the code already taking place in the Pawn class?
    Our Loop, which art in source code, hallowed be thy keyword.
    Thy condition come, thy instruction be done, in RAM as it is in cache.
    Increment us this day our daily counter,
    and forgive us our typos, as we also have forgiven our compilers.
    And lead us not to the nullpointer but deliver us from bugs.
    For thine is the API, the GUI, and the CLI while(true).
    Semicolon;
    Please don't send me questions about how to do something in the UDK via PM. That is better discussed in the forums and we only have limited PM storage.

  2. #2
    Redeemer
    Join Date
    Jul 2011
    Location
    London, UK
    Posts
    1,749

    Default

    Yeah i noticed that Pawn.Mesh thing weird thing to be honest, and anyway i think you'll get an error unrecognized Pawn if you do that in the pawn class, i already tried to do a trace from the pawn i wrote Pawn.Location i get an error unrecognized pawn, i then remembered i need to do it on the PC, i guess it's just a mistake from them, Jeff usually writes quickly but if we are sure that this is an error then we should tell him, btw thanks for this page never noticed it before this will be a big help for me,
    Last edited by reinrag; 06-01-2012 at 07:58 AM.

  3. #3
    Palace Guard
    Join Date
    Jan 2010
    Location
    Germany
    Posts
    3,940

    Default

    Bumpety bump. Just because threads get easily overlooked here with all the user documentation.
    Our Loop, which art in source code, hallowed be thy keyword.
    Thy condition come, thy instruction be done, in RAM as it is in cache.
    Increment us this day our daily counter,
    and forgive us our typos, as we also have forgiven our compilers.
    And lead us not to the nullpointer but deliver us from bugs.
    For thine is the API, the GUI, and the CLI while(true).
    Semicolon;
    Please don't send me questions about how to do something in the UDK via PM. That is better discussed in the forums and we only have limited PM storage.

  4. #4
    Palace Guard
    Join Date
    Jan 2010
    Location
    Germany
    Posts
    3,940

    Default

    Found another "issue". On the article about AnimationNodes, it provides some example code for the AimOffset node (further down here): http://udn.epicgames.com/Three/Anima...mNodeAimOffset


    That code will only work by default for Pawns that have absolutely no rotation applied, otherwise you may end up in situations where the aim will only be used when the player is behind that Pawn or what not, depending on it's rotation.

    To fix it, just add this to the line:

    Code:
    […]
    
    simulated function Tick(float DeltaTime)
    {
      local PlayerController PlayerController;
    
      Super.Tick(DeltaTime);
    
      PlayerController = GetALocalPlayerController();
      if (PlayerController != None && PlayerController.Pawn != None && AimNode != None)
      {
        DesiredAim = Rotator(Normal(Location - PlayerController.Pawn.Location) << Rotation);
    
        […]
    Our Loop, which art in source code, hallowed be thy keyword.
    Thy condition come, thy instruction be done, in RAM as it is in cache.
    Increment us this day our daily counter,
    and forgive us our typos, as we also have forgiven our compilers.
    And lead us not to the nullpointer but deliver us from bugs.
    For thine is the API, the GUI, and the CLI while(true).
    Semicolon;
    Please don't send me questions about how to do something in the UDK via PM. That is better discussed in the forums and we only have limited PM storage.


 

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.