Ludeon Forums

Ludeon Forums

  • October 16, 2018, 12:33:14 PM
  • Welcome, Guest
Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: [A17] Moddable (Tool for Modders)  (Read 2012 times)

CannibarRechter

  • Colonist
  • ***
  • Posts: 784
  • Dericious
    • View Profile
[A17] Moddable (Tool for Modders)
« on: September 09, 2017, 09:16:19 AM »

This tool/mod has one very simple purpose:

It allows previously unmoddable elements of RimworldI to be modded. This normally requires C#. This mod makes it UI modificiation possible for modders just using XML.

This mod overrides textures, materials, and Graphics that are bound inside the rimworld code to readonly static data with datataken from the mod directories. It has only been lightly tested at this point. FYI.

The defs file explains in its comments how to use it. You only need to know XML.

Additional items being supported at this time also include:
- Timeouts to force exit from raid map
- Timeouts to undraft
- Option to disable forced slowdown when raided

This mod is taking requests for additional overriding of core hard-coded values.

The download is here
« Last Edit: October 01, 2017, 11:23:26 AM by CannibarRechter »
Logged
CR All Mods and Tools Download Link
CR Total Texture Overhaul : Gives RimWorld a Natural Feel
CR Moddable: make RimWorld more moddable.
CR CompFX: display dynamic effects over RimWorld objects

SpaceDorf

  • Transcendent
  • *****
  • Posts: 4043
  • Secretly Captain Obvious
    • View Profile
Re: [A17] Moddable (Tool for Modders)
« Reply #1 on: September 26, 2017, 10:54:51 AM »

17 days since release and not a single person has commented on how awesomen thist is ?

Rimworlders, you should be ashamed of yourselves. I know I am.
Logged
Maxim 1   : Pillage, then burn
Maxim 37 : There is no overkill. There is only open fire and reload.
Rule 34 of Rimworld :There is a mod for that.
Avatar Made by Chickenplucker

CannibarRechter

  • Colonist
  • ***
  • Posts: 784
  • Dericious
    • View Profile
Re: [A17] Moddable (Tool for Modders)
« Reply #2 on: September 26, 2017, 11:10:50 AM »

Heheh, if you like this, wait until you see CompFXOverlay. It enables all sorts of things like flashing lights, twirling props, animations, flickers, balloons, and other FX to be overlayed on a Thing. All the overlays are working right now, but to be complete, they need to A) rotate their relative position when the thing rotates, and B) have triggers, like Thing has power. I'm working on those latter two right now.

This is part of a high detail texture (photo-real) overhaul I'm performing on the game (which is also almost done). Obviously, I'm making use of Moddable as I go. In the texture overhaul, all the things that modders couldn't touch before, including UI commands, icons, motes, etc: they're patched. That means the UI overhaul is comprehensive.

Only thing I have found so far that's actually impossible is the splash screen. Can't do that, because mods are loaded after it is (technically we could patch the assets file, or drop a different DLL over Assembly.dll, but that seems intractably invasive).
Logged
CR All Mods and Tools Download Link
CR Total Texture Overhaul : Gives RimWorld a Natural Feel
CR Moddable: make RimWorld more moddable.
CR CompFX: display dynamic effects over RimWorld objects

maculator

  • Colonist
  • ***
  • Posts: 192
  • Firefighter
    • View Profile
Re: [A17] Moddable (Tool for Modders)
« Reply #3 on: September 26, 2017, 11:26:51 AM »

I have no idea about xml or anything, but I saw the word "balloons"! And I guess something  that grants people easier access to the games files is always a good thing. Hope to see a balloons mod soon.
Logged

swefan

  • Drifter
  • **
  • Posts: 48
  • Refugee
    • View Profile
Re: [A17] Moddable (Tool for Modders)
« Reply #4 on: September 29, 2017, 10:20:33 AM »

Heheh, if you like this, wait until you see CompFXOverlay. It enables all sorts of things like flashing lights, twirling props, animations, flickers, balloons, and other FX to be overlayed on a Thing. All the overlays are working right now, but to be complete, they need to A) rotate their relative position when the thing rotates, and B) have triggers, like Thing has power. I'm working on those latter two right now.

This is part of a high detail texture (photo-real) overhaul I'm performing on the game (which is also almost done). Obviously, I'm making use of Moddable as I go. In the texture overhaul, all the things that modders couldn't touch before, including UI commands, icons, motes, etc: they're patched. That means the UI overhaul is comprehensive.

Only thing I have found so far that's actually impossible is the splash screen. Can't do that, because mods are loaded after it is (technically we could patch the assets file, or drop a different DLL over Assembly.dll, but that seems intractably invasive).

Thanks for these resource, thanks to you I finally succeeded in replacing the fire textures for the campfire, but how did you say "All the overlays are working right now" how can you modify them? fire animation "fireoverlay" is made of 3 images the problem is that they are used in different coordinates, and if we increase "firesize" this offset of the position is even more noticeable, how can I adjust this offset?

CannibarRechter

  • Colonist
  • ***
  • Posts: 784
  • Dericious
    • View Profile
Re: [A17] Moddable (Tool for Modders)
« Reply #5 on: September 29, 2017, 11:36:24 AM »

> and if we increase "firesize" this offset of the position is even more noticeable, how can I adjust this offset?

For your individual frames, you can change them to whatever you like. To change the offset of the graphic as it is displayed over the object, or to resize it, use stanzas like the below (which is just the ordinary game patch system, does not require Moddable):

Code: [Select]
<Operation Class="PatchOperationReplace">
<xpath>*/ThingDef[defName = "Campfire"]/comps/li[@Class="CompProperties_FireOverlay"]/fireSize</xpath>
<value><fireSize>1.3</fireSize></value>
</Operation>
<Operation Class="PatchOperationAdd">
<xpath>*/ThingDef[defName = "Campfire"]/comps/li[@Class = "CompProperties_FireOverlay"]</xpath>
<value><offset>(0,0,0.4)</offset></value>
</Operation>

What is shown for offset is x,y,z.

Don't mess around with y, that's the direction that is towards or away from you, the viewer. x is left-right. y is up-down. I believe that the unit size of the movement is 1, but spans from -0.5 to 0.5 for an objects of size 1. If the object is size 2, the movement double from -1 to 1.

« Last Edit: September 29, 2017, 11:41:42 AM by CannibarRechter »
Logged
CR All Mods and Tools Download Link
CR Total Texture Overhaul : Gives RimWorld a Natural Feel
CR Moddable: make RimWorld more moddable.
CR CompFX: display dynamic effects over RimWorld objects

swefan

  • Drifter
  • **
  • Posts: 48
  • Refugee
    • View Profile
Re: [A17] Moddable (Tool for Modders)
« Reply #6 on: September 29, 2017, 12:17:28 PM »

> and if we increase "firesize" this offset of the position is even more noticeable, how can I adjust this offset?

For your individual frames, you can change them to whatever you like. To change the offset of the graphic as it is displayed over the object, or to resize it, use stanzas like the below (which is just the ordinary game patch system, does not require Moddable):

Code: [Select]
<Operation Class="PatchOperationReplace">
<xpath>*/ThingDef[defName = "Campfire"]/comps/li[@Class="CompProperties_FireOverlay"]/fireSize</xpath>
<value><fireSize>1.3</fireSize></value>
</Operation>
<Operation Class="PatchOperationAdd">
<xpath>*/ThingDef[defName = "Campfire"]/comps/li[@Class = "CompProperties_FireOverlay"]</xpath>
<value><offset>(0,0,0.4)</offset></value>
</Operation>

What is shown for offset is x,y,z.

Don't mess around with y, that's the direction that is towards or away from you, the viewer. x is left-right. y is up-down. I believe that the unit size of the movement is 1, but spans from -0.5 to 0.5 for an objects of size 1. If the object is size 2, the movement double from -1 to 1.

Thanks for your answer, I will try to do it.
The problem is that each frame has a different offset, for example

fireTextureA
<Value> <offset> (0.2,0.1,0.4) </ offset> </ value>
fireTextureB
<Value> <offset> (0.7,0.5,0.4) </ offset> </ value>
fireTextureC
<Value> <offset> (1,0.3,0.4) </ offset> </ value>

how should I write this in xml?  :)

CannibarRechter

  • Colonist
  • ***
  • Posts: 784
  • Dericious
    • View Profile
Re: [A17] Moddable (Tool for Modders)
« Reply #7 on: September 29, 2017, 12:18:48 PM »

> The problem is that each frame has a different offset, for example

You can't.

But what you can do is open up the frames in GIMP or some other editor, and move the graphic around. I.e., make your own net new frames, and create your own net new animation.
Logged
CR All Mods and Tools Download Link
CR Total Texture Overhaul : Gives RimWorld a Natural Feel
CR Moddable: make RimWorld more moddable.
CR CompFX: display dynamic effects over RimWorld objects

swefan

  • Drifter
  • **
  • Posts: 48
  • Refugee
    • View Profile
Re: [A17] Moddable (Tool for Modders)
« Reply #8 on: September 29, 2017, 12:27:18 PM »

> The problem is that each frame has a different offset, for example

You can't.

But what you can do is open up the frames in GIMP or some other editor, and move the graphic around. I.e., make your own net new frames, and create your own net new animation.
That's what I had thought to do as an alternative solution, I'll record the animation and then adapt the 3 textures, thanks again  ;)

CannibarRechter

  • Colonist
  • ***
  • Posts: 784
  • Dericious
    • View Profile
Re: [A17] Moddable (Tool for Modders)
« Reply #9 on: October 01, 2017, 11:23:51 AM »

Updated to include an enabler for shutting down the forced slowdown time when raided.
Logged
CR All Mods and Tools Download Link
CR Total Texture Overhaul : Gives RimWorld a Natural Feel
CR Moddable: make RimWorld more moddable.
CR CompFX: display dynamic effects over RimWorld objects

CrazyMalk

  • Drifter
  • **
  • Posts: 67
  • Refugee
    • View Profile
Re: [A17] Moddable (Tool for Modders)
« Reply #10 on: October 31, 2017, 02:25:24 PM »

Are you accepting suggestions? It would be nice to have a "tameable" tag. If you set it to true, the pawn would be tameable, and if you set it to false, the pawn would not be tameable. It would be good if you wanted to create an animal that shoots projectiles using a mechanoid and make it tameable, or making a non-tameable creature.
This mod should be included in HugsLib lol
Logged

Kori

  • Colonist
  • ***
  • Posts: 452
  • Refugee
    • View Profile
Re: [A17] Moddable (Tool for Modders)
« Reply #11 on: February 07, 2018, 10:10:20 AM »

This is just what I was looking for! Do you think you could upgrade this handy tool for B18, please? :)

Also may I request an additional feature?
A setting to override the hardcoded sell/ buy price modifiers (x0.5 and x1.5) as well as the minimum buying price (0.5 silver).
The latter would be great for CE when buying ammo, where this minimum buying price ruins the balance for cheaper rounds at the moment.
Logged