i know
WHOA! Lets play spot the errors. Missing semicolons in various places. Needs a { bracket after the first line. Needs a double colon in the first line.
i was following this website from @boxmein:http://boxmein.x10.mx/tptelements/#
also i was not finished.
#include "simulation/Elements.h"
//#TPT-Directive ElementClass Element_CBTY PT_CBTY
Element_CBTY::Element_CBTY()
{
Identifier = "DEFAULT_PT_CBTY";
Name = "CBTY";
Colour = PIXPACK(0x959615);
MenuVisible = 1;
MenuSection = SC_ELEC;
Enabled = 1;
Advection = 0.0f;
AirDrag = 0.00f * CFDS;
AirLoss = 0.00f;
Loss = 0.00f;
Collision = 0.0f;
Gravity = 0.0f;
Diffusion = 0.00f;
HotAir = 0.000f * CFDS;
Falldown = 0;
Flammable = 0;
Explosive = 0;
Meltable = 0;
Hardness = 20;
Weight = 100;
Temperature = R_TEMP-2.0f +273.15f;
HeatConduct = 20;
Description = "Rechargable battery.";
State = ST_SOLID;
Properties = TYPE_SOLID;
LowPressure = IPL;
LowPressureTransition = NT;
HighPressure = IPH;
HighPressureTransition = NT;
LowTemperature = ITL;
LowTemperatureTransition = NT;
HighTemperature = ITH;
HighTemperatureTransition = NT;
Update = &Element_CBTY::update;
}
int Element_CBTY::update(UPDATE_FUNC_ARGS)
{
int r, rx, ry;
for (rx=-1; rx<2; rx++)
for (ry=-1; ry<2; ry++)
if (BOUNDS_CHECK && (rx || ry))
{
r = pmap[y+ry][x+rx];
if (!r)
continue;
//add your stuff here.
}
return 0;
}
Element_CBTY::~Element_CBTY() {}
it is the area that in need to add my stuff, where i do not know what to put.
Ok. There is a section on the wiki about this, and if you need help with something in specific, like making it do something when touching another element, start a convo with me.
Don't use that aweful coding tutorial thing. That is way outdated. Use this: