Options, Options, Options

March 12th, 2009

Click the blue circle in the upper left corner to cycle through the three connection drawing methods: NeatTools, Curves, and now, Straight Lines. Straight lines is a new one, but very simple. output to input.

This movie requires Flash Player 9

Moving up in the World

March 11th, 2009

Since I uploaded the NeatTools Binary to the NeatTools Sourceforge page on Tuesday, we (The NeatTools Project) moved from 0 downloads (obviously) and rank#26,034 to 24 downloads and rank #1233. So yay for me.

I predict we break into triple digits by the week end.

http://sourceforge.net/projects/neattools/

Division and Curves

March 11th, 2009

I’ve added the Division Module, and I’ve created a second drawing method for the connections. A very simple curve, which in some cases looks weird, but not too bad. Taken as a whole, I think it looks interesting and very clearly separates the modules from the connections visually, which is nice. They work in most situations, except when modules are overlapping. The math is a little involved (not hard, per say, but confusing at times) and I was in bed when I wrote it without handy access to pen and paper. So I skipped that situation for now. I’ll add it when I get around to it.

This movie requires Flash Player 9

Sligtly Less Buggy Version

March 8th, 2009

Still some problems with the subtraction, and functionality after links are removed, but addition and multiplication work again. Yay.

This movie requires Flash Player 9

Bugs Everywhere

March 8th, 2009

UPDATE: You know it’s time to stop working when the bugs you think you see, turn out to be all in your head -you know, like a crazy person? Anyway, shortly after I posted this I got a hit back on a post I made at the adobe forums and I feel stupid. I had a semi colon at the end of the second for loop which was screwing everything up. You can see it below. Bastard.

I had to pull a bunch of stuff apart for then next change and I’m having trouble getting it back together. I’ll put up the buggy version so you can play with it, and see what I’m talking about. My current problem is in the following bit of code:

public function broadcast():void
{
	trace("first loop");
	for (var Q:String in kid)
	{
		trace(Q + " => " + kid[Q]);
		trace(Q + " => " + connectList[Q]);
	}
 
	trace("second loop");
	for (var i:String in kid);
	{
		trace(i + " => " + kid[i]);
		trace(i + " => " + connectList[i]);
		kid[i].engine(connectList[i]);
	}
}

You see those two for..in loops? Well they output different things. Even though they are the same. Here’s what they output.

first loop
0 => [object LED]
0 => 2
1 => [object Math_Add]
1 => 0
2 => [object Math_Multiply]
2 => 0
second loop
2 => [object Math_Multiply]
2 => 0

See, the second one just outputs the last entry. If I put that kid[i].engine line in the first loop, it breaks that loop. So it’s something in the engine, but I don’t understand why the trace function, which it comes to first, doesn’t spit out the first entry. So here’s it is. Some new features: the lines light up if you hover over them and you can kill them by clicking on them. This should kill the relationship and actually works in the case of the LEDs and buttons, but not the math stuff for some reason…

This movie requires Flash Player 9

Buggy

March 6th, 2009

buggyI’m working on killing connection and redrawing new connections. I’ve got the physical killing done, you click a link, it goes by-by, but there are some residual connections left. Some of the LEDs still light when their old Button is pressed, things like that. On redrawing the connections, I can detect a hit area on the module, that when clicked, it draw a line continuously from the output area to the mouse pointer in a straight line, until…well, I haven’t got that far yet. Right now it looks very buggy. I’m including a screen shot.

Go Forth and Subtract

March 5th, 2009

I’m beginning to think I’m going to have to restructure my modules again. Currently my program assumes that all modules can take and make an unlimited number of connections and that they are all of the same type. It’s automatically handling it all nicely, but in practice NeatTools modules have many different input and output requirements. Some have multiple outputs of the same kinds, some multiple, each of a different kind. Some have a fixed number, some have unlimited. You can see where I’m going with this. Currently all modules start out with 0 inputs and outputs on all sides. When a connection is created it creates one. What I guess I need to do is start differentiating my modules’ connections. Crap. Any suggestions would be appreciated.

Bottom outputs seem pretty rare, so I’m ignoring them until I can’t anymore. For the modules that need two inputs, like subtractions, I’ve created two types of “mom”s (the arrays that hold the parent connections), mom and topMom. Which allows the module to tell which inputs are from the top and which are from the left. This should pretty easily work with division too.

As an interesting difference between my subtraction module and NeatTools’. Mine will accept unlimited top and side inputs and sum them before performing the subtraction.

This movie requires Flash Player 9

Switches Are Back

March 2nd, 2009

Switches are back and the correct color (well the color they are in NeatTools anyhow). I’ve also fixed some minor display bugs, like if you type too much in an integer box, the wires looked funky.

Since I brought the switch back, I added a shadow that indicates the button and the switch are in the up position. They are both slightly darker when down. I will likely land on some final display preference for all the modules much later, but it’s nice for now.

This movie requires Flash Player 9

Go Forth and Multiply

March 2nd, 2009

This movie requires Flash Player 9

Back Where I Started

March 2nd, 2009

The swf below looks and functions identically to the other versions, but a lot of behind the scenes automation has gone into it. I no longer have to define the number of inputs a module has when creating it, it auto increments when a connection is made. I no longer have to specify which ports to use when making a connection, I just tell it the two modules and it connects them. The modules-to-be-connected are assigned in the Connections constructor, and I’ve untangled all the drawConn/reDrawConn nonsense. The metaphoric link is created when the connection is established. The visual link is created at the end of the constructor and redrawn every frame.

This movie requires Flash Player 9