Not so that you can make the model, you have to use a modeling program for that. But if you mean so you can make it exist in-game, yes. ShapeBaseImageData is the Datablock that belongs in the players hand. You can't scale the model so you'd need to make it the right scale using your modeling program (that's what I do first) but after that you can offset and rotate it using the numbers in the datablock. You need the ItemData to be able to spawn it on a brick and put it in your inventory when you walk over it (to be able to get it in your hand in the first place).
I added some extra comments on those 2 datablocks to help you understand the relevant line by line of what it's doing
//////////
// item //
//////////
datablock ItemData(swordItem)
{
category = "Weapon"; // Mission editor category
className = "Weapon"; // For inventory system
// Basic Item Properties
shapeFile = "./sword.dts";
mass = 1;
density = 0.2;
elasticity = 0.2;
friction = 0.6;
emap = true;
//gui stuff
uiName = "Sword"; //this is what it will be called in the wrench box and inventory
iconName = "./icon_sword"; //this is an icon image file for the inventory
doColorShift = true; //same as shapebaseimagedata, check the comment there
colorShiftColor = "0.471 0.471 0.471 1.000";
// Dynamic properties defined by the scripts
image = swordImage; //this is tying to shapebaseimagedata
canDrop = true; //whether you can throw it away or not using ctrl W
};
////////////////
//weapon image//
////////////////
datablock ShapeBaseImageData(swordImage)
{
// Basic Item properties
shapeFile = "./sword.dts"; //the model that will be used
emap = true; //no idea
// Specify mount point & offset for 3rd person, and eye offset
// for first person rendering.
mountPoint = 0; //0 is the right hand
offset = "0 0 0"; //offset changes where the center of the model is in relation to the mount point
// When firing from a point offset from the eye, muzzle correction
// will adjust the muzzle vector to point to the eye LOS point.
// Since this weapon doesn't actually fire from the muzzle point,
// we need to turn this off.
correctMuzzleVector = false;
eyeOffset = "0.7 1.2 -0.25"; //where abouts on your screen you see the item in 1st person. dont use this if you want it to just be where it naturally is
// Add the WeaponImage namespace as a parent, WeaponImage namespace
// provides some hooks into the inventory system.
className = "WeaponImage";
// Projectile && Ammo.
item = swordItem; // this links to the ItemData datablock
ammo = " ";
projectile = swordProjectile; //this is the projectile that will be fired when statefire is true in an image state
projectileType = Projectile; //the projectile is a projectile I guess..
//melee particles shoot from eye node for consistancy
melee = true;
doRetraction = false;
//raise your arm up or not
armReady = true;
//casing = " ";
doColorShift = true; //if you have any alpha textures on the model you can tint or colour them here
colorShiftColor = "0.471 0.471 0.471 1.000";
// Images have a state system which controls how the animations
// are run, which sounds are played, script callbacks, etc. This
// state system is downloaded to the client so that clients can
// predict state changes and animate accordingly. The following
// system supports basic ready->fire->reload transitions as
// well as a no-ammo->dryfire idle state.
// Initial start up state
stateName[0] = "Activate";
stateTimeoutValue[0] = 0.5;
stateTransitionOnTimeout[0] = "Ready";
stateSound[0] = swordDrawSound; //when it is activated, the sword draw sound is played, then it takes half a second to be ready
stateName[1] = "Ready";
stateTransitionOnTriggerDown[1] = "PreFire"; //now it is ready, when the mouse is clicked ("transition on trigger down") it goes to prefire.
stateAllowImageChange[1] = true; //this line means you can change the weapon / tool you're wielding to something else while the weapon is in this state
stateName[2] = "PreFire";
stateScript[2] = "onPreFire"; //ties to the function swordImage::onPrefire
stateAllowImageChange[2] = false; //you can no longer change what you're wielding until this state is finished
stateTimeoutValue[2] = 0.1;
stateTransitionOnTimeout[2] = "Fire"; //in 1 tenth of a second it goes to the "fire" state
stateName[3] = "Fire";
stateTransitionOnTimeout[3] = "CheckFire";
stateTimeoutValue[3] = 0.2; //in a fifth of a second it goes to checkfire
stateFire[3] = true; //it shoots a projectile in this state
stateAllowImageChange[3] = false; //you still can't change weapons in this state
stateSequence[3] = "Fire"; //the sword animates since in first person it wouldn't move since the eyeOffset was changed to a custom value
stateScript[3] = "onFire"; //ties to function swordImage::onFire
stateWaitForTimeout[3] = true; //the timeout can't be circumvented
stateName[4] = "CheckFire";
stateTransitionOnTriggerUp[4] = "StopFire"; //if they have let go of the left mouse button, it stops swinging
stateTransitionOnTriggerDown[4] = "Fire"; //if they still have the mouse button down then it keeps swinging
stateName[5] = "StopFire";
stateTransitionOnTimeout[5] = "Ready";
stateTimeoutValue[5] = 0.2;
stateAllowImageChange[5] = false;
stateWaitForTimeout[5] = true;
stateSequence[5] = "StopFire"; //stop swinging animation
stateScript[5] = "onStopFire"; //links to swordImage::onStopFire
};
function swordImage::onPreFire(%this, %obj, %slot)
{
%obj.playthread(2, armattack); //animates the players arm up and down
}
function swordImage::onStopFire(%this, %obj, %slot)
{
%obj.playthread(2, root); //resets the players arm
}
Important to note that when messing about with image states, always check the bracketed numbers if there's a problem. Couldn't tell you how many times I've pasted a line and not changed the number