perhaps it will be helpfu to, to post some little examples from pioneer here, because i know many might be interested in scripting but are like me complete idiots in programming

ok, first what comes to my mind are models, but i know at least marcel will be interested.i'm by myself not good or anything, but if something is handy, then it's handy.the first handy thing for models i like to post here is a simple FOR loop, i even used it to less but it makes a lot of repetive things easier, so it's worth to spend a little time to get a little experienced with.let's take a look at some existing stuff, it's tomms's old skyscraper "boring highrise"
Code:
define_model('boringHighRise', {info = {scale = .75,bounding_radius=200,materials={'mat1','windows'},tags = {'city_building'},},static = function(lod)set_material("mat1", .35,.4,.3,1,.3,.3,.3,10)use_material("mat1")extrusion(v(0,0,20), v(0,0,-20), v(0,1,0), 1.0,v(-20,0,0), v(20,0,0), v(20,200,0), v(-20,200,0))set_material("windows", 0,0,.15,1, 1,1,1.5,100, .15,.15,0)use_material("windows")zbias(1, v(0,0,20), v(0,0,1))for y = 4,198,5 dofor x = -17,16,4 doquad(v(x,y,20), v(x+2,y,20), v(x+2,y+3,20), v(x,y+3,20))endendzbias(1, v(-20,0,0), v(-1,0,0))for y = 4,198,5 dofor x = -17,16,4 doquad(v(-20,y,x), v(-20,y,x+2), v(-20,y+3,x+2), v(-20,y+3,x))endendzbias(1, v(20,0,0), v(1,0,0))for y = 4,198,5 dofor x = -17,16,4 doquad(v(20,y+3,x), v(20,y+3,x+2), v(20,y,x+2), v(20,y,x))endendzbias(1, v(0,0,-20), v(0,0,-1))for y = 4,198,5 dofor x = -15,17,4 doquad(v(-x,y+3,-20), v(-x+2,y+3,-20), v(-x+2,y,-20), v(-x,y,-20))endendzbias(0)end})
the sequence that is of interest here is the splattering of the windows, instead to place each window with own coordinates on the wall he used a FOR loop,that saves a lot of work for it.let's look at a single one
Code:
for y = 4,198,5 dofor x = -17,16,4 doquad(v(x,y,20), v(x+2,y,20), v(x+2,y+3,20), v(x,y+3,20))endend
what does that shit do? not very hard to explain,"for y = 4,198,5 do" means "for each step of, start at 4, end at 198, with a stepwith of 5, do"this produces our coordinates for the y vector as follows 4,9,14,19,24... and so on upto 198 (doesn't matches? doesn't matters here).in increments, that's why "i" is default to set for the variable, but you can use any letter, but take one that makes some sense in the loop when you look at it.the next enclosed FOR loop is,"for x = -17,16,4 do" which produces the x coordinates we need "start at -17, up to 16, stepwith 4.then follows our geometry "quad" with the variables we get for "x" and "y" and the given plane "z" where they are placed on.the size of the window is defined by adding of the needed values to "x" and "y" for the size, in this case each window is 2 units wide and 3 units high.(usually the units equal meters in pioneer, but if you scale the model, it will be i.e. like this one, 0.75m each unit finally).of course the FOR loop can handle a lot of other things, but like i said my interest is formost modeling.besides, imo a example with a geometry (something you can imagine) is far better then to use anything else general valid.further you can use anything dynamic as variable that stands for "i",in this way i made the selection for the adverts to display, where i controlled the start value with the frequency controlled random numbers, so each increment has it's own starting value, while limit and stepwith are fixed resp. controlled either by a variable, for the adverts it's the number of adverts used as limit.now it starts to get "powerful"...[/hr]well, i know marcel, i should have posted this "years" ago, you could have saved a lot of work with the "struts and girders" and the "lights" in your spacestation.besides this model is working, feel free to use it

(i will post a few more old refreshed models, just for fun and as examples).[/hr]something different,i have a Q myself, perhaps someone knows the reason for this, actually i'm placing the windows on the old factory (remember "ACME Bolts & Nuts"?), which is originally even from tomm, i only added back then some details and later on textures.to the problem, im using a FOR loop to place the windows, but strangewisely it didn't acts as expected or not always, which confuses me because it's simpliest counting from - to and there should be no difference in the result, in no way.i use following for the front side windows on the upper section,
Code:
for y = 24.7,27,2.3 dofor x = 0.5,16.5,4 dolocal z = 0zbias(1,v(x+1.5,y+0.5,z),v(0,0,1))xref_quad(v(x,y,z), v(x+3,y,z), v(x+3,y+1,z), v(x,y+1,z))endend
ends in two rows of windows, last row is at 27m, means works through two times as expectednow i made a similar FOR loop for the right side,
Code:
for y = 1.7,27,2.3 dofor z = -19.5,-0.5,4 dolocal x = 20zbias(1,v(x,y+0.5,z+1.5),v(-1,0,0))quad(v(x,y,z),v(x,y+1,z),v(x,y+1,z+3),v(x,y,z+3))endend
the only offense difference is that i start here at the bottom (1.7m), but i end even at 27m and have the same step width of 2.3, at 27m should be the last row of windows (last iteration). means works through only ten times instead eleven as expected.BUT, it didn't works, it refuses, i have no idea why, ok, i can use 27.1 and the windows appear, but that's not what i expect and neither it is right, they have to be at 27 or else i'm crazy, can't count no more or whatever

. imo inaccuracies arn't possible 1+1 = 2, so i'm a little confused now.but perhaps someone has a explanation for this behave, which i can't see.actually, i'm still looking at the code and guessing, i see only one difference, the quad starts different, they do start at "bottom line" but the next vector is y+1, while in the upper example the quad starts at lower y next vector even lower y and then i go up to y+1 and again y+1. i have no idea if this plays a role (i didn't think so), but i will check it. nah even that wasn't a good idea it doesn't depends on the geometry, the variables are just variables, units to count nothing more.