Runboard.com
You're welcome.





runboard.com       Sign up (learn about it) | Sign in (lost password?)

Page:  1  2 

 
UglyGreenThings Profile
Live feed
Blog
Friends
Miscellaneous info

Registered user

Registered: 01-2005
Location: The Nexus of Sominus
Posts: 164
Karma: 1 (+1/-0)
Reply | Quote
New Class of Brain to play with UDOs....


I'm working on a new class of Brain that can deal with not having starsystems, but I'm running into a slight issue with debugging "Object Reference errors" generated when null conditions exist within the code.

Is there a quick and dirty check that I can put into the Brains coding to spit-out a messagebox to display the offending variable within the coding.

I've tried looking at ST4's coding, because I know it has extensive error-catching in it...but I'm getting lost in the code. any help, or guidance, would be appreciated. Thanks, ~UGTs
4/19/2009, 3:45 pm Link to this post Send Email to UglyGreenThings   Send PM to UglyGreenThings AIM Yahoo
 
UglyGreenThings Profile
Live feed
Blog
Friends
Miscellaneous info

Registered user

Registered: 01-2005
Location: The Nexus of Sominus
Posts: 164
Karma: 1 (+1/-0)
Reply | Quote
Re: New Class of Brain to play with UDOs....


Oh, I need to add.....

Is there a method to order Freighters to "Unolad" in the Brain class?

I see "Transport" and "Transport2"....but they both refer to StarSystems.
4/19/2009, 5:54 pm Link to this post Send Email to UglyGreenThings   Send PM to UglyGreenThings AIM Yahoo
 
GlitchSCG Profile
Live feed
Blog
Friends
Miscellaneous info

Head Administrator

Registered: 01-2005
Posts: 347
Karma: 6 (+7/-1)
Reply | Quote
Re: New Class of Brain to play with UDOs....


I neglected to give the Brain an Unload method. I flagged this to add it for the next Build.
4/20/2009, 5:35 am Link to this post Send Email to GlitchSCG   Send PM to GlitchSCG
 
UglyGreenThings Profile
Live feed
Blog
Friends
Miscellaneous info

Registered user

Registered: 01-2005
Location: The Nexus of Sominus
Posts: 164
Karma: 1 (+1/-0)
Reply | Quote
Re: New Class of Brain to play with UDOs....


How about the Object Reference errors?

I've been trying to use the "Try" and "Catch" statements with an existing Test Brain that checks for StarSystems (and disables any code that references StarSystems)...but I'm not having much luck with that.

Right now I have a base brain with all the StarSsytem references removed, that can at least move and order starships (without coordination, just random movement unless it "sees" and enemy starship).

I'm having trouble getting it to log UDOs and Stellar items (Black Holes, Pulsars, Wormholes, and Nebula) into its "memory" at the moment.
 
4/20/2009, 7:44 am Link to this post Send Email to UglyGreenThings   Send PM to UglyGreenThings AIM Yahoo
 
GlitchSCG Profile
Live feed
Blog
Friends
Miscellaneous info

Head Administrator

Registered: 01-2005
Posts: 347
Karma: 6 (+7/-1)
Reply | Quote
Re: New Class of Brain to play with UDOs....


Without being to examine the code in question it's hard to offer suggestions for how to deal with "object reference" errors. In general, try to make sure the variables have legitimate values assigned before referencing them.
4/20/2009, 1:12 pm Link to this post Send Email to GlitchSCG   Send PM to GlitchSCG
 
Viltris Profile
Live feed
Blog
Friends
Miscellaneous info

Registered user

Registered: 01-2005
Location: San Jose
Posts: 196
Karma: 4 (+6/-2)
Reply | Quote
Re: New Class of Brain to play with UDOs....


Is there a stack dump or just the error message?

Glitch, in the Brain code error handling, maybe you should have it print out stack dumps when a Brain throws an error. This would help Brain developers debug their Brains.

---
\/
4/20/2009, 4:02 pm Link to this post Send Email to Viltris   Send PM to Viltris AIM
 
GlitchSCG Profile
Live feed
Blog
Friends
Miscellaneous info

Head Administrator

Registered: 01-2005
Posts: 347
Karma: 6 (+7/-1)
Reply | Quote
Re: New Class of Brain to play with UDOs....


That's a good idea, I will keep it in mind for the 5.2 development effort.
4/20/2009, 4:11 pm Link to this post Send Email to GlitchSCG   Send PM to GlitchSCG
 
UglyGreenThings Profile
Live feed
Blog
Friends
Miscellaneous info

Registered user

Registered: 01-2005
Location: The Nexus of Sominus
Posts: 164
Karma: 1 (+1/-0)
Reply | Quote
Re: New Class of Brain to play with UDOs....


Just an error message that "Object reference not set to an instance of an object", which keeps repeating every time the brain code executes.

Usually I can pin-down this type of bug rather quickly, but this one is confounding me, because I'm having to block-off entire sections of code to clear the error (not just single lines).
4/21/2009, 4:50 am Link to this post Send Email to UglyGreenThings   Send PM to UglyGreenThings AIM Yahoo
 
GlitchSCG Profile
Live feed
Blog
Friends
Miscellaneous info

Head Administrator

Registered: 01-2005
Posts: 347
Karma: 6 (+7/-1)
Reply | Quote
Re: New Class of Brain to play with UDOs....


It means one of your variables contain a null, is not assigned, and you are attempting to access its value.

Last edited by GlitchSCG, 4/21/2009, 2:22 pm
4/21/2009, 2:22 pm Link to this post Send Email to GlitchSCG   Send PM to GlitchSCG
 
UglyGreenThings Profile
Live feed
Blog
Friends
Miscellaneous info

Registered user

Registered: 01-2005
Location: The Nexus of Sominus
Posts: 164
Karma: 1 (+1/-0)
Reply | Quote
Re: New Class of Brain to play with UDOs....


doesn't matter..... apparently Visual Studio ate the file. I can find no traces of it, even in my backup files.

All I have to work with now is my re-built UDO brain with all the StarSystem references stripped-out. I can add them later once the UDO code is optimized, with the proper checks. emoticon
4/21/2009, 6:44 pm Link to this post Send Email to UglyGreenThings   Send PM to UglyGreenThings AIM Yahoo
 


Add a reply

Page:  1  2 





You are not logged in (login)