Moving Solids v1 Beta
So I have been experimenting with moving solids in The Powder Toy, and this is the result. You can download the script to try them out.
Please report any bugs or feedback that you find.
Example save for testing: id:2986706
Another: id:2989705
Usage
This script adds 2 new elements:
VRTX - this is the basis of moving solids. A weird liquid. If the .tmp4 is set to 1, it gets pinned in place.
EDGE - connects the VRTX specified (by id) in the .ctype and .tmp properties. .tmp2 controls the length - 64 is one pixel. .tmp3 controls the springiness. The default (0) is perfectly rigid, a .tmp3 of 1 is minimum rigidity, and increasing .tmp3 increases rigidity, with maximum rigidity achieved at a .tmp3 of 128.
Together, these elements create a moving solid. Make sure to reload. This will prevent the moving solids from breaking upon reopening the save.
Changelog
v 1.2.1 Beta - Adds springs, performance improvements.
v 1.1.3 Beta - To reload, you now need to press T, save, open the save again, press X, and save. Helps with bugs.
v 1.1.2 Beta - Fixed reload function. EDGE now cannot connect to non-VRTX elements.
v 1.1.1 Beta - Added pinning, VRTX with a .tmp4 of 1 are 'pinned' to a certain point. Reload is now Ctrl+Shift+R.
v 1.0.2 Beta - Bugfixes
v 1.0.1 Beta - Initial beta release
This is really impressive! By far the best implementation of moving solids I've seen so far. Very excited to see how this develops.
Oddities (which you may or may not be aware of) include:
I see that there are no features for creating edges between vertices without manually setting properties. Will the polygon element serve this purpose?
The modified particle order reload function is a clever way to make saving/loading possible with this element.
I didnt even know it was possible to get actual moving solids, how did you do it?
@RebMiami Thanks! As for the bugs you found, here are my responses:
@Supercrafter It's hard to explain, maybe this article will help: Verlet physics engine
The main difference between that and these moving solids is that TPT uses Euler instead of Verlet physics.
1.0.2 Beta has released! Just a few bugfixes.
My only successful attempt made a triangle that pinched(stretched ? i dont remember correct word) into a single dot and deleted itself lol
@Maticzpl I'll probably change it to a keybind.