I have found a bug (don't know if it's already reported).
Here's the code, go to line 254 and fold a type called "type T_stair" and watch what happens with the rest of the code (it vanishes)
//MAIN
set display mode window width(get desktop window()), window height(get desktop window()), 32
sync on
sync rate 0
autocam off
disable systemkeys
disable escapekey
global kinta
global ke,last_ke,kero
global last_x#, last_y#, last_z#,object
global pix#,piy#,piz#
type T_GLOBALDATA
iCurrentCamera
hMainWindow
iMouseclick
//sLastPath$
fWorldPX# fWorldPY# fWorldPZ#
iMouseX iMouseY iMouseZ
iLastMouseX iLastMouseY iLastMouseZ
sProjectPath$
iSceneModified
fMousePX# fMousePY# fMousePZ#
segment_pos_y# fWall_size_y#
iMouseMoveZ iMouseMoveZ2
build_type$ status_gradnje
object_in_movement
t$
no_texture
texture_projection
Pi#
screen_w
screen_h
desktop_w
desktop_h
mouseclic
export$ ExportFile$
hLastModifiedControl
hLastModifiedControlEvent
mouse_obj mouse_obj2
grid_obj
arrows
endtype
global g as T_GLOBALDATA
LUA_Init()
start bbb gui
g.hMainWindow=get dbpro window()
g.t$=get dir$()
g.status_gradnje=100
g.fWall_size_y#=25
g.Pi#=3.141592653589793
g.screen_w=screen width()
g.screen_h=screen height()
g.desktop_w=window width(get desktop window())
g.desktop_h=window height(get desktop window())
windows set font 8,"Arial",0,0,0,0
set main window g.hMainWindow
window set text g.hMainWindow,"Landscape & Map Creator - Untitled"
`Loading screen
px=window width(get desktop window())/2-200
py=window height(get desktop window())/2-150
LoadingScreen=make layered window(px,py,400,300,"loading frame2.bmp",get desktop window())
show window LoadingScreen
window bring to top LoadingScreen
set active window LoadingScreen
global dim gParameterEditbox(20)
global dim gParameterLabel(20)
global dim gParameterName$(20)
rem Object selection list
global SObjects_Modified
global dim SObjects(3000)
global dim o_prazx#(3000) : global dim o_prazy#(3000) : global dim o_prazz#(3000)
global dim o_arazx#(3000) : global dim o_arazy#(3000) : global dim o_arazz#(3000)
global o_sraz#
type T_xyz# x# y# z# endtype
type T_SELECTEDVERTEXDATA
x# y# z# raz as T_xyz# vertex u# v#
endtype
`Vertex selection list
type T_SELECTEDVERTEX
limb Index
v as T_SELECTEDVERTEXDATA
endtype
global dim SVertices(30000) as T_SELECTEDVERTEX
global SVertices_Count
global show_vertexdata
type T_VERTICES
limb vertex x# y# z#
endtype
global dim gVertices(30000) as T_VERTICES
global gVertices_Count
`Poly selection list
type T_SELECTEDPOLY
poly limb
v1 as T_SELECTEDVERTEXDATA
v2 as T_SELECTEDVERTEXDATA
v3 as T_SELECTEDVERTEXDATA
endtype
global dim SPolys(30000) as T_SELECTEDPOLY
global SPolys_Count
global PolyPoint1X, PolyPoint1Y
global PolyPoint2X, PolyPoint2Y
global PolyPoint3X, PolyPoint3Y
`Limb selection list
type T_SELECTEDLIMB
limb praz as T_xyz# araz as T_xyz#
endtype
global dim SLimbs(1000) as T_SELECTEDLIMB
global SLimbs_Count
global dim l_selected(1000)
global l_sraz
`Edge selection list
type T_SELECTEDEDGE
limb
v1 as T_SELECTEDVERTEXDATA
v2 as T_SELECTEDVERTEXDATA
endtype
global dim SEdges(3000) as T_SELECTEDEDGE
global SEdges_Count
rem object planar texture projection
global dim tmap_group(300,300) : global dim tmap_group_used(3000)
rem object texture parameters
global dim l_tex_id(3000,100)
global dim limb_angle_x#(100)
global dim limb_angle_y#(100)
global dim limb_angle_z#(100)
type T_Layer
hide name$
endtype
global dim Layer(10) as T_Layer
global dim Layer_O(10,3000)
type TCamera
name$ width height window dock left top maximized
used zoom# grid active type$
px# py# pz#
cbView mView mShading
hW2 oldWidth oldHeight
wireframe flatshade pick_arrow arrows_size
endtype
rem object texture projection
type T_object_t_projection
id
min_x# min_y# min_z# max_x# max_y# max_z#
sx# sy# sz#
gpx# gpy# gpz# gax# gay# gaz#
x_ptr y_ptr z_ptr `p_count
//lpx# lpy# lpz# //lax# lay# laz#
endtype
type T_texture_mapping
type$ align$ group flipU flipV VCount sel$
vertices_ptr limbs_ptr
scaleU# scaleV# scrollU# scrollV#
endtype
type T_object_bounds
id
show
updated
x1# x2# x3# x4# x5# x6# x7# x8#
y1# y2# y3# y4# y5# y6# y7# y8#
z1# z2# z3# z4# z5# z6# z7# z8#
minx# miny# minz# maxx# maxy# maxz#
endtype
type T_object
id selected
Parent$ Parent Group$ Group Layer
modify modify$ submodify$
type$ subtype$ name$ place$
color as dword
pro as T_object_t_projection
tmap as T_texture_mapping
b as T_object_bounds
sx# sy# sz# ax# ay# az# px# py# pz#
Params Params$
ChildCount
UserParam UserParam$ transparent static freeze hide cull seethrough
iparam1 iparam2 iparam3
fparam1# fparam2#
sparam1$ sparam2$
endtype
global dim o(3000) as T_object
global dim o_path$(3000)
d3d set current array 1
d3d init main array 3000
for t=0 to 3000
o(t).Name$=""
o(t).Type$=""
o(t).Subtype$=""
o(t).Modify$=""
o(t).Submodify$=""
o(t).Parent$=""
o(t).group$=""
o(t).Params$=""
o(t).UserParam$=""
next t
type T_light
object_id type$ on show_cone exist
radius_id radius#
r g b
falloff_id falloff#
target_id
ratio1# ratio2#
endtype
global dim light(0) as T_light
type T_stair
type$
sc ht# he# sleft sright
width# height# length#
endtype
global dim stair(100) as T_stair
rem stair parameters
global dim stair_lha_x#(200) : global dim stair_lha_y#(200) : global dim stair_lha_z#(200)
global dim stair_rha_x#(200) : global dim stair_rha_y#(200) : global dim stair_rha_z#(200)
global dim stair_lhb_x#(200) : global dim stair_lhb_y#(200) : global dim stair_lhb_z#(200)
global dim stair_rhb_x#(200) : global dim stair_rhb_y#(200) : global dim stair_rhb_z#(200)
global dim WRightTab2(15)
type T_rgb r as byte g as byte b as byte endtype
type T_vertex x# y# z# nx# ny# nz# u# v# endtype
rem varijable za pozicioniranje objekata na sceni
type T_XYZ_float
x as float : y as float : z as float
endtype : global GU_XYZReturn as T_XYZ_float
type xy x y endtype
d3d init
LM Start
lm set mode 1
gosub main
init_view_cameras()
gosub prepare_segments
gosub make_rightclick_menu
global c_arrow, c_cross, c_hand, c_kapaljka, c_kefa
c_arrow=load cursor(0)
c_cross=load cursor(4)
c_hand=load cursor("cursors/hand_black.bmp","cursors/hand_alpha.bmp",16,16)
c_kapaljka=load cursor("cursors/kapaljka.bmp","cursors/kapaljka_a.bmp",0,30)
c_kefa=load cursor("cursors/kefa.bmp","cursors/kefa_a.bmp",0,30)
c_CameraRotate=load cursor("cursors/rotate.bmp","cursors/rotate alpha.bmp",16,16)
change mouse 32
window set cursor g.hMainWindow, c_arrow
type T_terrain
TexSize TilesX TilesZ
TileSizeX# TileSizeZ#
memblock texture
exist
endtype
global dim ter(4) as T_terrain
type T_LimbVertexM
v l
v2 l2
v3 l3
v4 l4
c
endtype
type T_LimbVertex
v l
endtype
type T_TerrainToolPoints
px# py# pz#
color
endtype
global dim gTerrain_ToolPoints(-1) as T_TerrainToolPoints
global gTerrain_ToolPointsCount
global teren
global dim terrain(4,513,513) as T_LimbVertexM
global dim terrain_brush(512,512) as dword
global dim terrain_tbrush(512,512)
global dim ter_tool#(64,64)
global ter_toolSize : ter_toolSize=8
global ter_brushTrans# : ter_brushTrans#=1
global dim terrain_old(1024,1024)
global dim ter_exclude(4)
global dim TSvertices(4,10000) as T_LimbVertex
global dim TSVertices_Count(4)
global dim Tv_prazx#(4,10000)
global dim Tv_prazy#(4,10000)
type T_Texture
t_id t_name$ TimesUsed
endtype
global dim TextureBank(-1) as T_Texture
type T_Material
diffuse as dword
specular as dword
ambient as dword
emissive as dword
TextureId TexturePath$ TextureName$ TextureFile$
endtype
global dim Material(-1) as T_Material
global MCount
type T_W_ObjectProperties
w
ebName udDX udDY udDZ udVCount udFCount
ebParent ebGroup udLayer
cbTransparent cbHidden cbFreezed cbStatic cbCull
cbSubObjectID ebSubObjectName bRenameSubObject
ebSubObjectTexName
udSubObjectOX udSubObjectOY udSubObjectOZ
udSubObjectAX udSubObjectAY udSubObjectAZ
wMoving
bAddNewParam bDeleteParam bMoveUpParam bMoveDownParam
ebNewParamName ebNewParamValue
bOK bCANCEL
endtype
global OProp as T_W_ObjectProperties
type T_LightmapSetup_Window
w
ebLMapName udLMapTexStage udLMapSize udLMapQuality udLMapBlur
cbLMapAmbientLOn udLMapAmbientLR udLMapAmbientLG udLMapAmbientLB
cbLMapBoostOn udLMapBoostMaxuser udLMapBoostMultiple
cbLMapAmbientOcludeOn udLMapAmbientOcludeRays udLMapAmbientOcludeDistance
bRender bClose
endtype
global LMapSetup as T_LightmapSetup_Window
type T_LightmapSettings
Name$ TexStage Size Quality Blur ALightOn ALightR ALightG ALightB
BoostOn BoostMaxUser BoostMultiple
AOccludeOn AOccludeRays AOccludeDistance
endtype
global LMapSettings as T_LightmapSettings
type T_LightmapRender_Window
w
pbProgress bCancel
endtype
global LMapRender as T_LightmapRender_Window
global gTerrainBrushes_tvItem
global dim ilMaterials(-1)
gosub init_interface
delete window LoadingScreen
set window on
window set style g.hMainWindow,window get style(g.hMainWindow)||WS_CLIPCHILDREN
show window g.hMainWindow
maximize window g.hMainWindow
w_statusBar=make window(0,window height(feko)-25,window width(feko),25,"",feko,WS_CHILD)
global gProgressBar
y=window height(get dbpro window())-20
gProgressBar=make progressbar(0,window height(w_tab2)-20,180,20,PBS_SMOOTH,w_tab2)
fg=make window(350,2,510,20,"",w_statusBar,WS_CHILD)
global gLabel, gudX, gudY, gudZ
windows set font 8,"Arial",0,0,0,0
gLabel=make label(0,0,60,20,"Position:",fg) `: window set font gLabel,8,"Arial",0,0,0,0
gudX=make updown control(70,0,15,90,"X:",fg) `: window set font gudX,8,"Arial",0,0,0,0
gudY=make updown control(195,0,15,90,"Y:",fg) `: window set font gudY,8,"Arial",0,0,0,0
gudZ=make updown control(320,0,15,90,"Z:",fg) `: window set font gudZ,8,"Arial",0,0,0,0
windows set font 7,"Arial",0,0,0,0
a=make window(450,0,80,20,"",fg,WS_CHILD)
global gCameraToolsToolbar
gCameraToolsToolbar=make toolbar(0,TBSTYLE_FLAT,a)
nl=make imagelist(18,18) : toolbar set imagelist gCameraToolsToolbar,nl
a=imagelist add image(nl,"data/rotate normal.bmp",18,18)
a=imagelist add image(nl,"data/pan normal b.bmp",18,18)
hl=make imagelist(18,18) : toolbar set hot imagelist gCameraToolsToolbar,hl
a=imagelist add image(hl,"data/rotate hot.bmp",18,18)
a=imagelist add image(hl,"data/pan hot b.bmp",18,18)
toolbar add button gCameraToolsToolbar,BTNS_CHECK,0,0
toolbar set button tooltip gCameraToolsToolbar,0,"Rotate Camera"
toolbar add button gCameraToolsToolbar,BTNS_CHECK,1,1
toolbar set button tooltip gCameraToolsToolbar,1,"Pan Camera"
maximize window gCameraToolsToolbar
type Quaternion
w as float
x as float
y as float
z as float
endtype
type Euler
x as float
y as float
z as float
endtype
global ReturnQuat as Quaternion
global ReturnEuler as Euler