Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Professional Discussion / Problem controlling deletion of objects

Author
Message
Davey B
21
Years of Service
User Offline
Joined: 22nd Aug 2004
Location:
Posted: 17th Sep 2010 19:27
Hi again,

So I'm trying to put together a system whereby as the player travels between sectors, only objects in the players current sector are loaded to preserve memory etc. The trouble is as I invoke the delete commands for objects not in the player's sector, other random objects seem to be deleted for no reason! Hence the prog crashes out with me telling it to position objects that dont exist! I'm really scratching my head with this one and wondered if maybe another set of eyes will help. The code snippet shown below shows how sectors are detected and planets are created/deleted. I'm happy to upload the whole project if necessary...



Thanks in advance!
Green Gandalf
VIP Member
21
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 17th Sep 2010 19:56
What's the purpose of the second line in the following bit?



The gosub in the next line immediately overwrites that value unless STAR(n).CLASS has the correct value. That may be correct and intentional but looks odd to me.

More importantly perhaps, should this be delete LIGHT not delete OBJECT?

Davey B
21
Years of Service
User Offline
Joined: 22nd Aug 2004
Location:
Posted: 17th Sep 2010 20:40
Thats great Gandalf thanks for that! I spent ages changing code and all it was was that bloody object reference instead of light! I knew it needed a fresh pair of eyes

I'm just trying to get the systems to load up now, hopefully I'll crack this soon, but no more errors now at least!

Cheers

Login to post a reply

Server time is: 2026-07-22 11:01:38
Your offset time is: 2026-07-22 11:01:38