RimWorld

RimWorld

1,961 ratings
Enable Oversized Weapons
3
3
2
2
   
Award
Favorite
Favorited
Unfavorite
Mod, 1.2, 1.3, 1.4, 1.5
File Size
Posted
Updated
53.203 KB
10 Jul, 2021 @ 12:22pm
19 Mar, 2024 @ 9:51am
10 Change Notes ( view )

Subscribe to download
Enable Oversized Weapons

Description
We did it!
Taking weapon drawSize into account is Vanilla Rimworld now.

What does this mod do now?
What is left of this mod is making the game take offSets into account when rendering carried equipment. Does nothing on it's own.
Maybe this will also be implemented in Vanilla Rimworld after the next DLC, who knows.
This mod is extremly lightweight as it literally only changes a single variable in the PawnRenderer.DrawEquipmentAiming function.

For Modders
The first 2 screenshots are an example on what you can do. All you need to do is set drawSize (optional) and/or offsets (also optional) in the graphicData xml node. Don't copy the dll into your mod, this will break the transpiler, because patching the same line in code doesn't work if the line gets replaced. Just add a dependency in your steam mod page. Loading order doesn't matter.

Why use this over JecsTools' Oversized Weapon? (Obsolete!)
- Better perfromance: This mod doesn't use extra comps. No comp list needs to be searched which would add up if modded weapons get alot of comps. JecsTools' Oversized Weapon searches every comp list of every drawn weapon every frame. Even if not all the weapons use JecsTools' Oversized Weapon, they still need to be searched. Imagine having a hundred rendered pawns with all their weapons drawn searched every single frame.

- Your mod doesn't break if you remove or forget to activate Enable Oversized Weapons: All you did was modify the already existing graphicData which vanilla Rimworld has, but ignores. There will be no errors. Worst case if you remove the mod: your weapons are now as tiny as vanilla Rimworld would render them. If a new Rimworld version would come (1.4 for example), you can even update your weapon mods without this mod being updated, because you are not depending on any code. This gives you the possibility to start updating from day one.

- Higher compability: Enable Oversized Weapons doesn't skip the vanilla Rimworld method. Other mods that use a Prefix or make a Transpiler will still get executed.

Example Size
Makes weapons bigger or smaller.
<drawSize>2.0</drawSize>
above 1 = bigger, below 1 = smaller
or
<drawSize>(2.0, 2.0)</drawSize>
If you want to stretch the weapon use different values.
first value = horizontal
second value = vertical

Example Offset
Offsets move the weapon in certain directions. For example you could move a sword more to the right when the pawn is facing right to position the handle exactly where the pawn's hand would be.

Every single offset is optional.
drawOffsetNorth: when the pawn looks up
drawOffsetEast when the pawn looks right
drawOffsetSouth when the pawn looks down
drawOffsetWest when the pawn looks left

offset direction values:
each offset has 3 values which determine in which direction the weapon gets moved
<drawOffsetNorth>(left/right, background/foreground, up/down)</drawOffsetNorth>
left < 0 < right
background < 0 < foreground
down < 0 < up

<drawOffsetEast>(1.0, 0.0, 1.0)</drawOffsetEast> would move the weapon a whole tile to the right and a whole tile up when the pawn looks right, like you can see in the screenshot. This is quite alot. You probably want to work with smaller numbers like -0.33 or +0.25

Keep in mind, that when a weapon lies on the ground, the drawOffsetNorth will get applied to the render position. This mod removes that from primary equipment, so the weapon is centered again (this can be turned off in the mod options). This is also done via a Harmony Transpiler and it only adjusts a single variable. Having it enabled should have close to none performance impact.

Compatibility
There should be no issues.
Loading order doesn't matter. (just somewhere after Harmony)
Safe to add or remove anytime.
Mods that skip DrawEquipmentAiming will also skip what this mod does.
Other transpilers that patch DrawEquipmentAiming should still all work without issues.
Other transpilers that patch Graphic.Print should still all work without issues.

Uses Harmony.
Github: https://github.com/splincore/Enable-Oversized-Weapons
Popular Discussions View All (4)
12
9 Aug, 2022 @ 10:37am
Oversived weapons that shouldnt be
Elth
1
2 Sep, 2021 @ 3:23pm
this mod not made for this version
PhiNiX
0
25 Dec, 2023 @ 3:15pm
This version is outdated.
Nightmare799
197 Comments
Carny Senpai  [author] 5 hours ago 
Good and bad news.

The good: This mod still functions in 1.6 without me having to change the code.

The bad: Rimworld now checks if a weapon has drawOffsets in its graphicData and instead of ignoring it like in 1.5 it now throws a config error. This is harmless but annoying. (this can be circumvented by setting "rotatable" to true in the weapon def, but i dont know what other technical impact this has)

The other bad news: Rimworld now uses drawSize when generating the button on the bottom of the screen when a pawn with a weapon is selected. This can make the weapons bigger than the button if the weapon is very large.

Neutral news: Weapons can now have equippedDistanceOffset. This will draw the weapon a certain distance from the pawn in the direction the pawn is aiming, but only when the pawn is actually attacking, not in idle.

I could update the mod now, but the changes in Rimworlds behaviour are annoying me and i am trying to find a solution.
AVNlover67 13 hours ago 
When is the update for this?
Carny Senpai  [author] 26 Jun @ 2:04am 
yes
Moz 25 Jun @ 6:38pm 
are you updating to 1.6?
Cat Burglar 22 Jun @ 4:40pm 
o7
AzoorFox 15 Jun @ 1:20pm 
UPDATE WHEN???????????????
katie kat 16 Nov, 2024 @ 8:42am 
now thats a big gun
odyocl2b 1 Jun, 2024 @ 3:49pm 
hello. I downloaded the mod and tried editing the xml file. I can't find the xml file, only the dll file. help me
Carny Senpai  [author] 13 May, 2024 @ 10:09am 
@Arnis would be nice to get more info about this. Imagine you go to an Uber, tell them something is broken with their car and then f*** off and proceed to tell other people to take care. Doesn't really help at all.
The Dutchman 12 May, 2024 @ 7:44am 
Obviously an incompatibility. But thanks for doing nothing to help diagnose it