|
|
#1 |
|
Junior Member
Join Date: Sep 2008
Posts: 11
|
Evil Variable Gotcha
I just found out after an hour or two of
hair-tearing, that variable names have a maximum length of 8 characters. If you declare two variables like:elephant = 0.5; elephant_poo = 0.1; there is really only one variable. Could this be put in the documentation please? |
|
|
|
|
|
#2 |
|
wellspring of milk
Major Dude |
huh? no, long variable names work fine for me - i just checked it. what is your Milkdrop version?
BUT... there's a limit of how many variables you can use - which is quite low at about 20. |
|
|
|
|
|
#3 |
|
Junior Member
Join Date: Sep 2008
Posts: 11
|
version 2.0e
Maybe it's only broken for the custom shapes? |
|
|
|
|
|
#4 |
|
Junior Member
Join Date: Sep 2008
Posts: 11
|
Another weird thing is that if you change
x = billy_the; in my test preset to x = billy; it picks up the 0.2 variable! So there are still two variables but it is definitely not correct behaviour. |
|
|
|
|
|
#5 |
|
wellspring of milk
Major Dude |
okay, that's reproducible. but it must have something to do with the underline character. indeed pretty weird, but nothing I'd like to waste time with. maybe you find a hack to pass variable states from one preset to another - who knows
![]() i don't think the script interpreter has changed since Milkdrop1 - if you want to dig deeper into it, you might find some answers in the old source code: http://milkdrop.us/dev.aspx |
|
|
|
|
|
#6 |
|
Banned
|
Let's check it out...
|
|
|
|
|
|
#7 | |
|
Banned
|
Shit happens (c)
That's hell ps3! I don't want to launch notepad, that's why i like to use the debugger
. Huh, i am a bad code-surfer...OK if this thread is about <troubleshooting>, here's a template for my new preset. I'll put it in "Cope's finished stuff". I wanna see spirals growing out of every white spot. Need help with arrays and loops... Please look into it, i haven't found any documentation. Quote:
|
|
|
|
|
|
|
#8 |
|
wellspring of milk
Major Dude |
there are at least two errors within the first loop
code: interesting stuff, i never even considered using arrays and loops |
|
|
|
|
|
#9 |
|
Banned
|
Thanks. I was dizzy, really!
a) There was float d[16] in the beginning, so tmp = GetPixel(uv+float2(d[i],d[i+1])); should be meant here as tmp = GetPixel(uv+d[i]); b)That was an invisible bug to me... BIG THANKS about this err! for(i=0;i<=7;i++){...vals[i+1]...} //i+1>7!!! PS. that's not "vals[i/2]..." - that is "vals[i]..." c)Fixed. >96 instr. Can I ask you for PS3 test, please? |
|
|
|
|
|
#10 |
|
wellspring of milk
Major Dude |
ps3? sry i'm out
|
|
|
|
|
|
#11 |
|
Major Dude
|
Well, it's white screen to me !
|
|
|
|
|
|
#12 |
|
Junior Member
Join Date: Sep 2008
Posts: 11
|
Thanks, Flexi, I feel vindicated now. I don't expect anybody to fix it but thought it was worth flagging up. I hope the latest source code gets opened up soon. Damn I might even submit a fix myself then.
|
|
|
|
|
|
#13 |
|
Banned
|
Thx Martin...
foolish err: ...uv+d[i]... REALLY should be ...uv+d[i]*texsize.zw PS: 27sg, I'm looking into the milkdrop 1.05 source at now. The code interpreter is 'evallib' module. That's a true place where the bug is. |
|
|
|
|
|
#14 |
|
Banned
|
The Instruction
Expression evaluation library v1.0 - by lone
-------------------------------------------- How to use ~~~~~~~~~~ ¦ resetVars ----------- void resetVars(void); Resets the variables table. It is necessary to call it prior to evaluate your first expression or variables contents may be random instead of zero ¦ evaluate ---------- double evaluate(char *expression, int *col); Evaluates an expression and returns the result. If a syntax error was encountered during the parsing of the expression, then col will be non-null and col-1 will be the index of the char which triggered the error. Limitations ~~~~~~~~~~~ ¦ you can set only up to 1024 variables. ¦ only decimal and hexadecimal bases available ¦ operators are limited to : + - / * % & | ¦ functions are limited to : sin, cos, tan, asin, acos, atan, atan2, sqr, sqrt, pow, exp, log, log10 Some examples ~~~~~~~~~~~~~ - assignments : pi=3.1415927 a=atan2(cos(pi/4),2) - direct evaluations : cos(pi/4) sin(45) - base notations : 3bh (this is 0x3B) 17d (this is 17) 17dh (this is 0x17D) Adding new functions ~~~~~~~~~~~~~~~~~~~~ The file EVAL.C contains the functions table (fnTable). Just add an entry with the name, the number of parameters, and a pointer to the function body. Implement the body and you're done. If your function ahs more than 2 parameters, you'll need to extend the grammar description file (CAL.Y) to add the FUNCTION3 (and eventually subsequent) token(s) and parsing informations. SCAN.L & CAL.Y ~~~~~~~~~~~~~~ SCAN.L contains description for the lexical analyzer generator (LEX). Use makel.bat to rebuild LEXTAB.C CAL.Y contains the LALR formal grammar description for the parser generator (BISON). Use makey.bat to rebuild CAL_TAB.C Compiling ~~~~~~~~~ Just include all source files to your project, and include EVAL.H into your main source code. License ------- Copyright 2005 Nullsoft, Inc. All rights reserved. .......................... ... blah blah licence stuff ----------------------------------------- Don't you think he's wrong with the 1024 vars available? It seems that we have the code generation mechanism unoptimized. |
|
|
|
|
|
#15 |
|
Banned
|
And the ps2
ps2 version for testing
|
|
|
|
|
|
#16 |
|
wellspring of milk
Major Dude |
according to redi jedi, the maximum amount of variables is set somewhere in a header file as a constant. i have not looked into the source yet, i'm still waiting for the MD2.0 sources...
redi-jedi also stated, that it is quite easy to include new functions with the script language |
|
|
|
|
|
#17 |
|
Banned
|
Found some bugs in MD2. Firstly, it seems to determine my videocard has no pixel shader support. Also, when trying to upgrade ps1.1 presets - MD shows a strange message:
This preset uses the highest pixel shader version (0) supported by your graphics chip. Nope. "The highest pixel shader version supported by my graphics chip" is 3 (2 because ATI+MD2+ps3=CRAP). Furthermore, if you press 'y' after this, MD closes with an error msg. There is no field in the settings panel to set the ps model, so i have no ideas what happened. Defaults don't help also. Trying to reinstall at now. PS: Have anybody tried my spiral heck test 3? I just can't take these ps3's anymore. Last edited by fed0r; 18th September 2008 at 09:29. |
|
|
|
|
|
#18 |
|
Major Dude
|
Geiss' preset authoring guide says variables used in the per frame equations are limited to 30:
"You can also make up to 30 of your own variables." This seems to be independant of what evallib could handle. Im my own experience, the limitation to 30 is fact and you will get very odd results when exceeding this limit. As to spiral heck 3: Only see some random dot noise before it fades to white. |
|
|
|
|
|
#19 |
|
Banned
|
Fixed my ps0 bug. I'm back again
![]() Hey Martin, big thanks. I'm not going to do ps3 any more until I'll get a new fix/card. |
|
|
|
|
|
#20 |
|
Will code for food
Join Date: Mar 2005
Location: orlando
Posts: 520
|
For as long as I can remember var names are "limited" to 8 chars, so for instance, in the code block:
someLongVarName1 = 5; someLongVarName2 = 10; monitor = someLongVarName1; Monitor should display 10 instead of 5 as would be expected, no error, no warning it simply ignores all characters after the first 8, which is why it still works in some instances, because If i had written: someLongVarName1 = 5; monitor = someLongVarName1; someLongVarName2 = 10; It would work as expected. orig limit was 30, my version upped it to 40 or 50, and not sure what he did Blah! |
|
|
|
![]() |
|
|||||||
| Thread Tools | Search this Thread |
| Display Modes | |
|
|