need help with functions

  • 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.

CiberX15

New Member
Oct 5, 2008
26
0
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!
 

CiberX15

New Member
Oct 5, 2008
26
0
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

}
 

Wormbo

Administrator
Staff member
Jun 4, 2001
5,913
36
48
Germany
www.koehler-homepage.de
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.