Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Messages - Duncan

#31
Any word on alpha 9 conversion? I am a big fan of this mod and it lack in A9 is felt acutely.
#32
Outdated / Re: [MOD] (Alpha 7) Neolithic Mod (v.0.96b)
December 11, 2014, 10:34:37 PM
Quote from: ItchyFlea on December 10, 2014, 05:59:24 PM
large problem: The game generates ruins made of the new metals, including bronze.

I an look into this in the code if you want. I am away from my usual machine for the next two months though so I cant give a reliable eta.
#33
Unfinished / Re: [Project] (Alpha ?) Neolithic Mod
October 05, 2014, 08:37:30 AM
Good to see some progress. I still feel like weapons are not the best solution though as I feel like a pawn should be able to carry an axe and still fight with a bow, but I think it is probably best to go ahead with what you are doing and refactor it later. As Tynan says in his blog, it is better to iterate fast and not care about making it perfect.

I set up the tool restrictions as you asked, you can get the files here. It is set up so that the pawn needs to be wielding any weapon which has a defName starting with "Pickaxe_" to mine, and with "HandAxe_" to cut trees. Please note the capitalisation, I copied it from your post. I understand why, pickaxe is one word and hand axe is two. But it could be confusing. If you want it changed let me know. Maybe something like 'Tool_Lumber_' and 'Tool_Mining_' or something along those lines. Whatever you want is fine by me though. To integrate my files with your mod just copy the dll into the assemblies folder, and the BaseWorkGivers.xml into the Defs/WorkGiverDefs.
#34
I updated the OP regarding fillpercent, it should be fine but if people have issues with it I will implement a variable for it properly.
#35
Quote from: Rikiki on October 03, 2014, 08:37:21 AM
fillPercent is used during projectile flying calculation. It helps to determine weather a bullet should be stoppped by a cover.

That can't be right, all rock types have fillPercent 1. Or is that a 0-1 float?
#36
I figured out the mineables problem, but not the overriding problem. It appears that Genstep_ScatterMineableChunks is called from Genstep_RocksFromGrid, and that is listed in the mapgen xml. The resulting mod can be found here

My guess is that without an xml reference it is not possible to override internal code.
#37
Unfinished / Re: [Project] (Alpha ?) Neolithic Mod
October 03, 2014, 07:55:27 AM
Woot I did it. I posted the mod for anyone to use in this thread. Just download it and follow the instructions there and you will be able to mod as many custom minerals as you want.
#38
Outdated / [MOD] (Alpha 7) Mineable ores utility mod
October 03, 2014, 07:53:53 AM
Hi all, I was helping ItchyFlea with his Neolithic Mod and I built a system to make the game accept modded ores. I thought this could interest other modders too so I am posting it here.

This mod is designed for inclusion in other mods, not as a standalone mod. Do not simply install it in your game or you will get silly bright coloured minerals that drop AI cores, and no metal.

You can download it here.

Usage:

Copy the MineableMod.dll in the assembly folder and the ModMapGenerators.xml for the MapGeneratorDefs.

If you are using an already modded MapGenerator you can just change the part where it says:
<!-- Create rocks from Elevation grid -->
      <li Class="Genstep_RocksFromGrid" />


to
<!-- Create rocks from Elevation grid -->
      <li Class="MineableMod.Genstep_RocksFromGrid_Mod" />


This is the part that calls my custom mineable scatterer.

Each modded ore needs to have a <fillPercent></fillPercent> tag with the probability of it spawning. These numbers are relative, see notes below for details or just treat them as an actual percentage, which will work as expected.

This mod will not add any vanilla ores to the map unless there are no custom ones defined. If you want vanilla ores you will have to add Defs for them copied from core and give them an appropriate fillpercent.

Notes:
The tag fillPercent is an internal rimworld tag that is used to define cover effectiveness. 1 is 100% cover (bullets dont go through stone) so using values lower than 1 is not recommended.

fillPercent is normalised internally in my code so your ores don't have to add up to 100%. If you have 2 ores with 1000% each it will work out the same as if you have two ores with 50% each, the percentages are actually just relative float values. This is also not extensively tested so let me know if this causes problems.

The actual total amount of ore per map is still the same as vanilla. I could modify this easily enough but it might be difficult to make it xml moddable. If someone desperately needs a mod with half as much or twice as much ore per map I could probably make that happen.

License is CC/BY
#39
Unfinished / Re: [Project] (Alpha ?) Neolithic Mod
October 03, 2014, 06:39:54 AM
It appears you are right, I looked into the code and there may be a dll solution but I am having issues. It is hard coded with the 4 current ore types and the class that codes it is difficult to mod. If you mod an ore it will be in the game, but it can't spawn in mapgen.

In the mean time, what you can do is change the name, description, graphics and droptypes of the current minables. Currently a certain percentage of ore is generated, of that 3% is gold, 3% is plasteel, 5% is silver and the rest is metal. These percentages are also hardcoded.

Given that you didn't want a lot of metalworking, maybe copper and tin but no more, what I would suggest is modding MineableMetal to just be another normal rock, and then mod gold, silver and plasteel to be copper, tin and maybe something like flint or obsidian. This will make those materials very rare but in a stone age mod that should be fine.

In case I do get mineables working (and out of curiosity anyway), what mineables did you want to mod in, and how common should they be?
#40
It seems it is not possible to mod mineable minerals in alpha 7 despite new minerals being added. I read the code and it hinges on the Genstep_ScatterMineableChunks class. The addition of minerals to the map is hard coded by def name. I wrote the following modification to the class which would work if I could get the program to call it:


public class Genstep_ScatterMineableChunks_Test : Genstep_ScatterMineableChunks
    {
private static readonly IntRange ChunkSizeRange = new IntRange(20, 40);
protected override ThingDef RandomThingDefToScatter
{
get
{
float value = Rand.Value;
                if (value < 0.1)
                {
                    return ThingDef.Named("MineableTest");
                }
if (value < 0.03f)
{
return ThingDef.Named("MineableGold");
}
if (value < 0.06f)
{
return ThingDef.Named("MineablePlasteel");
}
if (value < 0.11f)
{
return ThingDef.Named("MineableSilver");
}
return ThingDef.Named("MineableMetal");
}
}
}


The problem is this class is not referenced in any xml I can find. I don't know how to override a class that is not referenced in xml. Is it possible to get the program to call Genstep_ScatterMineableChunks_Test instead of Genstep_ScatterMineableChunks?

This is a general issue with modding and I have not found a thread which answers this question, possibly because the answer is obvious to coders familiar with dlls which I am not. If it is not possible then what is the point of the new minerals at all? There is an xml file for them but if you delete anything it crashes the game and if you add anything it ignores it.
#41
Unfinished / Re: [Project] (Alpha ?) Neolithic Mod
September 15, 2014, 10:31:03 AM
I checked the daily changelog, so far the only relevant information was:
"Equipment (weapons etc) can affect stats.
Apparel can now affect any stat, including work speed, psychic sensitivity (tinfoil hats!), social impact, etc."

This is great for this mod as it means you can simply set various tools and items to have a bonus or penalty to their relevant job skills, i.e a copper pick mines slower than a bronze one.

I also wrote a thread trying to get information on secondary equipment. If that gets an answer it should be very helpful.
#42
Help / How does secondary equipment work?
September 15, 2014, 10:27:54 AM
Can anyone explain how to use secondary equipment and what properties and uses it has? I found that the Pawn_EquipmentTracker has a variable
public List<Equipment> secondaries = new List<Equipment>();
that seems to track a list of equipment items. I tried creating an equipment item and tagging it as secondary equipment but it seemed to crash the GUI and some other systems. While it is obviously possible I did it wrong, it is also possible that the system is simply not fully implemented or that there is a bug with it. My test was really a stab in the dark because I had no idea what to expect or how to set it up.

If anyone has modded any secondary equipment it would be greatly appreciated if you could explain briefly some of the features and usage. It does not appear to be used in the core mod.
#43
Unfinished / Re: [Project] (Alpha ?) Neolithic Mod
September 15, 2014, 02:55:10 AM
I tried out .dll modding and it was surprisingly simple. I wrote a simple test mod to see how easy it would be to prevent jobs based on equipment/apparel/other pawn attributes and it worked fine. The mod I made simply prevents any character from chopping trees unless they have a Lee-Enfield equipped.

Basically on the xml side of things all that was required was setting a custom WorkGiverDef for the task that needs to be tool based. The only thing that needs to be changed is the giverClass tag. That makes the WorkGiver use my custom code and not the normal one. Basically it is as simple as:


<WorkGiverDef>
<defName>PlantsCut</defName>
<giverClass>RimworldDLLTest.WorkGiver_PlantsCutTest</giverClass>
<workType>PlantCutting</workType>
<verb>cut</verb>
<gerund>cutting</gerund>
</WorkGiverDef>


It is probably a good idea to check what changes, if any, are coming for equipment and apparel for Alpha 7. Then you need to decide what is the best way to implement tools as items. After that it should be no big deal to integrate them into the work system.
#44
Unfinished / Re: [Project] (Alpha ?) Neolithic Mod
September 11, 2014, 08:24:30 AM
I think this is one of the most important mod ideas because much of the functionality in it is groundwork that will enhance or enable a lot of other mods. Plus I love survival gameplay. I may consider donating some .dlls depending on available time and other factors.
I have some questions:

1. Is there some sort of shared repository where progress and changes can be shared for collaboration? If you want to go it alone that is fine but in my experience setting up git/svn and a basic forum/wiki/bugtracker makes a huge difference when people are working together. I have a redmine instance up on openshift if you want me to create a project for you.

2 . How attached are you to the total conversion idea? i.e. the part about not being able to progress beyond copper. My idea was that once copper casting and forging are available it is possible to make wire. If you have copper wire you can create a primitive transmitter. My original idea was that at this moment a research bench could become available through traders, and the standard game tech tree could be unlocked.

And some suggestions:
These are fairly advanced and only proposed for consideration once the basic mod is made. I understand that some of these ideas could be hard to implement. Obviously getting the basic steps done that you initially proposed is the first priority. Let me know if there are any small tasks I can help with.

Passive research:
Generally in this mod research is not necessary, it hinges upon having the tools or not, and an item progress tree would be the primary means of advancement. There are some things however which can be discovered. One idea I had was to make the research tree invisible, and make all jobs have a research component. Every time I melt copper for example a few points are added to smelting research. Once researched this unlocks tin and/or bronze. This has the effect that you play normally and at some point one of your guys simply shouts 'eureka!' and you have a new tech. This would feel much more natural than the current tech system.

Animal AI overhaul:
Unreal World has a brutally unforgiving hunting system. Many a hunter has starved to death while stalking and chasing his prey over the course of several days. Although the Rimworld engine would not really support the full depth of hunting and trapping from UW, some improvements are possible. Your idea about animals that fight back is one example. Animals that run away would be another. The normal behaviour for non-agressive creatures should be to maintain a safe distance from colonists. Cornering them or ambushing them should be part of hunting. A stealth mechanic would also go a long way here but that is a really tough one.

Seasons:
Cold harsh winters and other environmental effects are a huge bonus to survival gameplay. I think there might even be some vestigal code in the engine for low oxygen environments. I think having a super cold winter where plants wont grow and people can't spend long outside should be a priority for any mod.
#45
Help / Re: Low tech survival mod
September 11, 2014, 07:54:40 AM
Yes. I am glad to see I am not the only one with this idea, I imagined it would be a welcome addition. Feel free to lock this topic, although it is probably not necessary. I will be coming over to your thread to outline some suggestions and offer help.