Author Topic: Basic Weapon Help  (Read 4591 times)

So I've got a basic weapon script. I'm using pretty much the same stuff as with the default sword weapon, with a few exceptions (more damage, slower fire rate). This is just so I can get used to scripting weapons, since I'm new to it. But I'm struggling, the addon isn't showing up in my addons list when I go to start a server, which I believe means there's a compiling error.

Code: [Select]
datablock ProjectileData(advancedSwordProjectile : swordProjectile)
{
directDamage = 50;

uiName = "Advanced Sword Slice";
};

datablock ItemData(advancedSwordItem : swordItem)
{
shapeFile = "AddOns/Weapon_Sword/sword.dts";

uiName = "Advanced Sword";

image = advancedSwordImage;
};

datablock ShapeBaseImageData(advancedSwordImage : swordImage)
{
shapeFile = "AddOns/Weapon_Sword/sword.dts";

item = advancedSwordItem;
projectile = advancedSwordProjectile;

stateTimeoutValue[0] = 0.8;

stateTimeoutValue[3] = 1;
};

Did you enable it? Is it in or loaded via server.cs? Is there an error in your console when it tries to load it?

Yes, I have a server.cs file that executes it, but how do I enable it?

Yes, I have a server.cs file that executes it, but how do I enable it?
Go into the add-ons menu before you start a server and click the circle next to it?

Code: [Select]
shapeFile = "AddOns/Weapon_Sword/sword.dts";
should be

Code: [Select]
shapeFile = "Add-Ons/Weapon_Sword/sword.dts";

Go into the add-ons menu before you start a server and click the circle next to it?

Oh that's what you mean. The problem was it wasn't even showing up in the list of addons in the first place, I thought you meant something I had to do in the code.

Code: [Select]
shapeFile = "AddOns/Weapon_Sword/sword.dts";
should be

Code: [Select]
shapeFile = "Add-Ons/Weapon_Sword/sword.dts";

I fixed that, but it's still not showing up in my list of addons. Any ideas?

Oh that's what you mean. The problem was it wasn't even showing up in the list of addons in the first place, I thought you meant something I had to do in the code.
What's your add-on directory called? Are you seeing any console errors related to it?

Do you have a description.txt in the .zip file? Add-ons won't show up if they do not contain a description.txt file

The description.txt file is usually for describing what an add-on does, but can be blank for testing purposes.

description.txt usually looks like this

Quote from: description.txt
Title: Weapon Title
Author: Your name
Description: Description of add on

What's your add-on directory called? Are you seeing any console errors related to it?

The add-on folder is just called Add-Ons. The problem is I never start up the server, because when I go to "Start a Server" --> "Custom" --> and look to where the addon should be (it's called "Weapon_AdvancedSword"), it's not there.

Do you have a description.txt in the .zip file? Add-ons won't show up if they do not contain a description.txt file

The description.txt file is usually for describing what an add-on does, but can be blank for testing purposes.

description.txt usually looks like this


Yes, I have a description.txt file. I also have a namecheck.txt file. My two .cs files are advancedSword.cs, which looks like this:

Code: [Select]
datablock ProjectileData(advancedSwordProjectile : swordProjectile)
{
directDamage = 50;

uiName = "Advanced Sword Slice";
};

datablock ItemData(advancedSwordItem : swordItem)
{
shapeFile = "Add-Ons/Weapon_Sword/sword.dts";

uiName = "Advanced Sword";

image = advancedSwordImage;
};

datablock ShapeBaseImageData(advancedSwordImage : swordImage)
{
shapeFile = "Add-Ons/Weapon_Sword/sword.dts";

item = advancedSwordItem;
projectile = advancedSwordProjectile;

stateTimeoutValue[0] = 0.8;

stateTimeoutValue[3] = 1;
};

and my server.cs file looks like this:

Code: [Select]
exec("./advancedSword.cs");

What are the contents of your namecheck file?

What are the contents of your namecheck file?

Just a single line, the name of the weapon - "Weapon_AdvancedSword"

Just a single line, the name of the weapon - "Weapon_AdvancedSword"
Post your console log and/or the file.

Post your console log and/or the file.
Oh hang on, I figured it out. I stupidly put it in just the Blockland folder, not the Add-Ons folder.
Sorry about all the trouble guys, and thanks for your help! Locking