Have battery programmable with ctype. ctype none = normal mode, ctype non-conductor = off
Mine already does: (C++)
if(parts[i].ctype==PT_NONE)
{
parts[r>>8].life = 4;
parts[r>>8].ctype = rt;
sim->part_change_type(r>>8,x+rx,y+ry,PT_SPRK);
}
if((r&0xFF)==parts[i].ctype && parts[i].ctype!=PT_NONE)
{
parts[r>>8].life = 4;
parts[r>>8].ctype = rt;
sim->part_change_type(r>>8,x+rx,y+ry,PT_SPRK);
}
else if(!(sim->elements[parts[i].ctype].Properties&PROP_CONDUCTS)) //this works fine, it ignores none
{
return 0;
}
else
{
return 0;
}
Is that lua? If so, Im confused. may I just ask, what is c type, tmp1 and tmp 2? I think tmp1 is the element.
C++, I don't know anything about lua. Those are The properties you see at the top of the screen when you press D key. (except tmp 2 is not shown, only tmp1) ctype is in the () after the element name.
If you give battery a ctype of an element that battery can conduct to then it will only conduct to that ctype, no ctype = regular battery, nonconductive ctype (like dust or something) causes it to do nothing.
The code is only for developers and people who compile Powder Toy themselves, but it is otherwise implemented in my mod (Mythical Mod).
Yes and no, yes that would probably work the same but it's usually NONE unless you're in property editor tool.