Login - Create Account
Bookmark and Share

Tottes MegaSwitch

Login or Register to post new topics or replies
Totte
Übernerd

Posts: 1333
Filters: 97
OK, here is my MegaSwitch component, in a sample filter to show it off.

[ megaswitch.ffxml ]
- I never expected the Spanish inquisition
  Details E-Mail
StevieJ
Designer/Artist

Posts: 11224
Filters: 163
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..... smile;) smile:)
Steve

"Buzzards gotta eat...same as worms..." - Clint :)
  Details E-Mail
Crapadilla
lvl 52 Filter Weaver and Official "Filter Forge Seer"

Posts: 4037
Filters: 59
What's up with the attachment file names?
--- Crapadilla says: "Damn you, stupid redundant feature requests!" ;)
  Details E-Mail
Totte
Übernerd

Posts: 1333
Filters: 97
Quote
Crapadilla mysteriously wrote: What's up with the attachment file names?

My best guess, a fubar up bug that is broken.
- I never expected the Spanish inquisition
  Details E-Mail
Carl
c r v a

Posts: 7139
Filters: 74
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 smile:(
  Details E-Mail
Vladimir Golovin
Administrator
Filter Forge, Inc.
Posts: 3106
Filters: 54
Quote
Crapadilla wrote:
What's up with the attachment file names?


We'll fix this soon.
  Details E-Mail
Smacky
Posts: 6
Filters: 2
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
  Details E-Mail
Totte
Übernerd

Posts: 1333
Filters: 97
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
  Details E-Mail
Smacky
Posts: 6
Filters: 2
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
  Details E-Mail
Smacky
Posts: 6
Filters: 2
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
  Details E-Mail
Totte
Übernerd

Posts: 1333
Filters: 97
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
  Details E-Mail
Carl
c r v a

Posts: 7139
Filters: 74
Thanks Smacky [ and hi ] I'll give that a try smile:)

Edit; work perfectly thanks again Smacky
  Details E-Mail
Totte
Übernerd

Posts: 1333
Filters: 97
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
  Details E-Mail
Sphinx.
Filter Optimizer

Posts: 1344
Filters: 38
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.
Njyldgarkn sample cache!
  Details E-Mail
Smacky
Posts: 6
Filters: 2
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.
  Details E-Mail
Totte
Übernerd

Posts: 1333
Filters: 97
@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
  Details E-Mail
Sphinx.
Filter Optimizer

Posts: 1344
Filters: 38
Ok, perhaps it can add a little randomness then, hehe
Njyldgarkn sample cache!
  Details E-Mail
SpaceRay
SpaceRay

Posts: 6210
Filters: 12
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 ?
  Details E-Mail
Morgantao
Can't script

Posts: 2185
Filters: 20
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 smile:D

megaswitch (1).ffxml
  Details E-Mail
SpaceRay
SpaceRay

Posts: 6210
Filters: 12
Quote
Morgantao wrote:

Spaceray, download the updated version below


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 ?

Quote
Morgantao wrote:

uncheck IsRandomizable. Be sure that Variations is NOT set to 1. That way you can have all 16 outputs with the selector slider.


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.

Quote
Morgantao wrote:

Other than that don't ask me how this thing works, as it's WAY over my head.


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 smile:D

And if for you this is WAY over your head, imagine to me !!! It´s WAY WAY WAY BEYOND over my head 1000 meters smile:D

For me making and understanding script would be like be able to touch Lava with my naked hands smile:D
  Details E-Mail
Morgantao
Can't script

Posts: 2185
Filters: 20
In that case for me it's like putting out a campfire with my tongue smile:D
  Details E-Mail
SpaceRay
SpaceRay

Posts: 6210
Filters: 12
Quote
Morgantao wrote:
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.


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
  Details E-Mail
Morgantao
Can't script

Posts: 2185
Filters: 20
SR, you can always edit the ffxml file and change the variation of the default preset
  Details E-Mail
Totte
Übernerd

Posts: 1333
Filters: 97
Just saw this discussion, hope you having fun with it.
- I never expected the Spanish inquisition
  Details E-Mail
SpaceRay
SpaceRay

Posts: 6210
Filters: 12
Quote
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.


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.

Quote
Morgantao
SR, you can always edit the ffxml file and change the variation of the default preset


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.

Quote
Totte:
Just saw this discussion, hope you having fun with it.


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
  Details E-Mail
Totte
Übernerd

Posts: 1333
Filters: 97
You can make that 100 if you just spend more time editing the script
- I never expected the Spanish inquisition
  Details E-Mail
SpaceRay
SpaceRay

Posts: 6210
Filters: 12
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
  Details E-Mail
Totte
Übernerd

Posts: 1333
Filters: 97
As I said, just add more code.... more inputs... and your done
- I never expected the Spanish inquisition
  Details E-Mail
Skybase
Who are you?

Posts: 1949
Filters: 58
Yes one of these days there will be a component with 1000 inputs.
  Details E-Mail
SpaceRay
SpaceRay

Posts: 6210
Filters: 12
Thanks Totte, we wrote the post both at exactly the same time smile:D but yours when first than mine.

Quote
Totte wrote:
As I said, just add more code.... more inputs... and your done


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.

Quote
Skybase wrote:
Yes one of these days there will be a component with 1000 inputs.

smile:D
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 smile:D
  Details E-Mail

Join Our Community!

Filter Forge has a thriving, vibrant, knowledgeable user community. Feel free to join us and have fun!

15,371 Registered Users
+32 new in 7 days!

112,619 Posts
+100 new in 7 days!

10,102 Topics
+16 new in 7 days!

Online Users Last 15 minutes:

5 unregistered users.

Recent Wiki Edits:

Follow filterforge on Twitter