YOUR ACCOUNT

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

Posts: 1460
Filters: 107
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: 11264
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: 4365
Filters: 65
What's up with the attachment file names?
--- Crapadilla says: "Damn you, stupid redundant feature requests!" ;)
  Details E-Mail
Totte
Übernerd

Posts: 1460
Filters: 107
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: 7289
Filters: 82
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
Posts: 3446
Filters: 55
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: 1460
Filters: 107
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: 1460
Filters: 107
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: 7289
Filters: 82
Thanks Smacky [ and hi ] I'll give that a try smile:)

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

Posts: 1460
Filters: 107
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: 1750
Filters: 39
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.
  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: 1460
Filters: 107
@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: 1750
Filters: 39
Ok, perhaps it can add a little randomness then, hehe
  Details E-Mail
SpaceRay
SpaceRay

Posts: 12299
Filters: 35
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: 12299
Filters: 35
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: 12299
Filters: 35
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: 1460
Filters: 107
Just saw this discussion, hope you having fun with it.
- I never expected the Spanish inquisition
  Details E-Mail
SpaceRay
SpaceRay

Posts: 12299
Filters: 35
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: 1460
Filters: 107
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: 12299
Filters: 35
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: 1460
Filters: 107
As I said, just add more code.... more inputs... and your done
- I never expected the Spanish inquisition
  Details E-Mail
Skybase
2D/3D Generalist

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

Posts: 12299
Filters: 35
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
SpaceRay
SpaceRay

Posts: 12299
Filters: 35
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
  Details E-Mail
SpaceRay
SpaceRay

Posts: 12299
Filters: 35
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

Quote
Totte wrote:
You can make that 100 if you just spend more time editing the script


BUT the problem is that when you do it, then you get an error message from the IntSlider as seen here

Quote
The Incoming value range (1...20) exceeds the maximum range of this input (2...17) To fix this, lower the amount


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
  Details E-Mail
rachelduim
So Called Tortured Artist

Posts: 2498
Filters: 188
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.
  Details E-Mail
SpaceRay
SpaceRay

Posts: 12299
Filters: 35
Quote
rachelduim wrote:
This has 20 inputs to the switch. The problem you were having was probably in the input editor for the integers numbers.


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

Quote
The Incoming value range (1...21) exceeds the maximum range of this input (2...21) To fix this, lower the amount
  Details E-Mail
rachelduim
So Called Tortured Artist

Posts: 2498
Filters: 188
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.
  Details E-Mail
totte
Übernerd

Posts: 1460
Filters: 107
Cool this old little baby still is popular;-)
- I never expected the Spanish inquisition
  Details E-Mail
rachelduim
So Called Tortured Artist

Posts: 2498
Filters: 188
A greatly simplified version, the ELSEIF's are not needed. Works in FF7 & FF8.

megaswitch 2.2.ffxml
Math meets art meets psychedelia.
  Details E-Mail
SpaceRay
SpaceRay

Posts: 12299
Filters: 35
Quote
rachelduim wrote:
A greatly simplified version, the ELSEIF's are not needed.


Thanks very much for making this much simplified version

it works correctly also on FF 9

will see how it works
  Details E-Mail

Join Our Community!

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!

Create an Account

Online Users Last minute:

11 unregistered users.