![]() |
Variable Tracker For AVS!!!
1 Attachment(s)
w00t
roll-up roll-up Thanks to nic01, magicX, jaheck and Unconed. this whole thing was done in less than a day, those people have managed to help me out with some coding in the last few hours! :up: |
1 Attachment(s)
Here's a li'l remix, no big deal.
Cool idea Sid, just hardly usable. Dont have a clue where i'd need this except for a scorecounter within an avs game :D |
Why not improve it by floating the floating point? Use ex=log10(val)-.499999;ex=(abs(ex)%(abs(ex)+1))*sign(ex); to get the floating-point-shift. Though you might still want to leave the original behaviour in so that you can switch between 'fix' and 'sci' (like a real calculator).
Oh and I don't like the 9's with missing bottom stripe ;), change: six=(equal(pval,0)+equal(pval,2)+equal(pval,3)+equal(pval,5)+equal(pval,6)+equal(pval,8)+equal(pval,9)); (though you should now invert it to speed it up) Also, 'val=abs(val);' is run per-point, this can be put at the end of per-frame. And finally, for that fancy LED-look, set line width to 2... Anyway, it's very cool and compact, but is it useful? :rolleyes: :) It has turned up one thing though: AVS uses banker's rounding, which rounds N.5 to the nearest even number, rather than just all up/down. So 4.5 -> 4, but 5.5 -> 6. That proves by you have to use .4999 to force it to round down. |
eh. its not meant to be good for presets and finished products..
its just useful when you have a crazy complicated code and you want to keep track of a variable. nice remix.. you did that pretty quick :) |
Sorry, I edited after you replied ;). Read again...
|
Lol, i do that all the time..
The floating point thing: i was going to do that, but got sick of fucking around. Thanks for the code, but i dont get it, so i dont know how to implement it. I had at one point started doing what you mentioned, i had flt=-1 as a floating float. Thanks for the thing about the nine, i forgot about that.. btw, you managed to pick apart my coding prety quickely, even knowing the inverting thingo. fix of your fix: six=1-(equal(pval,1)+equal(pval,4)+equal(pval,7)); I was going to ask you about that rounding thing, i got really confused by it. |
1 Attachment(s)
Well in any case, you shouldn't expect any decent accuracy from AVS, as you can see from the readout itself ;). It seems the .49999 thing doesn't fix much for fractions, but only helps for integers.
Here's a version with dynamic point, but you can still toggle the old behaviour by setting fix=1 in init. ex is the adjusting exponent (basically log10(abs(val)) rounded, but with signs and AVS-freaky rounding taken into account). flp is the dynamic point position, but wrapped so it never goes too far. If you want to go extreme, you could program it for scientific notation 1.245e+10, but that's left as an exercise for the reader :P PS: MagicX, you mean for e.g. an AVS pinball game? |
a PINBALL GAME! *drooooooooooooool*
Thats it! And possible too!!! We need: an input field that grabs keyboard input prog An ape that renders the paddles and requests the keystate from the input prog. And it renders the ball based on physics of a table and that scans for borders. If there is a border, the color defines the amount of bounce (like texer does point scanning)! The rest can be done through scopes! Unfortunately this is 2 sizes too big for my programming skills and would take a looong time to work out. But it WILL work! *droooooool* :D :D :D |
Damn cool idea. I like the font of the numbers :D
|
1 Attachment(s)
nice work, i came back on to post my fix, but it had already been done!
my version works like this. You set the number of decimals with 'dec' in init. Or, you set 'dec' to -1, which activates the dynamic floater, which works from the left. i fixed up the nine aswell, and made the decimals easyer to read. you can really see how bad that rounding glitch is, considering this example is just adding integers!. |
Nice. I could have used this when making Goo Cube. I would have cleaned up soo many problems alto quicker than I did.
|
Magic.X: who said anything about APEs?
|
[sorry for reviving but i have to]
UnConeD, you think this would work without any APE? How would you realize the intput then? |
he's saying that there would be no user input
|
Well no, an ape would be required for the input, but that's basically it. All the stuff you talk about (flippers, collisions) is perfectly done in AVS...
|
Ok, maybe i just don't get it. How would you code a Ball SSC without knowledge of the sourceframe which is needed to render a collission?
The only thing i could imagine is that the SSC already contains the table layout. Then again, how would that go with the flippers? |
| All times are GMT. The time now is 20:28. |
Copyright © 1999 - 2010 Nullsoft. All Rights Reserved.