Nesting Type

Blitz3D Forums/Blitz3D Beginners Area/Nesting Type

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.

Be aware that nested types are not "truly" nested. That is, using the above example. If you create three players, and 2 weapons for each of them, when you cycle through all the weapons with For.. Each you will be cycling through all six weapons. There is no command to specifically cycle through only those that correspond to a particular player.

For that you will need to add a parent field which stores the type handle of the player who owns the weapon.

Of course, in the example given, you probably won't need any of this. But in other cases of nested types, you will need to know the "parent" of the "child" type instance.