Results 1 to 7 of 7
  1. #1

    Default Strange error....

    Im getting a weird error upon compiling this code
    Code:
    class BaconActor extends Actor
    placeable;
    
    var() int Yaw, Pitch, Roll;
    
    function PostBeginPlay()
    {
        SetRotation(Rotation + rot(Roll,Pitch,Yaw))
    }
    
    defaultproperties
    {
        Begin Object Class=SpriteComponent Name=Sprite
            Sprite=Texture2D'EditorResources.S_NavP'
            //HiddenGame=True
        End Object
        Components.Add(Sprite)
        Begin Object Class=ArrowComponent Name=Arrow
        End Object
        Components.Add(Arrow)
    }
    It says Error, Missing Pitch component of rotation (on the line where I SetRotation)
    Maybe it's just because I'm tired but can someone tell me what's going on please

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

    Default

    Might just be because you forgot a semicolon
    Code:
    class BaconActor extends Actor
    placeable;
    
    var() int Yaw, Pitch, Roll;
    
    function PostBeginPlay()
    {
        SetRotation(Rotation + rot(Roll,Pitch,Yaw));
    }
    
    defaultproperties
    {
        Begin Object Class=SpriteComponent Name=Sprite
            Sprite=Texture2D'EditorResources.S_NavP'
            //HiddenGame=True
        End Object
        Components.Add(Sprite)
        Begin Object Class=ArrowComponent Name=Arrow
        End Object
        Components.Add(Arrow)
    }
    Quote Originally Posted by liamcoau View Post
    Im getting a weird error upon compiling this code
    Code:
    class BaconActor extends Actor
    placeable;
    
    var() int Yaw, Pitch, Roll;
    
    function PostBeginPlay()
    {
        SetRotation(Rotation + rot(Roll,Pitch,Yaw))
    }
    
    defaultproperties
    {
        Begin Object Class=SpriteComponent Name=Sprite
            Sprite=Texture2D'EditorResources.S_NavP'
            //HiddenGame=True
        End Object
        Components.Add(Sprite)
        Begin Object Class=ArrowComponent Name=Arrow
        End Object
        Components.Add(Arrow)
    }
    It says Error, Missing Pitch component of rotation (on the line where I SetRotation)
    Maybe it's just because I'm tired but can someone tell me what's going on please

  3. #3

    Default

    I changed it to this:
    Code:
    class BaconActor extends Actor
    placeable;
    
    var() int Yaw, Pitch, Roll;
    
    function PostBeginPlay()
    {
        SetRotation(Rotation + rot(Roll,Pitch,Yaw));
    }
    
    defaultproperties
    {
        Yaw=1
        Pitch=1
        Roll=1
        Begin Object Class=SpriteComponent Name=Sprite
            Sprite=Texture2D'EditorResources.S_NavP'
            //HiddenGame=True
        End Object
        Components.Add(Sprite)
        Begin Object Class=ArrowComponent Name=Arrow
        End Object
        Components.Add(Arrow)
    }
    And I still get the same error

  4. #4
    Boomshot
    Join Date
    Aug 2011
    Posts
    2,920

    Default

    rot() and vect() can only take literal values, not variables. You have to construct the rotator manually, or write a supporting function.

    Code:
    function Rotator MakeRotator( int inPitch, int inYaw, int inRoll )
    {
        local Rotator r;
        r.Pitch = inPitch;
        r.Yaw = inYaw;
        r.Roll = inRoll;
        return r;
    }
    
    
    function PostBeginPlay()
    {
        SetRotation(Rotation + MakeRotator(Pitch, Yaw, Roll));
    }

  5. #5

    Default

    Okay, thanks

  6. #6
    Banned
    Join Date
    Feb 2011
    Location
    BXL/Paris
    Posts
    2,169

    Default

    @Spoof: Function MakeRotator is already declared in Object class - and is final...

  7. #7
    Boomshot
    Join Date
    Aug 2011
    Posts
    2,920

    Default

    Quote Originally Posted by VendorX View Post
    @Spoof: Function MakeRotator is already declared in Object class - and is final...
    Good point, I didn't look. Makes it easier


 

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.