IIzTrollin Posted October 12, 2015 Share Posted October 12, 2015 I'm getting this errorException occured while loading contract 'MannedAltitude18km': System.NullReferenceException: Object reference not set to an instance of an object at ContractConfigurator.Behaviour.Expression.OnLoad (.ConfigNode configNode) [0x00000] in <filename unknown>:0 at ContractConfigurator.ContractBehaviour.Load (.ConfigNode configNode) [0x00000] in <filename unknown>:0 at ContractConfigurator.ContractBehaviour.LoadBehaviour (.ConfigNode configNode, ContractConfigurator.ConfiguredContract contract) [0x00000] in <filename unknown>:0 at ContractConfigurator.ConfiguredContract.OnLoad (.ConfigNode node) [0x00000] in <filename unknown>:0ive uninstalled and reinstalled all my contracts but still same error whats causing it? (when i load the ship building) Quote Link to comment Share on other sites More sharing options...
nightingale Posted October 13, 2015 Author Share Posted October 13, 2015 I'm getting this errorException occured while loading contract 'MannedAltitude18km': System.NullReferenceException: Object reference not set to an instance of an object at ContractConfigurator.Behaviour.Expression.OnLoad (.ConfigNode configNode) [0x00000] in <filename unknown>:0 at ContractConfigurator.ContractBehaviour.Load (.ConfigNode configNode) [0x00000] in <filename unknown>:0 at ContractConfigurator.ContractBehaviour.LoadBehaviour (.ConfigNode configNode, ContractConfigurator.ConfiguredContract contract) [0x00000] in <filename unknown>:0 at ContractConfigurator.ConfiguredContract.OnLoad (.ConfigNode node) [0x00000] in <filename unknown>:0ive uninstalled and reinstalled all my contracts but still same error whats causing it? (when i load the ship building)Hmmm... I couldn't reproduce this one. Are you able to send me your save file (persistent.sfs)? Quote Link to comment Share on other sites More sharing options...
chrisl Posted October 14, 2015 Share Posted October 14, 2015 Out of curiosity, has the wiki been updated to include the duration rounding and reputation commands? Quote Link to comment Share on other sites More sharing options...
nightingale Posted October 14, 2015 Author Share Posted October 14, 2015 Out of curiosity, has the wiki been updated to include the duration rounding and reputation commands?Should be up to date with the current release, yes. Quote Link to comment Share on other sites More sharing options...
chrisl Posted October 14, 2015 Share Posted October 14, 2015 Should be up to date with the current release, yes.Ok. I guess I'm just looking in the wrong place. Quote Link to comment Share on other sites More sharing options...
nightingale Posted October 14, 2015 Author Share Posted October 14, 2015 Ok. I guess I'm just looking in the wrong place.I swear I'd done the Duration.Round(), but it's not there and I don't have unmerged stuff on the wiki. So fixed it now. The Reputation() function is in a dumb place (the ContractPrestige page). So I'm going to move it to where it should be - the Global Functions page. Quote Link to comment Share on other sites More sharing options...
chrisl Posted October 14, 2015 Share Posted October 14, 2015 I've created a duration variable named "Duration" which generated a random, rounded duration between 7 and 14 days. I want to use the resulting number of days as an int value so I created an int variable named "DurationText" but I'm running into issues. I know you can cast duration variables as double. I also know you can't do math on a duration. So I tried the following line:DurationText = double(@Duration) / 86400This doesn't work though I'm not exactly sure why not. Shouldn't the double() function convert @Duration into a float variable so that the rest of the equation can complete? Quote Link to comment Share on other sites More sharing options...
nightingale Posted October 14, 2015 Author Share Posted October 14, 2015 I've created a duration variable named "Duration" which generated a random, rounded duration between 7 and 14 days. I want to use the resulting number of days as an int value so I created an int variable named "DurationText" but I'm running into issues. I know you can cast duration variables as double. I also know you can't do math on a duration. So I tried the following line:DurationText = double(@Duration) / 86400This doesn't work though I'm not exactly sure why not. Shouldn't the double() function convert @Duration into a float variable so that the rest of the equation can complete?It should work - you'll have to say what's actually going wrong though for me to help much more. Also, the variable name confuses me - why DurationText if it's an integer? I assume you want to end up with it in the form "7 days" or something? Quote Link to comment Share on other sites More sharing options...
nightingale Posted October 14, 2015 Author Share Posted October 14, 2015 It should work - you'll have to say what's actually going wrong though for me to help much more. Also, the variable name confuses me - why DurationText if it's an integer? I assume you want to end up with it in the form "7 days" or something?Got it - think I see the issue. Try the latest dev build. Quote Link to comment Share on other sites More sharing options...
chrisl Posted October 14, 2015 Share Posted October 14, 2015 It should work - you'll have to say what's actually going wrong though for me to help much more. Also, the variable name confuses me - why DurationText if it's an integer? I assume you want to end up with it in the form "7 days" or something?Is there an output file that includes the contract configurator log details? I could get you the exact error that way. Without manually writing the entire error it basically says:Rethrow as System.Exception: Error parsing statement.Error occurred near '*':double(@Duration) / 86400As for why the name, no reason really. I'm using the variable in the description field: "....(must orbit for @/DurationText days)..." But I needed it to be an int instead of a string because I'm also using the variable to alter the mission reward. So the longer the mission has to run, the more it's worth. Quote Link to comment Share on other sites More sharing options...
nightingale Posted October 14, 2015 Author Share Posted October 14, 2015 Is there an output file that includes the contract configurator log details? I could get you the exact error that way. Without manually writing the entire error it basically says:Rethrow as System.Exception: Error parsing statement.Error occurred near '*':double(@Duration) / 86400As for why the name, no reason really. I'm using the variable in the description field: "....(must orbit for @/DurationText days)..." But I needed it to be an int instead of a string because I'm also using the variable to alter the mission reward. So the longer the mission has to run, the more it's worth.It's all in KSP.log. And that's not the full error - there should be the actual error as well. Anyway, if it's the same issue that I found, try the dev version linked in my previous post. Quote Link to comment Share on other sites More sharing options...
chrisl Posted October 14, 2015 Share Posted October 14, 2015 It's all in KSP.log. And that's not the full error - there should be the actual error as well. Anyway, if it's the same issue that I found, try the dev version linked in my previous post.Yeah, that looks like it fixed it. Quote Link to comment Share on other sites More sharing options...
Sticky32 Posted October 16, 2015 Share Posted October 16, 2015 So I have a new question, I am trying to add a description to a contract that changes based on the targetbody2. To do this I am trying to use a long if-then statement listing all the valid bodies and stating the desired description, however it picks up the @/targetbody2 and returns the body name for all of them but just lists the entire if-then statement. I tried putting parentheses and double quotes around it but maybe I did put them in the correct places. This method works in other areas so I thought it might be a good start here. Tried finding some samples like what I'm trying to do first but couldn't find anything other than coherent contracts, should I try to write it more like that? As always, link to the file in question: http://s000.tinyupload.com/index.php?file_id=45793942251904849091 Quote Link to comment Share on other sites More sharing options...
nightingale Posted October 16, 2015 Author Share Posted October 16, 2015 So I have a new question, I am trying to add a description to a contract that changes based on the targetbody2. To do this I am trying to use a long if-then statement listing all the valid bodies and stating the desired description, however it picks up the @/targetbody2 and returns the body name for all of them but just lists the entire if-then statement. I tried putting parentheses and double quotes around it but maybe I did put them in the correct places. This method works in other areas so I thought it might be a good start here. Tried finding some samples like what I'm trying to do first but couldn't find anything other than coherent contracts, should I try to write it more like that? As always, link to the file in question: http://s000.tinyupload.com/index.php?file_id=45793942251904849091Doing that is a bit tricky due to the way that strings are handled (only limited "search and replace" type operations are really possible within the string. You can do what you want by breaking it up. There's a good example here in Field Research. Quote Link to comment Share on other sites More sharing options...
DeCi Posted October 16, 2015 Share Posted October 16, 2015 Hmm, Everytime i boot up KSP i have to configure the contracts again. Is that normal? It doesnt seem to remember filter settings inbetween play sessions. Quote Link to comment Share on other sites More sharing options...
algeo Posted October 16, 2015 Share Posted October 16, 2015 (edited) Hmm, Everytime i boot up KSP i have to configure the contracts again. Is that normal? It doesnt seem to remember filter settings inbetween play sessions.I have the exact same issue with stock contracts, it forgets my settings each time i exit the application (curiously, it always remembers my non-stock settings). It wouldn't bother me at all to simply set it up every time I play if it weren't for the fact that all contracts which belong to one of the temporarily enabled groups get dropped from my active listing each time I load the save.I had a go at creating a .cfg file with the content from https://github.com/jrossignol/ContractConfigurator/wiki/Miscellaneous, but it still resets enabled/disabled tags when I load a save. Edited October 16, 2015 by algeo Quote Link to comment Share on other sites More sharing options...
nightingale Posted October 16, 2015 Author Share Posted October 16, 2015 Hmm, Everytime i boot up KSP i have to configure the contracts again. Is that normal? It doesnt seem to remember filter settings inbetween play sessions.There was a bug with how it sets those on startup, should be fixed for the next release. Quote Link to comment Share on other sites More sharing options...
tjsnh Posted October 16, 2015 Share Posted October 16, 2015 Stupid noob question. Looking over the docs (it's been a month or three since I've done serious syntax work) I've got a question about the best way to script "flying" contracts.What I'm trying to do are make some atmospheric aviation related contracts, and it seemed like the best way to do that is to create a contract to go perform some objective (science at X biome, reach speed X, whatever) with some argument in the parameter like "maxAltitude = 35000" or something, to force the use of an aircraft rather than a suborbital ballistic flight.Am I on the right track, or is there a better way to approach this? Quote Link to comment Share on other sites More sharing options...
nightingale Posted October 16, 2015 Author Share Posted October 16, 2015 Stupid noob question. Looking over the docs (it's been a month or three since I've done serious syntax work) I've got a question about the best way to script "flying" contracts.What I'm trying to do are make some atmospheric aviation related contracts, and it seemed like the best way to do that is to create a contract to go perform some objective (science at X biome, reach speed X, whatever) with some argument in the parameter like "maxAltitude = 35000" or something, to force the use of an aircraft rather than a suborbital ballistic flight.Am I on the right track, or is there a better way to approach this?Sounds like you're on the right track. You can also do a ReachState with state = FLYING, which is a bit more generic. But be advised there's a few ways for players to cheese that - an EVA Kerbal standing on his craft is considered flying, for example. But if you have other constraints based on altitude or speed then those exploits usually go away naturally. Quote Link to comment Share on other sites More sharing options...
Svm420 Posted October 17, 2015 Share Posted October 17, 2015 There was a bug with how it sets those on startup, should be fixed for the next release.Would this work for say station science contracts? I have to keep turning those off everytime I play along with Nehemiah's contracts. I tried the latest in dev version and that didn't seem to do it. Quote Link to comment Share on other sites More sharing options...
nightingale Posted October 17, 2015 Author Share Posted October 17, 2015 Would this work for say station science contracts? I have to keep turning those off everytime I play along with Nehemiah's contracts. I tried the latest in dev version and that didn't seem to do it.Can you try the dev version again (I hadn't checked in the .dll right away, so you may have grabbed an older one). If it's still not working, please describe how it's not working and I'll look into it (is it showing the contracts as disabled in the settings menu, but still offering them, or is it just not keeping the "disabled" state in the settings menu). Quote Link to comment Share on other sites More sharing options...
Svm420 Posted October 17, 2015 Share Posted October 17, 2015 Can you try the dev version again (I hadn't checked in the .dll right away, so you may have grabbed an older one). If it's still not working, please describe how it's not working and I'll look into it (is it showing the contracts as disabled in the settings menu, but still offering them, or is it just not keeping the "disabled" state in the settings menu).Will do! Will be back ASAP. Quote Link to comment Share on other sites More sharing options...
Svm420 Posted October 17, 2015 Share Posted October 17, 2015 Alright upon loading in with the latest dev version the station science contracts are enabled in the setting menu. Meaning it is not persisting the disabled state. Let me know if you want more info or anything else. Thanks! Quote Link to comment Share on other sites More sharing options...
nightingale Posted October 18, 2015 Author Share Posted October 18, 2015 Alright upon loading in with the latest dev version the station science contracts are enabled in the setting menu. Meaning it is not persisting the disabled state. Let me know if you want more info or anything else. Thanks!Should hopefully be enough for me to reproduce. I'll let you know if I hit trouble. Quote Link to comment Share on other sites More sharing options...
nightingale Posted October 18, 2015 Author Share Posted October 18, 2015 Alright, there was a combination of silly bugs that was making the stock contract disabling not persist properly. Now it's working. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.