Ok, I dunno wassup with this. For my player entitys I setup a Type to contain all their info. There can be a maxium of 16 players, so I dim an array(15) of Player. Now, I have my own seperate function for loading objects - it basically just uses the next free object id and then returns that value (the object id) for storing so you can refrence the object later. Now I have this code:
Players(PlayerID).BaseID = LoadObject(Base, 0)
Players(PlayerID).TurretID = LoadObject(Turret, 0)
That works fine (and the objects are loaded okay ect ect) but when you try to manipulate an object through Players(PlayerID).BaseID ect it fails saying illegal object number. My first thought was my loadobject function was failing to return a value.. but thats not the case. Whats happening is that Players(PlayerID).BaseID is failing to keep the integer value thats passed back to it. I tried printing the contents of BaseID and TurretID, they were both 0. And then I tried this:
a = LoadObject(Base, 0)
Players(PlayerID).TurretID = a
and printed them both. Most intresting! A contains the expected value returned from the function fine. But Players(PlayerID).TurretID still contains 0.. despite me quite simply telling it to = a right there and then. Whats going on here? Anyone got any clue? This has got me completly baffled :/