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 - Kilroy232

#16
There was a semicolon missing after the variable declaration but otherwise this fixed the problem I was having, thank you VERY much.


if (Def != null && hitThing != null ) //Fancy way to declare a variable inside an if statement. - Thanks Erdelf.
            {
                 Pawn hitPawn = hitThing as Pawn
               if(hitPawn!=null)


Also a big thank you to jecrell for this very well written tutorial!
#17
Just wanna say that this is a very good tutorial but I am having one problem. I am sure I just have done something silly but some help would be great.
As of right now I have just copy and pasted the example code to see if I did something wrong but I am still getting the error.


Severity Code Description Project File Line Suppression State
Error CS0103 The name 'hitPawn' does not exist in the current context PlagueGun C:\Program Files (x86)\Steam\steamapps\common\RimWorld\Mods\PlagueGun\PlagueGun\Projectile_PlagueBullet.cs 34 Active


#18
I would just like to let anyone who is interested know that I have updated the mod to run on alpha 17b and I have tested it to make sure that is bug free.

Having said that I am only one person and I cannot guarantee there are no bugs so if anyone has any problems please let me know. I am also happy to listen to any requests or ideas that you may have for the mod. I am doing my best to learn to write C# for the mod to provide a more detailed and higher quality mod.
#19
Help / Re: Adding a prerequisite to a patch
June 18, 2017, 01:04:38 PM
Quote from: kaptain_kavern on June 18, 2017, 12:58:48 PM
Something I asked in the "what will make the game easier to mod"!

I totally agree it could be great but as far as I know, it's not possible with XML only for now

If its not possible through XML only and anyone knows how to achieve this through C# I would love to know so that I can use this and hopefully help others do this as well.

I need something to replace the removed <ResearchMods> and <SpecialActions> nodes
#20
Help / Adding a prerequisite to a XML patch
June 18, 2017, 12:55:56 PM
Is it possible to have a patch that has a prerequisite that you have to research before the patch is applied?
#21
I have a question now that I have read through the original post and some of the comments. In my turrets mod I used this method to change specific values:

<researchMods>
      <li>
        <specialAction>TP.TPResearchMods.EnergyTurretOvercharge</specialAction>
      </li>
    </researchMods>


They have now removed the <researchMods> function but I would like to know if I can use patching in its place. I want to be able to have a research that will say increase a weapons range or damage. If anyone can help me out with that I would greatly appreciate it
#22
Quote from: asquirrel on February 06, 2017, 08:52:21 PM
When I enable your mod I get this error "couldn't relax research project coordinates apart after 200 passes" (see screenshot).  When I disable the mod the error goes away.  The mod is being loaded near the very end of my load order, just before my miniaturization mods.

I tried to upload my log file to the Ludeon server but today I'm getting an error (405: not allowed).

I haven't personally seen that on so there is a chance it has something to do with another mod. I will have a look into it and see if I can prevent the error
#23
I am happy to announce that this mod is now updated to run with alpha 16! Thank you for your patience and I am also happy to tell you that many fixes have been made along with the addition of new content including the 'Lazer' turret
#24
Quote from: nachtfalter on September 27, 2016, 08:15:44 AM
Still my favorite mod for additional turrets because they are very well balanced!
Thanks for updating!

And I have a new update coming too with a new turret for you guys :D
I am always glad to hear you guys like this mod, gives me motivation to keep it going. If you really felt like it and have the game on steam a like and or good rating helps other people see this too
#25
Quote from: skullywag on September 27, 2016, 10:17:34 AM
Why does the name of the def matter? im not following

Ya, I am interested as to how this caused the problem
#26
Help / Re: I'd like to start modding but..
September 25, 2016, 05:31:21 PM
Quote from: CannibarRechter on September 25, 2016, 11:17:43 AM
> just knowledge from computer programming courses (less relevant than you might think),

There's some relevancy there, but as someone with ~25 years experience in the field, and having worked with C, C++, Java, Lisp, and Python all professionally, the experience that matters isn't the languages per se, but rather not being easily overwhelmed by new symbols, and being able to comfortably detect structure. Another way of saying this is if you stare at a it a while, and really just try to find the structure, you probably will. The experienced programmer knows this right away, but people who don't have this experienced become overwhelmed, not knowing it's true.

I completely agree with you! I wasn't sure just how to work it but that's exactly it
#27
I could have a better look later today at your files but I would suggest removing one .xml files at a time from the mod or commenting out sections of code at a time to isolate where the problem is coming from. Then I would hope the problem would be easy to solve.

Off the top of my head I am not even sure how you would have done this but the only thing I can think of is that you have given something the same <DefName> as the gold and so when the mod is loaded after the core the gold or def is being over ridden
#28
Help / Re: I'd like to start modding but..
September 25, 2016, 08:53:55 AM
Ya I have to say that I have never used a tutorial, just knowledge from computer programming courses (less relevant than you might think), comparing modified and unmodified code and a ton of trial and error.

The fact that the core games XML files are available to be viewed is a great asset and I would suggest using that to the best of your ability.

Finally the address your question, XML is the more common and simpler for of modding while C# is less common and requires more knowledge while being far more useful for creating whole new functions in game
#29
Help / Re: Deep drilling
September 25, 2016, 08:48:04 AM
I assume by range you mean the radius by which the drill looks for resources. If that is the case those values are contained in the C# of the DeepDrillComp unfortunately.

This bit of code tells the game to search 9 cells around the building in a radial pattern


public bool TryGetNextResource(out ThingDef resDef, out int countPresent, out IntVec3 cell)
{
for (int i = 0; i < 9; i++)
{
IntVec3 intVec = this.parent.Position + GenRadial.RadialPattern[i];
if (intVec.InBounds())
{
ThingDef thingDef = Find.DeepResourceGrid.ThingDefAt(intVec);
if (thingDef != null)
{
resDef = thingDef;
countPresent = Find.DeepResourceGrid.CountAt(intVec);
cell = intVec;
return true;
}
}
}
resDef = null;
countPresent = 0;
cell = IntVec3.Invalid;
return false;
}
#30
Help / Re: Modified Version of DeepDrill advice?
September 22, 2016, 08:45:07 AM
Quote from: Master Bucketsmith on September 22, 2016, 07:36:34 AM
Myself, I prefer things kept simple and have some 'artistic liberty/leeway' in how realistic the end result is. Just to keep it in the setting/theme RimWorld vanilla has. You know, electricity for example. :P
So, I personally don't like long production chains with multiple stages, unless the oil is a base resource and from there on the different resources made of it have their own use, maybe. :)
I would love to be able to build storage tanks and be able to trade in those resources though!

Looks like you made a mistake with setting the thingClass or the compClass in the XML file.
If you share the thingDef for this building I might be able to pick it out.
Its actually good to get some feed back because I have been trying to decide whether I wanted to make it a long process (I love games like factorio) or more like I had original planned to make oil a useful resource from the beginning

Here is the xml code:

<ThingDef ParentName="BuildingBase">
    <defName>ManualOilDrill</defName>
    <label>manual oil drill</label>
    <description>A deep-crust drilling rig for extracting minerals from deep under the surface. Use a ground-penetrating scanner to detect the resources.</description>
    <size>(1,1)</size>
    <altitudeLayer>Building</altitudeLayer>
    <passability>PassThroughOnly</passability>
    <pathCost>70</pathCost>
    <fillPercent>0.5</fillPercent>
    <interactionCellOffset>(0,0,-1)</interactionCellOffset>
    <hasInteractionCell>true</hasInteractionCell>
    <designationCategory>Production</designationCategory>
    <designationHotKey>Misc12</designationHotKey>
    <specialDisplayRadius>1.5</specialDisplayRadius>
    <rotatable>true</rotatable>
    <costList>
      <Steel>100</Steel>
      <Component>3</Component>
    </costList>
    <placeWorkers>
      <li>PlaceWorker_ShowDeepResources</li>
    </placeWorkers>
    <drawPlaceWorkersWhileSelected>true</drawPlaceWorkersWhileSelected>
    <researchPrerequisites>
      <li>DeepDrilling</li>
    </researchPrerequisites>
    <statBases>
      <MaxHitPoints>140</MaxHitPoints>
      <WorkToMake>5000</WorkToMake>
      <Flammability>1.0</Flammability>
      <Beauty>-25</Beauty>
    </statBases>
    <comps>
      <li Class="CompProperties_Forbiddable"/>
      <li Class="CompProperties_Power">
        <compClass>CompPowerTrader</compClass>
        <basePowerConsumption>250</basePowerConsumption>
        <startElectricalFires>true</startElectricalFires>
        <shortCircuitInRain>false</shortCircuitInRain>
      </li>
      <li>
        <compClass>DeepOilDrill</compClass> <!-- This is my custom compClass -->
      </li>
    </comps>
    <graphicData>
      <graphicClass>Graphic_Single</graphicClass>
      <texPath>Things/Building/Production/DeepDrill</texPath>
      <drawSize>(2,2)</drawSize>
      <drawRotated>false</drawRotated>
    </graphicData>
  </ThingDef>