I've decided to make a new thread on my previous problem, because I had no help with it before. Anyway...
I have a level file, "lvl0.op" and it tells the code to load in all the objects and level data. Here's what it looks like:
When it says "createobject," that tells the code to load in an object. The objects load fine, except for they are completely invisible - I know that because you can see collisions against them.
Below are the "LoadLevel" and "CreateObject" functions:
How would I make the entities visible?
I have a level file, "lvl0.op" and it tells the code to load in all the objects and level data. Here's what it looks like:
0 data\media\levels\articbase2.b3d 15 10 16 1 1 1 createobject crate crate1 data\media\models\objects\crate\Crate.3ds 0 9 1 31 1 1 0 0 0 .07 .07 .07 0 0 0 createobject crate crate2 data\media\models\objects\crate\Crate.3ds 0 12 1 31 1 0 0 0 0 .07 .07 .07 0 30 0 createobject crate crate3 data\media\models\objects\crate\Crate.3ds 0 10 3.1 31 1 0 0 0 0 .07 .07 .07 0 -30 0
When it says "createobject," that tells the code to load in an object. The objects load fine, except for they are completely invisible - I know that because you can see collisions against them.
Below are the "LoadLevel" and "CreateObject" functions:
Function LoadLevel(filepath$) lvl.level = New level file = OpenFile(filepath$) lvl\title$ = ReadLine(file) lvl\id = ReadLine(file) lvl\mesh = LoadMesh(ReadLine(file)) EntityType lvl\mesh, LEVEL_COL camerax = ReadLine(file) cameray = ReadLine(file) cameraz = ReadLine(file) EntityParent w_pistol, camera TranslateEntity w_pistol, 1.8, -1.6, 2 RotateEntity w_pistol, 0, 180, 0 PositionEntity camera, camerax, cameray, cameraz CameraRange camera, .01, 1000 lvlsx# = ReadLine(file) lvlsy# = ReadLine(file) lvlsz# = ReadLine(file) ScaleEntity lvl\mesh, lvlsx#, lvlsy#, lvlsz# Repeat If Lower(ReadLine$(file))="createobject" obj_type$ = ReadLine$(file) name$ = ReadLine$(file) obj_mesh$ = ReadLine$(file) el_dest = ReadLine(file) x = ReadLine(file) y = ReadLine(file) z = ReadLine(file) alpha = ReadLine(file) shine = ReadLine(file) xv = ReadLine(file) yv = ReadLine(file) zv = ReadLine(file) sx = ReadLine(file) sy = ReadLine(file) sz = ReadLine(file) rx = ReadLine(file) ry = ReadLine(file) rz = ReadLine(file) CreateObject(obj_type$, name$, obj_mesh$, el_dest, x, y, z, alpha, shine, xv, yv, zv, sx, sy, sz, rx, ry, rz) EndIf Until Eof(file) CloseFile file End Function
Function CreateObject(type_of_object$, name$, filepath$, elevator_destination#=0, x=0, y=0, z=0, alpha#=1.0, shininess#=0.0, xv#=0, yv#=0, zv#=0, scalex#=1, scaley#=1, scalez#=1, rx#=0, ry#=0, rz#=0) ;create object newObject.obj = New obj newObject\obj_type$ = type_of_object$ newObject\name$ = name$ newObject\entity = CreateCube() newObject\x = x newObject\y = y newObject\z = z newObject\alpha# = alpha# newObject\shininess = shininess# newObject\x_vel# = xv# newObject\y_vel# = yv# newObject\z_vel# = zv# newObject\el_dest# = elevator_destination# ;build object EntityAlpha newObject\entity, newObject\alpha# EntityShininess newObject\entity, shininess# PositionEntity newObject\entity, newObject\x, newObject\y, newObject\z ScaleEntity newObject\entity, scalex#, scaley#, scalez# RotateEntity newObject\entity, rx#, ry#, rz# ;assign collisions Select newObject\obj_type$ Case "crate" EntityType newObject\entity, OBJECT_COL Case "car" EntityType newObject\entity, VEHICLECOL Case "door" EntityType newObject\entity, DOOR_COL Case "elevator" EntityType newObject\entity, LIFT_COL Case "computer" EntityType newObject\entity, OBJECT_COL Case "oil" EntityType newObject\entity, OBJECT_COL Case "keypad" EntityType newObject\entity, OBJECT_COL Case "glass" EntityType newObject\entity, GLASS_COL Case "enemy" EntityType newObject\entity, ENEMY_COL Case "misc" EntityType newObject\entity, OBJECT_COL End Select End Function
How would I make the entities visible?