how to make a torch brick
4 posters
Brick Mania :: Help :: Guides
Page 1 of 1
how to make a torch brick
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
I dont strive for syntax
- Code:
function brick1x1poleData::onPlant(%db,%brick,)
{
%brick.setLight(redlight);
%brick.setemitter(BurnEmitterA);
}
Raven- Moderate Gamer
- Posts : 239
Re: how to make a torch brick
thank you for the even that every person with an 8th 1st grade education could figure out
dafrandle- Master Gamer
- Posts : 848
Re: how to make a torch brick
dafrandle wrote:thank you for the even that every person with an8th1st grade education could figure out
Then write me a line of code. you douchebag if you can't script don't even talk.
Raven- Moderate Gamer
- Posts : 239
Re: how to make a torch brick
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
dafrandle- Master Gamer
- Posts : 848
Re: how to make a torch brick
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);
Raven- Moderate Gamer
- Posts : 239
Re: how to make a torch brick
The code in the OP is actually kind of useful.
Mega Bear- PC Gamer
- Posts : 1680
Age : 27
Re: how to make a torch brick
ehhhh... why would you not use events thought its easier and you don't use other people big loading times whn thay join
dafrandle- Master Gamer
- Posts : 848
Re: how to make a torch brick
dafrandle wrote:thank you for the even that every person with an8th1st grade education could figure out
No need to troll him for trying to make things easier for people...
Jakester- Moderate Gamer
- Posts : 163
Re: how to make a torch brick
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.
Raven- Moderate Gamer
- Posts : 239
Re: how to make a torch brick
Jakester wrote:dafrandle wrote:thank you for the even that every person with an8th1st 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.
Raven- Moderate Gamer
- Posts : 239
Re: how to make a torch brick
You fail to understand that is just a simple guide. for a refrence.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
Raven- Moderate Gamer
- Posts : 239
Similar topics
» Brick Mania - *NEW* BRICK BOARD -beta-
» Brick On Our Profile
» Brick Mania APP
» ANNOUNCEMENT: New Brick System
» Brick Mania has Tinychat!
» Brick On Our Profile
» Brick Mania APP
» ANNOUNCEMENT: New Brick System
» Brick Mania has Tinychat!
Brick Mania :: Help :: Guides
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum