Fractal Softworks Forum

Please login or register.

Login with username, password and session length
Advanced search  

News:

Starsector 0.96a is out! (05/05/23); Blog post: Colony Crises (11/24/23)

Author Topic: learning how to java-where to even start  (Read 2861 times)

scarface

  • Commander
  • ***
  • Posts: 122
    • View Profile
learning how to java-where to even start
« on: November 09, 2019, 06:48:54 AM »

Im not a programmer. i can understand some code, like, understand what it generally, probably does, but thats about it. i dont know how to use any programming programs, always "programmed" in other games in notepad++ in simple python or game specific language, like in paradox interactive games, bethesda games.

I really want to learn how to do it in starsector, however, there is so much info im overwhelmed, i cant find where to even start. In the past, i could just jump in the middle of the game files and start cooking because there wasnt actually any programming, just changing assets. Here, im completely lost. tried to basically duplicate ship system, cant even do that.

So, yall advice me on where to start? As i said, i dont know anything about programming in java, so guides on the forums for specific things are not very useful to me, or assume that the modder already has knowledge of java. But also, i dont want to learn how to do everything in java, dont want to spend weeks on fulltime learning, just stuff useful for the game. I realize its fairly contradictory. So, if theres any learning site that can help me, please point me towards it.
Logged

tomatopaste

  • Captain
  • ****
  • Posts: 305
    • View Profile
Re: learning how to java-where to even start
« Reply #1 on: November 09, 2019, 07:05:25 AM »

Personally I didn't have any knowledge in Java before I got into modding (although I knew how to use C# so that helped me understand processes). If you are want to create your own mod, your best bet is downloading some other faction mods and looking at how they work to understand what is going on. You can actually achieve quite a lot towards creating your own faction mod without comprehensive Java knowledge. This tutorial shows how to set up an IDE (A fancy name for a text editor that lets you program more easily than using notepad), and This tutorial shows you how to create your own basic ship that you can use in a faction. This tutorial shows you around the structure of a mod's folders and how to create your own system in a new game.
Hopefully this can give you an orientation to what modding starsector involves  ;D
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 23008
    • View Profile
Re: learning how to java-where to even start
« Reply #2 on: November 09, 2019, 07:34:22 AM »

I'd suggest still spending some time with java tutorials - not weeks, necessarily, but almost any info you pick up from that would likely save you time in the long run. Since you don't know much/anything about Java, you're at a point where you'll get a lot of benefit for your time in learning the basics, and also at a point where you'll spend a lot more time flailing around if you don't know some of the basics.

I can see where you're coming from, though, that wouldn't be as fun as learning as you go. So if the choice is between "take longer learning as you go" and "learn more efficiently from tutorials, but actually don't because it's too boring and so you don't do it" then the learning as you go is still the better option. Unfortunately, beyond what was already linked, I don't know that there could be a resource for that. Like, if you need to learn the basics, you need to learn the basics, you know?

I will say that you might find it easier by starting with some "loose" scripts (found in data/scripts, which the game compiles on startup) than by setting up an IDE, compiling your stuff into jar files, etc. The loose scripts are... well, worse in several ways, but also less overwhelming since it's basically just text file editing.

Eventually transitioning to using an IDE is still a really good idea, though.
Logged

Yunru

  • Admiral
  • *****
  • Posts: 1560
    • View Profile
Re: learning how to java-where to even start
« Reply #3 on: November 09, 2019, 07:38:27 AM »

For me, jumping to just ahead of the basics worked best.
It was more engaging than the baby steps, but I also ended up having to do those baby steps as part of it.

creature

  • Captain
  • ****
  • Posts: 376
    • View Profile
Re: learning how to java-where to even start
« Reply #4 on: November 09, 2019, 03:43:36 PM »

For starsector specifically, you might want to follow, for example, this tutorial that got me started: https://fractalsoftworks.com/forum/index.php?topic=4344.0

It seems you already know how to code other languages, so starting java shouldn't be a problem, but Starsector seems to require a middleman operation where you need to compile your code into a jar before it can work (so simply copying a .java file from some mod and tweaking it a bit won't show up in game). After that, I reckon you can just dive into your favorite mods, learn how things are done and go from there. I sure did.
« Last Edit: November 09, 2019, 03:45:35 PM by creature »
Logged

Nick XR

  • Admiral
  • *****
  • Posts: 699
    • View Profile
Re: learning how to java-where to even start
« Reply #5 on: November 09, 2019, 04:30:40 PM »

No matter what I'd learn the basics first, you might be able to sort-of get by without a basic understanding, but quickly any time you "save" will get eaten up by problems you don't understand that you would.

There's a lot of great free stuff online.  Honestly you don't need to go to school anymore to learn how to program IMO:

https://www.edx.org/course?search_query=java

Avoid any JavaScript stuff, despite the names being similar they are pretty different.  And that dumpster fire of a language will just poison your mind.

Thaago

  • Global Moderator
  • Admiral
  • *****
  • Posts: 6835
  • Harpoon Affectionado
    • View Profile
Re: learning how to java-where to even start
« Reply #6 on: November 09, 2019, 06:18:14 PM »

For Java coding, I find an IDE to be an absolute MUST. It will dynamically check for any syntax errors and highlight them - in some cases it even knows how to correct them and all it takes is right clicking an selecting the appropriate fix. I use Netbeans, and while the tutorial for setting it up is very old, I believe it is still accurate.
Logged

Nia Tahl

  • Admiral
  • *****
  • Posts: 776
  • AI in disguise
    • View Profile
Re: learning how to java-where to even start
« Reply #7 on: November 09, 2019, 06:34:31 PM »

an IDE like IntelliJ IDEA will also do other nice things like displaying available api methods you can call, which can be very useful when trying to figure out how to do something. A proper IDE is very much a must and very helpful for learning, imho. You can still start with loose scripts as Alex suggested, but setting up an IDE to work on them is quite simple (there's tutorials for all the popular ones, my recommendation is IDEA) and doesn't take long.

I came into SS modding with only some basic knowledge in C and the rest was just learning as I went. Start with simple things like stat-altering hullmods and shipsystems and work your way up towards more complex things. Doing some basic java tutorials will probably help if you don't have any real programming knowledge to start with, though.
« Last Edit: November 09, 2019, 06:36:44 PM by Nia Tahl »
Logged
My mods: Tahlan Shipworks - ScalarTech Solutions - Trailer Moments
It's all in the presentation