Way to disable color changing and show colors that are in the image png?

Author Topic: Way to disable color changing and show colors that are in the image png?  (Read 1650 times)

Code: [Select]
if(isFile("Add-Ons/System_ReturnToBlockland/server.cs"))
{
  if(!$RTB::RTBR_ServerControl_Hook) exec("Add-Ons/System_ReturnToBlockland/RTBR_ServerControl_Hook.cs");
  RTB_registerPref("Min Head Explosion Damage","Brick Blood","$gc_BBlood::MinDmg","int 0 1000","Server_Server_Buyblood",1000,0,0);
}
else
{
  $gc_BBlood::MinDmg = 1000;
}

//### Sound

datablock AudioProfile(gc_GoreExplosionSound)
{
  filename = "./bryzg.wav";
  description = AudioClose3d;
  preload = true;
};

//### Particles

datablock ParticleData(gc_TinyBloodParticle)
{
  dragCoefficient = 2;
  gravityCoefficient = 1;
  inheritedVelFactor = 0;
  constantAcceleration = 0;
  lifetimeMS = 500;
  lifetimeVarianceMS = 200;
  textureName = "base/client/ui/buyNowB_h.png";
  spinSpeed = 0;
  spinRandomMin = -100;
  spinRandomMax = 100;
  colors[0] = "255 255 255 1";
  colors[1] = "255 255 255 0";
  sizes[0] = 1;
  sizes[1] = 1.5;
  useInvAlpha = false;
};

datablock ParticleEmitterData(gc_TinyBloodEmitter)
{
  ejectionPeriodMS = 10;
  periodVarianceMS = 0;
  ejectionVelocity = 1;
  velocityVariance = 1;
  ejectionOffset = 0;
  thetaMin = 0;
  thetaMax = 180;
  phiReferenceVel = 0;
  phiVariance = 360;
  overrideAdvance = false;
  particles = "gc_TinyBloodParticle";
  uiName = "";
};

datablock ParticleData(gc_BloodParticle)
{
  dragCoefficient = 2;
  gravityCoefficient = 1;
  inheritedVelFactor = 0;
  constantAcceleration = 0;
  lifetimeMS = 500;
  lifetimeVarianceMS = 200;
  textureName = "./buyblood.png";
  spinSpeed = 0;
  spinRandomMin = -100;
  spinRandomMax = 100;
  colors[0] = "255 255 255 1";
  colors[1] = "255 255 255 0";
  sizes[0] = 3;
  sizes[1] = 4;
  useInvAlpha = true;
};

datablock ParticleEmitterData(gc_BloodEmitter)
{
  ejectionPeriodMS = 1;
  periodVarianceMS = 0;
  ejectionVelocity = 10;
  velocityVariance = 5;
  ejectionOffset = 0;
  thetaMin = 0;
  thetaMax = 180;
  phiReferenceVel = 0;
  phiVariance = 360;
  overrideAdvance = false;
  particles = "gc_BloodParticle";
  uiName = "";
};

datablock ParticleEmitterData(gc_BloodFountainEmitter)
{
  ejectionPeriodMS = 10;
  periodVarianceMS = 0;
  ejectionVelocity = 10;
  velocityVariance = 2;
  ejectionOffset = 0;
  thetaMin = 0;
  thetaMax = 10;
  phiReferenceVel = 0;
  phiVariance = 360;
  overrideAdvance = false;
  particles = "gc_TinyBloodParticle";
  uiName = "";
};

datablock DebrisData(gc_GoreDebris)
{
  shapeFile = "./fragment.dts";
  lifetime = 3;
  minSpinSpeed = -200;
  maxSpinSpeed = 200;
  elasticity = 0.5;
  friction = 0.2;
  numBounces = 3;
  explodeonMaxBounce = true;
  fade = true;
  gravModifier = 1;
  emitters[0] = gc_TinyBloodEmitter;
};

//### Explosions

datablock ShapeBaseImageData(gc_BloodFountainImage)
{
  shapeFile = "base/data/shapes/empty.dts";
  mountPoint = $HeadSlot;
  correctMuzzleVector = false;

  stateName[0] = "Bleeding";
  stateTransitionOnTimeout[0] = "Bleeding";
  stateWaitForTimeout[0] = true;
  stateTimeoutValue[0] = 1;
  stateEmitter[0] = gc_BloodFountainEmitter;
  stateEmitterTime[0] = 1;
};

datablock ExplosionData(gc_HeadGoreExplosion)
{
  uiName = "";
  lifetimeMS = 100;
  particleEmitter = gc_BloodEmitter;
  faceViewer = true;
  explosionScale = "1 1 1";
  soundProfile = gc_GoreExplosionSound;
  debris = gc_GoreDebris;
  debrisNum = 5;
  debrisNumVariance = 1;
  debrisPhiMin = 0;
  debrisPhiMax = 180;
  debrisThetaMin = 0;
  debrisThetaMax = 90;
  debrisVelocity = 6;
  debrisVelocityVariance = 2;
};

datablock ProjectileData(gc_HeadGoreExplosionProjectile)
{
  projectileShapeName = "";
  explosion = gc_HeadGoreExplosion;
  muzzleVelocity = 1;
  velInheritFactor = 1;
  lifetime = 1;
  explodeOnDeath = true;
  uiName = "";
};

datablock ExplosionData(gc_BloodExplosion)
{
  uiName = "";
  lifetimeMS = 50;
  particleEmitter = gc_BloodEmitter;
  faceViewer = true;
  explosionScale = "1 1 1";
};

datablock ProjectileData(gc_BloodExplosionProjectile)
{
  projectileShapeName = "";
  explosion = gc_BloodExplosion;
  muzzleVelocity = 1;
  velInheritFactor = 1;
  lifetime = 1;
  explodeOnDeath = true;
  uiName = "";
};

package gc_BrickBlood
{
  function Player::Emote(%this,%image)
  {
    if(getSubStr(%image,0,7) $= "painLow") { %db = gc_BloodExplosionProjectile; %image = ""; }
    if(getSubStr(%image,0,7) $= "painMid") { %db = gc_BloodExplosionProjectile; %image = ""; }
    if(getSubStr(%image,0,7) $= "painHig") { %db = gc_BloodExplosionProjectile; %image = ""; }
    if(%db !$= "" && %this.gc_lastBleedTime < getSimTime())
    {
      %p = new Projectile()
      {
        scale = %this.getScale();
        dataBlock = %db;
        initialVelocity = %this.getVelocity();
        initialPosition = VectorAdd(%this.getPosition(),"0 0" SPC (getWord(%this.getScale(),2)/2));
        sourceObject = %this;
        sourceSlot = 0;
        client = %this.client;
      };
 
    MissionCleanup.add(%p);
      %this.gc_lastBleedTime = getSimTime() + 100;
    }
    parent::Emote(%this,%image);
  }
  function Armor::Damage(%this,%obj,%sourceObject,%pos,%damage,%damageType)
  {
    parent::Damage(%this,%obj,%sourceObject,%pos,%damage,%damageType);
    if(%obj.isDisabled())
    {
      if(%damage >= $gc_BBlood::MinDmg)
      {
        if(getWord(%pos,2) > getWord(%obj.getWorldBoxCenter(),2) - 3.3*getWord(%obj.getScale(),2))
        {
          %obj.unhideNode(bicorn);
          %obj.hideNode(cophat);
          %obj.hideNode(triplume);
          %obj.hideNode(flarehelmet);
          %obj.hideNode(helmet);
          %obj.hideNode(knithat);
          %obj.hideNode(plume);
          %obj.hideNode(pointyhelmet);
          %obj.hideNode(scouthat);
          %obj.hideNode(septplume);
          %obj.hideNode(visor);
          %obj.hideNode(headskin);
          %p = new Projectile()
          {
            scale = %obj.getScale();
            dataBlock = gc_HeadGoreExplosionProjectile;
            initialVelocity = %obj.getVelocity();
            initialPosition = VectorAdd(%obj.getPosition(),"0 0" SPC getWord(%obj.getScale(),2));
            sourceObject = %obj;
            sourceSlot = 0;
            client = %obj.client;
          };
 
        MissionCleanup.add(%p);
          %obj.mountImage(BloodFountainImage,2);
        }
      }
    }
  }
  function Armor::onDisabled(%data,%obj,%enabled)
  {
    %p = new Projectile()
    {
      scale = %obj.getScale();
      dataBlock = gc_BloodExplosionProjectile;
      initialVelocity = %obj.getVelocity();
      initialPosition = %obj.getPosition();
      sourceObject = %obj;
      sourceSlot = 0;
      client = %obj.client;
    };
 
  MissionCleanup.add(%p);
    parent::onDisabled(%data,%obj,%enabled);
  }
};
activatePackage(gc_BrickBlood);
I'm trying to make it not dye the png that I have for the file a certain color, is there a way to do that?

If you remove these fields from both gc_BloodParticle and gc_TinyBloodParticle your particles should stop shifting color to red.

Code: [Select]
colors[0] = "255 255 255 1";
colors[1] = "255 255 255 0";


Quote
if(!$RTB::RTBR_ServerControl_Hook) exec("Add-Ons/System_ReturnToBlockland/RTBR_ServerControl_Hook.cs");
Change to
Quote
if(!$RTB::ServerControl_Hook) exec("Add-Ons/System_ReturnToBlockland/ServerControl_Hook.cs");


Change to

it's meant to be

Code: [Select]
if(!$RTB::Hooks::ServerControl)
    exec("add-ons/system_returntoblockland/hooks/serverControl.cs");

It is unrelated to this problem but yes, that's still an improvement that's valid to prevent multiple files from being executed when that isn't necessary.

If you remove these fields from both gc_BloodParticle and gc_TinyBloodParticle your particles should stop shifting color to red.

Code: [Select]
colors[0] = "255 255 255 1";
colors[1] = "255 255 255 0";


Thanks, that worked.