Author Topic: "Bad Datablock from server"  (Read 9105 times)

Did you even read everything that anyone said?

Did you even read everything that anyone said?
That forceRequiredAddon discussion was only helpful in general; I changed the server.cs, but it didn't solve the problem. I'm getting the same exact error. Unless I missed something completely other than Wrapperup's post I don't think anything else was said on the topic.





Instead of

if(forceRequiredAddOn("Weapon_Bow") == $Error::AddOn_NotFound)
{
   error("ERROR: Weapon_Bows_Akimbo - required add-on Weapon_Bow not found");
   return;
}
else if(forceRequiredAddOn("Weapon_Rocket_Launcher") == $Error::AddOn_NotFound)
{
   error("ERROR: Weapon_Bows_Akimbo - required add-on Weapon_Rocket_Launcher not found");
   return;
}
else
{
   exec("./Weapon_BowRocket.cs");
}


Try this for the server.cs

$FRA::WeaponBow = forceRequiredAddOn("Weapon_Bow");
if($FRA::WeaponBow == $Error::AddOn_NotFound)
{
      error("ERROR: Weapon_Bows_Akimbo - required add-on Weapon_Bow not found");
      return;
}
$FRA::RocketL = forceRequiredAddOn("Weapon_Rocket_Launcher");
if($FRA::RocketL == $Error::AddOn_NotFound)
{
      error("ERROR: Weapon_Bows_Akimbo - required add-on Weapon_Rocket_Launcher not found");
      return;
}
exec("./Weapon_BowRocket.cs");


What I changed is the forceRequiredAddOn using a global variable. Not sure if it would change this, though.

What errors are in the console?

No. Just do this:
Code: [Select]
forceRequiredAddOn("Weapon_Bow");
forceRequiredAddOn("Weapon_Rocket_Launcher");
exec("./Weapon_BowRocket.cs");
The bow and rocket launcher will never not be found because they're default add-ons and the launcher will make sure they're there. Plus forceRequiredAddOn will enable them if they're not enabled, so there's no point in checking if they're disabled.

His server.cs isn't the problem anymore. We already fixed that.

What errors are in the console?

Loading Add-On: Weapon_BowRocket (CRC:1480223719)
Executing Add-Ons/Weapon_BowRocket/server.cs.
  Loading Add-On "Weapon_Bow"
Executing Add-Ons/Weapon_Bow/server.cs.
Executing Add-Ons/Weapon_Bow/weapon_bow.cs.
Executing Add-Ons/Weapon_Bow/server.cs.
Executing Add-Ons/Weapon_Bow/weapon_bow.cs.
Warning: DamageType "ArrowDirect" already exists.
Executing Add-Ons/Weapon_Rocket_Launcher/server.cs.
Executing Add-Ons/Weapon_Rocket_Launcher/weapon_rocket launcher.cs.
Warning: DamageType "RocketDirect" already exists.
Warning: DamageType "RocketRadius" already exists.
Executing Add-Ons/Weapon_BowRocket/Weapon_BowRocket.cs.
Add-Ons/Weapon_BowRocket/Weapon_BowRocket.cs (0): preload failed for BowRocketImage: Bad Datablock from server.
Activating package: AltFire
14 datablocks added.

This is from before I made those changes to the server.cs, but the bad datablock problem still shows up. The console log is attached in the OP. I'll have to wait until probably tomorrow to get a new console log but I think this can be worked with the same way.

In game the item will spawn on a brick like normal, but equipping it doesnt do anything. None of the images are mounted nor does the image even change.

And I'm sure one of you will point this out (if you look at Weapon_BowRocket.cs) but I'm aware that the AltFire package I made is messy and forgets everything up. It's just a test so I'll ask that you don't worry about it but any tips or guides on making it better are appreciated. Thanks.

Try

datablock ShapeBaseImageData(BowRocketImage : BowImage)

Try

datablock ShapeBaseImageData(BowRocketImage : BowImage)
That fixed it, but then caused an error because of a state being unresolved. I've fixed it in the below code.
Code: [Select]
datablock ShapeBaseImageData(BowRocketImage : BowImage)
{

   // Specify mount point & offset for 3rd person, and eye offset
   // for first person rendering.
   mountPoint = 0;
   offset = "0 0 0";
   eyeOffset = 0; //"0.7 1.2 -0.5";
   rotation = eulerToMatrix( "0 0 0" );

   shapeName = "base/data/shapes/empty.dts";
   emap = false;

   // 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 = true;

   // Add the WeaponImage namespace as a parent, WeaponImage namespace
   // provides some hooks into the inventory system.
   className = "WeaponImage";

   // Projectile && Ammo.
   item = BowRocketItem;
   ammo = " ";
   projectile = ArrowProjectile;
   projectileType = Projectile;

   //melee particles shoot from eye node for consistancy
   melee = false;
   //raise your arm up or not
   armReady = true;

   doColorShift = false;
//   colorShiftColor = AkimboBowItem.colorShiftColor;//"0.400 0.196 0 1.000";

stateName[0] = "Activate";
stateWaitForTimeout[0] = true;
stateTimeoutValue[0] = 0.05;
stateTransitionOnTimeout[0] = "Ready";

stateName[1] = "Ready";
stateTransitionOnTriggerDown[1] = "Click";

stateName[2] = "Click";
stateScript[2] = "onClick";
stateWaitForTimeout[2] = true;
stateTimemoutValue[2] = 0.05;
stateTransitionOnTimeout[2] = "Idle";

stateName[3] = "Idle";
stateTransitionOnTriggerUp[3] = "Ready";




stateSound[0] = "";

stateFire[2] = 0;
stateAllowImageChange[2] = 1;
stateSequence[2] = "";
stateSound[2] = "";

stateTransitionOnTimeout[3] = "";
stateTimeoutValue[3] = 0;
stateAllowImageChange[3] = 1;
stateSequence[3] = "";

stateName[4] = "";
stateTransitionOnTriggerUp[4] = "";
stateTransitionOnTriggerDown[4] = "";

stateName[5] = "";
stateTransitionOnTimeout[5] = "";
stateTimeoutValue[5] = 0;
stateAllowImageChange[5] = 1;
stateScript[5] = "";
};

OP still has to work on the states, because when you fire it, the bow never stops firing. Plus the rocket launcher and bow are in the same hand(unless that was what OP wanted?).

Also, %obj.setImageTrigger(2, 1); in onTrigger will be called any time the player jumps, right clicks, clicks, or crouches. You also have the last variable for onTrigger wrong. It's a boolean as to wether the button was pushed or released, not the player.
« Last Edit: December 20, 2014, 08:25:23 AM by jes00 »

I think what he should do is just have rocket launcher be mounted instead of both of them since the bow is already being mounted.

Oh, then the actual main problem is resolved. I knew that all that other garbage was going to happen (weapons mounted to same hand, altfire working that way), but the point was to test out this hypothetical system I had in mind. I wanted to avoid basing the BowRocketImage image off of anything at first anyway but I didn't predict the sequences being affected this way, which is a new problem I'll be looking to fix if I use this method to solve the Bad Datablock problem.