Author Topic: Armor : Armor  (Read 911 times)

Code: [Select]
datablock PlayerData(CannonTurretR : Cannonturretarmor)
{

   lookUpLimit = 2.6;
   lookDownLimit = 2.2;


   minlookangle = -0.4;
   maxlookangle = 0.2;
   uiName = "Cannon Raft Turret";
};
It crashes the game on startup. COnsole says something about not being able to locate the cannonturretarmor. Can someone help?

COnsole says something about not being able to locate the cannonturretarmor.
... if you're trying to create a datablock from it it's a good idea to make sure it's actually there first.

... if you're trying to create a datablock from it it's a good idea to make sure it's actually there first.
I used forcerequired.
Code: [Select]
%errorB = ForceRequiredAddOn("Vehicle_Pirate_Cannon");

if(%errorB == $Error::AddOn_Disabled)
{
   //A bit of a hack:
   //  we just forced the jeep to load, but the user had it disabled
   //  so lets make it so they can't select it
   PirateCannonArmor.uiName = "";
}

if(%errorB == $Error::AddOn_NotFound)
{
   //we don't have the jeep, so we're screwed
   error("ERROR: Vehicle_Biplane - required add-on Vehicle_Jeep not found");
}
else
{
   exec("./Vehicle_Raft.cs");
}

Hint: The Pirate Cannon is not called "PirateCannonArmor". Read the actual script for it.

Hint: The Pirate Cannon is not called "PirateCannonArmor". Read the actual script for it.
Fixed that. Same console crash thing.

It's not called "CannonTurretArmor" either.

It's not called "CannonTurretArmor" either.
Code: [Select]
datablock PlayerData(CannonTurret : PlayerStandardArmor)I thought Armor was added at the end of every playertype name.

I changed Armor to player and it worked. Now it has syntax errors.
Code: [Select]
Loading Add-On: Vehicle_Raft (CRC:706921544)
Add-Ons/Vehicle_Raft/Vehicle_Raft.cs Line: 237 - Syntax error.
>>> Some error context, with ## on sides of error halt:
   radiusDamageType  = $DamageType::VehicleExplosion;



   explodeOnDeath^^= 1;



   armingDelay         = 0;

   lifetime            = 0;

   

   uiName = "";

};

















datablock PlayerData(CannonTurretR : CannonTurretPlayer)



   lookUpLimit ##=## 2.6;

   lookDownLimit = 2.2;

^



   minlookangle = -0.4;

   maxlookangle = 0.2;

   uiName = "Cannon Raft Turret";

};



























function RaftVehicle::onAdd(%this,%obj)

{

   %t = new AIPlayer()

   {

      dataBlock = Cannonturret;
>>> Error report complete.

ADD-ON "Vehicle_Raft" CONTAINS SYNTAX ERRORS

datablock PlayerData(CannonTurretR : CannonTurretPlayer)
{


Missing an open {
Fixed that, now the console gives me that unable to locate parent turret again.

Fixed that, now the console gives me that unable to locate parent turret again.
That means it can't find the higher class.

That means it can't find the higher class.
But how do I fix it?

It means exec the parent datablock before the child, or it won't find it.

It means exec the parent datablock before the child, or it won't find it.
Yeah, for example, you cannot do this:
Code: [Select]
myFunction();
function myFunction()
{
    echo("ol");
}

But you can do this:
Code: [Select]
function myFunction()
{
    echo("ol");
}
myFunction();

Basically, the cannon has to be executed before you reference it.