Ludeon Forums

Ludeon Forums

  • August 05, 2021, 08:27:46 AM
  • Welcome, Guest
Please login or register.

Login with username, password and session length
Advanced search  
Pages: 1 2 3 [4] 5 6 7

Author Topic: [Tutorial] How to Make a RimWorld Mod, Step by Step  (Read 171565 times)

SpaceDorf

  • Transcendent
  • *****
  • Posts: 4083
  • Secretly Captain Obvious
    • View Profile
Re: [Tutorial] How to Make a RimWorld Mod, Step by Step
« Reply #45 on: July 16, 2017, 10:34:22 PM »

post to follow ..
Logged
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

Cayprol

  • Muffalo
  • *
  • Posts: 5
  • Refugee
    • View Profile
Re: [Tutorial] How to Make a RimWorld Mod, Step by Step
« Reply #46 on: July 24, 2017, 08:05:18 AM »

Great guide! totally, good for newbies like me.

btw, the example file still hasn't been fixed, that missing "/".

Also, for this guide particularly, I did all this on a Mac.
Just to try out how the recently ported VS works.
Didn't encounter any problem so far, I even used the built-in decompiler to inspect assembly.
Visual Studio for Mac requires Mono 5.0 and higher, so no .NET3.5.
« Last Edit: July 24, 2017, 08:06:50 AM by Cayprol »
Logged

D Mars

  • Muffalo
  • *
  • Posts: 2
  • Refugee
    • View Profile
Re: [Tutorial] How to Make a RimWorld Mod, Step by Step
« Reply #47 on: August 03, 2017, 05:59:31 PM »

Hey so I followed your guide, I'm able to spawn the Plague gun in game but it doesn't work when I try shooting another colonist. I downloaded all 3 files so I can visually compare them and everything seems to match up. I get this error on load though(http://imgur.com/a/T7X7i), any ideas on where I went wrong? Thanks!
« Last Edit: August 03, 2017, 06:02:19 PM by D Mars »
Logged

Wof

  • Muffalo
  • *
  • Posts: 2
  • Refugee
    • View Profile
Re: [Tutorial] How to Make a RimWorld Mod, Step by Step
« Reply #48 on: August 03, 2017, 08:36:42 PM »

Hey so I followed your guide, I'm able to spawn the Plague gun in game but it doesn't work when I try shooting another colonist. I downloaded all 3 files so I can visually compare them and everything seems to match up. I get this error on load though(http://imgur.com/a/T7X7i), any ideas on where I went wrong? Thanks!

I had the same issue. The problem was that the .dll wasn't created in my Assemblies folder but instead in a new folder inside the Source folder. I just moved it and it was fine.
Logged

D Mars

  • Muffalo
  • *
  • Posts: 2
  • Refugee
    • View Profile
Re: [Tutorial] How to Make a RimWorld Mod, Step by Step
« Reply #49 on: August 03, 2017, 10:03:54 PM »


I had the same issue. The problem was that the .dll wasn't created in my Assemblies folder but instead in a new folder inside the Source folder. I just moved it and it was fine.

This was it! Plague gun works now with no issues! Thanks bro you're the best!
Logged

Wof

  • Muffalo
  • *
  • Posts: 2
  • Refugee
    • View Profile
Re: [Tutorial] How to Make a RimWorld Mod, Step by Step
« Reply #50 on: August 03, 2017, 10:12:34 PM »

No problem! Glad I could help  :)
Logged

SpaceDorf

  • Transcendent
  • *****
  • Posts: 4083
  • Secretly Captain Obvious
    • View Profile
Re: [Tutorial] How to Make a RimWorld Mod, Step by Step
« Reply #51 on: August 06, 2017, 05:57:16 AM »

Thank you flying spaghetti monster for finally sending my to the right IDE

sometimes microsoft gets it right

it's fast, it's portable, it's beautiful ..
Logged
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

Eck

  • Muffalo
  • *
  • Posts: 3
  • Browncoat
    • View Profile
Re: [Tutorial] How to Make a RimWorld Mod, Step by Step
« Reply #52 on: August 06, 2017, 03:06:36 PM »

Awesome tutorial, but I think there are some unnecessary steps. You don't need to (and I don't think you should) include all the parent base items in your custom RangedWeapon_PlagueGun.xml file. Those entries will already included from the Core game files so the copied entries aren't necessary (and might cause conflicts). Basically skip step 11, and remove every ThingDef in the RangedWeapon_PlagueGun.xml file after the BASES comment.

I followed the tutorial through and got everything working even though I raised my eyebrow at the copy/pasted base classes. After that, I deleted all the base def entries, changed some other things like fire rate and range, and everything still worked.

@Tynan - Could you double check my post and make sure I'm giving good advice. I only just started messing with modding Rim World and even though I tested what I said, I wouldn't mind a sanity check. :)

- Eck
Logged

Spdskatr

  • Colonist
  • ***
  • Posts: 383
  • Practically lives in the Discord server
    • View Profile
Re: [Tutorial] How to Make a RimWorld Mod, Step by Step
« Reply #53 on: August 19, 2017, 04:19:24 AM »

Awesome tutorial, but I think there are some unnecessary steps. You don't need to (and I don't think you should) include all the parent base items in your custom RangedWeapon_PlagueGun.xml file. Those entries will already included from the Core game files so the copied entries aren't necessary (and might cause conflicts). Basically skip step 11, and remove every ThingDef in the RangedWeapon_PlagueGun.xml file after the BASES comment.

Always add the abstracts in. When I was developing my plastics mod (rip that mod) I had a weird conflict with Numbers (that I only discovered during casual play and probably wasn't the fault of the mod author) that meant the game wasn't recognizing the abstracts from other mod folders, causing errors like "ThingDef __ has null ThingClass". It disappeared only when I added the building and resource base abstracts.

The abstracts thing was supposedly meant to start inheriting from previous mods in A14, but I developed the mod in A16.

Moral of the story: Always add them in. You may get unexpected and obscure bugs.

P.S. If it works for you then you really don't need to read any of this. it's just a warning in case you encounter null ThingClass errors in the future :P
« Last Edit: August 19, 2017, 04:32:22 AM by Spdskatr »
Logged
My mods

If 666 is evil, does that make 25.8069758011 the root of all evil?

BinkyThePirate

  • Muffalo
  • *
  • Posts: 7
  • Refugee
    • View Profile
Re: [Tutorial] How to Make a RimWorld Mod, Step by Step
« Reply #54 on: August 21, 2017, 05:25:45 PM »

This is a very useful intro to modding basics, and for the most part I know enough xml and C# to get what's going on in it, but with the 'var plagueOnPawn' section I'm not really clear on what is happening, just retyping what's there in the tutorial without really understanding why. Could someone give a basic rundown of what's actually going on there?
Logged

Jibbles

  • Colonist
  • ***
  • Posts: 448
  • Refugee
    • View Profile
Re: [Tutorial] How to Make a RimWorld Mod, Step by Step
« Reply #55 on: August 22, 2017, 06:05:08 AM »

New to visual studios..and it's late.  Just don't hate me for asking. I sort of get stuck at step 18 and I want to make sure I'm doing this right.

He mentions going into the application tab.  Is "project options" the same thing?
http://i.imgur.com/dmwUfrw.png
This window is the only place I see where I can change stuff like the namespace, framework etc. 


Quote
20) Go to the Build tab in the project properties.

21) Change the output path to be RimWorld\Mods\PlagueGun\Assemblies
- All .dll files will go into this directory when we "build" our code library.

22) In that same window, click the Advanced... button.

23) Change Debugging information to none.
- This prevents a simple error that occurs when RimWorld doesn't know what to do with the debug .pdb files.

This is what makes me think I'm in the wrong place. I don't see an advanced button, or overlooking where I can change the debug information to none.
Logged

BinkyThePirate

  • Muffalo
  • *
  • Posts: 7
  • Refugee
    • View Profile
Re: [Tutorial] How to Make a RimWorld Mod, Step by Step
« Reply #56 on: August 22, 2017, 07:00:13 AM »

Mac layout of Visual Studio seems slightly different. For Windows, clicking on 'Build' from the menu tree on your left would bring up the Build properties tab, where you can set the options mentioned. Check under the 'Output' sub-menu, that might let you change the output path and give you the No Debugging Info option. But that's just a guess. Maybe someone with VS for Mac can offer more help. It's probably inside one of those sub-menus under Build, though.
Logged

janospalfi

  • Muffalo
  • *
  • Posts: 1
  • Refugee
    • View Profile
Re: [Tutorial] How to Make a RimWorld Mod, Step by Step
« Reply #57 on: August 22, 2017, 10:11:55 PM »

Thanks for the tutorial, easy to follow and actually goes into coding.  After putting it all together, I get the gun to spawn and everything works as intended, however, upon loading the mod I receive a bunch of XML errors:
XML error: Duplicate XML node name #text in this XML block: <ThingDef Name="BaseMakeableGun" ParentName="BaseGun" Abstract="True">
I've been through the xml file looking for a missing /
Tried removing the Bases
And haven't been able to figure out what the problem is
« Last Edit: August 22, 2017, 10:13:52 PM by janospalfi »
Logged

Jibbles

  • Colonist
  • ***
  • Posts: 448
  • Refugee
    • View Profile
Re: [Tutorial] How to Make a RimWorld Mod, Step by Step
« Reply #58 on: August 23, 2017, 02:11:00 AM »

Find it strange that there isn't a completed version to download so we can test and see how everything is supposed to look and work. Can someone share? I'm grateful for this tutorial but I'm not able to get it to work.

still missing the / in xml file.

I come across errors even though I've copied things word for word. Guess I'm doing something wrong when it comes building the project.

Could not find type named Plague.ThingDef_PlagueBullet from node
Could not find a type named Plague.Projectile_PlagueBullet
XML error: <AddHediffChance>0.05</AddHediffChance> doesn't correspond to any field in type ThingDef.
XML error: <HediffToAdd>Plague</HediffToAdd> doesn't correspond to any field in type ThingDef.
Config error in TST_Bullet_PlagueGun: TST_Bullet_PlagueGun has null thingClass.
Logged

Veridian

  • Muffalo
  • *
  • Posts: 1
  • Refugee
    • View Profile
Re: [Tutorial] How to Make a RimWorld Mod, Step by Step
« Reply #59 on: September 13, 2017, 11:45:37 AM »

Find it strange that there isn't a completed version to download so we can test and see how everything is supposed to look and work. Can someone share? I'm grateful for this tutorial but I'm not able to get it to work.

still missing the / in xml file.

I come across errors even though I've copied things word for word. Guess I'm doing something wrong when it comes building the project.

Could not find type named Plague.ThingDef_PlagueBullet from node
Could not find a type named Plague.Projectile_PlagueBullet
XML error: <AddHediffChance>0.05</AddHediffChance> doesn't correspond to any field in type ThingDef.
XML error: <HediffToAdd>Plague</HediffToAdd> doesn't correspond to any field in type ThingDef.
Config error in TST_Bullet_PlagueGun: TST_Bullet_PlagueGun has null thingClass.

Hey, I found the solution to this problem after running into it myself.

For whatever reason, this tutorial has the wrong information regarding the file hierarchy of the mods folder. You can see the correct hierarchy here: http://rimworldwiki.com/wiki/Modding_Tutorials/Mod_folder_structure

I would recommend downloading a mod that adds guns, looking over their file format, and then restructuring the plague gun folder to look like theirs. I did that, and it fixed the issue.

Unfortunately, now that the gun can be spawned in the game, it doesn't appear to be causing the plague. Even though I get the text telling me that it was a successful plague inflict, the pawn does not have the plague. Will look into it more.

Otherwise, this is a wonderful resource when getting into modding. But, if you are new to modding and are looking to use this guide, I have to recommend looking over the modding wiki a few times first. This step by step tutorial has a few bumps that will be really difficult to overcome unless you use the resources on the wiki.

Edit: So as it turns out, the gun does work! Due to how the plague works, the gun will inflict a 'hidden' plague on the victim. This plague will develop overtime until it reaches a threshold upon which it will notify you that that pawn has the plague! Alternatively, you can just keep shooting the victim, and assuming they don't die first, you'll eventually be notified that they have the plague. This is because the C# code adds the severity to a pawn who already has the plague rather than resetting the severity. Neat!
« Last Edit: September 13, 2017, 12:29:07 PM by Veridian »
Logged
Pages: 1 2 3 [4] 5 6 7