Shield Belt Mark 2 - Please Help

Started by ScarletFromSteam, February 19, 2019, 05:08:45 AM

Previous topic - Next topic

ScarletFromSteam

I've been digging through the Apparel_Belts.xml file and the ResearchProjects_3_Microelectronics.xml files for all the values of the Shield Belt.

Though the specific flag I am looking for is what tells the Shield Belt to PREVENT ITS wearer from firing a gun while having this equipped.

Because what I would want to do is create one extra, sequential tech research for an improved "Shield Generator" that functions more like in conventional sci-fi (such as Star Wars and Halo), that actually just lets you use a gun with the shield.

So, if anyone can tell me what variable I have to flip to make a "Shield Belt Mark 2", please help me. Thank you.

I also tried looking in the folder ThingsDef > Weapons, comparing the Ranged and Melee XML documents to see if anything jumped out at me...nothing.

And as a secondary objective, I tried to add a new trait to the TraitsDef XML file...almost exactly like one that already existed, but with a different name, description, and slightly tweaked stat offsets. What happened was that the game refused to even work with that entire TraitsDef file. So, if I can have some help learning how to fix this and add my own, that would be great.

For maximum exposure (and because the pinned board on Steam told me specifically to come to this forum), this is a repeat of my question posed here:
https://steamcommunity.com/app/294100/discussions/0/3658515990059050960/

P.S. I read through the guide here https://ludeon.com/forums/index.php?topic=33219.0 and I was sincerely hoping that adding something that's almost copy-pasted from already-existing resources but with one or two stat changes and a flipped flag wouldn't be AS involved as this particular forum post would lead me to believe!

Kirby23590

I think that this Requires some knowledge of C# for coding it...

It has this thing <thingClass>ShieldBelt</thingClass> that i believe that you're looking for?

Here is this Tutorial from the Rimworld wiki to Decompile the source code ( I would recommend ILSpy ) and This for making a Custom dll for making a new shield belt allowing the user to fire their weapons while wielding shield belts.

I hope this helps...

One "happy family" in the rims...
Custom font made by Marnador.



LWM

I *think* what you would have to do is create a derived class from SheildBelt, make that your thingClass, and change (override) AllowVerbCast to just return true?

But that may miss some things, and would require (relatively straightforward, one hopes) C#.

And good luck to your colonists when 5 enemy snipers with shields show up ><

--LWM

Kirby23590

#3
Quote from: LWM on February 22, 2019, 12:20:07 PM
And good luck to your colonists when 5 enemy snipers with shields show up ><
--LWM

Well to that when 5 Snipers with Sniper Rifles mostly show up in the colony's doorsteps,
I say we throw away our guns and beat them to a pulp with our Melee Weapons and release the hounds on them...
Just don't forget getting your Shield Belts on your brawlers so they couldn't go for no Instakills or headshots on your guys... :)

But back to topic,

You to have to change your thingclass in your custom dll's code name or something like that,

i may be no expert and an utter beginner in coding C# but i think to has to be like this Mydll.NewShieldBelt in the thingClass for it to work.

Just replace mydll with your name of your dll file and NewShieldBelt with the public class you named it...

Just make sure your dll file is in the Assemblies folder, if not make a new folder for it and put it there. ScarletFromSteam! ;)

One "happy family" in the rims...
Custom font made by Marnador.



Mehni

Namespace.Class, not dllname.class

otherwise valid advice.