Jump to content

NaN in SH?


Recommended Posts

I only posted here because i have some mods installed altho the issue im having, i dont think its mod related.

I was building my first shuttle in the hangar (using B9) and at some point the cost of the craft changed from a number to NaN. I didnt notice at first, after adding some more parts i pressed launch to test the craft out but it said i didnt have enough money (I've got 1.3 millions) then i noticed NaN.

Ive tried exiting and re entering the hangar, re loading the game ... Nothing. The shuttle still costs NaN.

This happened to an aircraft that i just built, tested and then ive changed the wings position and bam! NaN.

Wat is happening? Did i just lose hours making those things?

EDIT: oh and i forgot to mention im on 24.2

Edited by code99
Link to comment
Share on other sites

Please follow the instructions in the "How to get support" sticky thread, especially the bits about a list of your mods and uploading your output_log.txt/player.log file. Also, since the issue is persistent across reloads of KSP it would indicate that there is probably a NaN saved into your craft file so uploading that would probably be useful too...

Link to comment
Share on other sites

I did read the sticky just forgot to mention im typing from the phone (got no internet for my pc where i live) and thus i can't upload pics or files.

And this phone is not really compatible with the forum software, i have to try several times to post or open threads here before im able to ...

As for what mods i use, its quite a list (should also mention I've been playing with these mods for a couple of weeks now and didnt have a single problem or crash, until now):

Toolbar

ATM

B9

Chatterer

Deadlyreentry

Distant Object

DMagic Orbital Science

Exurgent Engineering (dependency)

FinePrint

Firespitter (just the dll, its a dependency)

KAS

Kerbal Joint Reinforcement

Hyper Edit

KineTech Animation (not sure what this is, probably dependency)

KW Rocketry

Infernal Robotics

MechJeb2

Mission Controller

Docking Port Alignment

Near Future Propulsion

Nova Punch 2

Real Chute

Station Science

Tarsier Space Tech

Alarm Clock

Tweak Scale

Module Manager

Link to comment
Share on other sites

Well, it is going to be rather hard to give you any helpful support but I'll give it a try...

The first thing to do is to open your craft file in a text editor and search it for NaN. Presumably there will be one or more lines that say something like "cost = NaN". Changing all instances of NaN to a valid number should result in your craft working but the cost will not be accurate. A better solution may be to work out which parts are affected (scroll up from the NaN line until you find the "part = xxxx" line) and, if there aren't many of them, then try removing these parts in the SPH and replacing them with new parts. This should result in the cost being correct...

Link to comment
Share on other sites

Well i found just one NaN in both my ships.

Its not a part but a module, TweakScale:

MODULE

{

name = TweakScale

isEnabled = True

...

...

Events

{

}

Actions

{

}

}

RESOURCE

{

name = ElectricCharge

amount = NaN

...

...

}

Thats what I've found. I can type the whole thing instead of this short version if need be but it might take a while.

The only "cost" there is here is under TweakScale, called "dryCost = 39000" but that as you can see has a number.

I will remove tweakscale, i didnt even use it in my game. Will that fix it?

Or should i remove both that and the batteries?

EDIT: now that i think of it, only one of the ships has batteries on them, the shuttle. The aircraft has no batteries installed.

Edited by code99
Link to comment
Share on other sites

Firstly, don't just remove TweakScale as it is probably used by at least one of your other mods (e.g. RealChute). Make sure that you have the correct versions of your mods for KSP 0.24.2 as versions built for 0.25 may not work correctly.

Most (all?) command pods, cockpits and probe cores have a small battery inside to power the reaction wheel and lots of engines can also hold a small amount of electricity. A PART block (a block is from the { to the matching }) contains a number of MODULE blocks and a number of RESOURCE blocks. Scroll up to find the PART block it is inside.

First, load the craft as it is and try right clicking on the engine or the command pod (depending on which part you found it in). You should find that the electric charge slider (if there is one) is reading NaN. If there is a slider then try dragging the slider and if it changes back to a number (e.g. 0.0) then the cost should start calculating correctly again. If this works then it is caused by the part having a tweakable electric charge with a maxAmount of 0 (this is a known bug in the stock game handling of tweakable resources with maxAmount = 0). Let us know which part it is, it may be that the part is "broken" in stock or a mod may be breaking it (possibly tweakscale, possibly another).

If this doesn't work (or there is no electric charge slider) then open the craft file in your text editor again and simply change the "amount = " line to the same number as the "maxAmount = " line.

Edited by Padishar
Link to comment
Share on other sites

This thread is quite old. Please consider starting a new thread rather than reviving this one.

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...