Author Topic: Plethora's coding issues: Why are my alterations still overwriting the bow?  (Read 2057 times)

Thanks in advance to all who will help.

I'm getting my feet wet and have little idea what I'm doing. Forgive the incompetence of a newbie.

Ok, I've been toying around with the bow, including taking out all the emitters and stuff; pure weapon now. Bow still overwrites it even after I've eliminated all ties to the bow as far as I know. What the devil am I missing?
Code: [Select]
//PlethBow.cs
//bow and arrow weapon stuff

//projectile
AddDamageType("PlethArrowDirect",   '<bitmap:add-ons/Weapon_PlethBow/CI_Pletharrow> %1',    '%2 <bitmap:add-ons/Weapon_PlethBow/CI_Pletharrow> %1',0.5,1);

datablock ProjectileData(arrowProjectile)
{
   projectileShapeName = "./Pletharrow.dts";

   directDamage        = 40;
   directDamageType    = $DamageType::PlethArrowDirect;

   radiusDamage        = 10;
   damageRadius        = 100;
   radiusDamageType    = $DamageType::PlethArrowDirect;

   explodeOnPlayerImpact = false;
   explodeOnDeath        = false; 

   armingDelay         = 10000;
   lifetime            = 10000;
   fadeDelay           = 10000;

   isBallistic         = true;
   bounceAngle         = 0; //stick almost all the time
   minStickVelocity    = 1.0;
   bounceElasticity    = 5.0;
   bounceFriction      = 0.3;   
   gravityMod = 0.65;

   hasLight    = true;
   lightRadius = 3.0;
   lightColor  = "9 0 0";

   muzzleVelocity      = 99.0;
   velInheritFactor    = 1;

   uiName = "Pleth Arrow";
};


//////////
// item //
//////////
datablock ItemData(PlethBowItem)
{
category = "Weapon";  // Mission editor category
className = "Weapon"; // For inventory system

// Basic Item Properties
shapeFile = "./Plethbow.dts";
rotate = false;
mass = 1;
density = 0.2;
elasticity = 0.2;
friction = 0.6;
emap = true;

//gui stuff
uiName = "Pleth Bow";
iconName = "./icon_Plethbow";
doColorShift = true;
colorShiftColor = "0.400 0.196 0 1.000";

// Dynamic properties defined by the scripts
image = PlethbowImage;
canDrop = true;
};

////////////////
//weapon image//
////////////////
datablock ShapeBaseImageData(PlethbowImage)
{
   // Basic Item properties
   shapeFile = "./Plethbow.dts";
   emap = true;

   // 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 10" );

   // 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 = PlethBowItem;
   ammo = " ";
   projectile = arrowProjectile;
   projectileType = Projectile;

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

   doColorShift = true;
   colorShiftColor = PlethBowItem.colorShiftColor;//"0.400 0.196 0 1.000";

   //casing = " ";

   // Images have a state system which controls how the animations
   // are run, which sounds are played, script callbacks, etc. This
   // state system is downloaded to the client so that clients can
   // predict state changes and animate accordingly.  The following
   // system supports basic ready->fire->reload transitions as
   // well as a no-ammo->dryfire idle state.

   // Initial start up state
stateName[0]                     = "Activate";
stateTimeoutValue[0]             = 0.5;
stateTransitionOnTimeout[0]       = "Ready";
stateSound[0] = weaponSwitchSound;

stateName[1]                     = "Ready";
stateTransitionOnTriggerDown[1]  = "Fire";
stateAllowImageChange[1]         = true;

stateName[2]                    = "Fire";
stateTransitionOnTimeout[2]     = "Reload";
stateTimeoutValue[2]            = 0.05;
stateFire[2]                    = true;
stateAllowImageChange[2]        = false;
stateSequence[2]                = "Fire";
stateScript[2]                  = "onFire";
stateWaitForTimeout[2] = true;
stateSound[2] = PlethbowFireSound;

stateName[3] = "Reload";
stateSequence[3]                = "Reload";
stateAllowImageChange[3]        = false;
stateTimeoutValue[3]            = 0.5;
stateWaitForTimeout[3] = true;
stateTransitionOnTimeout[3]     = "Check";

stateName[4] = "Check";
stateTransitionOnTriggerUp[4] = "StopFire";
stateTransitionOnTriggerDown[4] = "Fire";

stateName[5]                    = "StopFire";
stateTransitionOnTimeout[5]     = "Ready";
stateTimeoutValue[5]            = 0.2;
stateAllowImageChange[5]        = false;
stateWaitForTimeout[5] = true;
//stateSequence[5]                = "Reload";
stateScript[5]                  = "onStopFire";


};
« Last Edit: July 03, 2013, 08:32:13 PM by Plethora »

code plz, I have no idea what you did wrong

Did you change the uiName and datablock name?

Did you change the uiName and datablock name?
symptoms suggest this is what you screwed up. Typical newb mistake.

symptoms suggest this is what you screwed up. Typical newb mistake.
I feel like he forgot a semi colon or quote mark

I feel like he forgot a semi colon or quote mark
this is possible.

Code taken from quake like and altered slightly:
Code: [Select]
// Plethora's Playertype
// A playertype to fit the needs of Plethora


datablock PlayerData(playerHyperArmor : PlayerStandardArmor)
{
   runForce = 100 * 100;
   runEnergyDrain = 0;
   minRunEnergy = 0;
   maxForwardSpeed = 20;
   maxBackwardSpeed = 15;
   maxSideSpeed = 10;

   maxForwardCrouchSpeed = 20;
   maxBackwardCrouchSpeed = 15;
   maxSideCrouchSpeed = 10;

   jumpForce = 10 * 100;
   jumpEnergyDrain = 0;
   minJumpEnergy = 0;
   jumpDelay = 0;

minJetEnergy = 0;
jetEnergyDrain = 0;
canJet = 0;

uiName = "Hyper Player";
showEnergyBar = false;

   runSurfaceAngle  = 89;
   jumpSurfaceAngle = 89;
}

Code of the document "server", also taken from quake and altered slightly:
Code: [Select]
exec("./Player_Hyper.cs");

Should I be removing "armor" from "PlayerHyperArmor"?
« Last Edit: July 01, 2013, 10:13:04 PM by Plethora »

the last bracket for a datablock has to have a semi colon after it

also namecheck is not required I usually leave it out

check your console when you execute your addon if you see lots of red text and error messages it will tell you where the errors is

When you create a datablock, the closing bracket requires a semi-colon to be placed at the end, the same rule applies when you create any object.
« Last Edit: July 02, 2013, 11:17:12 PM by Kadon »

Ok, it's working now. Thanks all.

When you create a datablock, the closing bracket requires a semi-colon, the same rule applies when you create an object.
And packages.

...the same rule applies when you create an object.

A datablock is an object.
echo(isObject(brick1x1Data));

New issue in OP. No, I don't plan to make this a daily occurrence.

the arrow projectile hasn't been renamed


also make new topics for new issues don't remove the old stuff, because people may search coding help to try to get help with their stuff only to find it removed
« Last Edit: July 03, 2013, 08:38:18 PM by swollow »

You didn't rename the datablock.

Lines that say new Datablock(Arrow____) should be something like new Datablock(PlethArrow) .