RimWorld

RimWorld

1,780 ratings
Enable Oversized Weapons
3
3
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 @ 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
190 Comments
odyocl2b 1 Jun @ 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 @ 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 @ 7:44am 
Obviously an incompatibility. But thanks for doing nothing to help diagnose it
Arnis 10 May @ 6:54pm 
caused a lot of lag in my game when a kid was holding a weapon, could be incompatibility so take care yall
Solarius Scorch 27 Apr @ 4:10am 
Thank you! <3
Carny Senpai  [author] 19 Mar @ 9:52am 
Updated for 1.5
Carny Senpai  [author] 30 Nov, 2023 @ 10:04am 
@linnea101011 There is no functionality that only works while aiming in this mod. This mod allows you to change the weapon position for each of the 4 directions the pawns can look at. Usually pawns always look south when drafted and only change the direction they look at for aiming and while walking. You can rotate the weapon with equipmentAngleOffset (or something like that) in the weapon xml, but that is vanilla.
linnea101011 30 Nov, 2023 @ 6:27am 
Is there any way with this mod to adjust the weapon position while aiming? It's a bit janky with the mod I'm messing with.
TheEpicTroll 16 Aug, 2023 @ 10:02pm 
my dream of creating the perfect african warlord in rimworld can now be realized
PeterMX 15 Jun, 2023 @ 12:33pm 
"Oi mate, can I get a blast of firepowder?"
"Only a minuscule burst, my friend."
*whips out a pair of outrageously gigantic shooters, ridiculously exaggerated for the occasion*