So i made a c++ element called METR, my lua codes are turning to paint so i cant use them, anyone know how to get it in the game or in a mod? here is the code:
#include "simulation/Elements.h"
//#TPT-Directive ElementClass Element_METR PT_METR {INSERT ID HERE}
Element_METR::Element_METR()
{
Identifier = "DEFAULT_PT_METR";
Name = "METR";
Colour = PIXPACK(0x792b2b);
MenuVisible = 1;
MenuSection = SC_EXPLOSIVE;
Enabled = 1;
Advection = 1e-005f;
AirDrag = 50f * CFDS;
AirLoss = 0;
Loss = 0.75f;
Collision = 0f;
Gravity = 1.5f;
Diffusion = 0.1f;
HotAir = 15f * CFDS;
Falldown = 0;
Flammable = 0;
Explosive = 0;
Meltable = 0;
Hardness = 0;
Weight = 100;
Temperature = 9999f;
HeatConduct = 251;
Description = "The thing that killed the dinosaurs off! Use the pen size to determine the size of the meateor. Made by TSK";
Properties = TYPE_ENERGY;
LowPressure = IPL;
LowPressureTransition = NT;
HighPressure = IPH;
HighPressureTransition = NT;
LowTemperature = ITL;
LowTemperatureTransition = NT;
HighTemperature = ITH;
HighTemperatureTransition = NT;
Update = &Element_METR::update;
Graphics = &Element_METR::graphics;
}
// #define UPDATE_FUNC_ARGS Simulation* sim, int i, int x, int y, int surround_space, int nt, Particle *parts, int pmap[YRES][XRES]
//#TPT-Directive ElementHeader Element_METR static int update(UPDATE_FUNC_ARGS)
int Element_METR::update(UPDATE_FUNC_ARGS)
{
}
// #define GRAPHICS_FUNC_ARGS Renderer *ren, Particle *cpart, int nx, int ny,
// int *pixel_mode, int* cola, int *colr, int *colg,
// int *colb, int *firea, int *firer, int *fireg, int *fireb
//#TPT-Directive ElementHeader Element_METR static int graphics(GRAPHICS_FUNC_ARGS)
int Element_METR::graphics(GRAPHICS_FUNC_ARGS)
{
}
Element_METR::~Element_METR() {}
Please and thank you!
If you're on windows:
Also, I don't think you need to #define UPDATE_FUNC_ARGS, bcuz it is defined in some other file, and nice graphics function :P
what the science is SCons?
@TPT_PL .................................................... that................................. was..................................... BEAUTIFUL
Edit:OH JEEZ, ERRRRRM................................. IM A NOOB AT CODE, DOES NOT COMPUTE, FDLFLBSDLFBGKDSFJFBDKJB *implosion*
By turning scripts to paint he probably means that he selected MS Paint as the program to open all lua files with.
If you want to run the lua file in tpt, just put it in the same file directory as Powder.exe and type dofile("potato.lua") (obviously potato.lua would be your filename) in le console. Magic. Unicorns. I do just shove any element scripts into autorun.lua, which is automatically loaded every time you open tpt, so you don't have to dofile or stuff.