WHCode RED
28th September 2002 19:08 UTC
Dynamic Shift...
I need some help with my dynamic shift code.. I'm TOTALLY new to scripting in AVS, so please excuse me for the ever-so-simple code... as you can see in my preset, on a beat, it randomly makes the "fire" go to the left or right, like a breeze is coming by. Well, it actually works pretty good, but if it chooses to go to the right or left too much, the visual is bad, and is hard for it to choose the right number to go back the other way.i want it to be able that when it is at a certain point, to go the other way, by forcing it to use the positive or negative numbers, to go the other way until it reaches another point, then it goes all regular again. This might not make much sence now, but just dl it and see for yourself. Might take a bit, but it does happen... Any Help?
dirkdeftly
28th September 2002 19:32 UTC
Because you're incrementing ex every beat, you can get a situation where ex=ex+2 every beat, or ex=ex-2 every beat. Instead, use ex=rand(n)-n/2 (which gives you numbers from n-n/2=n/2 to 0-n/2=-n/2. And x=2.1 is pointless since you redefine it later.
WHCode RED
28th September 2002 19:46 UTC
Wow, thanks!
I always thought i was missing something simple... :p
Edit: yeah, 2.1 is kinda pointless, but when there is no beat, doesnt it give it a breeze, as if there was a beat?? ... ... ... ... ... ... Dang, I hate thinking.. <buzzing coming from head>
jheriko
28th September 2002 20:32 UTC
Welcome to the world of AVS and the Winamp AVS forums!
Its always nice to see new faces around here.
(edit: I know I'm a 'new kid on the block' right now)
dirkdeftly
29th September 2002 00:13 UTC
Because ex doesn't ever change when there's no beat. When you say x=..., x is wiped out and replaced with .... So you're wiping out that 2.1 and replacing it with ex.
Jaheckelsafar
29th September 2002 06:50 UTC
If you wanna do something only on the beat, you gotta do in the beat section. You could make it gust on a beat, then have it gradually go back to the original breeze.