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

#226
Help / Re: Many Dll Questions
April 30, 2014, 01:16:44 AM
I've written a bunch of code up now, all of it looks pretty nice, but I cant finish it without writing new IEnumerables.
I understand what they do. They use toils to direct what the pawns do.

Where if anywhere can I find the code for all the IEnumerables? I know where all the toils are located.

Does anyone know what this specific little chunk from the Building_Bed does? I need to define a new Building class for my MedBeds.
public override IEnumerable<Command> GetCommands()
{
Building_Bed.<GetCommands>c__IteratorC <GetCommands>c__IteratorC = new Building_Bed.<GetCommands>c__IteratorC();
<GetCommands>c__IteratorC.<>f__this = this;
Building_Bed.<GetCommands>c__IteratorC expr_0E = <GetCommands>c__IteratorC;
expr_0E.$PC = -2;
return expr_0E;
}


This is my failed attempt to basically rewrite the TakeToBed/Rescue JobDriver. I'm wondering if anyone knows how it should be written, or a better way to acheive the same result.
class JobDriver_TakeToMedBed : JobDriver

    {protected Pawn Takee
            get
                return (Pawn)base.CurJob.targetA.Thing;
        protected Building_MedBed DropBed
            get
                return (Building_MedBed)base.CurJob.targetB.Thing;
        public JobDriver_TakeToMedBed(Pawn pawn) : base(pawn)

        protected override IEnumerable<Toil> MakeNewToils()
        {
            //yield return Toils_Goto.GotoThing(TargetIndex.A, PathMode.ClosestTouch);
            //yield return Toils_Haul.StartCarryThing(TargetIndex.A);
            //yield return Toils_Haul.
        }
    }
#227
Quote from: Austupaio on April 29, 2014, 05:46:52 PM
Personally, I'd like the bar, yeah.
Secondary, but I'd also prefer they were much less efficienct than the true solar panel building. You can place them anywhere, they're cheap, they're walk-able and raiders don't target them, plus for all that you lose a neglible amount of power. Doesn't feel super balanced to me.
Neat mod though, I do like having these when a full 4X4 building just isn't possible.
Thanks for the feedback!
Now I have them working I can do improvements. New texture, power bar.
Now sure where to make the targetable.
They have low heath, and get destroyed sometimes, from fire often or if placed near targeted objects. Though I increased the health from 30 to 50 with this last update.
16 of them takes up the same space and metal cost(80) as a big solar. Not so OP, they end up costing you more if even 1 gets destroyed.
I'm almost thinking of making them charge more, but be that much weaker (and cost more).

Quote from: jamieg on April 29, 2014, 06:05:07 PM
awesome, im gunna play it a few day with the mod pack, if it works fine is it still cool to add it with next update?

Yeah that's cool ;D I'm pretty sure it's bugless and compatible with everything. Going to run a test game here in a bit.
#228
Quote from: jamieg on April 29, 2014, 04:23:29 PM
so they are working like real solar panels now?
Yeah. Night off, full sun=full charge, and varies between.

Just notes:
.003% less power produced for easier math.
The power bar that shows the charge is removed (you can see it go up and down on the regular solars), that was actually the problem in the first place. I could make them act like normal solars but each panel had that huge charge bar. Does anyone want a little charge bar for each panel? I'm pretty sure that's possible.
#229
Quote from: Vas on April 28, 2014, 09:02:33 PM
I believe the game would require multiple build levels to be able to build a roof.  I doubt it'll be possible.  Roof panels would be good though because they would be out of your way and such.  They should not however forward power down, only by touching a power forwarding wall can  they supply power to the stuff below them.  In case you figure out a way to do it.I really think the game could be much nicer if they'd allow 3 levels to build with, so you could build roofs on top level, everything on middle, and only certain objects like underground pipes or wires on bottom level.  Colonists wouldn't be able to leave middle level ever.
It would probably fix all the issues with roofed and non-roofed areas. That whole system is super screwy.
And you could build different roof types besides factory standard corrugated steel coated in invisi-spray.
Plenty of games have a level dedicated just to utilites.
If we're talking hypothetical extra z-levels; I would definitely want just one more level for building.
A second floor is very common in buildings, especially western towns, almost all those buildings are 2 stories high.
The old west just so happens to be a core theme of rimworld.  :'( But Tynan already said never on z-levels right?
I think once you start with z levels it becomes, well why not 3, why not 10, why not 60, why not infinite.
#230
Yeah the panels would have to produce 106.25 each to be equal with solar panels, which would make some really odd numbers at points, So you give up 4 power for convenience of tinyness.
No idea how to make a new roof, but I'm looking into it.
#231
Outdated / Re: [MOD] (Alpha 3) MedBed
April 28, 2014, 03:45:16 PM
Quote from: WhackyRavenLand on April 28, 2014, 03:16:10 PM
My apologies for causing trouble! =)  Didn't think to check the folders when I got it in the modlist ingame where I could activate it =p
RB
No problem, I'm glad you figured it out. I think I've had that issue before. It's a confusing one to sort out, less obvious.

I've been trying to write up the dll to make colonists perfer taking to medbed before regular beds, couple snags but I'm close, thankfully WorkGivers are defined in xml.It may be impossible, there are too many things connected to sleeping and ownership.
#232
Outdated / Re: [MOD] (Alpha 3) Modular Solar Panels
April 28, 2014, 12:45:11 PM
Updated! Now change charge depending on light level!

Give it a try Vas!
Thanks to JackQW for his dll example, and pawnstorm for teaching me what I needed to write it up myself.
#233
Outdated / Re: [MOD] (Alpha 3) Extra Research Tables
April 28, 2014, 08:03:49 AM
Quote from: StorymasterQ on April 27, 2014, 10:40:48 PM
If there are >1 Research Tables (vanilla game or mod) and all of them are manned, will all of them generate research points towards the current research?
On a second note, will we ever be able to work more than 1 research at a time (probably not)? And will we ever be able to deny researching a particular research without the appropriate research table?
Yes multiple researchers works. I tested it. Couldn't find any limit in the code.
The next 2 question I don't know, but I wish.

It would be cool to make these researched, which unlocks further research, but I wouldn't know how to make the table  required. These tables are almost identical to the original, just changed size and texture, to avoid choosing one over the other for any reason than how it looks. I use both from the mod, but that original is a clunker  ;D

I think it would be cool to be able to research at worktables, or research tables can also do bills. So colonists can do chemistry at the chem table as well as research. Research food upgrades at the cookstove or research trade at the comms console. Maybe even create sellable research pages to trade. It might overlap with tasks, but I get tired of selling my research table 1/4 through a game be nice if they had other uses. Maybe turn research into a bill?

#234
Outdated / Re: [MOD] (Alpha 3) MedBed
April 27, 2014, 08:31:56 PM
Do you have the basic beds in the furniture menu? If not, mod prob isn't activated.
Then go into godmode, the advanced beds should appear in the furniture menu. Just to make sure that's loaded
If they are, check that you have a Medbed1.2/Defs/ResearchDefs/ResearchProject_MedBed.xml that looks like this:
<?xml version="1.0" encoding="utf-8" ?>
<ResearchProjectDefs>


<ResearchProjectDef>
<defName>MedicalBeds</defName>
<label>Medical Bedding</label>
<description>Allows you to interweave cloth and medicines, in order to make advanced medical beds.</description>
<totalCost>35000</totalCost>
<prerequisites></prerequisites>
</ResearchProjectDef>


</ResearchProjectDefs>

and that MedBed1.2/Defs/ThingDefs/Building_Furniture_MedBed.xml includes <researchPrerequisite>MedicalBeds</researchPrerequisite> near the bottom of the <ThingDef> for AdvMedBed.

Otherwise I don't know what's going wrong.

#235
Help / Re: Many Dll Questions
April 27, 2014, 08:12:26 PM
Changing <thingClass>Pawn</thingClass> to <thingClass>BattleFormations.XPawn</thingClass> is the xml reference you're talking about right? I get that. Just making the class used.
Quote from: pawnstorm on April 27, 2014, 02:01:41 PM
you can't make changes directly to the Assembly-Csharp library. Sometimes you have to dig deep until you find something that leads to a value you can change in some xml file.
This really put things into perspective. Thank you for taking time to explain all this to me, I've learned an incredible amount today. I was able to succesfully edit your code a tiny bit.
#236
Outdated / Re: [MOD] (Alpha 3) MedBed
April 27, 2014, 08:02:27 PM
Have you scrolled down the research list?
#237
Outdated / Re: [MOD] (Alpha 3) MedBed
April 27, 2014, 07:21:34 PM
Yeah 3f, 413, Medbed 1.2.
I just download a fresh copy off here and tried it, still working fine.
Maybe try redownloading. Do you have other mods installed? Can you see other types of research?
#238
Outdated / Re: [MOD] (Alpha 3) MedBed
April 27, 2014, 06:34:44 PM
The research should be called "Medical Bedding"
#239
Help / Re: Many Dll Questions
April 27, 2014, 01:34:11 PM
Quote from: pawnstorm on April 27, 2014, 12:35:11 PM
Well, first you need to compile a class library, not an application. You can change it in the project settings somewhere. Secondly, you can't just create something with the same name as in Assembly-Csharp, it'll just create name conflicts.
I don't know if you have any programming knowledge, but if this is your first experience with it it's probably going to be a very steep learning curve if you try to dive right in. Your best bet is probably to look at some of other people's mods and see if you can make little changes to those.

Edit: Maybe it'll help a little if you read a bit about object oriented programming in C#. This seems to be a nice brief yet informative article about it: http://www.c-sharpcorner.com/UploadFile/84c85b/object-oriented-programming-using-C-Sharp-net/

Most of the things you put in your library need to be defined first in an xml file, you can't just create classes and expect Rimworld to use them just cause they're there.
Okay I changed it to compile as a class library, that fixed the error, and I have the dll now. Thanks!

This is my first really hands-on experience. I've watched tons of tutorials and I have a C# book by me, so I have a good base understanding of what's going on. But most things fail to properly explain namespaces/classes/methods. It has been a steep learning curve, but reading and tinkering with these dlls has been super educational. I'm going to read more about Object Oriented Programming now.

The code for BattleFormations and PowerSwitches edits already existing classes. This example is just an enumerator, it doesn't seem to be contained inside a class, so I'm not sure what to do.
I'm trying to make a new surface type that will only be supported by sand (for jamieg's sandpit) It seemed like a simple enough first dll mod.
I already edited the TerrainType.xml so that Sand is the only terrain that supports the new surface.
#240
Quote from: daft73 on April 27, 2014, 12:36:41 PM
Quote from: Kirid on April 27, 2014, 12:31:23 PM
My favorites are probably Diablo ......
Speaking of, so I was expanding my game music (a mega-list of music I listen to whilst playing stuff), when I thought to try Diablo's Soundtrack absurd amounts up to 300$...really lol. My 1,000,000,000,000 yr old original copy is somewhere out in the old man-cave, now just storage, and my wife's workout room. May need to try to dig it out...
Wow that's crazy! I've still got mine around here somewhere..
Funny story: When I was little I convinced my super religious Grandma to let me install it on her computer by telling her "It's a game where you go to hell and kill the Devil" Instant Okay.