Board Thread:The Last Sovereign Discussion/@comment-31632839-20170920202133/@comment-31632839-20190530155604

First of all, It's fine to use my code however you see fit. I don't even care if you credit me or not.

I just read this thread and did not check my code ( and I dont remember much of it, as it was 18 months or so ago that I uploaded the last version). But generally speaking the idea was magic.js (computing) and setupFrame.js (html generating) was supposed to be some kind of framework. So you had to only add your Investments in the toExpandAddHere.js File. But it is quite possible that new Investments cant be added with the available functions, as I could not foresee what the new Investment would require...

I did decide to not add the discrenary funding and only add checkboxes for the fundings that impacted your ProN. As for the reason, the tool was designed to be a lightweight investment calculation. If you want more than that, there are other way more complete (and therefor more complex) tools.

That tool was my first JS project, although it went through a (complete?) rewrite atleast once. So my code might not be the best basis to learn from.

With that being said. Yes in JS === is usally to be prefered to ==. === does check the value of the two variables aswell as their types, whereas == only compares the values. So using === instead of == will prevent mix-ups caused by inadvertent type conversations.

For the replaced IF clauses, ye sure you can do that, but that's not much of a saving and the if clause is more verbose which is not a bad thing for code maintaince.

For the same reason i prefer 0px to just 0, but thats a matter of taste i guess.

I assume every code specific question was answered already, but incase there are still open questions. Do not hesitate and ask. I'll dive back into the code and try to help you ;)

Lastly, my plans for the tools future:

Last time i updated the tool, was when chapter 4 started. At that time most of all chapter 4 investments got added to the game. As I added them to the tool I decided that adding Investments is too big a chore and too likely to produce errors(lots of copy pasting and walls of text and a missing or extra space, comma or parathesis are likely fatal..). The solutions I came up with was a interface to add, edit and delete investments, aswell as characters, sections and hiddenstats. The interface would have a export feature that would produce the basis for a calculation tool. Basically it would produce the toExpandAddHere.js File.

But I never actually started with that idea, although I still plan to do it somewhen. Mostly because I wanna play with the custom made interconnected lists(basically a database) that such an interface would need.

But at first i wanna finish my RP tool. Which is mostly finished, but I have not worked on it for months. >.<

P.S. I reuploaded the version 0.4.4