Archive: Figure this one out...


18th March 2003 03:00 UTC

Figure this one out...
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.

18th March 2003 03:07 UTC

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.


18th March 2003 03:20 UTC

-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. :)


18th March 2003 03:40 UTC

Change the variable names. Some names are known to not work. Tested and proven.


18th March 2003 04:21 UTC

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


19th March 2003 01:28 UTC

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.


19th March 2003 01:47 UTC

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.


19th March 2003 05:35 UTC

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:

19th March 2003 12:03 UTC

AVS is using them, so you can't. Don't know of any, but I have come across them messing up presets before.


19th March 2003 22:40 UTC

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


23rd March 2003 21:02 UTC

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.

24th March 2003 00:37 UTC

"Actually, even I'm not quite sure what it's supposed to be."

when you do a preset...please, please, please, please, please have a point in mind...thank you........


24th March 2003 01:32 UTC

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...


24th March 2003 04:50 UTC

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.


25th March 2003 15:28 UTC

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...

3rd April 2003 20:51 UTC

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.