Introduction

General Scripting 101 - Getting Started - Introduction - Weapons - Armor - FAQs

     Ahh, the fun part! Now you get to make some observations and get familiarized a little bit with the code. I'll try to cover the basics of reading the code and finding your way within all the *.cs files in the project. I'll only cover some of the simple stuff, so as not to boggle or overwhelm any of you for now. And another thing: I'd like to apologize already for the cheap-looking site design =D. Here we go.

Finding Your Way:
     Alright. So you want to know where all the stuff is at? Here's a short explanation of where you can find certain things that you may or may not want to edit.

Accessory.cs - Items that aren't weapons or major armors. Stuff like Wind Walkers and Crystal Blue Potions are here.
Armors.cs - This is where all of your armors like Leather Armor and Full Plate Armor are.
Classes.cs - All remort names and classes are created and maintained in here.
Enemyarmors.cs - This is where all of those NPC's are made.
RPGfunk.cs - Stuff like saveworld and character creation values, etc...
Shopping.cs - New items you create that you intend on selling should be listed here. All sellable items are given an index.
Skills.cs - Looking to create a new skill like "Blacksmithing"? Skills are listed and defined here.
Weapons.cs - Weapons are created here. Things like Broadsword or Claymore are made in this file.

     There are quite a few more files, but these are the ones that you'll probably mess with most often. I am guessing that if you came here, you probably are wanting to make a new armor or weapon, etc...

 

Understanding What the Hell it Means:
     Greek is the language that people typically associate to things that they can't seem to understand. Consider this the Cheap-ass Geek-English Dictionary. =P I'll try to get you to understand the basics here, any sort of programming experience helps. Preferably C or C++.

//***************************************
// BROAD SWORD
//***************************************

ItemImageData BroadswordImage
{
shapeFile = "sword";
mountPoint = 0;

weaponType = 0; // Single Shot
reloadTime = 0;
fireTime = GetDelay(Broadsword);
minEnergy = 0;
maxEnergy = 0;

accuFire = true;

sfxFire = SoundSwing5;
sfxActivate = AxeSlash2;
};
ItemData Broadsword
{
heading = "bWeapons";
description = "Broad Sword";
className = "Weapon";
shapeFile = "sword";
hudIcon = "blaster";
shadowDetailMask = 4;
imageType = BroadswordImage;
price = 0;
showWeaponBar = true;
};
function BroadswordImage::onFire(%player, %slot)
{
MeleeAttack(%player, GetRange(Broadsword), Broadsword);
}

Wondering what the hell this all means? Well, don't worry though-- you aren't alone. I'll try to do a line-by-line description of what it all means.

//***************************************
// BROAD SWORD
//***************************************

This is just a header, it's useless except to help you find the broadsword section. It serves no real coding purpose though. Any line that starts with // is not important code, rather a note or a divider.

ItemImageData BroadswordImage
This is identifying the object itself, so it knows what all this data belongs to.
{
Section separation, end the ItemImageData section and beginning od next section.
shapeFile = "sword";
Tells Tribes what model to use for this sword.
mountPoint = 0;
I believe that this is where the the model is located in relation to your player model.
weaponType = 0; // Single Shot
Defines weapon type. In this case, it fires once.
reloadTime = 0;
This is something that does not need to be set, as there is a different system for it.
fireTime = GetDelay(Broadsword);
This is the equivalent of the reload time. Delay is calculated based upon weight of object.

minEnergy = 0;
maxEnergy = 0;

accuFire = true;

sfxFire = SoundSwing5;
Sound upon "firing".
sfxActivate = AxeSlash2;
Next sound that is heard when using this weapon.
};
End section.
ItemData Broadsword
Identifying it again.
{
heading = "bWeapons";
In your inventory screen, this is the heading it will appear under.
description = "Broad Sword";
In your inventory screen, you'll see this for the weapon name.
className = "Weapon";
shapeFile = "sword";
hudIcon = "blaster";
shadowDetailMask = 4;
imageType = BroadswordImage;
price = 0;
Leave this at 0, as there is an auto-generation for weapon cost.
showWeaponBar = true;
};
function BroadswordImage::onFire(%player, %slot)
{
MeleeAttack(%player, GetRange(Broadsword), Broadsword);
}

Alrighty then, let's make a weapon! Time for the next section.

Tutorial © 2001 by Particle.