how to make a torch brick

View previous topic View next topic Go down

how to make a torch brick

Post  Raven on Thu Aug 18, 2011 4:30 pm

So after fucking around with bricks i wanted to set a emmiter and a light at the same time without events. i wrote this and though i should share et
I dont strive for syntax

Code:
function brick1x1poleData::onPlant(%db,%brick,)
{
%brick.setLight(redlight);
  %brick.setemitter(BurnEmitterA);
}
avatar
Raven
Moderate Gamer
Moderate Gamer

Posts : 240

View user profile

Back to top Go down

Re: how to make a torch brick

Post  dafrandle on Thu Aug 18, 2011 8:47 pm

thank you for the even that every person with an 8th 1st grade education could figure out
avatar
dafrandle
Master Gamer
Master Gamer

Posts : 862

View user profile

Back to top Go down

Re: how to make a torch brick

Post  Raven on Thu Aug 18, 2011 10:55 pm

dafrandle wrote:thank you for the even that every person with an 8th 1st grade education could figure out

Then write me a line of code. you douchebag if you can't script don't even talk.
avatar
Raven
Moderate Gamer
Moderate Gamer

Posts : 240

View user profile

Back to top Go down

Re: how to make a torch brick

Post  dafrandle on Thu Aug 18, 2011 11:31 pm

eventing is not scripting not even close i made a stop set up for a death rase tha open dores thats not even complex, mega can back me up on that one
avatar
dafrandle
Master Gamer
Master Gamer

Posts : 862

View user profile

Back to top Go down

Re: how to make a torch brick

Post  Raven on Thu Aug 18, 2011 11:46 pm

dafrandle wrote:eventing is not scripting not even close i made a stop set up for a death rase tha open dores thats not even complex, mega can back me up on that one

One problem with that post. this is not eventing you dipshit can you fucking read? its called TORQUESCRIPT not events. and who cares if its not complex. not all scripts are. like i said if you don't know anything about torque shut your yappers.

Edit: Learn somthing

Code:

datablock fxDtsBrickData(plastic : brick2x2Data)
  {
      category = "PlasticMod"; //Category of the brick ( the tab when you press B )
      subCategory = "Resources"; //Sub category, like baseplates, Cubes or Water
      uiname = "Plastic"; //The name of the brick
      isPlastic = true; //Just to say this brick is plastic
      mintime = 60; //Minimum time to respawn
      maxtime = 90; //Maximum time to respawn
  };
  datablock projectileData(shaperProjectile : hammerprojectile)
  {
  directDamage        = 0; //Makes projectile of the sword hit for 0 instead of sword's
  };
  datablock itemData(shaperItem : hammerItem)
  {
   uiName = "Plastic Shaper"; //Name to be displayed on BL
   
   image = shaperImage;
   
   colorShiftColor = "0.750 0.750 0.750 1.000000";
  };
  datablock shapeBaseImageData(shaperImage : hammerimage)
  {
   item = shaperItem;
   
   projectile = shaperProjectile;
   
   projectileType = Projectile;
   
   colorShiftColor = "0.750 0.750 0.750 1.000000";
  };
package PlasticGamemode
{
  //The following is just to make the animations, don't mess with it
  function shaperImage::onFire(%datablock, %obj, %slot)
  {
   Parent::onFire(%datablock, %obj, %slot);
   
   %obj.playThread(2, "armAttack");
  }

  function shaperImage::onStopFire(%this, %obj, %slot)
  {
   %obj.playThread(2, "root");
  }
  //End of animation part

  function shaperProjectile::onactivate(%this, %obj, %col, %fade, %pos, %normal) //When the projectile collides with something...(it can or not be a brick)
  {
      %client = %obj.sourceObject.client; //We get the client who hit with the plastic shaper
      if(%col.getClassName() $= "fxDTSBrick")
      {
        %db = %col.getDatablock(); //%db is now equal to the datablock of the brick
        if(%db.isPlastic)
        {
            //If it's plastic...
            onHit(%client,%col,%db); //%client is the client, %col is the brick and %db is the datablock of the brick
            serverPlay3D(wrenchHitSound, %pos);
        }
        else
        {
            //If it's not...
            commandToClient(%client,'centerPrint',"<color:ffffff>This is not plastic!",3);
        }
      }
      else
      {
        //If it's not a brick...
        commandToClient(%client.client,'centerPrint',"<color:ffffff>Use the plastic shaper in plastic brick",3);
      }
  }
  function onHit(%client,%brick,%brickdb) //When the plastic is hit...%client is the client that hit it %brick is the plastic brick and %brickdb is the datablock of the brick
  {
      if(%brick.percent >= 100)
      {
        commandToClient(%client,'centerPrint',"<color:ffffff>You gained 5 plastic for shaping this plastic!",3);
        %client.plastic += 5; //Adds 5 plastic to the client
        %brick.disappear(30); //Makes the brick disappear for 30secs, so you can't click it or do anything, just like disappear event
        %brick.percent = 0; //Makes the brick be 0% completed
        %brick.setColor(getRandom(0,8)); //Makes the brick a random color between 0 and 8 (the ID)
        bottomPrint(%client); //Update bottomPrint
      }
      else
      {
        %brick.percent += 5; //Adds 5 to percent, making the brick +5% completed.
        commandToClient(%client,'centerPrint',"<color:ffffff>You hit the unshaped plastic\n<color:ffff00>"@%brick.percent@"% completed!",3,2); //Displays that you hit the brick and how much % completed.
        if(%brick.percent >= 100)
            onHit(%client,%brick,%brickdb); //If it's already 100% or over, we don't want to say it's 100% completed, so we do it like if you hitted with the plastic shaper again
      }
  }
  //When a brick is planted. Please note that this makes a bug with loading, which is pretty hard to fix, so I made an hacky fix
  function FxDtsBrick::onPlant(%brick)
  {
      if(!$Loading)
        schedule(50,0,"checkBrick",%brick); //Go thru the brick and do our checks
      return parent::onPlant(%brick); //return the onPlant stuff so it actually makes the bricks.
  }
  function checkBrick(%brick)
  {
      %client = %brick.client; //We find the client on the brick
      %brickdb = %brick.getDatablock(); //We get the datablock of the brick
      if(%brickdb.isPlastic) //If the brick is plastic...
      {
        if(%client.isSuperAdmin)
        {
            %brick.percent = 0; //We make it have 0% completed, so it starts at 0% instead of [blank]%
            %brick.setColor(getRandom(0,8));
        }
        else //If it's not SA
            %brick.killBrick(); //We kill the brick
        return;
      }
      else if(%client.plastic >= 1)
      {
        //We are good, take off plastic
        %client.plastic--; //Takes 1 plastic off client
        bottomPrint(%client); //Update bottomPrint
        commandToClient(%client,'centerPrint',"<color:ffffff>You made a brick, but it costed you <color:ffff00>1 <color:ffffff>plastic",3);
      }
      else //If the client has less than 1 plastic...
      {
        %brick.killBrick(); //We kill the brick
        commandToClient(%client,'centerPrint',"<color:ffffff>You need to have atleast <color:ffff00>1 <color:ffffff>plastic to plant this brick!",3);
      }
  }
  function bottomPrint(%client)
  {
      //Bottomprints the plastic count
      commandToClient(%client,'bottomPrint',"<color:ffffff>Plastic: <color:ffff00>"@%client.plastic);
  }
};
activatePackage(PlasticGamemode);

avatar
Raven
Moderate Gamer
Moderate Gamer

Posts : 240

View user profile

Back to top Go down

Re: how to make a torch brick

Post  Mega Bear on Fri Aug 19, 2011 2:44 am

The code in the OP is actually kind of useful.

____________________________
Steam - Add me!
avatar
Mega Bear
PC Gamer
PC Gamer

Posts : 1703
Age : 20

View user profile

Back to top Go down

Re: how to make a torch brick

Post  dafrandle on Fri Aug 19, 2011 5:04 am

ehhhh... why would you not use events thought its easier and you don't use other people big loading times whn thay join
avatar
dafrandle
Master Gamer
Master Gamer

Posts : 862

View user profile

Back to top Go down

Re: how to make a torch brick

Post  Jakester on Fri Aug 19, 2011 7:22 am

dafrandle wrote:thank you for the even that every person with an 8th 1st grade education could figure out

No need to troll him for trying to make things easier for people...
avatar
Jakester
Moderate Gamer
Moderate Gamer

Posts : 167

View user profile

Back to top Go down

Re: how to make a torch brick

Post  Raven on Fri Aug 19, 2011 3:05 pm

dafrandle wrote:ehhhh... why would you not use events thought its easier and you don't use other people big loading times whn thay join

What? that does not effect loading times
It's meant to be for the console.
avatar
Raven
Moderate Gamer
Moderate Gamer

Posts : 240

View user profile

Back to top Go down

Re: how to make a torch brick

Post  Raven on Fri Aug 19, 2011 3:08 pm

Jakester wrote:
dafrandle wrote:thank you for the even that every person with an 8th 1st grade education could figure out

No need to troll him for trying to make things easier for people...

In my opinion it's easier to just make it set it when you plant the brick it wastes time hitting a pole with the wrench to set it that way.
avatar
Raven
Moderate Gamer
Moderate Gamer

Posts : 240

View user profile

Back to top Go down

Re: how to make a torch brick

Post  Raven on Fri Aug 19, 2011 5:14 pm

dafrandle wrote:ehhhh... why would you not use events thought its easier and you don't use other people big loading times whn thay join
You fail to understand that is just a simple guide. for a refrence.
avatar
Raven
Moderate Gamer
Moderate Gamer

Posts : 240

View user profile

Back to top Go down

Re: how to make a torch brick

Post  Sponsored content


Sponsored content


Back to top Go down

View previous topic View next topic Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum