2010-07-03 09:24 PM
n=REQUEST ("Name_of_material", index, name)I tried this, and can see that variable n is 0 when there is no material with that index, while it is 1 when a material exists.
2010-07-07 01:06 AM
!--define arrays dim s[], t[] !--loop thru materials for xx=1 to 255 dummy= REQUEST ("Name_of_material", xx, name) if dummy & (strsub(materials,1,1) = strsub(name,1,1)) then n= n+1 t= name endif next xx !--array sorting for i=1 to vardim1(t) s= "" next i for i=1 to vardim1(t) p=i for j=1 to i-1 if s >t then for k=i to j+1 step -1 s =s[k-1] next k p=j : j=vardim1(s) endif next j s =t next i !--deliver the value list values "materials" s, custom
2010-07-07 01:20 AM
!--define arrays dim s[], t[] !--loop thru materials for xx=1 to 255 dummy= REQUEST ("Name_of_material", xx, name) if dummy & strstr(name, materials) then n= n+1 t= name endif next xx !--array sorting for i=1 to vardim1(t) s= "" next i for i=1 to vardim1(t) p=i for j=1 to i-1 if s >t then for k=i to j+1 step -1 s =s[k-1] next k p=j : j=vardim1(s) endif next j s =t next i !--deliver the value list values "materials" s, custom
2010-07-07 01:32 AM
n=REQUEST ("Name_of_material", index, name)is executed, and you have a similar statement in your script as you loop through to collect the material names. Do you get error messages when your script is executed?
2010-07-07 07:10 AM
!--define arrays dim s[], t[] !--loop thru materials for xx=1 to 255 test= REQUEST{2}("Material_info", xx, "gs_mat_surface_rgb", r, g, b) if test then dummy= REQUEST("Name_of_material", xx, name) if strsub(materials,1,1) = strsub(name,1,1) then n= n+1 t= name endif endif next xx !--array sorting for i=1 to vardim1(t) s= "" !--for numbers-->0 | for strings-->"" next i for i=1 to vardim1(t) p=i for j=1 to i-1 if s >t then for k=i to j+1 step -1 s =s[k-1] next k p=j : j=vardim1(s) endif next j s =t next i !--deliver the value list values "materials" s, custom
2010-07-07 08:40 AM
project2{2} 3,270,3+1024This is crude, but gives a quick preview of the squares with a simple color based on the material, but it does not use the actual texture files of the materials.
n=REQUEST{2} ("Material_info", "07 | Spanish Tile", "gs_mat_texture", file_name, w, h, mask, alpha) DEFINE IMAGE_FILL "TestFill" file_name, fillTYPES_MASK 2, 85, 255, 136, 255, 34, 255, 136, 255, h, w, 0, 0However, when I use the Check Script button, I get a syntax error for the second line that says "String type expression required at line 7..." I don't know what my error is - can you try this and let me know what I'm doing wrong?
2010-07-07 09:56 AM
2010-07-08 02:21 PM
Eric wrote:Hi Eric,
... when I use the Check Script button [with DEFINE IMAGE_FILL], I get a syntax error for the second line that says "String type expression required at line 7..." I don't know what my error is - can you try this and let me know what I'm doing wrong?
2010-07-08 04:54 PM
2010-07-08 09:52 PM
n=REQUEST{2} ("Material_info", "Testing Material", "gs_mat_texture", file_name, w, h, mask, alpha) parameters pict[1]= file_name DEFINE IMAGE_FILL "Testing" pict[1], 255, 255, 255, 255, 255, 255, 255, 255, w, h, 0, 0 set IMAGE_FILL "Testing" poly2_ 4, 1+2+4+8, 0, 0, 0, a, 0, 0, a, b, 0, 0, b, 0