October 20, 2017, 12:35:38 PM

Author Topic: [Modding] Faarks mini mods  (Read 59334 times)

Faark

  • Sr. Member
  • ****
  • Posts: 466
    • View Profile
[Modding] Faarks mini mods
« on: March 08, 2013, 01:19:12 PM »
Hey guys,

it is highly unlikely continue maintaining this project. This isn't an easy step for me, but I haven't played the game for ages, so there isn't any personal need for mods anymore. Also fun isn't a motive anymore as well, since the games crappy mod support makes creating challenging mods (from a development perspective perspective) excessively time consuming. And that sadly wont change in a reasonable time frame.

The entire latest as-is code is now available on GitHub. I hope it might be of use for someone and it would be awesome if anyone would like to take over this project. If that is the case, please leave me a message!




____________________
* ORIGINAL POST *

Hey Gnomads,

i was trying to create some mods for Gnomoria. There isn't anything like this before, so thats kind of difficult. My solution appears to work, but now it is time to make sure there are no unwanted side effects. It would be great if some of you could test that stuff while reporting everything unusual.


It currently contains 3 little demo/example mods that:

- The start screen will now display the Seed for its automatically generated world, so you can create a playable version of it if you like what you see.

- A copy of your savegame is created after every saving. I know it already exists as an external tool, but made such a great example :D

- The scrollbar status will be synced, when you switch between the "Status" and "Permissions" tabs in the Population UI. That should help e.g. when searching idle gnomes and assigning them a new job.



You can download it here!
(Version History)


Thanks everyone who will participate, hope we will help improving Gnomoria in ways none of us one can currently imagine!
Feel free to leave feedback and questions below. I'll start with some basic Q/A.

« Last Edit: September 11, 2013, 04:34:39 PM by Faark »
When will your gnomes start flooding your kingdom with legendaries? - Check out my mods! - Want to create mods yourself? Here is a early draft of a modding tutorial. Just checking by here infrequently these days, but feel free to PM me!

Faark

  • Sr. Member
  • ****
  • Posts: 466
    • View Profile
Re: [Modding] Wanted: Testers for some mods
« Reply #1 on: March 08, 2013, 01:19:35 PM »
Q/A


How to install and use it?

- Download GnoMod.zip from the link above.
- Unpack everything directly into your Gnomoria directory (e.g. C:\Programme\Gnomoria).
- Run the Game via GnomoriaModUI.exe
- ModUI should be pretty much self explaining. Make sure to check "enabled" for those mods, this isn't done automatically, yet.
- Whenever you want to install a new mod, copy its dll-file into your gnomoria directory, sub folder "Mods"

___

What is this and how does it work?

This is a small application that creates a copy of gnomoria.exe and injects calls to external code aka mods into it using Mono.Cecil.

___

Is it legal?

I think so! The modding package requires an existing Gnomoria installation to work and does not contain any original stuff. I also have not found any rules prohibiting modding, only some posts about that there are no plans to support modding with some kind of API. Well, my stuff obviously can handle it them self.
I also tried to let Robobob confirm that he is fine with it, but didn't get any response so far in the last couple of days.

___

Where is the source?

Sorry, not public for now. I will make the source available soon, but for now we should first check that there are no mayor flaws. And to polish it, so it looks great for you :)
*Update* I'm to lazy to share the source. But you are feel to do decompile my stuff. I also expect you to allow others the same on your mods an for "educational" purpose.

___

Does this mean there will be lots of mods soon?

Well, this does not really make modding easy!
It takes care of one very technical step, as well as in the future hopefully also more stuff like updating mods. But the modder still have to figure out how to implement his feature on its own. This requires a lot of work and "digging" into how gnomoria itself works.

___

You want to create a mod?

Great! Here is a very early draft of a tutorial. Just leave me a private message with any question, feedback or whatever you might have. You should be familiar with C#, though.
« Last Edit: June 17, 2013, 03:08:29 AM by Faark »
When will your gnomes start flooding your kingdom with legendaries? - Check out my mods! - Want to create mods yourself? Here is a early draft of a modding tutorial. Just checking by here infrequently these days, but feel free to PM me!

RhoOphuichi

  • Jr. Member
  • **
  • Posts: 95
    • View Profile
Re: [Modding] Wanted: Testers for some mods
« Reply #2 on: March 09, 2013, 08:32:13 AM »
Wow! This could be great!

SmilingDemon

  • Newbie
  • *
  • Posts: 6
    • View Profile
Re: [Modding] Wanted: Testers for some mods
« Reply #3 on: March 11, 2013, 08:57:57 AM »
Ok! I am going to try it ! Sounds nice!

Faark

  • Sr. Member
  • ****
  • Posts: 466
    • View Profile
Re: [Modding] Wanted: Testers for some mods
« Reply #4 on: March 12, 2013, 03:57:33 PM »
Thanks guys.

Ive updated the Download-Link above. It now contains to more modifications:
- The Right-Click-Menu should be a little more user friendly, as suggested here
- The game does not "center enemy" anymore, when an enemy is spotted. Was suggested here

For now I only a quick look on it with Gnomoria 0.31, but it appears to work just fine with this latest version.
When will your gnomes start flooding your kingdom with legendaries? - Check out my mods! - Want to create mods yourself? Here is a early draft of a modding tutorial. Just checking by here infrequently these days, but feel free to PM me!

Faark

  • Sr. Member
  • ****
  • Posts: 466
    • View Profile
Re: [Modding] Faarks mini mods
« Reply #5 on: April 08, 2013, 05:47:56 AM »
Hey guys,

i have uploaded a new version. Beside some cleanup and optimizations the biggest addition are some new experimental mods. That means they are yet not even nearly full finished, but more some kind of tech demo. Feel free to try them and leave feedback.



Reselect latest action
This one isn't very intuitive at first but can save quite a few clicks. It adds an extra category "Rebuild" to the right click menu. This lists your latest chosen constructions including materials. For example if your were placing some solid dirt floors but want to cancel an misplaced one in between, you can then simply re-select the previous "build floor" command to continue ordering additional such floors and do not have to choose floor type and material again.
The list needs to become longer and more usable in general, through haven't yet planned on how to do this.


MaximizeWindowButton
Adds a "M" button to maximize the window to any of these supporting it. On-Click-Resizing ftw


NextCharButtonInCharWindow
Adds buttons to go to the next & prev gnome in the details window of a gnome. Though currently you have to move your mouse after using those buttons and before clicking it again, otherwise the UI will not have focus and the click will go "into the world"... haven't found a way to prevent this yet :(


ShowDevConsole (mod disable by default)
The game actually has parts of a small dev console in it. Not that much features, just about a dozen and most are not very useful. But it could be interesting for some of you, so this mod allows you to show/hide it via the right click menu.
Side note: A game speed of 10k isn't healthy for your gnomes ;)


JobBoardUI (screenshot)
By far my biggest and potentially most useful mod yet. It replaces the games usual process of finding jobs for gnomes.
  • The most important change in function is that priorities are now used across all kinds of jobs. That mean gnomes will prefer a stockpile job with priority 4 over for example an build wall command in priority 8.
  • The kingdom window now also contains a "Jobs" tab. There you can view the priorities of your jobs as well as change them via drag and drop.
This mod for now is more a tech demo and still work in progress. There are still a lot of issues and unfinished functions. For example:
  • Priorities from the new system are not saved. That means after loading a savegame all shops/areas will have the priorities set in their overviews. Also...
  • There are also some issues when syncing priorities from the new board back to the old priorities. Currently this doesn't work at all but will never be fully possible, since the new board can specify different priorities for different job-types (like harvest vs plant seeds). Changing a priority in a shops overview does ofc correctly updated this shop in this mods job list.
  • The details panel in the jobs tab is still empty (will contain stuff like default prios for such jobs or "goto") and the "job tree" misses a lot of common tree features, like expanding or collapsing
  • Also for now after any change to job priorities instead of updating the UI the window will simply close^^
Yes, especially the mod list isn't even close to perfection. But while the GUI is mostly useless it already allows you to use the good old priorities across job "types".


__


Click here for the download.

As usual, you install this mod by unpacking the content from within the downloaded file into your Gnomoria directory. Run the game with mods via starting GnomoriaModUI.exe.


Hope some of you will like it; Questions, Feedback, Help and Suggestions are always welcome.
When will your gnomes start flooding your kingdom with legendaries? - Check out my mods! - Want to create mods yourself? Here is a early draft of a modding tutorial. Just checking by here infrequently these days, but feel free to PM me!

kinsi

  • Hero Member
  • *****
  • Posts: 594
  • Don't touch the shiny!
    • View Profile
Re: [Modding] Faarks mini mods
« Reply #6 on: April 08, 2013, 11:19:54 AM »
Hi Faark, just tested your mod(s) with 0.8.34 (non-steam)

- Show FPS/Seed works
- Reselect latest action works
- Maximize Window works
- Showing the dev console works
- Next/Previous char sometimes just closes the character window
- Job board works (and closes after each drag and drop as you have described)

I encountered only one bug that seems to be related to your mod:
If i start a new game my gnomes will only idle and finally die of thirst.
No canges to starting professions, just ordered some tasks but they stay idle till the bitter end.
No mining, foraging, woodcutting, animal husbandry, farming and i guess building too, but without material to build...
Tested it with a savegame from 0.8.33 and had no problems at all!
You have questions or suggestions? Before posting use the search function! Click >here< !!!

CL4P-TP aka Claptrap: "Well done! Your ability to walk short distances without dying will be Handsome Jack's Downfall!"

Faark

  • Sr. Member
  • ****
  • Posts: 466
    • View Profile
Re: [Modding] Faarks mini mods
« Reply #7 on: April 08, 2013, 12:22:31 PM »
Damn, i totally forgot about new games...
The JobBoard contains a little fix for the idle gnome lag, since that bug really annoyed me this weekend, i was working on the responsible part of the game anyway and it just took a few minutes. Not pretty elegant, ofc, since RoboBob announced a fix for that anyway. And it obviously couldn't handle new games :/

Thanks for the hint, the mod should recover now in that such situations. The file above is updated.
When will your gnomes start flooding your kingdom with legendaries? - Check out my mods! - Want to create mods yourself? Here is a early draft of a modding tutorial. Just checking by here infrequently these days, but feel free to PM me!

antgraf

  • Newbie
  • *
  • Posts: 16
    • View Profile
Re: [Modding] Faarks mini mods
« Reply #8 on: April 12, 2013, 01:12:12 AM »
Wow, quite interesting method of overriding Gnomoria by method hook. I've tried to just run GnomanEmpire::Run() in my own process (separate thread, use Invoke to sync) but there are some initialization problems appear. Thanks for the idea.
Personally I tried to create something similar, a framework for 3rd party developers to extend Gnomoria. Looks like you have succeeded...

Faark

  • Sr. Member
  • ****
  • Posts: 466
    • View Profile
Re: [Modding] Faarks mini mods
« Reply #9 on: April 12, 2013, 02:41:59 PM »
Jop, this stuff had pretty much the same idea behind it. The only reason i have not yet really released the api is because i am not yet really satisfied with it and hope that there will be some breaking changes. But if you or anyone else here want to make a mod of Gnomoria just leave me a private message!
When will your gnomes start flooding your kingdom with legendaries? - Check out my mods! - Want to create mods yourself? Here is a early draft of a modding tutorial. Just checking by here infrequently these days, but feel free to PM me!

Woden

  • Sr. Member
  • ****
  • Posts: 391
    • View Profile
Re: [Modding] Faarks mini mods
« Reply #10 on: April 12, 2013, 05:51:32 PM »
Wow, quite interesting method of overriding Gnomoria by method hook. I've tried to just run GnomanEmpire::Run() in my own process (separate thread, use Invoke to sync) but there are some initialization problems appear. Thanks for the idea.

I had the same problem when I first started on my utility, but Faark helped walk me through it. You need to call GnomanEmpire's Initialize method... the problem is, it's private, so you need to use reflection to call it. If you want an example, check out the source code of {my utility}; it'll be under the MainWindow constructor.

Shodan

  • Full Member
  • ***
  • Posts: 157
    • View Profile
Re: [Modding] Faarks mini mods
« Reply #11 on: April 14, 2013, 06:44:03 AM »
Would it be possible to have config file for mods?
In cases where mods would need store data over sessions and not mess with the original safe file.
Maybe in the future?

Faark

  • Sr. Member
  • ****
  • Posts: 466
    • View Profile
Re: [Modding] Faarks mini mods
« Reply #12 on: April 15, 2013, 03:30:26 AM »
Yop, saving stuff is very much on top of my to-do-list, atm. But saving is not easy, since the saved game should run just fine regardless what mod you disable or play without the mod sys at all. There will always be a lot of stuff the mod has to do itself :(
When will your gnomes start flooding your kingdom with legendaries? - Check out my mods! - Want to create mods yourself? Here is a early draft of a modding tutorial. Just checking by here infrequently these days, but feel free to PM me!

Bardodle

  • Full Member
  • ***
  • Posts: 201
  • SURGEON OF DEATH
    • View Profile
Re: [Modding] Faarks mini mods
« Reply #13 on: April 17, 2013, 09:05:33 PM »
Oh yeah, Faark thank a lot for this awesome mod :D

I really like the feature on this mod specially the resize option.

Question:
Why my miner prioritize hauling than his mining job?

Request( only if your interested)
-Go main menu AKA exit without save

Faark

  • Sr. Member
  • ****
  • Posts: 466
    • View Profile
Re: [Modding] Faarks mini mods
« Reply #14 on: April 19, 2013, 03:33:40 AM »
Hi Bardodle,

do you have the mod "JobBoardUI" enabled? This makes the game consider priorities from all kind of jobs. So a stockpile with priority 1 handled before a workshop with priority 4. With this mod right click commands currently have a default priority of 2. So really make sure there is no priority 1 stockpile. You can check what jobs there are with what priorities at the Kingdoms window, "Jobs" tab. Or just disable this specific mod, if you do not like that behavior :)


Ive updated the mod package linked above.
- There now is a mod that adds an "exit (no save)" to the pause menu (was actually very easy)
- The maximize window button got a skin
- The Jobs list is slightly improved (doesn't close after reordering, few issues fixed)
When will your gnomes start flooding your kingdom with legendaries? - Check out my mods! - Want to create mods yourself? Here is a early draft of a modding tutorial. Just checking by here infrequently these days, but feel free to PM me!