ok.nonethelessif you like to tinker with the new stuff i thought this might be helpful,as i said i wrote a "couple" of helper functions and here is the exlanation to the new (and old) functionsa similar document i will write to explain the purpose and use of the sub-models i created.
**GERNOT'S LMR FUNCTION REFERENCE** ("basic functions" and some submodels to)revision 1, 05-10-2017valid for all functions:if a function uses a variable such as "time" or "anmation position"or needs to call a "ship state", it can only be used in the dynamic section of a model(i.e. nav_lights).functions with fixed values can be used in the static section (i.e. interpolate).**math.clamp = function(v, min, max)**(basic)clamps "min." to "max." referring to "v"example:math.clamp( driver, 0.2, 0.7)will clamp "driver" (animation position) from 0.2 to 0.7 and return 0.0 to 0.5**cuboid(pos, size)**(basic)creates a cuboid starting at "pos" with the dimensions of "size"example:cuboid(v(0,0,0),v(2,0.5,1))creates a cuboid starting at corner v(0,0,0) with the dimensions x=2, y=0.5, z=1if you use negative values the cuboid will have a inverted surface**joined_patch(p, edge, pts)**(basic)i'm not experienced with this function**vlerp(t, v1, v2)**(basic)interpolates "vector1" with "vector2" by factor "t" (0.0 - 1.0), usually time or a animation pos.with a fixed "t" you can interpolate vectors to create a new vector, e.g. "slide a vector on a plane".example:vlerp( 0.5, v(0,0,0), v(1,0,0)will return v(0.5,0,0)**lerp_materials(a, m1, m2)**(basic)interpolates two materials by factor "a" (0.0 - 1.0), usually time (but any "driver" is possible)the same as vlerp only that it blends two materials by a factorexample:set_material( 'material', lerp_materials( get_time(),{0,0,0,.3, 0,0,0,0, 1.5,0,.5},{0,0,0,.99, 0,0,0,0, .5,2.5,0}))**counter(spd)**(gernot)counts in steppings from 1 to 10, "spd" controls the stepping rate (speed)if "spd" isn't set it defaults to seconds**deg_to_rad(degree)**(gernot)converts degrees to radiantsthe C function "deg2rad" was once disabled, that's why i replaced it wth this.**mirx(vector), miry(vector), mirz(vector)**(gernot)mirrors input vectors x, y, or zexample:mirx( v( 2.5, 0, 0 ) ) will return v( -2.5, 0, 0 )useful in vector lists or otherwise to quickly mirror a vectorexample:vectors of a quad,v0 = v( -0.5, -0.5, 0 )v1 = mirx( v0 )v2 = miry( v1 )v3 = miry( v0 )**interpolate(v1,v2)**(gernot)interpolates two vectors,example:interpolate( v( 2, 1, 3 ), v( 4, 2, 1 ) )returns v( 3, 1.5, 2 )vlerp( v( 0.5, v( 2, 1, 3 ), v( 4, 2, 1 ) ), does the same, nonetheless i use it sometimes**nav_lights(size,red,green,coll1,coll2,steady)**(gernot)creates standard navigation lights, ths function is replaced by "pos_lights", but left for compatibilitythey are both similar. "nav_lights" i don't use anymore.size = size of the "light""red", "green", "coll1", "coll2", "steady", are the position vectors of the respective "light"with this function you can specify all lights at once.example:nav_lights( 2, v( -10, 0, 0 ), v( 10, 0, 0, ), v( 0, 3, 10 ), v( 0, -1, -10 ), 1)will produce a red navlight at pos v(-10,0,0), a green at v(10,0,0), a white at v(0,3,10)and a white at v(0,-1,-10).the last value is a boolean and if specified "coll2" won't be flashing to use as a headlight i.e.if nothing is specified (returns "nil") then it's assumed it's flashing**missile(index, position, v_right, v_up, scale, missile_pod)**(gernot)calls missile dummy-models to be playced on the ships, if a missile is fired the model will be removed.index = index 1 to 8 (8 visible missiles, the max. is 16 but only 8 are shown)position = position of the missilev_right = horizontal orientation (to orient a missile)v_up = vertical orientation (to decide if placed under or on top of the shipalso to place a missile upright if ever needed)scale = this didn't scales the missile, it's ment to keep the missile scaled ordinallyand requests the final model scale, which is defined in the info section of a model.missile_pod = boolean (any glyph or none), if true the missile will have a mounting else not.example:missile(1, v( 12, -3, 5 ), v( 1, 0, 0), v(0, -1, 0), model_scale, yes)will place missile 1 (of 8) at v(12,-3,5) oriented forward v(1,0,0)and rotated to be used under the ship v(0,-1,0), the scale is kept 1:1 with "model_scale"and "yes" means i like o have a mounting for the missilemissiles and mountings will be reposiioned automatically if you specify a mounting(top of the mounting will be your entered position, else it's he centre of the missile)**translate(name,v1,v2,vx,vy,scale,delay,offset,input)**(gernot)translates a model for you, very useful because you don't have to mess with "math.clamp""vlerp" and the correctional values you need.name = models name which is to translatev1 = start vector (from)v2 = end vector (to)vx = horizontal orientation of the modelvy = vertical orientation of the modelscale = obviousely the scale of the modeldelay = delay of "animation position" (0.0 - 1.0) when the animation has to start, i.e. 0.333offset = offset of "anmation position" (0.0 - 1.0) when the animation has to end i.e. 0.666input = the "driver" which is to use, if nothing is specied it deaults to "WHEEL_STATE".example:translate('piston1', v( 0, 0, 0 ), v( 0, -5, 0 ), v( 1, 0, 0 ), v( 0, 1, 0 ), 1, 0.0, 0.333)will translate model "piston1" from v(0,0,0) to v(0,-5,0), with orientation "upright", scale 1and clamp the animation from timepoint 0.0 to 0.333driven by default "wheel_state" animation position.**rot_gear(name,pos,v_x,v_y,scale,degr,v_rot,delay,offset,input)**(gernot)rotates a model for you, very useful because you don't have to mess with "math.clamp""vlerp" and the correctional values you need as well with "math.sin/cos" or "deg_to_rad",you just enter the desired degrees to rotate in the given timespan.name = models name which is to translatepos = position of the modelv_x = horizontal orientation of the modelv_y = vertical orientation of the modelscale = obviousely the scale of the modeldegr = degrees to rotatev_rot = axis over which is to rotate positve values is clockwise rotation, negative is ccw.delay = delay of "animation position" (0.0 - 1.0) when the animation has to start, i.e. 0.333offset = offset of "anmation position" (0.0 - 1.0) when the animation has to end i.e. 0.666input = the "driver" which is to use, if nothing is specied it deaults to "WHEEL_STATE".example:rot_gear('rig', v( 0, 0, 0 ), v(1, 0, 0 ), v( 0, 1, 0 ), 1.0, 90, v( 1, 0, 0) 0.333. 1.0)rotates model "rig" at position v(0,0,0) , oriented "upright", size 1, with rotation 90°,clockwise over x axis, start at 0.333, end at 1.0, driver is default (not specified).all correctional values should be calculated proper, though you only have to position and orient the model proper.**rot_clock(vector, fractions)**(gernot)returns rotation values to rotate a model stepped in whole seconds, i.e. for a clock.with fractions you can lower or raise the speed if needed, if not specified SECONDS are assumedexample:you have to use this in a models call,local v_rot = rot_clock( v( 1, 0, 0 ), 60 )call_model('clockhand_minute', v( 0, 0, 0 ), v( 1, 0, 0 ), v_rot, 1.0)will rotate "clockhand_minute" over x axis in minutes stepping (stepped! not continously).**selector(grp,offset)** (note this function has changed compared to my release)(gernot)random selector function, recently it uses the random materials as seed since the label has been removed from the ships previewgrp = group number of 4 groupsoffset = randomize 1 to amount of offset, if not specified 1000 is assumedexample:selector(2,8)will use selector group 2 and randomize between 1 and 8**squad_color()**(gernot)selects randomly 1 of 5 colors to use for decals, dresses or similarself = this function needs no arguments**autoscale_tex(size,offset,string_input)**(gernot)autoscales a text string though it will use only a given space disregarding (resp. regarding) the length of the string.size = text scale, usually the same scale you use for a label if you use this for a ship,else the scale which fits i.e. to the 7 letters of "Pioneer" to use the space you got for the label / text to create.offset = the "default" string length, if you use 7 it will use exactly the space you need for 7 glyphs i.e. in "Pioneer",if you raise this value it will clamp the scale to this amount of glyphs in the given scale.example:autoscale_text(4, 10, 'that's really cool')will scale the string "that's really cool" as if it would be only 10 letters long in the size of 4.that is really cool!

**legalname()**(gernot)generates a random shipname (have phun)self = this function needs no argumentsexample:legalname()returns i.e. following string "FUNNY SAUCER"**get_material(matlist.name)**(gernot)selects a predefinied material by it's name from a tablename = material name (refere to "functions.lua" for the recent material names)example:get_material(matlist.steel)will return "set_material('steel',.25,.28,.3,1,1,1.3,1.5,30,0,0,0)NOTE:don't forget to register the material in the models info section.**ENGINE GLOW MATERIALS**a set of engine glow materialsthey all "turn off" if a ship is docked or landed rough, thus they may only be used dynamicaglow()returns a semitransarent engine glow materialbglow()returns a solid engine glow materialengine glow materials which changes the color depending on the drivetype (common "sky blue" ,military "acid green")teglow()returns a semitransarent engine glow materialseglow()returns a solid engine glow material**poslights(typ,position,scale,lod)**(gernot)this is the new positionlights or navlights function, this function you have to use for each position seperate.therefore it has greater flexbility as "nav_lights" and upscales the light in lower lod's thus it's still visible when the ship is far away.typ = 'right', 'left', 'green', 'red', 'centre'positon = position of the "poslight"scale = size of he poslightlod = lod, just enter "lod" if you call the function, it will take the recently used lod of the model it's used in to upscale the light.it's not perfect but still better as if the navlights vanish already at lod 3.example:poslights('green',v( 24, 0, 5 ), 2, lod)creates a green flashing position light at v(24,0,5) in scale 2 and uses the recent lod to upscale the light.**stationstages()**(gernot)this function simply returns the two animation drivers needed for spacestationsget_animation_stage('DOCKING_BAY_#')get_animation_position('DOCKING_BAY_#')asstage_bay#pos_bay#example:to use in the dynamic section f a spacestation model, if called once you can use the variables in your models animation like,local driver1if stage_bay1 == 1 thendriver1 = pos_bay1end**stationlights = function(pos,size,color,model_scale)**(gernot)small function, many arguments,it does not much as only to position a light for you which else can be done as wellpos = positionsize = size of lightcolor = color of light as vector (v(1,1,1) for white)model_scale = final model scale from the models info section to keep the light in scale 1:1example:stationlights( v( 0, 0, 0 ), 40, v( 1, 0.8, 0 ), model_scale)