logo
Main

Forums

Downloads

Unreal-Netiquette

Donate for Oldunreal:
Donate

borderline

Links to our wiki:
Wiki

Walkthrough

Links

Tutorials

Unreal Reference

Usermaps

borderline

Contact us:
Submit News
Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic How to import a Rune monster (animated asset) into Unreal (Read 179 times)
gopostal
Betatester
Offline


Hack coder

Posts: 942
Joined: Jul 31st, 2008
Gender: Male
How to import a Rune monster (animated asset) into Unreal
Jan 26th, 2017 at 1:31pm
Print Post  
Here's the process from start to finish on how to import an asset from outside Unreal. Once you see how it's done you'll be amazed at how much you can do and how simple it is. Let's get started...

Things you will need:

creatures.ums file from the folder ..Rune/meshes
UModel :  http://www.gildor.org/en/projects/umodel
DN UnPSA Toolkit:  http://www.david-najar.com/downloads/
Some sort of photo manipulation software that can convert targa to bmp (I use photoshop)
Notepad++ or similar program to edit code (I swear by ConTEXT but that's just me)
UMake: http://mb.link-m.de/umake/ ;  (You MUST use UMake and not another compiler, more later on that)

Step 1:
Drop the creatures.ums file from the Rune models folder on top of the umodel exe. This will open umodel and display a preview of the contents of the package. Now select "Help" and then choose "Keyboard shortcuts". This will list the various hotkeys.  You can look through the contents using the PageUp/PageDown keys. Scroll around until you find the file called "GiantCrab_0".

Some things we are looking for when choosing assets is a decent set of animations. See at the bottom left where it says Anims:0/23 ? That means there are 23 distinct animations for this model. Static decorations will not have any animations (derp). to preview these animations use the bracket keys to scroll through the named animation sets and use the space bar to play each one.

If you like the animations and they are enough to use for your project then hit CTRL + X to export this model. Be sure to also export any skins that appear to be used on the model that are inside this package. I found "GiantCrabcrabpain" and "GiantCrabcrab3". The former looks to be a skin from a hurt crab and the latter a normal crab. I exported both of them with the same CTRL + X command while viewing them.

If you look in your Rune/Meshes folder you will now see a new folder called "UmodelExport". Drag that to your desktop, we are now done with Rune.
  

I don't want to give the end away
but we're all going to die one day
Back to top
 
IP Logged
 
gopostal
Betatester
Offline


Hack coder

Posts: 942
Joined: Jul 31st, 2008
Gender: Male
Re: How to import a Rune monster (animated asset) into Unreal
Reply #1 - Jan 26th, 2017 at 1:32pm
Print Post  
Step 2:
Open the UmodelExport folder. Convert the targa skin files in the texture folder to BMP and save them. Now open DN UnPSA Toolkit. Follow this order of operations:
-Under PSK File select Open and point it towards the UModel folder's Skeletal Mesh folder. This will load the proper PSK.
-Under PSA Files select Open and load the file in MeshAnimation folder. You should see the animation populate the middle boxes.
-At the bottom find the button "Save .uc File..." and select that. This will ask you to name the file. Call it "GiantCrab" and save it to the Umodel folder.

You can close DN UnPSA Toolkit now, you are done with it. On to the code.

Setp 3:
Prepare your import folder. In your Unreal install add a folder in the base called "GiantCrab". In this folder add sub-folders called "Classes", "Models", and "Textures". Drag the PSK and PSA files from the UModel Folder and put them into the Models folder. Get the BMP's you created and drag those to the Textures folder. Finally drag the uc file and put it into Classes. You are now prepared to compile.
  

I don't want to give the end away
but we're all going to die one day
Back to top
 
IP Logged
 
gopostal
Betatester
Offline


Hack coder

Posts: 942
Joined: Jul 31st, 2008
Gender: Male
Re: How to import a Rune monster (animated asset) into Unreal
Reply #2 - Jan 26th, 2017 at 1:33pm
Print Post  
Step4:
Open the uc file and you will see this:
Code (C++)
Select All
//=============================================================================
// Class generated by UnPSA Toolkit (David Najar 04/2009, Daniel Maddison 11/2013)
// GiantCrab.
//=============================================================================
Class GiantCrab Expands Actor;

#exec MESH MODELIMPORT MESH=GiantCrab_0 MODELFILE=SkeletalMesh/GiantCrab_0.psk
#exec MESH LODPARAMS MESH=GiantCrab_0 HYSTERESIS=0.00 STRENGTH=0.01 MINVERTS=10.00 MORPH=0.30 ZDISP=0.00
#exec MESH ORIGIN MESH=GiantCrab_0 X=0 Y=0 Z=0 YAW=0 PITCH=0 ROLL=0
#exec ANIM IMPORT ANIM=GiantCrab ANIMFILE=MeshAnimation/GiantCrab.psa COMPRESS=1
#exec MESHMAP SCALE MESHMAP=GiantCrab_0 X=1.0 Y=1.0 Z=1.0

#exec ANIM SEQUENCE ANIM=GiantCrab SEQ=baseframe STARTFRAME=0 NUMFRAMES=1 RATE=1
#exec ANIM SEQUENCE ANIM=GiantCrab SEQ=ground STARTFRAME=1 NUMFRAMES=2 RATE=2
#exec ANIM SEQUENCE ANIM=GiantCrab SEQ=wake STARTFRAME=3 NUMFRAMES=11 RATE=11
#exec ANIM SEQUENCE ANIM=GiantCrab SEQ=Idle STARTFRAME=14 NUMFRAMES=20 RATE=20
#exec ANIM SEQUENCE ANIM=GiantCrab SEQ=attackl STARTFRAME=34 NUMFRAMES=11 RATE=11
#exec ANIM SEQUENCE ANIM=GiantCrab SEQ=attackr STARTFRAME=45 NUMFRAMES=11 RATE=11
#exec ANIM SEQUENCE ANIM=GiantCrab SEQ=attackB STARTFRAME=56 NUMFRAMES=12 RATE=12
#exec ANIM SEQUENCE ANIM=GiantCrab SEQ=moveforward STARTFRAME=68 NUMFRAMES=20 RATE=20
#exec ANIM SEQUENCE ANIM=GiantCrab SEQ=movebackward STARTFRAME=88 NUMFRAMES=20 RATE=20
#exec ANIM SEQUENCE ANIM=GiantCrab SEQ=MoveLeft STARTFRAME=108 NUMFRAMES=20 RATE=20
#exec ANIM SEQUENCE ANIM=GiantCrab SEQ=MoveRight STARTFRAME=128 NUMFRAMES=19 RATE=19
#exec ANIM SEQUENCE ANIM=GiantCrab SEQ=rotateleft STARTFRAME=147 NUMFRAMES=19 RATE=19
#exec ANIM SEQUENCE ANIM=GiantCrab SEQ=rotateright STARTFRAME=166 NUMFRAMES=19 RATE=19
#exec ANIM SEQUENCE ANIM=GiantCrab SEQ=rearup STARTFRAME=185 NUMFRAMES=7 RATE=7
#exec ANIM SEQUENCE ANIM=GiantCrab SEQ=rearidle STARTFRAME=192 NUMFRAMES=12 RATE=12
#exec ANIM SEQUENCE ANIM=GiantCrab SEQ=rearupattack STARTFRAME=204 NUMFRAMES=9 RATE=9
#exec ANIM SEQUENCE ANIM=GiantCrab SEQ=backfromrear STARTFRAME=213 NUMFRAMES=6 RATE=6
#exec ANIM SEQUENCE ANIM=GiantCrab SEQ=flippeddie STARTFRAME=219 NUMFRAMES=12 RATE=12
#exec ANIM SEQUENCE ANIM=GiantCrab SEQ=flippedidle STARTFRAME=231 NUMFRAMES=12 RATE=12
#exec ANIM SEQUENCE ANIM=GiantCrab SEQ=transflipover STARTFRAME=243 NUMFRAMES=15 RATE=15
#exec ANIM SEQUENCE ANIM=GiantCrab SEQ=towake STARTFRAME=258 NUMFRAMES=12 RATE=12
#exec ANIM SEQUENCE ANIM=GiantCrab SEQ=rock STARTFRAME=270 NUMFRAMES=2 RATE=2
#exec ANIM SEQUENCE ANIM=GiantCrab SEQ=flipup STARTFRAME=272 NUMFRAMES=23 RATE=23
#exec ANIM DIGEST ANIM=GiantCrab
#exec MESH DEFAULTANIM MESH=GiantCrab_0 ANIM=GiantCrab
 



A bit of coding knowledge comes in handy now but it's not impossible to muddle through without. Here are some things to watch for:
-Make sure the first line is correct:
#exec MESH MODELIMPORT MESH=GiantCrab_0 MODELFILE=SkeletalMesh/GiantCrab_0.psk
should be
#exec MESH MODELIMPORT MESH=GiantCrab_0 MODELFILE=Models\GiantCrab_0.psk
because we need to point the compiler to the proper folder where the model is stored. Be sure to make this same change to the line "#exec ANIM IMPORT" so it sees the animations in the model folder.

The line that reads
#exec MESH ORIGIN MESH=GiantCrab_0 X=0 Y=0 Z=0 YAW=0 PITCH=0 ROLL=0
will end up being
#exec MESH ORIGIN MESH=GiantCrab_0 X=0 Y=0 Z=0 YAW=-64 PITCH=0 ROLL=-64
because after compiling you'll see the model is not oriented correctly. You'll often have to make adjustments like this to pre-pivot the model when you compile it. If you want to see what I mean then don't make this change yet and do it afterwards. You'll see your crab is pointed all wrong, though it will work just fine. It's a good idea to really understand this part.

Your crab would now compile but it has no assignment for textures so it would be invisible. Add these lines to the bottom of the uc file:

#exec texture IMPORT NAME=GiantCrabcrab3 FILE=Textures\GiantCrabcrab3.bmp GROUP=Skins DETAIL=Dirty
#exec MESHMAP scale MESHMAP=GiantCrab_0 X=0.05 Y=0.05 Z=0.1
#exec MESHMAP SETTEXTURE MESHMAP=GiantCrab_0 NUM=0 TEXTURE=GiantCrabcrab3

This is importing the bmp file and assigning it to the model. Now you will have a skinned model. Finally lets add the end section to the uc file:

defaultproperties
{
   Mesh=SkeletalMesh'GiantCrab_0'
   CollisionRadius=20.000000
   CollisionHeight=6.000000
   DrawScale=3.0
   Texture=GiantCrabcrab3
   DrawType=DT_Mesh
}

You'll need to test inside editor to figure these values out for each model. Things like collision size and drawscale are important and you need to get them correct. If you don't know how to do this then go learn that part before moving on.

Finally save the uc file. It's time to compile.
  

I don't want to give the end away
but we're all going to die one day
Back to top
 
IP Logged
 
gopostal
Betatester
Offline


Hack coder

Posts: 942
Joined: Jul 31st, 2008
Gender: Male
Re: How to import a Rune monster (animated asset) into Unreal
Reply #3 - Jan 26th, 2017 at 1:36pm
Print Post  
Step 5:
Compile the monster using UMake (and UMake ONLY!). For some reason I do not understand every other compiler I've tried creates errors and problems when trying to work with files exported with UnPSA. Provided you coded everything correctly you will now have a u file called "GiantCrab". You can open this in editor and see the model and animations. Nice job, you now have a usable asset.

I'm not going to get into how to code the monster but I will post this (really rough) code for a playable crab. All I did is rename animations that already existed in the model to animations that are called in the default pupae code. Example:

This is the attack animation that already exists in the model
//#exec ANIM SEQUENCE ANIM=GiantCrab SEQ=attackl STARTFRAME=34      NUMFRAMES=11      RATE=11
I need an attack called "Lunge" since it is called for in the pupae code so I just add another import for this animation and call it lunge like this:
#exec ANIM SEQUENCE ANIM=GiantCrab SEQ=Lunge    STARTFRAME=34   NUMFRAMES=11  RATE=11  Group=Attack

So now the code won't dead end on an animation that doesn't exist. This is not by any means a complete way to do things, it's just the first step on doing a proper recoding. This goes deep quickly though and way beyond the scope of this tut. Here's the rough code for a crab you can place in a map and see working:
Code (C++)
Select All
Class GiantCrab Expands Pupae;

#exec MESH MODELIMPORT MESH=GiantCrab_0 MODELFILE=Models\GiantCrab_0.psk
#exec MESH LODPARAMS MESH=GiantCrab_0 HYSTERESIS=0.00 STRENGTH=0.01 MINVERTS=10.00 MORPH=0.30 ZDISP=0.00
#exec MESH ORIGIN MESH=GiantCrab_0 X=0 Y=0 Z=0 YAW=-64 PITCH=0 ROLL=-64
#exec ANIM IMPORT ANIM=GiantCrab ANIMFILE=Models\GiantCrab.psa COMPRESS=1
#exec MESHMAP SCALE MESHMAP=GiantCrab_0 X=1.0 Y=1.0 Z=1.0

#exec ANIM SEQUENCE ANIM=GiantCrab SEQ=baseframe 		STARTFRAME=0 	NUMFRAMES=1 	RATE=1
//	#exec ANIM SEQUENCE ANIM=GiantCrab SEQ=All		 		STARTFRAME=0	 NUMFRAMES=295
//#exec ANIM SEQUENCE ANIM=GiantCrab SEQ=ground 			STARTFRAME=1 	NUMFRAMES=2 	RATE=2
	#exec ANIM SEQUENCE ANIM=GiantCrab SEQ=Fighter  STARTFRAME=1   NUMFRAMES=2   RATE=2
//#exec ANIM SEQUENCE ANIM=GiantCrab SEQ=wake 				STARTFRAME=3 	NUMFRAMES=11 	RATE=11
	#exec ANIM SEQUENCE ANIM=GiantCrab SEQ=Pick     STARTFRAME=3   NUMFRAMES=11  RATE=11
#exec ANIM SEQUENCE ANIM=GiantCrab SEQ=Idle 				STARTFRAME=14 	NUMFRAMES=20 	RATE=20
//#exec ANIM SEQUENCE ANIM=GiantCrab SEQ=attackl 			STARTFRAME=34 	NUMFRAMES=11 	RATE=11
	#exec ANIM SEQUENCE ANIM=GiantCrab SEQ=Lunge    STARTFRAME=34   NUMFRAMES=11  RATE=11  Group=Attack
//#exec ANIM SEQUENCE ANIM=GiantCrab SEQ=attackr 			STARTFRAME=45 	NUMFRAMES=11 	RATE=11
	#exec ANIM SEQUENCE ANIM=GiantCrab SEQ=Munch    STARTFRAME=45   NUMFRAMES=11   RATE=11
#exec ANIM SEQUENCE ANIM=GiantCrab SEQ=attackB 			STARTFRAME=56 	NUMFRAMES=12 	RATE=12
//#exec ANIM SEQUENCE ANIM=GiantCrab SEQ=moveforward 	STARTFRAME=68 	NUMFRAMES=20 	RATE=20
	#exec ANIM SEQUENCE ANIM=GiantCrab SEQ=Crawl    STARTFRAME=68   NUMFRAMES=20  RATE=20
#exec ANIM SEQUENCE ANIM=GiantCrab SEQ=movebackward 	STARTFRAME=88 	NUMFRAMES=20 	RATE=20
#exec ANIM SEQUENCE ANIM=GiantCrab SEQ=MoveLeft 		STARTFRAME=108 NUMFRAMES=20 	RATE=20
#exec ANIM SEQUENCE ANIM=GiantCrab SEQ=MoveRight 		STARTFRAME=128 NUMFRAMES=19 	RATE=19
#exec ANIM SEQUENCE ANIM=GiantCrab SEQ=rotateleft 		STARTFRAME=147 NUMFRAMES=19 	RATE=19
#exec ANIM SEQUENCE ANIM=GiantCrab SEQ=rotateright 	STARTFRAME=166 NUMFRAMES=19 	RATE=19
//#exec ANIM SEQUENCE ANIM=GiantCrab SEQ=rearup 			STARTFRAME=185 NUMFRAMES=7 	RATE=7
	#exec ANIM SEQUENCE ANIM=GiantCrab SEQ=Bite     STARTFRAME=185    NUMFRAMES=7  RATE=7  Group=Attack
#exec ANIM SEQUENCE ANIM=GiantCrab SEQ=rearidle 		STARTFRAME=192 NUMFRAMES=12 	RATE=12
//#exec ANIM SEQUENCE ANIM=GiantCrab SEQ=rearupattack 	STARTFRAME=204 NUMFRAMES=9 	RATE=9
	#exec ANIM SEQUENCE ANIM=GiantCrab SEQ=Stab     STARTFRAME=204   NUMFRAMES=9  RATE=9  Group=Attack
	#exec ANIM SEQUENCE ANIM=GiantCrab SEQ=Tear     STARTFRAME=204  NUMFRAMES=9  RATE=9
#exec ANIM SEQUENCE ANIM=GiantCrab SEQ=backfromrear 	STARTFRAME=213 NUMFRAMES=6 	RATE=6
#exec ANIM SEQUENCE ANIM=GiantCrab SEQ=flippeddie 		STARTFRAME=219 NUMFRAMES=12 	RATE=12
#exec ANIM SEQUENCE ANIM=GiantCrab SEQ=flippedidle 	STARTFRAME=231 NUMFRAMES=12 	RATE=12
//#exec ANIM SEQUENCE ANIM=GiantCrab SEQ=transflipover 	STARTFRAME=243 NUMFRAMES=15 	RATE=15
	#exec ANIM SEQUENCE ANIM=GiantCrab SEQ=Dead     STARTFRAME=243   NUMFRAMES=15  RATE=15
	#exec ANIM SEQUENCE ANIM=GiantCrab SEQ=Dead2    STARTFRAME=243  NUMFRAMES=15  RATE=15
	#exec ANIM SEQUENCE ANIM=GiantCrab SEQ=Dead3    STARTFRAME=243  NUMFRAMES=15  RATE=15
#exec ANIM SEQUENCE ANIM=GiantCrab SEQ=towake 			STARTFRAME=258 NUMFRAMES=12 	RATE=12
//#exec ANIM SEQUENCE ANIM=GiantCrab SEQ=rock 				STARTFRAME=270 NUMFRAMES=2 	RATE=2
	#exec ANIM SEQUENCE ANIM=GiantCrab SEQ=TakeHit  STARTFRAME=270   NUMFRAMES=2 RATE=2
#exec ANIM SEQUENCE ANIM=GiantCrab SEQ=flipup 			STARTFRAME=272 NUMFRAMES=23 	RATE=23
#exec ANIM DIGEST ANIM=GiantCrab
#exec MESH DEFAULTANIM MESH=GiantCrab_0 ANIM=GiantCrab

#exec texture IMPORT NAME=GiantCrabcrab3 FILE=Textures\GiantCrabcrab3.bmp GROUP=Skins DETAIL=Dirty
#exec MESHMAP scale MESHMAP=GiantCrab_0 X=0.05 Y=0.05 Z=0.1
#exec MESHMAP SETTEXTURE MESHMAP=GiantCrab_0 NUM=0 TEXTURE=GiantCrabcrab3

defaultproperties
{
   Mesh=SkeletalMesh'GiantCrab_0'
   CollisionRadius=20.000000
   CollisionHeight=6.000000
   DrawScale=3.0
   Texture=GiantCrabcrab3
   DrawType=DT_Mesh
} 



This tut is the base for any number of imports across a number of game engines. Honestly you are only limited by what UModel will export and I've found Gildor (the author) to be wonderful in helping if you find an asset that you can't get. Once you master this simple sequence you'll be amazed at the content you now have access to using.

Have fun with your new skillset. I'm around if you have questions. I was originally going to do this in teamspeak but I don't know if I'll be up to it this weekend. Instead I'll just post this tut and you can follow whenever it's convenient for you.

-Kelly

  

I don't want to give the end away
but we're all going to die one day
Back to top
 
IP Logged
 
Rubie
Betatester
Offline


Retired

Posts: 135
Location: Belgium
Joined: Jan 19th, 2013
Gender: Male
Re: How to import a Rune monster (animated asset) into Unreal
Reply #4 - Jan 27th, 2017 at 12:26pm
Print Post  
Hi there,

Thanks for your posts this is very helpful to me Smiley

Greets, rubie
  

I have no signature Smiley
Back to top
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint
Bookmarks: del.icio.us Digg Facebook Google Google+ Linked in reddit StumbleUpon Twitter Yahoo