Types, room.chair

Blitz3D Forums/Blitz3D Beginners Area/Types, room.chair

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.

Hey, say I have 3 space ships, and each ship has 5 guns (gun information is stored as a child type of the main parent space ship type).

How do I retrieve gun information only for the second space ship? When I using something like:

for P1.PlayerShip = Each PlayerShip
    Select P1\ShipNumber
      Case 2
         for P1\WeaponMounts.WeaponMount = Each WeaponMount
            *PLAYER 2'S GUNS ONLY*
         Next
    End Select
Next


But it brings back info for all the weaponmount child types not just ones on P1.

I see in Jasu's example he doesn't use the for/next loop, but instead stores the next weapon in the sequence and loop through 'manually'. But wouldn't that break if I deleted one of the middle ones and break the chain?

Whats the best way to do this?