View Full Version : gettin my own weapon mesh ingame
legacy-muppet
07-10-2003, 07:03 AM
hi all,
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:
mesh'crapGun.weapon1'
where crapGun is the name of my *.ukx file and Weapon1 is one of the weapons in it.
i also tried
mesh'myPackage.crapGun.weapon1'
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
legacy-monkeycircus
07-10-2003, 07: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.
legacy-muppet
07-10-2003, 08: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' ?
legacy-monkeycircus
07-10-2003, 08: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
mesh=mesh'MyPackage.Crappy.crappy****omatic'
i think
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.
legacy-muppet
07-10-2003, 08: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"
DefaultProperties
{
FireModeClass(0)=LasgunFire
FireModeClass(1)=LasgunFire
SelectSound=Sound'WeaponSounds.ShockRifle.SwitchTo ShockRifle'
SelectForce="SwitchToShockRifle"
AIRating=0.630000
CurrentRating=0.630000
EffectOffset=(X=65.000000,Y=14.000000,Z=-10.000000)
DisplayFOV=60.000000
Priority=2
DefaultPriority=2
HudColor=(B=255,G=0,R=128)
SmallViewOffset=(X=2.000000,Y=9.000000,Z=-8.000000)
CenteredOffsetY=-8.000000
CenteredYaw=-500
InventoryGroup=4
PickupClass=Class'LasgunPickup'
PlayerViewOffset=(X=-10.000000,Y=3.000000,Z=-2.000000)
PlayerViewPivot=(Pitch=1000,Yaw=-800,Roll=-500)
BobDamping=1.800000
AttachmentClass=Class'LasgunAttachment'
IconMaterial=Texture'InterfaceContent.HUD.SkinA'
IconCoords=(X1=322,Y1=190,X2=444,Y2=280)
ItemName="Lasgun"
LightType=LT_Steady
LightEffect=LE_NonIncidence
LightBrightness=150.000000
LightRadius=4.000000
LightHue=200
LightSaturation=70
LightPeriod=3
Mesh=Mesh'myPackage.crapGun.crapomatic'
}
legacy-Gobi
07-10-2003, 10:46 AM
Try this if you have already an ukx file:
Mesh=SkeletalMesh'BlablaMesh.Blabla1'
DrawType=DT_Mesh
DrawScale=1.000000
should be in your gun default properties.
legacy-Spin
07-10-2003, 11: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
defaultproperties
{
Mesh=AR16a1_3rdMesh
DrawType=DT_Mesh
bStatic=False
}
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:
Mesh=SkeletalMesh'Package.Weaponname'
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.
legacy-muppet
07-11-2003, 02: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.1.6 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.