PDA

View Full Version : Figure this one out...

Clinical
18th March 2003, 02:00
Okay, I have two different versions of a dynamic movement. One of them works fine, the other doesn't work when you first load it; you have to cut and re-paste the contents of the "pixel" box. The problem is that I don't like the way that the one that works looks. :cry: Can somebody spot why the other one's not working?

The one that works:Init:
int=acos(-1)/4096;t=0;fs=1;fc=1

Frame:
t=t+int;
st=sin(t);sy=sin(y);ct=cos(t);cx=cos(x);
cs=st*sy;cc=ct*cx;
fs=fs*.7+cs*.3;fc=fc*.7+cc*.3

Pixel:
x=x/fc;
y=y/fs

blend off, wrap on, rect coords on, BF on, grid 1x1
The one that doesn't work:Init:
int=acos(-1)/4096;t=0;cs=1;cc=1;sy=1;cx=1;st=1;ct=1;

Frame:
t=t+int;
st=sin(t);sy=sin(y);ct=cos(t);cx=cos(x);
cs=st*sy;cc=ct*cx;

Pixel:
x=x/cc;
y=y/cs;

all other options same as previous
If you're wondering why all those "xxx=1"s are in the init in the second one, it's because I was trying to make sure that it wasn't trying to divide by zero.
By the way, I don't care if you don't like how this DM looks. I'm not asking for your opinion, I'm asking why it doesn't work. Thank you very much.

anubis2003
18th March 2003, 02:07
What's with having sin(y) and cos(x) in the FRAME: area? That will always be the same(just the sine of the last y value and cosine of the last x value). Also, you don't need to do that "xxx=1" stuff, because AVS will just ignore divide by zero's. One possible error is because the second one multiplies 2 trig functions, which can fairly often result in a very low number.

Clinical
18th March 2003, 02:20
-I figured that calculating the sin and cos of y and x in the "frame" box would recalculate the values every frame (because wouldn't x and y be different for every frame?)... or maybe I'm just a dimwit... :p
-I didn't know AVS ignored "divide by zero"s... thanks for the tip.
-A resulting very low number still wouldn't explain why it works if you cut (i.e. remove) the stuff in "pixel" and then put it back in...

Thanks for the help anyway. :)

Nic01
18th March 2003, 02:40
Change the variable names. Some names are known to not work. Tested and proven.

Clinical
18th March 2003, 03:21
Actually, in an earlier version of the not-working one, I used the same variable names (fc and fs) as in the working one. It still didn't work then, but the variable names do work, because they're in the current working one. *reads that back and gets all googly-eyed* :S I will try changing the variable names, though. ANYthing to get this damn preset working. :hang:

Why is it I always ask these questions that don't really get resolved? Bad luck? Idiocy? What do you think? :p

Nic01
19th March 2003, 00:28
Just actually tried the 1st DM, and I wonder to myself : How in the world are you going to use that DM?

Anything you're up to with that, I don't really see how it's going to be a beauty...

Can you tell me what it's supposed to be like? I thought it's one of those fake 1-axis 3d rotation of a plane.

anubis2003
19th March 2003, 00:47
Oh and clinical, the only thing that may make sin(x) and cos(y) different each frame is the fact that you assign new values to them, but I still don't think that it will be different.

shreyas_potnis
19th March 2003, 04:35
Originally posted by Nic01
Change the variable names. Some names are known to not work. Tested and proven.
can you name a few?
i fail to understand the reason why some varible names dont work
:weird: :confused:

anubis2003
19th March 2003, 11:03
AVS is using them, so you can't. Don't know of any, but I have come across them messing up presets before.

dirkdeftly
19th March 2003, 21:40
not those, others. wierd ones like "spdx" (outta the blue, don't ask) don't work in SOME scopes, but work in others. very odd indeed. if you've checked your math and your syntax a hundred and seventeen times over and it still doesn't work the way it's supposed to...find where the errors start and change the name of the variable. nine times out of ten it'll work like a charm

Clinical
23rd March 2003, 20:02
Originally posted by Nic01
Just actually tried the 1st DM, and I wonder to myself : How in the world are you going to use that DM?

Anything you're up to with that, I don't really see how it's going to be a beauty...

Can you tell me what it's supposed to be like? I thought it's one of those fake 1-axis 3d rotation of a plane. Actually, even I'm not quite sure what it's supposed to be. It's one of those presets that you'll hate if you don't like intensely "flashy" presets. I used a couple bass spins, a scatter, that dm, and a dynamic distance modifier (in case you didn't know, I'm not really "about" technically impressive presets). My friends and I think it looks pretty neat, and that's really all I care about. :) I'll try changing the variable names tonight, thanks for the help everyone.

dirkdeftly
23rd March 2003, 23:37
"Actually, even I'm not quite sure what it's supposed to be."

Nic01
24th March 2003, 00:32
I usually don't have a point in mind, but knows what kind of DM it needs and knows what is good and what is bad.
You just gotta have that little voice inside guiding you. (okay, most of you will probably think I'm insane after that little sentence)

I think my 7th pack will be rather based on objectives though

Okay, time to stop changing topics...

Zevensoft
24th March 2003, 03:50
As a matter of fact the simplest variable I know which doesn't work is 'ch', weird though why it wouldn't work. Another weird thing is that the variable 'b' (which is used for beat detection) is only set at the start of a frame, and can have any value you like between then. Odd.

Clinical
25th March 2003, 14:28
Originally posted by Atero
when you do a preset...please, please, please, please, please have a point in mind...thank you........ Forget it. Some of my best presets had no point when I created them. Maybe it's not your style, but ordered chaos works fine for some people. :p

Anyway, I think I've solved the problem: AVS hates me. I tried changing the variable names to several different things... nothing. I tried rearranging the equations... nothing. I wonder if this has something to do with the fact that I created the original preset in WA2 and am running it in WA3... nah...

jheriko
3rd April 2003, 19:51
I've noticed that some of my code with variables beginning with c have broken and been fine when i have removed the offending variable.. hence i use q for a counter and not c.