Creating an NRaas project Debugging mods

Talk nerdy to us here.
myranalis
Reactions:
Posts: 12
Joined: June 24th, 2014, 6:00 pm

Debugging mods

Post by myranalis » September 6th, 2014, 8:47 pm

Hello guys. I'm just setting up a dev environment to have a bit of a play - I've forked the code, and got my own local copy all set up OK. I'm just wondering how you're debugging mods? Looking at some into tutorials they're building a package file and moving putting that in the mods folder to test it. So I assume that means every change I make I have to rebuild the package file? And I won't be stepping through the debugging environment in VS? If someone can give me a quick run down on where to look for info when the changes I've made don't work I'd appreciate it!

Also, anyone have any suggestion as to any jobs on the various task lists that would be suitable for a complete newbie to sims modding?

Thanks

Anna

User avatar
igazor
Organizer
Reactions:
Posts: 17151
Joined: April 8th, 2013, 6:00 pm
Answers: 206
Location: Everyone should strive to find their inner platypus.

Post by igazor » September 6th, 2014, 9:07 pm

Hi Anna,
I'm afraid that our lead coder will be out of commission for at least a few days. A hurricane force storm passed through his area today and, although he's fine, he is without electricity for a while. In the meantime it is possible that another coder will see and respond to your question, but please don't be put off if you don't get a response for a short while.

myranalis
Reactions:
Posts: 12
Joined: June 24th, 2014, 6:00 pm

Post by myranalis » September 6th, 2014, 9:34 pm

Hurricane sounds fun :) No worries - I'll just poke about randomly in the code for a while :)

myranalis
Reactions:
Posts: 12
Joined: June 24th, 2014, 6:00 pm

Post by myranalis » September 8th, 2014, 10:59 pm

Well, I am quite pleased with myself after two days of putzing. I've managed to put an option dialog into OnceRead but the 'OnceRead' tab under the 'NRaas' menu has gone all funny. Its tan instead of blue and is drawing kind-of broken. I am stumped as to what I've done - other than this happened right after I added a 'PrimaryInteraction' class to make the options into the popup style of dialog. Can anyone enlighten me as to what I'm missing?

User avatar
Chain_Reaction
Site Admin
Reactions:
Posts: 7620
Joined: December 30th, 2011, 6:00 pm
Answers: 82
Contact:

Post by Chain_Reaction » September 10th, 2014, 3:03 am

To answer about debugging - rebuild your DLL and replace it in S3PE, run the game, test. It's painful but there's no VS environment that can mimic the game engine. Remember to stuff the code with as many debugging notifications as you can. Even if you don't think you need to know what the value of that variable is, one too many never hurt after waiting for it to load. I've been there many times. :)

As for the dialog. OnceRead has no options presently. Have you added some? And did you change the namespace to the PrimaryInteraction class?

myranalis
Reactions:
Posts: 12
Joined: June 24th, 2014, 6:00 pm

Post by myranalis » September 10th, 2014, 7:14 am

Yup, I added a couple using the Careers options as an example. OnceRead seemed to have a pretty tackleable enhancement list. Prior to adding the PrimaryInteraction class my options came up in the blue toggle pie toggle style but appeared to work OK. (Could be wrong, haven't even tried to write anything to use them, but the boolean values toggled and appeared to save) Through excessive debugging of the careers mod I was able to understand the PrimaryInteraction class was responsible for making it into the dialog 'somehow' so I added NRaas.OnceReadSpace.Interactions.PrimaryInteraction and my options did switch to the dialog form - but with the really odd drawing of the one tab. I'm not even sure where to begin trying to figure out what I've done there.

User avatar
Chain_Reaction
Site Admin
Reactions:
Posts: 7620
Joined: December 30th, 2011, 6:00 pm
Answers: 82
Contact:

Post by Chain_Reaction » September 10th, 2014, 9:28 pm

Okay and how do the options themselves look? Did you give them the IPrimaryOption interface and null out the ParentListingOption?

myranalis
Reactions:
Posts: 12
Joined: June 24th, 2014, 6:00 pm

Post by myranalis » September 10th, 2014, 9:33 pm

Identical to the careers setup I've added a 'DebuggingSetting' inheriting BooleanSettingOption<GameObject>, IPrimaryOption<GameObject>. I've also added a General.AllowAutonomousReadingOfSkillBooks which inherits from BooleanSettingOption<GameObject>, IGeneralOption. IGeneralOption inherits from IOptionItem<GameObject> though, not IPrimaryOption.

myranalis
Reactions:
Posts: 12
Joined: June 24th, 2014, 6:00 pm

Post by myranalis » September 10th, 2014, 9:41 pm

Hmm, I can't get a screenshot capture of how those menus are drawing to show you. Any advice? Its weird. I've never seen anything come up that way in normal play. As to the ParentListingOptions, the DebuggingSetting does return null. The AllowAutonomousReadingOfSkillBooks one returns General.ListingOption (again direct copy from Careers object, namespace definitely changed to OnceRead). As you can see at this point I've done very little other than copy/paste and try to wrap my head around what's going on :)

myranalis
Reactions:
Posts: 12
Joined: June 24th, 2014, 6:00 pm

Post by myranalis » September 10th, 2014, 9:42 pm

Oh, and the other thought: It is only the 'OnceRead' option itself under 'NRaas' that is drawing wrong. Once you get into the actual options dialog - everything draws fine.

Post Reply