Engine Structure and Entity Loading in Blitz3D

Blitz3D Forums/Blitz3D Tutorials/Engine Structure and Entity Loading in Blitz3D

When I first learned this code, I had already been using it. You don't have to understand a function to use a function. You only need to know how to use it.

So. Try using the LoadWorld() as is. Then, experiment.

Basically, whats going on is each type of entity in your .b3d export (from 3dws) is getting loaded into Blitz3D with different properties. Those properties should have already been defined in 3dws (try selecting an object and hitting 'Shift+Enter'. Class is the 'classname')

As for the functions that weren't explained, KeyValue() and Piece(), here is what I know: The 'playerstart' entity has an 'angles' property. In order to use the playerstart info in 3dws, 'KeyValue' returned the key values of the 'angles' property into the variable 'angles$'. It also set default values incase there weren't any already for the 'angles' property. Then, since now all three values are in a string (in the variable 'angles$'), you use peice() to seperate each value and assign them to different variables.

I hope that clears up what those two functions are for.

As for the other stuff... well I'm not sure how you can code in 3 different assembly languages but not understand a for loop and a switch statement. Look up "CountChildren()" and "GetChild()". The for loop continues until the variable 'c' equals the total children of the world pivot (an entity that is the parent of every entity in your .b3d file). The select statement (aka switch statement) just filters through the 'classnames' (a property assigned to every object in 3dws) of different types of entities you have in your .b3d file until it finds the 'classname' that the variable 'node' (which is the current entity in the loop) points to.

Well then... I might as well just write a tutorial myself...

Hope this helps to everyone struggling with this. I was one of you only a short time ago.