|
|
|
|
#1 |
|
Major Dude
Join Date: May 2003
Location: Australia
Posts: 1,353
|
Variable Tracker For AVS!!!
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! |
|
|
|
|
|
#2 |
|
Major Dude
Join Date: Feb 2002
Location: Leipzig / Germany
Posts: 859
|
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
|
|
|
|
|
|
#3 |
|
Whacked Moderator
Join Date: Jun 2001
Posts: 2,104
|
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? ![]() 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. |
|
|
|
|
|
#4 |
|
Major Dude
Join Date: May 2003
Location: Australia
Posts: 1,353
|
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
|
|
|
|
|
|
#5 |
|
Whacked Moderator
Join Date: Jun 2001
Posts: 2,104
|
Sorry, I edited after you replied
. Read again...
|
|
|
|
|
|
#6 |
|
Major Dude
Join Date: May 2003
Location: Australia
Posts: 1,353
|
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. |
|
|
|
|
|
#7 |
|
Whacked Moderator
Join Date: Jun 2001
Posts: 2,104
|
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? Last edited by UnConeD; 28th May 2003 at 12:16. |
|
|
|
|
|
#8 |
|
Major Dude
Join Date: Feb 2002
Location: Leipzig / Germany
Posts: 859
|
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*
|
|
|
|
|
|
#9 |
|
Major Dude
Join Date: Jan 2003
Location: Mumbai, India
Posts: 787
|
Damn cool idea. I like the font of the numbers
http://home.iitb.ac*****~shreyaspotnis |
|
|
|
|
|
#10 |
|
Major Dude
Join Date: May 2003
Location: Australia
Posts: 1,353
|
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!. |
|
|
|
|
|
#11 |
|
Major Dude
Join Date: Feb 2002
Location: home
Posts: 1,318
|
Nice. I could have used this when making Goo Cube. I would have cleaned up soo many problems alto quicker than I did.
Stoke me a clipper. I'll be back for Christmas. - Arnold Rimmer Red Dwarf |
|
|
|
|
|
#12 |
|
Whacked Moderator
Join Date: Jun 2001
Posts: 2,104
|
Magic.X: who said anything about APEs?
|
|
|
|
|
|
#13 |
|
Major Dude
Join Date: Feb 2002
Location: Leipzig / Germany
Posts: 859
|
[sorry for reviving but i have to]
UnConeD, you think this would work without any APE? How would you realize the intput then? |
|
|
|
|
|
#14 |
|
Major Dude
Join Date: May 2001
Location: somewhere else
Posts: 1,286
|
he's saying that there would be no user input
powered by C₈H₁₀N₄O₂ |
|
|
|
|
|
#15 |
|
Whacked Moderator
Join Date: Jun 2001
Posts: 2,104
|
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...
|
|
|
|
|
|
#16 |
|
Major Dude
Join Date: Feb 2002
Location: Leipzig / Germany
Posts: 859
|
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? |
|
|
|
![]() |
|
|||||||
| Thread Tools | Search this Thread |
| Display Modes | |
|
|