marcel,check the selector function,you can alter it easy to your needs and implement it to the stations script.since you don't have symbols in a stations name you can forget the most of the original script and simply convert the string to numbers (it's that long ago, i nearly forgot how i did it

)this converts the stations name to numberstonumber(get_arg_string(0),36)"36" is the base, or in other words, you can restrict here how many alphanumerical symbols are translated to numbers, "36" stands for the whole alphabet simply.possible numbers will be left unchanged, a "space" or any other symbol will make troubles of course, then we need a more complex translation.easiest would be to use only the first three letters in the name and hope that they will never contain anything else then alphanumerical (no ' , -, "space", or such).tonumber((string.sub(get_arg_string(0),1,3),36)this will only use the first three letters of the stations name, maybe that's safer to use (four letters might work to, i guess a ' wont appear in between the first four letters of a name, except maybe one is named i.e. "xxx's", three is really safe, as long nothing is named "xx's").a replacement isn't very useful in this case, because you won't know where a possible non alphanumerical symbol will appear (unlike the ships registration, where the dash is always the third symbol).you could use this number already for your different preset materials, but it will have different length perhaps.it's better to use math.random to generate a number with a given length, so you will know in which range the selection has to be.to get a seed you can use with math.random use it this waymath.randomseed(tonumber((string.sub(get_arg_string(0),1,3),36))right below generate now the random number from the seed, i.e.local my_no = math.random(0,100)the math.random function will use now the above seed to generate a quasi random number between 0 and 100then use a if request to specify the materials, i.e.if my_no < 50 thenset_material('hull', .5,.5,.5,1,.3,.3,.3,10)elseset_material('hull', .1,.75,.75,1,.3,.3,.3,10)endyou can make a function of that and put it in front of the stations script.
Code:
function my_number(self) math.randomseed(tonumber(string.sub(get_arg_string(0),1,3),36)) my_no = math.random(0,100) end
the result of the callmy_number()ismy_nowhile "my_no" is now any number between 0 and 100use it now with the above described if request in the dynamic part of the models script.make sure that this is only called above LOD1 (because arguments won't be passed to the collision mesh, it will return then "nil" and halts the process), means
Code:
if lod > 1 then my_number() if my_no < 51 then set_material('hull', .5,.5,.5,1,.3,.3,.3,10) else set_material('hull', .3,.7,.6,1,.3,.3,.3,10) endend
alternatively you could also use the random stuff where the "my_number()" call stands, instead to create the function "my_number". (don't forget to list the material "hull" in the info section under "materials = {...},")i hope that works, i haven't made it proof.report if it didn't works, and what was probably the error message, then i will check what can be done against that.---the idea to use the original seed isn't bad, but the modules arguments won't be available for models, that's why i had to find a different method for the ships variations i.e. (textures or preset colors).to use the "name" (string(0)), was the easiest and safest way.in certain cases this is sad, because i.e. i can't request the cities name from a building, which i would have liked to for the factory's name like "ACME bolts and nuts, division (city name), or it's neither possible to give the chappel a name by name generation (i.e. St. Morton).it's possible to use "os.clock" for this, unfortunately the name will change then each time you enter the system.i guess to make it possible to request the systems initial seed or better the cities name* to generate a random number from it, would be a nice extra for buildings (* makes it possible to cover both, a name for industrial and other buildings, i.e. "xxx city hall" and a random number for extras or variations of a building).terrestrial spaceports will allow a get_arg_string(0), it's possible to use the cities name on a spaceport to.