View Full Version : gettin my own weapon mesh ingame
07-10-2003, 06:03 AM
i've made a weapon mesh and exported it to a *.psk file with actorX, i then imported it into unrealEd3.0 and saved my gun as a *.ukx file.
I've been trying to follow the sega 500 tutorials but honestly, they are a bit vague at parts. I can get the mesh into the game if i put the *.ukx file in the "UT2003/animations" folder, but not if i put it in my own packages folder, eg. if i put it in "UT2003/myPackage" then i dont know how to reference it in my code because it isnt finding my file.
im currently using:
where crapGun is the name of my *.ukx file and Weapon1 is one of the weapons in it.
i also tried
that didnt seeem to work either.
for distribution purposes i am assuming that all of my own files need to be in myPackage's folder, correct me if im wrong :) so would somebody please be able to explain how i call a weapon mesh from my own *.ukx file so i can use it as the first person or third person mesh for my weapon.
hope this makes sense, i'm a bit tired, hehe
07-10-2003, 06:23 AM
If you use your package you need to import the model via UCC.
You sometimes see compiler exec commands on the headers of some uscript files, like;
#exec Import Text blah de blah
You need to do that, but import your mesh, like this:
#exec MESH IMPORT FILE="crapgun.psk" NAME="crappy****omatic" GROUP="crapgun"
Put that under the class identifier in your weapon class.
That should import it to "MyPackage.crapgun.Crappy****omatic" The weapon will also be stored inside the .u package, which saves having extra files (you can get the compiler to save it as a package, but I forget how to do that).
Note that you will probably also need to tweak the position of the gun model in 1st/3rd person, and you will need a psa animation package to link it to.
07-10-2003, 07:08 AM
thanks for the quick reply monkeycircus,
thats definatley sounds like what im looking for :) thanks.
a question or 2 concerning this if i may :P
firstly is there a special path where i need to keep my psk file? like do i put it in the root of myPackage folder or does the #exec function look for it somewhere else? its just that im getting an ExecWarning saying: bad MESH IMPORT, and then an error where im trying to reference the mesh i've created. So its not getting imported or something.
also when i call the mesh does it matter weather i use mesh=mesh'blahblah' or mesh=skeletalmesh'blahblah' ?
07-10-2003, 07:14 AM
the model file can be loaded from anywhere within the package folder, usually people use Mypackage/models/mymodel.psk
When calling the mesh, it should be
I am not sure weather it matters if you refer to it as a skeletal mesh or just a mesh. With a weapon I don't think it matters because it should have a skeleton (because it is animated, or at least should be animated). I think.
07-10-2003, 07:45 AM
it's still not compiling, i have my model in myPackage\models\gun.PSK and i've tried putting all different pathnames in the EXEC function call.
i've included my guns class becasue i thought maybe someone could see if i was doing something wrong in either the #EXEC function, or the line where i reference the mesh.
im getting a "bad MESH IMPORT" error from the compiler.
// class name: Lasgun
class Lasgun extends Weapon;
#EXEC mesh IMPORT FILE="models\gun.psk" NAME="crapomatic" GROUP="crapGun"
07-10-2003, 09:46 AM
Try this if you have already an ukx file:
should be in your gun default properties.
07-10-2003, 10:02 AM
This is the import script for one of my own 3rd person meshes (all the 1st person weapons are in a .ukx compiled through the anim browser)
class AR16a1_3rd extends decoration;
#exec MESH MODELIMPORT MESH=AR16a1_3rdMesh MODELFILE=models\AR16a1_3rd.PSK LODSTYLE=10
#exec MESH ORIGIN MESH=AR16a1_3rdMesh X=0 Y=0 Z=0 YAW=-2048 PITCH=0 ROLL=0
#exec ANIM IMPORT ANIM=AR16a1_3rdAnims ANIMFILE=models\AR16a1_3rd.PSA COMPRESS=1 MAXKEYS=999999 IMPORTSEQS=1
#exec MESHMAP SCALE MESHMAP=AR16a1_3rdMesh X=1 Y=1 Z=1
#exec MESH DEFAULTANIM MESH=AR16a1_3rdMesh ANIM=AR16a1_3rdAnims
#exec ANIM DIGEST ANIM=AR16a1_3rdAnims USERAWINFO VERBOSE
#EXEC TEXTURE IMPORT NAME=AR16a1_3rdTex0 FILE=TEXTURES\AR163rd.bmp GROUP=Skins
#EXEC MESHMAP SETTEXTURE MESHMAP=AR16a1_3rdMesh NUM=0 TEXTURE=AR16a1_3rdTex0
For first person weapons I would recommend importing the .PSK/.PSA into the anim browser and then linking the mesh in your weapon class with:
as gobi says, but if it's any assistance the above code is a more complete set of #exec's for direct importing .psk/.psa at script.
07-11-2003, 01:32 AM
thanks for the replies,
so Spin, looking at ur code, does this mean i need to make my own class that extends the decoration class in order to use a mesh (for third person)? is this why i may have been getting the compile bad IMPORT MESH error, because i was using the #EXEC call from my main weapon class?
gobi: with the first person weapons, that was what i was doin in the first place, but i have to have the precompiled .ukx file in the 'UT2003\animations' folder for my code to find it, when i want the .ukx in 'UT2003\myPackage' folder :)
i'll have a bit of a play around with that stuff though, thanks a lot for the help :)
Powered by vBulletin® Version 4.2.0 Copyright © 2013 vBulletin Solutions, Inc. All rights reserved.