[A17] Moddable (Tool for Modders)

Started by CannibarRechter, September 09, 2017, 09:16:19 AM

Previous topic - Next topic

CannibarRechter

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
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

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.
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

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).
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

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.

swefan

Quote from: CannibarRechter 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).

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

#5
> 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):


<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.

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

Quote from: CannibarRechter 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):


<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

> 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.
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

Quote from: CannibarRechter 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.
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

Updated to include an enabler for shutting down the forced slowdown time when raided.
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

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

Kori

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.

Lady Wolf

#12
Super thread neco, I know, but given I want to use this tool I was wondering if it was ever updated?