Totte
![]() |
OK, here is my MegaSwitch component, in a sample filter to show it off.
megaswitch.ffxml - I never expected the Spanish inquisition |
|||||||
Posted: July 2, 2010 1:22 am | ||||||||
StevieJ
![]() |
I can't look at it yet due to the current V2 problem.....but got me thinking that a script could be made so that each switch could be drop-menu labelled in the controls.....when I get more advanced with scripting of course.....
![]() ![]() Steve
"Buzzards gotta eat...same as worms..." - Clint :) |
|||||||
Posted: July 2, 2010 11:12 am | ||||||||
Crapadilla
![]() |
What's up with the attachment file names?
--- Crapadilla says: "Damn you, stupid redundant feature requests!" ;) |
|||||||
Posted: July 3, 2010 2:57 pm | ||||||||
Totte
![]() |
My best guess, a fubar up bug that is broken. - I never expected the Spanish inquisition |
|||||||
Posted: July 3, 2010 4:45 pm | ||||||||
Carl
![]() |
it only open as xml file for me [ same problem with all these attachments on the site since they changed server ], this happen once before a couple of years ago but for the life of me I can't recall how to get round it, pitty as I would use this
![]() |
|||||||
Posted: July 3, 2010 6:47 pm | ||||||||
Vladimir Golovin
Administrator |
We'll fix this soon. |
|||||||
Posted: July 4, 2010 2:21 am | ||||||||
Smacky |
Hi all. This is my first post, but i thought I could be of help.
Carl wrote "it only open as xml file for me [ same problem with all these attachments on the site since they changed server ], this happen once before a couple of years ago but for the life of me I can't recall how to get round it, pitty as I would use this " My workaround for this issue is to right click on the file link, choose "save target as" and give the file a new name with ffxml as the extension. Once you've downloaded the file, move it into your "My Filters" folder, then restart FF. Seems to work well with most. Totte, I like the idea, but I can't get your megaswitch filter to work. Produces the same output no matter what the setting is. I've looked at the script, but my programming days are long behind me. Perhaps it is some incompatibility between Mac OS and Windows (which is what I am using). Cheers, Smacky |
|||||||
Posted: July 4, 2010 4:37 pm | ||||||||
Totte
![]() |
Did you slide the variation slider? Strange, cause it should pick on out the the maximum inputs set (1-16), where 1 is rather silly as it will be only one to choose from.
- I never expected the Spanish inquisition |
|||||||
Posted: July 4, 2010 6:15 pm | ||||||||
Smacky |
No, I was definitely using the itemcount slider. Since you mentioned the variation slider I tried an experiment where I changed the value of the V slider to something else, and got some pretty curious results. With variation set to 1, the filter always outputs the #1 input, no matter what itemcount is set at. If I change variation to something else, the output is more or less random, although most of them are still input #1. Very strange, and I would guess some kind of bug in V2.
Smacky |
|||||||
Posted: July 4, 2010 7:31 pm | ||||||||
Smacky |
Totte.
I had another look at the script and found the problem, I think.In the prepare function there is a line that goes: "index = math.mod(VARIATION, itemcount)" I'm not sure what this line is meant to do, but if I change it to: "index = itemcount" the filter seems to work as advertised. Cheers. Smacky |
|||||||
Posted: July 4, 2010 7:45 pm | ||||||||
Totte
![]() |
Smacky: the filter works as intended.
Itemcount sets how many of the 16 inputs that are currently in use. using Variation-slider, the output will be psuedo-randomly picked from one of those 16 inputs using the "index = math.mod(VARIATION, itemcount)" line. The problem really is "no way to explain that" except in - - comments in Lua. - I never expected the Spanish inquisition |
|||||||
Posted: July 5, 2010 12:42 am | ||||||||
Carl
![]() |
Thanks Smacky [ and hi ] I'll give that a try
![]() Edit; work perfectly thanks again Smacky |
|||||||
Posted: July 5, 2010 1:24 am | ||||||||
Totte
![]() |
I guess the problem is that you want a controllable switch, not a random switch, which this is. The changes you made Smacky transformed it to a controllable switch, from a random switch (which is what I created). Maybe have a second input saying (controllable/randomized), which will be the best of both worlds...
Posted a new version on 4eyes. - I never expected the Spanish inquisition |
|||||||
Posted: July 5, 2010 1:39 am | ||||||||
Sphinx.
![]() |
Hi Totte,
I just realized that the input constants, e.g. INPUT_1 contains simple index values. To get the value of an input constant, write error(INPUT_1) or whatever the name of the input is. In your case there is a perfect relation with the actual index variable in your script, making the big conditional obsolete: function get_sample(x, y) return get_sample_map(x, y, index) end; should work just fine. This could have been different, but you obviously first added all the inputs (in correct order) and then itemCount input. That is why their value matches your index. |
|||||||
Posted: July 5, 2010 1:46 am | ||||||||
Smacky |
Oops. My apologies. I did think you were demonstrating how to make an oversized switch component, when you were obviously going for something more interesting. My bad. I'll shut up now.
|
|||||||
Posted: July 5, 2010 11:43 am | ||||||||
Totte
![]() |
@Sphinx . They were added, they reordered, as otherwise they came 1, 10,11,12,13,14,15,2,3 etc....
I will check your approach, but I think it will fail as I have reordered them, but a nice idea. @Smacky: lol - now you got Both. - I never expected the Spanish inquisition |
|||||||
Posted: July 5, 2010 1:37 pm | ||||||||
Sphinx.
![]() |
Ok, perhaps it can add a little randomness then, hehe
|
|||||||
Posted: July 5, 2010 2:23 pm | ||||||||
SpaceRay
![]() |
Hello, Please could you explain how this works for a beginner that does not know nothing about scripts ?
I have downloaded it, replaced the big number name for the Megaswitch name and clicking over it is installed in FF 3.0 The problem for me comes when I try to use it, as the slider DOES NOT work and nothing happens when changing from one to another. Surely I am making something wrong. Do you need to modify the script to use it ? How do you select from the 16 sources, just using the selector slider and choosing one of the numbers ? |
|||||||
Posted: January 28, 2012 7:44 pm | ||||||||
Morgantao
![]() |
Spaceray, download the updated version below (from totte's website) and uncheck IsRandomizable. Be sure that Variations is NOT set to 1. That way you can have all 16 outputs with the selector slider.
Other than tat don't ask me how this thing works, as it's WAY over my head. I would love to see an example of this megaswitch in action in a proper filter, just to try and understand how to implement it, but I guess that's up to the masters of the FF universe to decide if they have the time to do that ![]() megaswitch (1).ffxml |
|||||||
Posted: January 29, 2012 6:25 am | ||||||||
SpaceRay
![]() |
Thanks very much for the new updated version, I have downloaded it. In wich Totte´s website is this available ? In the one of his profile or other different ?
WOW!! Thanks very much for this suggestion and instruction on how to use it, I knew I was doing something wrong and did not work and was because I used variations=1 , after changing the variation to a higher number it works perfectly well selecting the source between the 16 available.
Well, I do NOT need to ask anything more, and really do NOT need to know how it works inside the script to be able to use it. You do not need to understand and know how electricity works to use it, do you?, you just plug the electrical appliance you want to use in wall socket and use it, don´t care how and why it works ![]() And if for you this is WAY over your head, imagine to me !!! It´s WAY WAY WAY BEYOND over my head 1000 meters ![]() For me making and understanding script would be like be able to touch Lava with my naked hands ![]() |
|||||||
Posted: January 29, 2012 9:14 am | ||||||||
Morgantao
![]() |
In that case for me it's like putting out a campfire with my tongue
![]() |
|||||||
Posted: January 29, 2012 5:35 pm | ||||||||
SpaceRay
![]() |
Please, is there some good way that Variation is NOT set to 1 when downloading the filter. The only way I have found is to make the presets have a different variation number but do not know if this is a good way or there can be another one. Thanks again to Totte for this MegaSwitch |
|||||||
Posted: August 11, 2012 3:23 pm | ||||||||
Morgantao
![]() |
SR, you can always edit the ffxml file and change the variation of the default preset
|
|||||||
Posted: August 13, 2012 2:18 pm | ||||||||
Totte
![]() |
Just saw this discussion, hope you having fun with it.
- I never expected the Spanish inquisition |
|||||||
Posted: August 18, 2012 2:10 am | ||||||||
SpaceRay
![]() |
I have seen that this works right and as always that is loaded a filter it loads the first (or the last default filter) filter preset it will always move the variation to the one on the preset and be higher than one, so there is no more problem.
This would be IF you could not do it inside FF, but you can do it and update any preset (that is not a factory preset) with the right values of variations, so there is no problem.
Yes, thanks to you there is the possible thing to have a 16 switch instead of the normal 12 one Thanks again to Totte for this MegaSwitch |
|||||||
Posted: August 18, 2012 3:12 am | ||||||||
Totte
![]() |
You can make that 100 if you just spend more time editing the script
- I never expected the Spanish inquisition |
|||||||
Posted: August 18, 2012 3:21 am | ||||||||
SpaceRay
![]() |
I have made a great, interesting and useful discovery in this filter
YOU CAN HAVE AS MANY SWITCHS AS YOU WANT WITH THIS SCRIPT AND NOT ONLY 16 I was wondering if it would be possible to make a 20 switchs megaswitch instead of the 16 available now, and I was going to make this request when I have seen that he Map script component has an Input Editor on the settings tab and there you can configure any amount of switchs AND also customize other possible connections required if needed for this component. So now this filter has risen much it´s value and is even better than what I thought. Thanks again to Totte for this MegaSwitch |
|||||||
Posted: August 18, 2012 3:21 am | ||||||||
Totte
![]() |
As I said, just add more code.... more inputs... and your done
- I never expected the Spanish inquisition |
|||||||
Posted: August 18, 2012 3:22 am | ||||||||
Skybase
![]() |
Yes one of these days there will be a component with 1000 inputs.
|
|||||||
Posted: August 18, 2012 3:25 am | ||||||||
SpaceRay
![]() |
Thanks Totte, we wrote the post both at exactly the same time
![]()
What is very good on this is that you do not need to modify the inner code of the script and do not have to modify the script itself, it is very easily done with the "Input editor" available to add any more inputs you want and configure them as you want without any problem, which is great.
![]() Well considering that FF does NOT make a selection of the components that are behind the switch and ALL of them are included in the results components (wich is a very bad thing) it would be impossible to make this AND keep it working right and being fast and usable ![]() |
|||||||
Posted: August 18, 2012 3:34 am | ||||||||
SpaceRay
![]() |
This is really a missing gem from the forum, and it deserves to be known more, as this is very useful, interesting and good way to go over the limitation of filter forge and that you can not have more than 12 elements in the switch, with this great megawitch from Totte, totally recommended if you ever need to have more than 12 elements for a switch
|
|||||||
Posted: June 15, 2015 12:40 am | ||||||||
SpaceRay
![]() |
I bump this again as the FF 8 switch is still having the limit and this switch is much better with up to 16 elements by default but it seems that it can be upgraded with more elements
BUT the problem is that when you do it, then you get an error message from the IntSlider as seen here
So is there then a problem that IntSlider does NOT allow more a higher amount of 17 ??? Or I am missing something ? HERE BELOW I ATTACH THE MODIFIED VERSION As you can see if you go over 16 values it does nothing, although the script is modified. IF you can explain it would be much appreciated. Thanks for any help Here is what I have done to modify the filter I have been wondering how to do this and until know I have not known how to do it, and now I found how to do it Just add elseif ( index ==17) then inp=INPUT_17 elseif ( index ==18) then inp=INPUT_18 elseif ( index ==19) then inp=INPUT_19 .... and then go to the Input Editor and click on new input and add as many additional inputs as you have added to the script you need to add a name and then use the INPUT_17 (being 17 the corresponding number of each new input created) you can put the name as you want and do not have to be Input and the number then go to ItemCount and Selector components and increase the number of inputs to the total amount THE BELOW FILTER IS FOR FF 8.0 DOES NOT WORK ABOVE 16 inputs megaswitch 20.ffxml |
|||||||
Posted: April 16, 2019 9:51 pm | ||||||||
rachelduim
![]() |
SpaceRay, this works in FF7 and FF8. I have taken out the randomize and item count, something is not right about randomization (which should work in the prepare section but is not working). This has 20 inputs to the switch. The problem you were having was probably in the input editor for the integers numbers. A side note, I could not edit this on the Mac, editing the script constantly crashed in FF7 and FF8 when trying to change the range of integer numbers in the input editor.
megaswitch 2.1.ffxml Math meets art meets psychedelia. |
|||||||
Posted: April 16, 2019 11:38 pm | ||||||||
SpaceRay
![]() |
Great, Thanks very much for fixing it for 20 inputs and it works right as you have done it BUT if I try to add any additional input I get the SAME error as before but now the limit is 21 instead of 17
|
|||||||
Posted: April 17, 2019 12:16 am | ||||||||
rachelduim
![]() |
Ok, your issue is probably this, click the Map Script. Go to the Input Editor. Scroll down to Numeric Inputs and highlight Selector. Then change the Maximum Value to whatever you need, then click OK. I'm hoping this is the part you missed.
Math meets art meets psychedelia. |
|||||||
Posted: April 17, 2019 12:42 am | ||||||||
totte
![]() |
Cool this old little baby still is popular;-)
- I never expected the Spanish inquisition |
|||||||
Posted: April 17, 2019 1:16 am | ||||||||
rachelduim
![]() |
A greatly simplified version, the ELSEIF's are not needed. Works in FF7 & FF8.
megaswitch 2.2.ffxml Math meets art meets psychedelia. |
|||||||
Posted: April 17, 2019 9:53 pm | ||||||||
SpaceRay
![]() |
Thanks very much for making this much simplified version it works correctly also on FF 9 will see how it works |
|||||||
Posted: August 30, 2020 12:50 pm |
Filter Forge has a thriving, vibrant, knowledgeable user community. Feel free to join us and have fun!
33,712 Registered Users
+19 new in 30 days!
153,534 Posts
+31 new in 30 days!
15,348 Topics
+72 new in year!
11 unregistered users.