Sign in to follow this  
Belrindor

How to get started modding?

Recommended Posts

Hopefully one of our great community modders can answer this.

What would be the best place to start to eventually make a mod for WU?

I've a background in programming, though it has been a (not small) number of years. But, just treat me like a total noob here.

What languages would I need to pick up, and where should one even start?

Thank you very much for your time.

  • Like 1

Share this post


Link to post
Share on other sites

Java mainly. You can make some mods with Javascript and the script runner tool in ago's server mod launcher. One area that seems to be different with WU modding is using bytecode to make edits to Java Virtual Machine (JVM). A lot of mods tend to avoid the bytecode path as it is full of pitfalls. But it's also very versatile in that you can do anything with it.

 

To keep things simple I'd stick with with JavaScript via script-runner. Using Java reflection to change various things about vanilla is good. And Java + the action-performer/behaviour-provider in modlauncher is also good.

Share this post


Link to post
Share on other sites

Hopefully this thread isn't too old to continue...

 

I've been writing code since 1983, no stranger to how things work, for the most part.  However, the last 10 years or so has been almost entirely in the .Net world.  I can write Java, that's not the issue.  The issue is the various IDE's, how to get set up with the WU code, and getting started with a template project that compiles and runs "out of the box".  In Visual Studio, I could load up a template solution and jump right in.  That doesn't seem to be the paradigm for Java development.

 

What would really help me out, and possibly other non-Java developers, is a starter project for the Client modloader, all set up and ready to dive into.  I know there's a good set of articles on the Server modloader, but nothing for the client that I'm aware of.  The two projects are NOT the same, I've tried to apply the general logic from the Server wiki to client mod development.  Failed miserably.  I've made changes to existing Client mods and compiled using Maven, but now I want to write a Client mod that hasn't been done yet and I can't seem to get started.  I'm assuming an IDE would assist in creating new interfaces/windows in the client, etc.  But maybe I'm just projecting the "Visual" part of Visual Studio onto all IDEs?  :)  It's so simple to add a button, text label, whatever when working in VS...  Is this even possible in Java development?

 

Even a detailed set of steps would be better than nothing.  :)  Something like this?

 

1) Download IDE XXX and install it using these parameters/settings.

2) Start a new project/whatever the IDE calls a solution.

3) Add XX libraries to the project by doing these exact steps...

4) Decide how you want to modify the client code (out of scope here)

4a) Here's sample code to send text to the event window, local chat, etc.

4b) Here's sample code to create a WU window with text and a button to close it.

4c) Here's sample code to add an entry to the settings window.

5) Compile by doing these steps.

6) Copy it to your mods folder and see what happens.

 

 

  • Like 1

Share this post


Link to post
Share on other sites

@RicowanI am actually looking for the same information as you are however in the server modloader space. Can you share the pointers you found in that area?

Share this post


Link to post
Share on other sites

I used to develop a lot in C and C++ a while back. Diving into Java really for the first time (although object oriented isn't new to me) so I am getting hung up on the first three steps actually:

 

1) Download IDE XXX and install it using these parameters/settings.

2) Start a new project/whatever the IDE calls a solution.

3) Add XX libraries to the project by doing these exact steps...

 

I tried Eclipse however having trouble getting to third step. Also tried Intellj and getting stuck there even doing a Hello World program that simply writes to system.out

 

The joys of the learning curve I guess....

 

Share this post


Link to post
Share on other sites

IntelliJ > Eclipse imo; at least for any long term development.

 

Quote

3) Add XX libraries to the project by doing these exact steps...

You want to use maven(1) or gradle(2). Probably gradle would be better.

1: https://maven.apache.org/articles.html

 

2: https://gradle.com/training/introduction-to-gradle-05202019/

 

think of both of those as packagemanager+makefile. It describes dependencies that are downloaded from the "maven central" repository (or other repository) during build. Using libraries picked by-hand is something you definitely could do, but if you are willing to publish code later, you should not. Even if you don't plan on publishing, you should not.

 

Ago publishes both client and server modloader jars on his repos.

 

Its PITA to figure out on how to build a random bunch of java source files downloaded from github.

 

Quote

5) Compile by doing these steps.

this also is pretty much trivialised by using either build system.
 

Quote

 

4a) Here's sample code to send text to the event window, local chat, etc.

 

 

 

 

 

I can't produce examples (anymore) on either of those; read up on @bdew's mods on github. Bdew's love, Bdew's life, Bdew's awesome. All hail Bdew.

 

Then, client-helper mod's code is relatively easy to read, too (its full of bad examples of code though, imho; but hey, it works so its good enough (no sarcasm here)).

Edited by nekoexmachina
  • Like 2

Share this post


Link to post
Share on other sites

TY @nekoexmachina

 

Before reading your reply I managed to make some serious headway. I started building an existing, working mod (meditation mod) from source code using maven and eclipse. After some interesting learning curve experiences it eventually compiled. I then extended the mod to do a small additional thing. After compiling again I tested it on a working server successfully. 

 

It worked!

 

Lots more to learn however slowly making headway! I have to look into your suggestions including learning about gradle

Share this post


Link to post
Share on other sites

Gradle is best imo. Makes things a lot easier when forking existing code and allowing others to help when you're stuck in places. The auto-importing of dependencies from the build.gradle is a huge time-saving benefit.

Share this post


Link to post
Share on other sites

dependency management is a feature of maven as well. in fact gradle uses maven repositories to get dependencies.

 

but i wholeheartedly agree for single reason: xml (which maven uses for configuration) sucks balls.

  • Like 1

Share this post


Link to post
Share on other sites

Thanks for the tips guys. Definitely adding gradle to the list of things to explore.

Share this post


Link to post
Share on other sites

I did a little stream, quality of video kind of sux but meh it either helps or it doesn't.

 

  • Like 2

Share this post


Link to post
Share on other sites

@Cuddles - That was absolutely fantastic! The earlier parts of the video would have significantly shortened my learning curve last week had it been available then. The later parts of the video gave me some more background knowledge that I hadn't either encountered or thought about yet.

 

Thank-you very much for creating this for people to watch!

 

~Nappy

Edited by Nappy

Share this post


Link to post
Share on other sites

yeah i tried to use my usual recording software but it wouldn't get the windows that pop up like exporting and such, so had to use stream and capture entire screen which is why the quality sux, slow internet down here in aus   haha

Share this post


Link to post
Share on other sites

Thanks Coldie, that was very helpful!  I assume writing a client mod is similar as far as which external jars to include (client.jar vs. server.jar, etc.)...  anything else to know about when modding the client vs. the server?

 

Share this post


Link to post
Share on other sites

sorry never done any client mods, my theory is that if I think something should be changed then it should be changed for everyone.

I do use some client mods I just decide not to make any myself.

  • Like 1

Share this post


Link to post
Share on other sites

Cuddles that's a pretty excellent video, thanks! -- Like Ricowan I'm also an experienced programmer, but new to all this moden Java lark. (I last did Java around 14 years ago, when the IDEs of popular choice were BlueJ and JDeveloper.)

Share this post


Link to post
Share on other sites

was very basic intro I would say but when I first started I didn't really know what half the stuff in a basic mod meant or did  haha

So yeah I think even basic intro is good to get started with really.

 

If people want more specific stuff just ask and I will see what I can do.

  • Like 1

Share this post


Link to post
Share on other sites

It still helped splendidly. :)

 

The only difficulty I've run into is building the JARs. I've checked out a few existing mods from Github so I know they should work, but when it comes to selecting a main class for a JAR artifact IntelliJ is having none of it.

 

 

Share this post


Link to post
Share on other sites
On 4/25/2019 at 2:38 PM, Cuddles said:

yeah i tried to use my usual recording software but it wouldn't get the windows that pop up like exporting and such, so had to use stream and capture entire screen which is why the quality sux, slow internet down here in aus   haha

 

I guess you tried OBS already? That's what I use to record on screen videos.

Share this post


Link to post
Share on other sites

I changed to using streamlabs about a month ago for my streaming, I can record using it as well for full screen capture but the quality of the last video I did was so 'good' it was over 3GB for 15 min recording lol

So yeah still finding that nice spot which looks good and isn't insanely huge file size.

Share this post


Link to post
Share on other sites
On 5/7/2019 at 12:10 AM, Cuddles said:

I changed to using streamlabs about a month ago for my streaming, I can record using it as well for full screen capture but the quality of the last video I did was so 'good' it was over 3GB for 15 min recording lol

So yeah still finding that nice spot which looks good and isn't insanely huge file size.

Would be great if you can upload it again. I've been looking for a video since quite a while. I also have .NET Dev background, but don't get too far without some screenshots or videos :)

Share this post


Link to post
Share on other sites

Found this video on Youtube, that finally helped me to understand server modding. Unforunatly, client modding is not explained:

 

  • Like 3

Share this post


Link to post
Share on other sites
On 4/25/2019 at 1:26 PM, Cuddles said:

I did a little stream, quality of video kind of sux but meh it either helps or it doesn't.

 

 

^ link doesn't work, any chance to repost the video link? ty!

Edited by Barfoot

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this