Importing a Weapon Model - UT2003

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

RobotIntestines

New Member
Jul 4, 2003
7
0
0
Hello,

I am trying to import a test weapon model.

I am using 3ds2unr, with the instructions from here: http://www.planetunreal.com/wod/tutorials/importing.htm

I have a folder in my main/root UT2003 directory called 'testwep'.

c:\UT2003\testwep

In this folder, I have two directories: 'Models' and 'Classes'.

c:\UT2003\testwep\Classes
c:\UT2003\testwep\Models


In the 'Classes' folder, I have one file, created by 3ds2unr, called 'testwep.uc'.

c:\UT2003\testwep\Classes\testwep.uc


In the 'Models' folder, I have two files, created by 3ds2unr, called 'testwep_a.3d' and 'testwep_d.3d'.

c:\UT2003\testwep\Models\testwep_a.3d
c:\UT2003\testwep\Models\testwep_d.3d


The file, 'testwep.uc', consists of the following:

Code:
 //=============================================================================
// testwep.
//=============================================================================
class testwep expands Actor;

#exec MESH IMPORT MESH=testwep ANIVFILE=MODELS\testwep_a.3d DATAFILE=MODELS\testwep_d.3d X=0 Y=0 Z=0
#exec MESH ORIGIN MESH=testwep X=0 Y=0 Z=0

#exec MESH SEQUENCE MESH=testwep SEQ=All      STARTFRAME=0 NUMFRAMES=1
#exec MESH SEQUENCE MESH=testwep SEQ=ENFORCER STARTFRAME=0 NUMFRAMES=1

#exec TEXTURE IMPORT NAME=Jtestwep1 FILE=MODELS\testwep1.PCX GROUP=Skins FLAGS=2 // Material #1

#exec MESHMAP NEW   MESHMAP=testwep MESH=testwep
#exec MESHMAP SCALE MESHMAP=testwep X=0.1 Y=0.1 Z=0.2

#exec MESHMAP SETTEXTURE MESHMAP=testwep NUM=1 TEXTURE=Jtestwep1

defaultproperties
{
    DrawType=DT_Mesh
    Mesh=testwep
}



I have added the following line to the 'UT2003.ini' file:

Code:
 EditPackages=testwep



When I run 'ucc make' from the command line, I get the following error:

Code:
 Analyzing...
Bad class definition 'testwep'/'' /840/840
Can't find file '..\testwep\Classes\testwep.uc' for import
General Protection fault!

History:

Exiting due to error


Can anyone help me figure out why this isn't working?
 

RobotIntestines

New Member
Jul 4, 2003
7
0
0
Thank You.

That was incredibly helpful. I have successfully imported the mesh, and it can now be seen by the mesh browser in UnrealED.

I am now trying to use this mesh as my weapon mesh. (In the first-person view)

For some reason, the first-person view of my new weapon is invisible in-game. (The weapon is usable, it displays the correct text message when selected, and it fires correctlly. It is just invisible)

Here is the class file that I used to import the mesh:

Code:
 //=============================================================================
// jBox.
//=============================================================================
class jBox extends Actor;

#exec MESH IMPORT MESH=jBox ANIVFILE=MODELS\jBox_a.3d DATAFILE=MODELS\jBox_d.3d X=0 Y=0 Z=0
#exec MESH ORIGIN MESH=jBox X=0 Y=0 Z=0

#exec MESH SEQUENCE MESH=jBox SEQ=All STARTFRAME=0 NUMFRAMES=1
#exec MESH SEQUENCE MESH=jBox SEQ=BOX STARTFRAME=0 NUMFRAMES=1

#exec TEXTURE IMPORT NAME=JjBox1 FILE=MODELS\testwep1.PCX GROUP=Skins FLAGS=2 // Material #1

#exec MESHMAP NEW   MESHMAP=jBox MESH=jBox
#exec MESHMAP SCALE MESHMAP=jBox X=0.1 Y=0.1 Z=0.2


defaultproperties
{
    DrawType=DT_Mesh
    Mesh=jBox
}


Here is the new weapon class code I used to create the new weapon, and assign the new mesh to it: (It is from a tutorial I found, so the comments are not mine. The only line that I added is the following:

Line that I added: "Mesh=mesh'jbox.jbox'"

class Conspigulator extends Weapon
config(user); //So weapon preference settings are stored alongside all the standard weapons.

defaultproperties
{
ItemName="Conspigulator" //The text you see when you switch to the weapon and in various other places.
IconMaterial=Material'InterfaceContent.Hud.SkinA' //Texture where the icon to be show in the weapon bar is.
IconCoords=(X1=322,Y1=372,X2=444,Y2=462) //Position of icon in that texture.

FireModeClass(0)=ConspigulatorFire
FireModeClass(1)=ConspigulatorAltFire

DrawScale=10
Mesh=mesh'jbox.jbox' //What you see in 1st person.
BobDamping=2.3 //How much the weapon moves about as you walk.

PickupClass=class'ConspigulatorPickup'
EffectOffset=(X=100,Y=28,Z=-19) //Where effects are drawn. Used for start location of InstantFire beam effects.
PutDownAnim=PutDown
DisplayFOV=60

PlayerViewOffset=(X=0,Y=2.3,Z=0) //Position of the weapon in 1st person
PlayerViewPivot=(Pitch=0,Roll=0,Yaw=0) //Rotation of the model in 1st person.
UV2Texture=Material'XGameShaders.WeaponEnvShader' //What does this do?

AttachmentClass=class'ConspigulatorAttachment'
SelectSound=Sound'WeaponSounds.LightningGun.SwitchToLightningGun'
SelectForce="SwitchToLightningGun" //The various 'Force' variables are for force feedback mice etc. There is no way to test them without such a device, but it is probably a good idea to include them anyway, for completeness.

AIRating=0.69 //How much bots want to use this weapon.
CurrentRating=0.69

DefaultPriority=3
InventoryGroup=9 //Which slot the weapon occupies.
GroupOffset=1 //This must be different to all other weapons that occupy the same InventoryGroup.
}


I have no idea what I am doing wrong. Why would the weapon not be visible?

Have I textured the mesh incorrectly?
Do weapons need Static Meshes (As opposed to 'Mesh=') ?
I only imported one 3DS file. Does the weapon need an animation in first-person view?
Is it something else?


The mesh that I imported is just a rectangle that someone made for me in 3ds Max. It's dimensions are less than 256x256. 3ds2unr gave no errors when I applied it to the .3DS file.

The texture is just a 256x256 red square .pcx image I made in Photoshop.

If the problem may be with my .3ds file, are there any 3ds files or meshes I could download from somewhere to test with instead?
 
Last edited by a moderator:
The code looks very UT2003 like (FireModeClass for example isn't in UT or Unreal1)

But the mesh system is UT (with .3D files), it's an UT tutorial you used.
The new system uses skeletal meshes (why, don't ask me, the old one worked fine for weapons)
Now you need .PSA and .PSK files, and import those
(I do that in UnrealEd, and then save everything, models+animations+skins as 1 package)

I don't know how to get the PSA/PSK files, our modeler does that for us :)
 

RobotIntestines

New Member
Jul 4, 2003
7
0
0
Thanks everyone.

I am still unable to see any weapon I try to create.

Here is what I am trying now:

I create a rectangular box in UnrealED. I then save it as a mesh. (In a package)

I change my weapon class file to point to the new mesh. The weapon shows up as invisible in game.

Possible problems: (I am drawing at straws here)

- My mesh is only one 'frame'. It is not animated. Does it have to be animated, or consist of many frames?

- My mesh shows up with the default 'green bubbles' texture in the mesh browser. Is this bad at all?

-Am I supposed to be assinging a texture to the mesh in the weapon class file?

-I have played with the PlayerOffset x,y, and z values in the class file. That hasn't worked yet.

- I AM able to make the weapon use and show all of the existing UT2003 weapons/meshes. It just won't display mine.



- I can not find a single tutorial on this subject anywhere.


-I am using 'meshes' as opposed to 'static meshes', because the UT2003 weapons class files say 'mesh = mesh.XWeapons.AssaultRifle'', as opposed to 'StaticMesh = ..*'.

Any ideas? This is the most frustrating thing I have ever dealt with :(

It feels like everyone else in the world automatically knows how to do this somehow. :(
 
Last edited:

RobotIntestines

New Member
Jul 4, 2003
7
0
0
Thank you.

Is this something I can do in UnrealED (as opposed to using 3DS MAX or Maya)?

Also, how many frames of animation do I need?

I am sorry to ask so many questions in the forum, but I simply am unable to find information anywhere.

edit: I just realized that in all of my Google searches, I have been typing in "UT2003". Maybe there is pertinent information written about original UT....
 
Last edited: