Help needed with VERY basics.

Started by Compo, March 16, 2017, 07:27:07 AM

Previous topic - Next topic

Compo

Hi

Ive never modded before. Ive checked the tutorial pages, and thats all good, but i have no idea how to get started?

I mean the first things i should do?
Do i need to make a new folder(s) somewhere?
Do i start a new colony? and play around from there?
Do i need to make a backup of anything? and do i need to place it somewhere special? I dont want to corrupt my game, or saves.

A general list of things in order, to help me get started (in layman terms), would be great.

Im looking at using xml, it looks simple enough lol.

Also will editing the core folder in one save, edit it in another save?
Then how do i go about saving the file? and putting it into my game?

Sorry for my impotence, i just dont want to screw this ace game up, and lose my current save games.

Thanks for any help  :)

skullywag

Have you read:

http://rimworldwiki.com/wiki/Modding

it pretty much tells you exactly what to do.
Skullywag modded to death.
I'd never met an iterator I liked....until Zhentar saved me.
Why Unity5, WHY do you forsake me?

RawCode


Compo

Thx guys. But I believe i can make a mod (still uncertain tho).
What im after is, how to go about it. Like some simple directions.
Once i know the path, then i can use the tutorials to make the mod..if you can understand what i mean? lol
E.G.(speculation)
1st- Make a new folder "Rimworld Mod" in such an such place.
2nd- Start a new colony, and open up dev mode.
3rd- Fiddle about with the code.
4th- Save game. Then find that save in folder "x", copy the core data and place it into the new "Rimworld Mod" folder. ?

Would this work?

I apologise for being a pain in the arse.

Ykara

Nope that wouldn't work, you can't mod RimWorld with save games. You basically just copy files from the core folder to a new one and edit the values or create new items for example.
I could go in detail, but I would recommend downloading an already finished mod and look at the files. Then combine this with the tutorial and you should be able to put together your first small mod without any problems.
Good luck!

jimthenoob

#5
Quote from: Compo on March 16, 2017, 12:57:27 PM
Thx guys. But I believe i can make a mod (still uncertain tho).
What im after is, how to go about it. Like some simple directions.
Once i know the path, then i can use the tutorials to make the mod..if you can understand what i mean? lol
E.G.(speculation)
1st- Make a new folder "Rimworld Mod" in such an such place.
2nd- Start a new colony, and open up dev mode.
3rd- Fiddle about with the code.
4th- Save game. Then find that save in folder "x", copy the core data and place it into the new "Rimworld Mod" folder. ?

Would this work?

I apologise for being a pain in the arse.

I'm pretty new to this my self, but i have dabbled in the XML and just learned to decompile(?) the main game to poke around.

A standard mode goes into the rim world "mods" folder on your hard drive. what I have been doing to fiddle around is this

go to the Rimworld folder in

*.*/steam/steamapps/common/rimwolrd.

located there is a folder "mods" located inside is the "core" mod folder. to start your own mod make a new folder in the /mods folder, name it what you like. this creates you mods folder that everything will be loaded from.


follow me?

next step is to lay your mod folder out. its needs a few of its own folders as follows.

/*your mod name*
     /About
     /Defs
     /textures


these 3 are needed from what i can tell, there is another option folder /assemblies that contains custom assembled dll code from what i can tell (still working on figuring that one out)

/About

this folder must contain an XML file with info about the mod, as well as a picture for the mod to display. I just copied the folder from the core mod and altered the XML file to reflect my mod name and description.

/Defs

requires all the XML files that will define your mods items and other behaviors. I have been emulating the core mod structure but with custom XML names. (ie. buildings go into the "ThingDefs_buildings" folder ect.)


/Textures

this folder is were your mod will go to look for textures. these paths are set in the XML data and this folder is the "root" (not sure if right term) folder for these. so in the XML you just leave it out and ad the rest of the path

example:


    <graphicData>
      <texPath>Things/chemlamp</texPath>
      <graphicClass>Graphic_Single</graphicClass>
      <drawRotated>false</drawRotated>
      <damageData>
        <rect>(0.35,0.35,0.3,0.4)</rect>
      </damageData>
    </graphicData>


this chunk is a items graphic data. the <texpath> points tword my mods texture/things folder (note how we did not need to type in texture/things) the last part, the "/chemlamp" points to the name of a png image file in the "/things" folder.




to start modding what i have been doing is going into the core folder, and coping some of the XML defs i wish to use as code examples. just copy and pasting code blocks around to see what does what. just make sure not to use the same def names as  the vanilla items unless you want to overwrite them when your mod loads.

if you need more info on the XML structure i would be happy to do my best to help. its part of the learning process to teach others :P

Compo

Quote from: jimthenoob on March 16, 2017, 01:24:43 PM

I'm pretty new to this my self, but i have dabbled in the XML and just learned to decompile(?) the main game to poke around.

A standard mode goes into the rim world "mods" folder on your hard drive. what I have been doing to fiddle around is this

go to the Rimworld folder in

*.*/steam/steamapps/common/rimwolrd.

located there is a folder "mods" located inside is the "core" mod folder. to start your own mod make a new folder in the /mods folder, name it what you like. this creates you mods folder that everything will be loaded from.


follow me?

next step is to lay your mod folder out. its needs a few of its own folders as follows.

/*your mod name*
     /About
     /Defs
     /textures


these 3 are needed from what i can tell, there is another option folder /assemblies that contains custom assembled dll code from what i can tell (still working on figuring that one out)

/About

this folder must contain an XML file with info about the mod, as well as a picture for the mod to display. I just copied the folder from the core mod and altered the XML file to reflect my mod name and description.

/Defs

requires all the XML files that will define your mods items and other behaviors. I have been emulating the core mod structure but with custom XML names. (ie. buildings go into the "ThingDefs_buildings" folder ect.)


/Textures

this folder is were your mod will go to look for textures. these paths are set in the XML data and this folder is the "root" (not sure if right term) folder for these. so in the XML you just leave it out and ad the rest of the path

example:


    <graphicData>
      <texPath>Things/chemlamp</texPath>
      <graphicClass>Graphic_Single</graphicClass>
      <drawRotated>false</drawRotated>
      <damageData>
        <rect>(0.35,0.35,0.3,0.4)</rect>
      </damageData>
    </graphicData>


this chunk is a items graphic data. the <texpath> points tword my mods texture/things folder (note how we did not need to type in texture/things) the last part, the "/chemlamp" points to the name of a png image file in the "/things" folder.




to start modding what i have been doing is going into the core folder, and coping some of the XML defs i wish to use as code examples. just copy and pasting code blocks around to see what does what. just make sure not to use the same def names as  the vanilla items unless you want to overwrite them when your mod loads.

if you need more info on the XML structure i would be happy to do my best to help. its part of the learning process to teach others :P

Ah mate, your a star! Thats more of what i was looking for thank you!
One question. So when you make a mod, do you only need to add the bits you want changed? Meaning will it overwrite the core folder?

Quote from: Ykara on March 16, 2017, 01:10:31 PM
Nope that wouldn't work, you can't mod RimWorld with save games. You basically just copy files from the core folder to a new one and edit the values or create new items for example.
I could go in detail, but I would recommend downloading an already finished mod and look at the files. Then combine this with the tutorial and you should be able to put together your first small mod without any problems.
Good luck!
Thanks. I am starting to see the way better now. Thats a great idea about looking at a mod (honestly never thought about that).
Im going to start small, maybe a new storyteller or something (or is that big?).

Thanks again chaps, much appreciated!
I'll probably be posting here again soon  ::)

dburgdorf

Quote from: Compo on March 17, 2017, 08:36:29 AMIm going to start small, maybe a new storyteller or something (or is that big?).

I'd like to throw in two quick comments.

First, a storyteller might not be the best place to start. The storyteller definition file isn't necessarily complex, but as I discovered when I put together my own storyteller mod, it's not very well documented. I had a hell of a time trying to find any explanation of what a lot of the elements did, and figuring out what effect various changes were likely to have involved a lot more guesswork than I would have preferred.

Second, more generally, you might want to reverse your approach. Trying to figure out how to create a mod before you even know what mod you'd like to make isn't "wrong" in any sense, of course, but it seems likely to lead to frustration. (At least it would for me.) You might be better off taking a step back and just playing the game until you find something specific that you'd like to add or change. Then find mods that do something similar, and see how they work, to figure out how to accomplish your goal.

"How do I make a mod?" is a very large question, and the answer includes a lot of information that may or may not be relevant to whatever ends up being your specific goal. "How do I make a mod to do X?" is a much smaller question, and probably a better one to start with.  ;)
- Rainbeau Flambe (aka Darryl Burgdorf) -
Old. Short. Grumpy. Bearded. "Yeah, I'm a dorf."



Buy me a Dr Pepper?

jimthenoob

#8


from what I can tell it works like this for overwriting things. any new defs you make in your mod folder will be loaded into the game with all the core defs as long as they have unique def names.

the game loads defs in order. so core first, then what ever else is in your mod list. It follows that defs with the same <defname> fields will simply load over each other. So if i make a new Heater, but i want it to replace the core Heater, i would write a new def for that heats with the exact same def name, so when it loads, the game discards the previous def of the same name in memory.  (in this case core)

for example this block of code will load a resource into the system called RTG:

  <ThingDef ParentName="ResourceBase">
    <defName>RTG</defName>
    <label>RTG Module</label>
    <description>A relitivly simple device, Produces a small ammount of power passivly via the decay of refined uranium.</description>
    <graphicData>
      <texPath>Things/RTG</texPath>
      <graphicClass>Graphic_Single</graphicClass>
    </graphicData>
    <resourceReadoutPriority>First</resourceReadoutPriority>
    <soundInteract>Silver_Drop</soundInteract>
    <soundDrop>Silver_Drop</soundDrop>
    <useHitPoints>false</useHitPoints>
    <resourceReadoutAlwaysShow>true</resourceReadoutAlwaysShow>
    <stackLimit>6</stackLimit>
<statBases>
      <MarketValue>1</MarketValue>
      <Mass>10</Mass>
      <SharpDamageMultiplier>0.5</SharpDamageMultiplier>
      <BluntDamageMultiplier>1.1</BluntDamageMultiplier>
    </statBases>
    <thingCategories>
      <li>Manufactured</li>
    </thingCategories>
    <smallVolume>true</smallVolume>
    <deepCommonality>1</deepCommonality>

  </ThingDef>


if i changed this codes <defname> to "Chemfuel" for example (a core def name) it should overwrite it in game with my new information, replacing all the chem fuel barrels with this new code. i haven't started testing anything with more then one mod loaded while i code, but i imagine this could cause some incompatibility if you mess with too much core stuff.

Compo

@dburgdorf
Thx buddy. Any advice is great. I do however have a bigger mod in mind, id imagine it most probably is way out of my range for a long time yet.
Thx again for the heads-up :)
I had a think-tank with a mate last night, and came up with some silly ideas, including chicken cannon/mortar lol
P.S. Is there a way to multi quote here (forum)?

@jimthenoob
Greatstuff! Im gonna start playing about today. Thx again, youve been a massive help bud :)

Granitecosmos

Quote from: Compo on March 18, 2017, 03:45:19 AM
@dburgdorf
Thx buddy. Any advice is great. I do however have a bigger mod in mind, id imagine it most probably is way out of my range for a long time yet.
Thx again for the heads-up :)
I had a think-tank with a mate last night, and came up with some silly ideas, including chicken cannon/mortar lol
P.S. Is there a way to multi quote here (forum)?

@jimthenoob
Greatstuff! Im gonna start playing about today. Thx again, youve been a massive help bud :)

When you write your reply and you scroll down to see others' replies, on the right side you'll see an Insert Quote button. You can use those as many times as you like. You can also edit the comments if you want to, or outright change them to something entirely different, for example:
Quote from: dburgdorf on March 17, 2017, 10:21:34 AM
Sometimes, when my Dorfs are exceptionally stupid again, I wonder what exactly the [INTELLIGENT]-tag does.
It was inevitable.

You should also take a look at this for all your formatting needs.

As for basics, like the others said, grab Notepad++ and start opening the xml files in Core/Defs to see what does what. XML is easy to understand so the more you stare at the code, the more you'll understand it. Trust me, that's how I first got into xml editing 10 years ago.
First you should just edit some stat values and see how it affects the game. You can edit Core files if you want but make sure you copy-paste the original Core folder somewhere safe as backup. Once you feel you're getting the hang of it you can start adding new stuff based on existing ones, like a new Pants or something.

You can also download other mods and see how they do their things. My mods are all xml mods, feel free to take a look at the files.

Compo

Thx Granitecosmos :)

I actually was looking at your modlist the other day, the way youve presented them is really cool..with great humour haha.
As for my modding future, im kind of getting the basics now. Ive actually added a gun, and (although it took ALL day) finally figured out to add the image.
Funny thing is..i was going from pillar to post, trying to get the image in, and finally cracked it by going back to jim's first post in this thread, which of course i thought id followed to-a-tee, but hadnt :p