PDA

View Full Version : Characters/npcs/player, how the frak?


Fang
11-11-2009, 12:30 PM
I'm thoroughly lost on this. Even after looking around at the related threads on this board. I've read this. (http://udn.epicgames.com/Three/DevelopmentKitProgramming.html)

To be clear:
How do you get your custom character into the game, either in the way of it being player controlled or just AI-controlled?
This is what I'm asking, as it seems alot of people have been asking this.

I'm banging my head against a wall here. Could someone make it clear, what you have to do?
Checklist/tutorial/whatever. I'm an artist, I just wanna try out stuff ingame(UDK).

Update: Success! Check out later post for working stuff. :)

mikepurvis
11-11-2009, 12:45 PM
Here is the UDN link. There are some tutorials available also as well as some pulgins that automate the process if you google or bing it you'll come up with a bunch. It's easier to do than some people make out.

http://udn.epicgames.com/Three/UT3CustomCharacters.html

If you are open to scripting there are a lot of different ways you can do it. I have used the method outlined here with success. I think some of this used to be in the licensee only area so only some people may have been able to access it until recently. Not sure though, maybe it was always available.

http://udn.epicgames.com/Three/ImportingAnimationsTutorial.html

and then linked to the created package from extending PlayerController, and also from extending Pawn. There is more than one way to do it.

Fang
11-11-2009, 01:22 PM
Oh right, I have already nailed down how to import it into the UDK editor. But thanks for that Animation page, there's some good stuff there.

So I have my created package, but it's this scripting bit that I need help with -
The last part from UT3CustomCharacters (http://udn.epicgames.com/Three/UT3CustomCharacters.html), "Configuring the Mesh for Use In-Game ", this is geared towards getting it into UT3.
It's saying I should edit the UTCustomChar.ini but the UDK doesn't use this correct? So what does this step translate to for the UDK?

Then there's this you mentioned about extending Playercontroller and Pawn, could some light be shed on this?

I'm clueless on this. I need a lovely string tied to my ankle so I don't go astray. Lead me please! :)

Taxxem
11-11-2009, 01:38 PM
I noticed in a previous post someone mentioned changing the default properties of PlayerController class or the UTPlayerController class depending where you want to start. Basically the code would look like:

class MYCLASSNAMEHERE extends PlayerController;

defaultproperties
{

.... Change default properties here.
}

Is that your question?

mikepurvis
11-11-2009, 02:02 PM
OK, I'll try to strip it down to the minimum required. If anyone see's mistakes please point them out. There are several tutorials for starting off with scripting, and how to compile ect.

You need to make a custom GameType and a custom CharacterController. The GameType will make the game use your CharcterController instead of the default one. In the CharacterController you can assign your mesh and animations etc. If your animation are custom, ie. different names than the UT3 ones you can make your functions to play them here as well.

GameType

class CustomGameType extends UTGame
config(CustomGame);

simulated function PostBeginPlay() {
local UTGame Game;
Super.PostBeginPlay();

Game = UTGame(WorldInfo.Game);

if (Game != None)
{
//Game.DefaultPawnClass = class'CustomGame.Custom_Pawn';
Game.PlayerControllerClass=Class'CustomGame.Custom PlayerController';
}
}



Here is a very stripped down custom PlayerController that assigns a mesh and animations by default. I pulled this out of one of my mods, and made the names generic. Let me know if it is missing something essential.


class CustomPlayerController extends UTPlayerController
config(CustomGame);

DefaultProperties
{

defaultMesh=SkeletalMesh'CustomGame_YourModel.Mesh es.YourModel_skelMesh'
defaultMaterial0=MaterialInterface'CustomGame_Your Model.Materials.YourModel_Mat1'
defaultMaterial1=MaterialInterface'CustomGame_Your Model.Materials.YourModel_Mat2'
defaultAnimTree=AnimTree'CustomGame_YourModel.Anim s.AnimTree'
defaultAnimSet(0)=AnimSet'CustomGame_YourModel.Ani ms.YourModel_anims'
defaultPhysicsAsset=PhysicsAsset'CustomGame_YourMo del.Meshes.YourModel_Physics'

}



You can make sure the names are correct by copying them out of the UDK editor. After you compile run the udk with the command line switch to use your map and this gametype.

example:

C:\Users\Mike\Documents\UDK\Binaries\UDK.exe DM-TestMap?game=CustomGame.CustomGameType -nomovie -log


To see if it worked might want to put it into 3rd person camera also. Put this in the CustomPlayerController class so you can see if it worked.


simulated function PostBeginPlay() {
super.PostBeginPlay();

SetCameraMode(true);
}

Fang
11-11-2009, 02:29 PM
This is very helpfull, I'm starting to wrap my head around this, I'll update in a while to let you know.

Fang
11-11-2009, 03:51 PM
I don't use the first material at the moment, also I don't have any custom animtrees or animsets, and I wasn't sure about the PhysicsAsset.

What have I done wrong? I'm sure there are a bunch of glaring mistakes.


My Directory:
Development\Src\MyMod\Classes\
TestGame.uc
TestPlayerController.uc

My Package:
UTGame\Content\Characters\
CH_Jocke.upk

My SkeletalMesh:
SK_CH_Boots_male
My Material:
M_CH_Boots_male

There are some of the names I'm not sure about, correct me if I'm wrong:

GameType = TestGame.uc

class TestGame extends UTGame
config(mymod);

simulated function PostBeginPlay() {
local UTGame Game;
Super.PostBeginPlay();

Game = UTGame(WorldInfo.Game);

if (Game != None)
{
//Game.DefaultPawnClass = class'mymod.Custom_Pawn';
Game.PlayerControllerClass=Class'mymod.TestPlayerC ontroller';
}
}

PlayerController = TestPlayerController.uc

class TestPlayerController extends UTPlayerController
config(Mymod);

simulated function PostBeginPlay() {
super.PostBeginPlay();

SetCameraMode(true);
}

DefaultProperties
{

defaultMesh=SkeletalMesh'CH_Jocke.Meshes.SK_CH_Boo ts_male_skelMesh'
//defaultMaterial0=MaterialInterface'CH_Jocke.Materi als.YourModel_Mat1'
defaultMaterial1=MaterialInterface'CH_Jocke.Materi als.M_CH_Boots_male'
//defaultAnimTree=AnimTree'CH_Jocke.Anims.AnimTree'
//defaultAnimSet(0)=AnimSet'CH_Jocke.Anims.SK_CH_Boo ts_male_anims'
//defaultPhysicsAsset=PhysicsAsset'CH_Jocke.Meshes.S K_CH_Boots_male_Physics'

}

mikepurvis
11-11-2009, 04:57 PM
I'm not positive all these are in the UDK, they are in UT3.

Are you just trying to import a component? Boots? This is for doing a whole character.


DefaultProperties
{

defaultMesh=SkeletalMesh'CH_Jocke.Meshes.SK_CH_Boo ts_male_skelMesh'
defaultMaterial0=MaterialInterface'CH_Jocke.Materi als.M_CH_Boots_male'
defaultAnimTree=AnimTree'CH_AnimHuman_Tree.AT_CH_H uman'
defaultAnimSet(0)=AnimSet'CH_AnimHuman.Anims.K_Ani mHuman_BaseMale'
defaultPhysicsAsset=PhysicsAsset'CH_AnimHuman.Mesh .SK_CH_BaseMale_Physics'

}

Fang
11-11-2009, 05:40 PM
It's actually just for practice or whatever, I thought I'd only import a pair of boots walking around, asuming it wouldn't cause any problems. I wanted to get the tech-stuff out of the way before doing the whole thing.

You think I have to import the whole character?

Warning/Error Summary
---------------------
C:\UDK\UDK-2009-11\Development\Src\MyMod\Classes\TestPlayerControl ler.uc(7) : Warning, Unknown property in defaults: defaultMesh=SkeletalMesh'CH_Jocke.Meshes.SK_CH_Boo ts_male_skelMesh'
C:\UDK\UDK-2009-11\Development\Src\MyMod\Classes\TestPlayerControl ler.uc(8) : Warning, Unknown property in defaults: defaultMaterial0=MaterialInterface'CH_Jocke.Materi als.M_CH_Boots_male'
C:\UDK\UDK-2009-11\Development\Src\MyMod\Classes\TestPlayerControl ler.uc(9) : Warning, Unknown property in defaults: defaultAnimTree=AnimTree'CH_AnimHuman_Tree.AT_CH_H uman'
C:\UDK\UDK-2009-11\Development\Src\MyMod\Classes\TestPlayerControl ler.uc(10) : Warning, Unknown property in defaults: defaultAnimSet(0)=AnimSet'CH_AnimHuman.Anims.K_Ani mHuman_BaseMale'
C:\UDK\UDK-2009-11\Development\Src\MyMod\Classes\TestPlayerControl ler.uc(11) : Warning, Unknown property in defaults: defaultPhysicsAsset=PhysicsAsset'CH_AnimHuman.Mesh .SK_CH_BaseMale_Physics'

Oh and I actually also get this whenever I try that piece of code.
Warning/Error Summary
---------------------
C:\UDK\UDK-2009-11\Development\Src\MyMod\Classes\TestPlayerControl ler.uc(7) : Error, Type mismatch in Call to 'SetCameraMode', parameter 1

It's obviously my implementation of the code thats wrong somehow.

mikepurvis
11-11-2009, 06:04 PM
Hi,

My bad on the set camera. it's 'ThirdPerson' not true, sorry. or SetBehindView(true);


class TestPlayerController extends UTPlayerController
config(Mymod);

simulated function PostBeginPlay() {
super.PostBeginPlay();

SetCameraMode('ThirdPerson');
}

DefaultProperties
{

defaultMesh=SkeletalMesh'CH_Jocke.Meshes.SK_CH_Boo ts_male_skelMesh'
defaultMaterial0=MaterialInterface'CH_Jocke.Materi als.M_CH_Boots_male'
defaultAnimTree=AnimTree'CH_AnimHuman_Tree.AT_CH_H uman'
defaultAnimSet(0)=AnimSet'CH_AnimHuman.Anims.K_Ani mHuman_BaseMale'
defaultPhysicsAsset=PhysicsAsset'CH_AnimHuman.Mesh .SK_CH_BaseMale_Physics'

}

mikepurvis
11-11-2009, 06:06 PM
I think it should run with those warnings, if you can see those resources in the UDK Editor it will run.

Gillies
11-11-2009, 06:25 PM
there is no defaultmesh now in the pawn class, so you can no longer set the character model that way

mikepurvis
11-11-2009, 06:31 PM
I'm sorry, I took out too much. I had added defaultMesh and the others as variables to the PlayerController. I'll just clean ( make some names generic ) the whole class up and post it.

mikepurvis
11-11-2009, 06:56 PM
Warning: I have not tested this, it's out of my head. Something like this should work. I'll test it out in a bit when I find a model to use, and edit it if it does not work.


class CustomGameType extends UTGame
config(CustomGame);

var TestPlayerController currentPlayer;

simulated function PostBeginPlay() {
local UTGame Game;
Super.PostBeginPlay();

Game = UTGame(WorldInfo.Game);

if (Game != None)
{
//Game.DefaultPawnClass = class'CustomGame.Custom_Pawn';
Game.PlayerControllerClass=Class'CustomGame.Custom PlayerController';
}

function RestartPlayer(Controller aPlayer)
{
super.RestartPlayer(aPlayer);
`Log("Player restarted");
currentPlayer = TestPlayerController(aPlayer);

currentPlayer.resetMesh();

currentPlayer.rSetBehindView(true);
currentPlayer.rSetCameraMode('ThirdPerson');
}
}



class TestPlayerController extends UTPlayerController
config(Mymod);

// members for the custom mesh
var SkeletalMesh defaultMesh;
var MaterialInterface defaultMaterial0;
var AnimTree defaultAnimTree;
var array<AnimSet> defaultAnimSet;
var AnimNodeSequence defaultAnimSeq;
var PhysicsAsset defaultPhysicsAsset;

simulated function PostBeginPlay() {
super.PostBeginPlay();

SetCameraMode('ThirdPerson');

resetMesh();
}

// Sets the Pawns Mesh to the resources speced in the DefaultProperties
public function resetMesh(){
self.Pawn.Mesh.SetSkeletalMesh(defaultMesh);
self.Pawn.Mesh.SetMaterial(0,defaultMaterial0);
self.Pawn.Mesh.SetPhysicsAsset(defaultPhysicsAsset );
self.Pawn.Mesh.AnimSets=defaultAnimSet;
self.Pawn.Mesh.SetAnimTreeTemplate(defaultAnimTree );
}

// Called at RestartPlayer by GameType
public function rSetBehindView(bool view){
SetBehindView(view);
}

// Called at RestartPlayer by GameType
public function rSetCameraMode(name cameraSetting){
SetCameraMode(cameraSetting);
}

DefaultProperties
{

defaultMesh=SkeletalMesh'CH_Jocke.Meshes.SK_CH_Boo ts_male_skelMesh'
defaultMaterial0=MaterialInterface'CH_Jocke.Materi als.M_CH_Boots_male'
defaultAnimTree=AnimTree'CH_AnimHuman_Tree.AT_CH_H uman'
defaultAnimSet(0)=AnimSet'CH_AnimHuman.Anims.K_Ani mHuman_BaseMale'
defaultPhysicsAsset=PhysicsAsset'CH_AnimHuman.Mesh .SK_CH_BaseMale_Physics'

}

Fang
11-11-2009, 07:07 PM
Alright, @mikepurvis, thanks alot for all the help so far! I'll be back tomorrow, got to get some sleep regretfully.

When I get this working I'll frickin' merge all the good stuff from this thread into tutorial or something.

NightRyder
11-11-2009, 07:07 PM
Thanks mikepurvis, this is sure to help a bunch. Example code is always nice.


Edit: maybe it is just me, but I don't have a package called 'CH_Jocke'. I also don't have any boots other then the armor pickup static mesh boots. On top of that, While I do have an AnimationSet for BaseMale, I don't have Materials or Meshes for a BaseMale. Although I do have them for a Corrupt_Male. That would be alright, but I don't have an AnimationSet for a Corrupt_Male. I'm so confused, how does the demo work? Shouldn't there be a complete set of Assets for the character that runs around as AI and you spawn as?


Edit2: For anyone who doesn't want to go hunting for Assets, I found and used the following:

SkeletalMesh CH_LIAM_Cathode.Mesh.SK_CH_LIAM_Cathode
MaterialInterface CH_Corrupt_Male.Materials.MI_CH_Corrupt_MBody01_VR ed
AnimTree CH_AnimHuman_Tree.AT_CH_Human
AnimSet CH_AnimHuman.Anims.K_AnimHuman_BaseMale
PhysicsAsset CH_AnimCorrupt.Mesh.SK_CH_Corrupt_Male_Physics'
This replicated for the most part exactly what the demo already looks like. The only difference I could see was the body doesn't glow yellow when you spawn, only your head did... Of course to see any of this you need to be in 3rd person. Note that the MaterialInterface seemed optional since the SkeletalMesh has predefined Materials on it already.

A few notes for those who are curious:
Without the PhysicsAsset - when you died you didn't fall down. You just paused in mid stride and in air.
Without the AnimTree or AnimSet - If either were missing you didn't get any animation, just floated around in the default pose.
Without the MaterialInterface - This didn't see to change anything as far as I could see.
With an incorrect PhysicsAsset - Your body was lowered to the lowest LOD, and you flickered in and out of existence.

Showster
11-12-2009, 04:47 AM
Hi Mike,,

Just testing that code now, the bit in the game type...

function RestartPlayer(Controller aPlayer)
{
super.RestartPlayer(aPlayer);
`Log("Player restarted");
currentPlayer = TestPlayerController(aPlayer);

currentPlayer.resetMesh();

currentPlayer.rSetBehindView(true);
currentPlayer.rSetCameraMode('ThirdPerson');
}
}

Gives the error :-

C:\UDK\UDK-2009-11\Development\Src\CustomGame\Classes\CustomGameTy pe.uc(18) : Error, 'Function' is not allowed here
Compile aborted due to errors.

So I'm going to try commenting it out and see if that can be done another way :D

Showster
11-12-2009, 05:00 AM
ITS AAAAAAAAAAAAAAAAAaalivvvve

Game Type

class CustomGameType extends UTGame
config(CustomGame);

var CustomPlayerController currentPlayer;

function RestartPlayer(Controller aPlayer)
{
super.RestartPlayer(aPlayer);
`Log("Player restarted");
currentPlayer = CustomPlayerController(aPlayer);

currentPlayer.resetMesh();
currentPlayer.rSetBehindView(true);
currentPlayer.rSetCameraMode('ThirdPerson');
}




simulated function PostBeginPlay() {
local UTGame Game;
Super.PostBeginPlay();

Game = UTGame(WorldInfo.Game);

if (Game != None)
{
//Game.DefaultPawnClass = class'CustomGame.Custom_Pawn';
Game.PlayerControllerClass=Class'CustomGame.Custom PlayerController';
}
}



defaultproperties
{



PlayerControllerClass=Class'CustomGame.CustomPlaye rController'


}




Player Controller

class CustomPlayerController extends UTPlayerController
config(Mymod);

// members for the custom mesh
var SkeletalMesh defaultMesh;
var MaterialInterface defaultMaterial0;
var AnimTree defaultAnimTree;
var array<AnimSet> defaultAnimSet;
var AnimNodeSequence defaultAnimSeq;
var PhysicsAsset defaultPhysicsAsset;

simulated function PostBeginPlay() {
super.PostBeginPlay();

SetCameraMode('ThirdPerson');

resetMesh();
}

// Sets the Pawns Mesh to the resources speced in the DefaultProperties
public function resetMesh(){
self.Pawn.Mesh.SetSkeletalMesh(defaultMesh);
self.Pawn.Mesh.SetMaterial(0,defaultMaterial0);
self.Pawn.Mesh.SetPhysicsAsset(defaultPhysicsAsset );
self.Pawn.Mesh.AnimSets=defaultAnimSet;
self.Pawn.Mesh.SetAnimTreeTemplate(defaultAnimTree );
}

// Called at RestartPlayer by GameType
public function rSetBehindView(bool view){
SetBehindView(view);
}

// Called at RestartPlayer by GameType
public function rSetCameraMode(name cameraSetting){
SetCameraMode(cameraSetting);
}

DefaultProperties
{
bBehindView=True

defaultMesh=SkeletalMesh'sos_prime.prime'
//defaultMaterial0=MaterialInterface'CH_Jocke.Materi als.M_CH_Boots_male'
defaultAnimTree=AnimTree'CH_AnimHuman_Tree.AT_CH_H uman'
defaultAnimSet(0)=AnimSet'CH_AnimHuman.Anims.K_Ani mHuman_BaseMale'
defaultPhysicsAsset=PhysicsAsset'CH_AnimCorrupt.Me sh.SK_CH_Corrupt_Male_Physics'

}


Changed the link to the Phys asset as the old one has been gobbled up, added a couple things in the player controller (moved the function around and added default property link just in case) to see what happens. Not sure which bit did the trick yet have to test first.

And the proof.... Apologies crappy old quake 3 model hehe...

http://i269.photobucket.com/albums/jj41/UKShowster/Untitled-2.jpg

Fang
11-12-2009, 06:24 AM
I'm glad other peeps find this helpfull too, also CH_Jocke is a custom package of mine so you naturally wouldn't have it.

@Showster, glad you got it working I'm gonna give it a go aswell!

EDIT: I got it working too! I'll post pic later, only thing that didn't work was that my textures was black, but I don't think that's a scripting error.
Gotta go now though. But this is awesome!

Showster
11-12-2009, 08:08 AM
Cool Fang! Post your piccies.

I've just got it to spawn an NPC via an actor factory by using the controller code in the pawn... I overidded SetCharacterClassFromInfo

There is probably a nicer way to do this but hey its a start :)



class CustomPawn1 extends UTPawn;

// members for the custom mesh
var SkeletalMesh defaultMesh;
var MaterialInterface defaultMaterial0;
var AnimTree defaultAnimTree;
var array<AnimSet> defaultAnimSet;
var AnimNodeSequence defaultAnimSeq;
var PhysicsAsset defaultPhysicsAsset;


simulated function SetCharacterClassFromInfo(class<UTFamilyInfo> Info)
{
Mesh.SetSkeletalMesh(defaultMesh);
Mesh.SetMaterial(0,defaultMaterial0);
Mesh.SetPhysicsAsset(defaultPhysicsAsset);
Mesh.AnimSets=defaultAnimSet;
Mesh.SetAnimTreeTemplate(defaultAnimTree);

}

defaultproperties
{

defaultMesh=SkeletalMesh'sos_prime.prime'
defaultAnimTree=AnimTree'CH_AnimHuman_Tree.AT_CH_H uman'
defaultAnimSet(0)=AnimSet'CH_AnimHuman.Anims.K_Ani mHuman_BaseMale'
defaultPhysicsAsset=PhysicsAsset'CH_AnimCorrupt.Me sh.SK_CH_Corrupt_Male_Physics'

Begin Object Name=WPawnSkeletalMeshComponent
AnimTreeTemplate=AnimTree'CH_AnimHuman_Tree.AT_CH_ Human'
End Object
Mesh=WPawnSkeletalMeshComponent
Components.Add(WPawnSkeletalMeshComponent)

}

Fang
11-12-2009, 08:35 AM
It's a pretty dull picture, but it's proof innit? I'm gonna work on getting a whole character in and also sorting out the black texure.


Notice the black boots? Yea, thats the character. ;)
http://cgartists.files.wordpress.com/2009/11/proofcustomchar1.jpg

mikepurvis
11-12-2009, 11:41 AM
Glad this is working for you.

InCharacter
11-12-2009, 12:04 PM
If any of you that got this working would be so kind as to wrap it up into a tutorial, I'll link it to the BeyondUnreal wiki.

- Jared

Fang
11-12-2009, 02:05 PM
I could wrap it up into a tutorial, I've got it working for a full character now as shown below.
But I'm not sure about the condition of my materials, they are White(which they are supposed mostly to be) yes but I'm not convinced they're working properly.
I'm not sure if this has anything to do with the scripting part. I'm gonna do some tests.
I'm using 2 materials now, one for the head and one for the body, might be a problem?
Also considering that this isn't going in to UT3, do you even need Two Materials for this?

http://cgartists.files.wordpress.com/2009/11/fullcharworking.jpg

geodav
11-12-2009, 02:15 PM
yes you need 2 materials, it's coded in the pawn class, don't for get to follow the correct MaterialInstantConstant setup other wise it might not work

ps great thread

thanks to the code provided i'm making some progress
http://img691.imageshack.us/img691/6870/udk1.th.jpg (http://img691.imageshack.us/i/udk1.jpg/)

need to add more characters in the hope someone can help with team stuff

Fang
11-12-2009, 05:46 PM
@geodav, Aw alright, thanks. I'm gonna mess with the materials and textures a bit, I wanna be sure that I'm doing it right before moving on anyways so. Good luck with you project

@showster, Cool stuff, I got a actorfactory running pumping custompawns, awesome thanks for that!

If nobody else beats me I'll wrap this up tomorrow into a tutorial or something.
All good people shall get credit of course.:rolleyes:

Darquelord
11-19-2009, 11:40 AM
Hey guys, looking to add my custom player as well. I was looking at some of the code posted and it seems your using the default player animset. If I wanted to I could use my own custom anim set? I am basically doing a total conversion type mod and want to see how far we can push this. Also I see that your characters seem to be broken into parts, is that something that has to be done or if I use my own animations then I shouldn't have to right? Please advise, DL out.

Xero
11-24-2009, 02:39 AM
@Darquelord
Yes you can use you own custom anim set etc. For example my custom test model here in just a simple ball.

Thanks guys this thread was really helpful. Although I am having trouble getting more that one material to work. Only one material is showing up in game.

I'm using a simple sphere skeletal mesh with two material channels. One for the face and the other for the body.
As you can see here the player model (the one on the right) isn't looking right.

http://img695.imageshack.us/img695/6481/badmaterial.th.jpg (http://img695.imageshack.us/i/badmaterial.jpg/)

Here's a sample of how I setup the materials.

var MaterialInterface defaultMaterial[2];

public function resetMesh()
{
self.Pawn.Mesh.SetMaterial(0,defaultMaterial[0]);
self.Pawn.Mesh.SetMaterial(0,defaultMaterial[1]);
}

DefaultProperties
{
defaultMaterial[0]=MaterialInstanceConstant'DusknDawn.Materials.Dusk _Face_MIC'
defaultMaterial[1]=MaterialInstanceConstant'DusknDawn.Materials.Dusk _Body_MIC'
}

Could someone help me out with this one?
Thanks.

ovinet
12-14-2009, 01:29 PM
Hi fellows UDK developers. With big pain I was able to add my mesh as a player, but I have to tell you, the tutorial fang made is not working, fortunately I found something else which helped me :

http://tutorial.toltecstudios.com/

Combined with a little code from your guys code I was able to manage that. Now, can someone tell me any tips on using your walk animation for your mesh ? I use a bear model, and I have a walk animation for it, but I have no idea how I apply it to my model when I walk with it. At the moment, my char moves but there is no animation, just the movement forward of where I go

Dante_sk
01-03-2010, 09:00 AM
I have the same problem. Could somone help us out ?

Denny
01-03-2010, 09:11 AM
You have to make a new AnimTree for your pawn, which you then define in DefaultProperties. It's in the AnimTree that you define which animations that should be used for PHYS states like moving and custom nodes that you call on through code. If the animation nodes are calling on an animation sequence that doesn't exist in the AnimSet, the character will T-pose and just float around.

Dante_sk
01-03-2010, 02:39 PM
Yes I already figure that out and tryied to make th AnimTree but the problem is i dont know how to make AnimTree. And I know how to define the AnimTree in DefaultProperties, but i dont know from where and how to call the animations from code.
I am searching for some tutorial/solution for a few days now - but every tuts stops at putting your char into UDK.
Could you please make some simple example, make screenshot and post it here ?
Let's say for one move - walk forward.

I would be eternaly gratefull for that.

Denny
01-03-2010, 03:11 PM
http://www.screentoaster.com/watch/stVEtRRUdIR19dRVlVXlleXlBW

There's a short video showing how to make a basic AnimTree for ground movement. It should be pretty easy to understand.

Dante_sk
01-04-2010, 06:05 AM
Yeay it works :D
Many many thanks Denny.
From the start it didnt work, but i realized from another topic that I didnt had defined wich animset to use in defaultProperties (agian your post :) ).

McTavish
01-04-2010, 07:08 AM
Could you create an anim tree in UDK and then reference it in your unrealscript ? or would you totally have to hard code it to have it in your script ? Trying to wonder how you would have a sort of split between what you do in UDK/Kismet and what you do with UnrealScript and have it all in the same game ?

DaemonXR
01-04-2010, 07:21 AM
Hello guys!

This is very informative thread. I am trying to follow u what u r talking. I am not coder at all.
Best regards

thelaw
01-04-2010, 07:44 AM
Could you create an anim tree in UDK and then reference it in your unrealscript ? or would you totally have to hard code it to have it in your script ? Trying to wonder how you would have a sort of split between what you do in UDK/Kismet and what you do with UnrealScript and have it all in the same game ?

From what I understand, you will need a reference to an AnimNode which you can use to play custom animations using its aptly named function PlayCustomAnim or just control the node in various ways.

Look at lines 1332-1334 and lines 1556 and 1573 of UTPawn.uc

McTavish
01-04-2010, 07:56 AM
I get it from 1332-1334, Im guessing you setup the animnodes in Kismet and then reference them in your code. Using kismet as a sort of animation editor. Not a huge deal anyway I was really just wondering out of interest. Btw lines 1556 and 1573 ? Especially line 1573 not sure why I was looking there as its blank and then is followed by some ServerPlayEmote function ?

immortius
01-04-2010, 08:00 AM
Could you create an anim tree in UDK and then reference it in your unrealscript ? or would you totally have to hard code it to have it in your script ? Trying to wonder how you would have a sort of split between what you do in UDK/Kismet and what you do with UnrealScript and have it all in the same game ?

You can certainly create an AnimTree in the editor and reference it in UnrealScript - that's how you set a class to use the AnimTree. Although I guess you mean mess with it in UnrealScript? That is also possible. Generally you wouldn't bother altering the structure of an AnimTree at runtime - the editor is much more intuitive for doing that work. But there can be reasons for interacting with the nodes themselves.

It should be noted that the way the emote system in UT3 and UDK works is as follows:
1) The AnimTree the UTPawns use (creating in the editor) has a small set of nodes at the front for overriding animations to the, either fully or just to the top or bottom half.
2) When a pawn is created the AnimTree is accessed and references to these three nodes are saved.
3) When an emote is played one of these nodes is used to play it.

It is also possible to implement custom animation behaviours, like using different movement animations when injured by altering the state of a UTAnimBlendBase (or subclass) from code. I've done things like this in the past - like changing which attack animation is used based on held weapon.

I just dug up an old tutorial I wrote for creating custom AnimNodes in UT3 and reposted it for UDK - you may find it interesting. http://forums.epicgames.com/showthread.php?p=27068281#post27068281

thelaw
01-04-2010, 08:20 AM
Sorry its line 1566, just search for
TopHalfAnimSlot.PlayCustomAnim

Thanks immortius, very informative tutorial.

foad_udk
02-12-2010, 04:02 AM
Thank you very much
I already downloaded all your training
Be very helpful
am change character But is inactive
Bindings=(Name="C",Command="DoDuck")
I did Animtree (crouch)
But half of work to
please help me I really need