Author Topic: Weapon will not load ingame?  (Read 765 times)

Well, I'm trying to make a weapon. But when I load it into the game, it doesn't appear anywhere. I think this part of the console.log shows the problem:
Code: [Select]
Loading Add-On: Weapon_Rapid_Launcher (CRC:1199414599)
Add-Ons/Weapon_Rapid_Launcher/weapon_rapid_launcher.cs Line: 327 - Syntax error.
>>> Some error context, with ## on sides of error halt:
^shapeFile = "./rocketLauncher.dts";

^rotate = false;

^mass = 1;

^density = 0.2;

^elasticity = 0.2;

^friction = 0.6;

^emap = true;



^//gui stuff

^uiName = "Rapid Launcher";

^iconName = "./icon_rapidLauncher";

^doColorShift = true;

^colorShiftColor = 0.678 0.000 ##1##.000 1.000



^ // Dynamic properties defined by the scripts

^image = rapidLauncherImage;

^canDrop = true;

};



////////////////

//weapon image//

////////////////

datablock ShapeBaseImageData(rapidLauncherImage)

{

   // Basic Item properties

   shapeFile = "./rocketLauncher.dts";
>>> Error report complete.

ADD-ON "Weapon_Rapid_Launcher" CONTAINS SYNTAX ERRORS

Some things I'd like to point out:
Yes, this is being based off of Weapon_Rocket_Launcher.
It says that line 327 has a syntax error, but I didn't modify that line from the original file: velInheritFactor    = 1.0;
It also says the colorShiftColor is 0.678 0.000 ##1##.000 1.000; where did those #'s come from?

Can anyone help?
Here is the weapon I'm making: http://www.mediafire.com/download/53qmtfb1crjhf38/Weapon_Rapid_Launcher.zip
Here is the full console.log: http://www.mediafire.com/download/d041r04x71hjkkw/console(4).log

Also, please keep in mind that I am new to coding.

When the console tells you that there is a problem on line #, look not just on that line, but on the lines before and after. It usually tells you that it found the error on the line after where the error actually is.

Decided to look at your script. Line 327 is colorShiftColor = 0.678 0.000 1.000 1.000. I wont spoon feed you what is wrong, but compare that line to the lines above and below, its missing two things that the others have. The first is fairly obvious, so ill leave that up to you to work out, the second is less obvious for a new scripter. When defining a value which has multiple words in it, you must encase it with quotation marks ( " ). Ill leave the fixing to you.
« Last Edit: December 30, 2013, 11:00:48 AM by boodals 2 »

-snipallthetext-
Well, I got the " marks around the color settings now, and that fixed that problem.

But this is the new report:
Code: [Select]
Loading Add-On: Weapon_Rapid_Launcher (CRC:1292851348)
Add-Ons/Weapon_Rapid_Launcher/weapon_rapid_launcher.cs Line: 330 - Syntax error.
>>> Some error context, with ## on sides of error halt:

^elasticity = 0.2;

^friction = 0.6;

^emap = true;



^//gui stuff

^uiName = "Rapid L.";

^iconName = "./icon_rapidLauncher";

^doColorShift = true;

^colorShiftColor = "0.678 0.000 1.000 1.000"



^ // Dynamic properties defined by the scripts

^image ##=## rapidLauncherImage;

^canDrop = true;

};



////////////////

//weapon image//

////////////////

datablock ShapeBaseImageData(rapidLauncherImage)

{

   // Basic Item properties

   shapeFile = "./rocketLauncher.dts";

   emap = true;



   // Specify mount point & offset for 3rd person, and eye offset
>>> Error report complete.

ADD-ON "Weapon_Rapid_Launcher" CONTAINS SYNTAX ERRORS

I think I have learned that the #'s show where the error is. But what confuses me is where the error is now. It's on the line image = rapidLauncherImage;
Could it be referring to the RapidLauncherImage datablock below it? I don't model, so nothing should have modified the rocketlauncher.dts file.

Updated Weapon: http://www.mediafire.com/download/53qmtfb1crjhf38/Weapon_Rapid_Launcher.zip
Updated Console.log: http://www.mediafire.com/download/a8gb0t48u8o4po1/console(5).log

You solved one of the problems, but didn't solve the other.

I wont spoon feed you what is wrong, but compare that line to the lines above and below, its missing two things that the others have. The first is fairly obvious, so ill leave that up to you to work out

The problem is still on the same line.

You solved one of the problems, but didn't solve the other.

The problem is still on the same line.

;

How didn't I notice that. I use it whenever I use a console command and it's on EVERY OTHER LINE OF CODE in the .cs file.
Running a test...

Test was a success! Sorry for the late edit.
« Last Edit: December 30, 2013, 01:49:13 PM by Mrmii21 »