RimWorld

RimWorld

EdB Prepare Carefully
Is there a way to Hook my Mod into YOUR Mod somehow?
From a comment in my mod:


"I'm enjoying the mod! I would like it a little better if it worked with prepare carefully? There are certain starting items I like giving myself such as an animal companion or breeding pair. However, you scenario doesn't allow for any customization. "

I've added some Lightsabers to the game, but I'm not sure how it's keeping him from having an animal companion? Is there something I can tweak in the scenario to allow him to have the option of a companion or breeding pair like he asked? Is this is even related to your mod at all somehow, lol. Probably he just wants me to add some pets to the scenario. But it's meant to be just a single Jedi with his saber and sparse supplies, its not suppose to be easy, but the early combat isn't a problem due to that.

If it is possible to make it optional using your mod, I would like to do that, so people can decide to go hardcore without it if they wanted, and really only would have the option to use the pets if this mod was in play.

Anywho, I downloaded the mod to see if there was some variables I could hook into or something, but due to the DLL nature of the bulk of the work it does, I thought I would check here first and see if there was anything you could help me with here.

(Mod located here if you need to take a look )
https://steamhost.cn/steamcommunity_com/sharedfiles/filedetails/?id=747240493
Last edited by PH4T3 <*.*>; 2 Sep, 2016 @ 8:56pm
< >
Showing 1-5 of 5 comments
edbmods  [developer] 3 Sep, 2016 @ 10:24am 
I'm seeing a couple of things here. It does look like you have a misconfiguration in your lightsaber ThingDefs. Try turning on development mode (Main Menu -> Options -> check the Development Mode option) and starting a game. You'll see what I mean. When you start a game, you'll get this error:

MakeThing error: MeleeWeapon_WhiteLightsaber is madeFromStuff but stuff=null. Assigning default.

This means that you're defining the lightsabers as something that's made from different materials (steel, silver, etc), but then in the scenario, you're not saying which material your white lightsaber should be made from.

It turns out that this triggers a pretty bad bug in Prepare Carefully where the mod gets stuck when trying to spawn items into the map--it just hangs there forever until you kill it. I'm going to need to fix that.

I'm not 100% sure what you're trying to do with your mod, so I can't say what the right advice is, but you've got a couple of options:

1) You could change the lightsabers to not be "made from stuff". There are pluses and minuses with this approach. You would need to rethink how you've set up a lot of your definitions related to crafting lightsabers in the game if you decided to go that way.

2) Alternatively, in your scenario, you need to choose a material for the starting white lightsaber by doing this:

<li Class="ScenPart_StartingThing_Defined">
<def>StartingThing_Defined</def>
<thingDef>MeleeWeapon_WhiteLightsaber</thingDef>
<stuff>Steel</stuff>
</li>

In any case, thanks for bringing this up. It definitely revealed a bug in my mod that I will need to fix. Good luck with the mod--it's fun!
PH4T3 <*.*> 3 Sep, 2016 @ 1:17pm 
Thanks for the quick response! That is very interesting that my bug helped you find a bug, haha. Typical me style, lol. Well, I understand what is going on here from your explanation. I think what happened was at one point I was allowing other materials to be used and then decided to switch to steel only as I was slightly confused about how to tell it the difference between required materials and optional materials. If I added like gold it wanted gold AND steel for some reason, so I just simplied it to go back later and upgrade it and I must of missed something when I was setting it back to just steel.

My tests found that gold was a bad idea to use anyways BUT someone MIGHT want to do it despite how bad gold is for a sword.

Thanks for the code nugget there, I understand what its saying. Now, you are setting it so all white lightsabers default as steel correct?

I think I will give this a shot, but I know this is beyond the scope of what would be asking for help with mod compatability, but do you happen to know how to tell it the difference between manditory and optional materials?

I know the first section you tell it what types, and the 2nd section you sort of do it again and tell it the quantity. Does that make sense? That is how I understand it works, but I'm not sure how I would do this. Oh, is it something more like instead of me saying <Steel></Steel> it would be like <Metallic></Metallic> as really I think all the metals would be nice to use if they player wants to use them. And MAYBE uranium too, and again, all these things sound like mostly bad ideas since their combat properties are lower than steel or plasteel. But just adds some variety.

Anywho thanks for the info, going to go test that now. And will report back my findings. And if you can help me with the other question and don't mind, would appreciate that as well. As you probably know much of the info for modding is somewhat hard to find online, and what is there is limited in scope. Thanks again, and have a good weekend!

:bag:
Last edited by PH4T3 <*.*>; 3 Sep, 2016 @ 1:24pm
PH4T3 <*.*> 3 Sep, 2016 @ 1:44pm 
UPDATE - I think that did the trick. I see why that could happen, I should of had Metallic somewhere in the default of all lightsabers or something like that. But I think your suggestion worked. Thanks :0 Also if you can shed light on my other question that would be great, if not no worries.
edbmods  [developer] 3 Sep, 2016 @ 2:07pm 
I've never modded items, so I don't really know how that works. If you want to look at making the items so that they aren't "made from stuff", you can take a look at Core/Defs/ThingDefs_Misc/Weapons_Guns.xml and look at how the guns are set up. Look at "BaseMakeableGun" and "Gun_Pistol." You'll see that the guns all have a <costList> defined that looks like the list of materials needed to craft them--but I'm not sure.
Last edited by edbmods; 3 Sep, 2016 @ 2:08pm
PH4T3 <*.*> 4 Sep, 2016 @ 10:58am 
Good thinking, normally that is what I do is check out Core when I am not sure about something. Not sure why I didn't think about that this time, haha. Thanks again.
< >
Showing 1-5 of 5 comments
Per page: 1530 50