1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
  2. Two Factor Authentication is now available on BeyondUnreal Forums. To configure it, visit your Profile and look for the "Two Step Verification" option on the left side. We can send codes via email (may be slower) or you can set up any TOTP Authenticator app on your phone (Authy, Google Authenticator, etc) to deliver codes. It is highly recommended that you configure this to keep your account safe.

need help with functions

Discussion in 'Programming' started by CiberX15, Nov 19, 2008.

  1. CiberX15

    CiberX15 New Member

    Joined:
    Oct 5, 2008
    Messages:
    26
    Likes Received:
    0
    how do you triger a function, i know how to write a function but i cant get my pawn to exicute it. help please!
     
  2. Wormbo

    Wormbo Administrator Staff Member

    Joined:
    Jun 4, 2001
    Messages:
    5,913
    Likes Received:
    36
    FunctionName(parmaeter1, parameter2, etc.);
    ^-- whereever you want to call your function
     
  3. CiberX15

    CiberX15 New Member

    Joined:
    Oct 5, 2008
    Messages:
    26
    Likes Received:
    0
    I’m trying to do something like this

    Function Walk()
    {
    setPhysics(PHYS_Walking);
    }

    Walk();

    But the compiler gives me errors. This piece of script is inside the script for a pawn. I’m really new to unreal script so I know I’m probably doing something stupid like you can’t run functions in the pawn. But if that is true were would you run them? Since I am using the unreal runtime I can’t even take apart other characters to see how they work. The code I’m using for the pawn is below, thanks for the help.

    // I'm WORKING! Wait, never mind
    class ExampleBoy extends ExamplePawn;


    function Walk()
    {
    setPhysics(PHYS_Walking);
    }

    Walk();

    defaultproperties
    {
    Mesh=SkeletalMesh'UDN_CharacterModels_K.GenericMale'
    ControllerClass=Class'MyFirstExample.TameariaCitizen'

    RunningAnims[0]="RunF"
    RunningAnims[1]="RunB"
    RunningAnims[2]="RunL"
    RunningAnims[3]="RunR"
    WalkingAnims[0]="WalkF"
    WalkingAnims[1]="WalkB"
    WalkingAnims[2]="WalkL"
    WalkingAnims[3]="WalkR"
    CrouchAnims[0]="CrouchF"
    CrouchAnims[1]="CrouchB"
    CrouchAnims[2]="CrouchL"
    CrouchAnims[3]="CrouchR"
    FlyingAnims[0]="FlyF"
    FlyingAnims[1]="FlyB"
    FlyingAnims[2]="FlyL"
    FlyingAnims[3]="FlyR"
    SwimmingAnims[0]="Swim"
    SwimmingAnims[1]="SwimB"
    SwimmingAnims[2]="SwimL"
    SwimmingAnims[3]="SwimR"

    StandingTurnAnims[0]="WalkL"
    StandingTurnAnims[1]="WalkR"
    CrouchTurnAnims[0]="CrouchL"
    CrouchTurnAnims[1]="CrouchR"

    StandIdle="IdleLong"
    CrouchIdle="CrouchIdle"
    FlyIdle="FlyIdle"
    SwimIdle="SwimTread"

    JumpStandingAnim="JumpUp"
    JumpMovingAnim="JumpF"
    LandAnim="JumpFLand"
    FallingAnim="Falling"

    DanceAnim="IdleStretch"

    BaseEyeHeight=110
    CollisionRadius=+00040.000000
    CollisionHeight=+00113.000000
    CrouchHeight=+80.0

    }
     
  4. Wormbo

    Wormbo Administrator Staff Member

    Joined:
    Jun 4, 2001
    Messages:
    5,913
    Likes Received:
    36
    I recommend a basic introduction to object-oriented programming and also a good look at how it's done in other UnrealScript classes.

    Generally, functions can only be called from within other functions.
     

Share This Page