Loading From File

Blitz3D Forums/Blitz3D Beginners Area/Loading From File

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.


Level\AssetType$=ReadString$( loadfile ) ; loads back Type of Mesh
...
Level\BlockHandle = CopyMesh (Level\AssetType$) ;Inserts Mesh <---doesn't work



I think you're confusing handle names with string$ here.
Handles are really just numerical integer variables,
like in the following

apple=10

b$="apple"


b$ has absolutely no connection with the variable 'apple'

You could try having a field that contains a string related to the mesh you need, but will need another lot of code to actually copy the mesh.


i.e.

[codebox]

Select True
Case Level\Meshtype$="Chair"
Level\BlockHandle=CopyMesh(Chair)


...etc
[/code]
Whilst it would be nice to just have

Level\BlockHandle=CopyMesh(Mesh) regardless of the mesh type, but handles' values will change depending on memory resources etc.

I dunno if the undocumented commands of Handle and Object are any good with this, but I don't recommend their use.