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

#1
Outdated / Re: [A17] Thrones+Crowns
October 24, 2017, 07:53:03 AM
Quote from: SpaceDorf on October 23, 2017, 02:47:28 PM
Quote from: DrMrEd on October 23, 2017, 02:22:08 PM
it seemed a little overwhelming otherwise,
THAT  :

IS

THE

POINT

LOL dude - your point is undeniable :)
#2
Outdated / Re: [A17] Thrones+Crowns
October 23, 2017, 02:22:08 PM
Here's a link to my db: https://www.dropbox.com/s/d1k1aagsxrgsobi/Thrones%2BCrowns%20v1.zip?dl=0

Regarding the size, I've played with that a bit, but opted for the single cell because it seemed a little overwhelming otherwise, but I'm open to changing the default. If you want to try out different sizes, pull up the Def file at steamapps/workshop/content/294100/1178644141\Defs\ThingsDefs_Buildings.xml and edit line #13. The default is <drawSize>(3,3)</drawSize> but maybe (4,4) is better?
#3
Outdated / Re: [A17] Mod Announcements Thread
October 23, 2017, 10:37:11 AM
Thrones+Crowns

My first released mod! Adds Thrones and Crowns to the game. XML only, so should be compatible, but I've only had a few folks test things. Happy to hear any feedback!

Steam link: http://steamcommunity.com/sharedfiles/filedetails/?id=1178644141
#4
Outdated / [A17] Thrones+Crowns
October 23, 2017, 10:36:31 AM
My first released mod! Adds Thrones and Crowns to the game. XML only, so should be compatible, but I've only had a few folks test things. Happy to hear any feedback!

Steam link: http://steamcommunity.com/sharedfiles/filedetails/?id=1178644141
#5
Mods / Re: (TEXTURE REQUEST) Ferrets
October 23, 2017, 08:52:44 AM
I've been doing some art lately, and after blindly starting with some very bad results, I found this guide: https://imgur.com/a/xdDzg. If you have some decent base images and a good amount of patience, this method can give you very good results without having to freehand anything.
#6
Help / Re: Game sounds
October 20, 2017, 04:31:04 PM
I grepped through source and the only place I found anything to do with construction failure is in RimWorlds/Frame.cs, which has a FailConstruction method:


    public void FailConstruction(Pawn worker)
    {
      Map map = this.Map;
      this.Destroy(DestroyMode.FailConstruction);
      Blueprint_Build newBlueprint = (Blueprint_Build) null;
      if (this.def.entityDefToBuild.blueprintDef != null)
      {
        newBlueprint = (Blueprint_Build) ThingMaker.MakeThing(this.def.entityDefToBuild.blueprintDef, (ThingDef) null);
        newBlueprint.stuffToUse = this.Stuff;
        newBlueprint.SetFactionDirect(this.Faction);
        GenSpawn.Spawn((Thing) newBlueprint, this.Position, map, this.Rotation, false);
      }
      Lord lord = worker.GetLord();
      if (lord != null)
        lord.Notify_ConstructionFailed(worker, this, newBlueprint);
      MoteMaker.ThrowText(this.DrawPos, map, "TextMote_ConstructionFail".Translate(), 6f);
      if (this.Faction != Faction.OfPlayer || (double) this.WorkToMake <= 1400.0)
        return;
      Messages.Message("MessageConstructionFailed".Translate((object) this.Label, (object) worker.LabelShort), (GlobalTargetInfo) new TargetInfo(this.Position, map, false), MessageSound.Negative);
    }


The only explicit sound call here is the MessageSound.Negative one, but that's associated with the notification.

Next try was to grep through all the XML Defs, and again there are limited hits. The only thing that might be applicable is from Defs/SoundDefs/UI_Oneshots_Designation.xml:


  <SoundDef>
    <defName>DesignateFailed</defName> 
    <eventNames /> 
    <maxSimultaneous>1</maxSimultaneous> 
    <subSounds>
      <li>
        <onCamera>True</onCamera>     
        <grains>
          <li Class="AudioGrain_Clip">
            <clipPath>UI/Designate/DesignateFailed</clipPath>
          </li>
        </grains>     
        <volumeRange>
          <min>19.11764</min>       
          <max>19.11764</max>
        </volumeRange>     
        <sustainLoop>False</sustainLoop>
      </li>
    </subSounds>
  </SoundDef>


Using the Unity Extractor, I can see there's a "resources/DesignateFailed.83" audio clip, and using something called "AssetsBundleExtractor" I was able to pull a .wav file out (along with all the other game sounds!!). DesignateFailed is a very, very short "splat" type sound. I didn't notice any volume oddities with it relative to the other extracted sounds. I tried to attach the .wav to this post (no idea if it'll work). 

I'm thinking at this point you could point that SoundDef to something else that's more pleasing to you via a patch.


[attachment deleted by admin: too old]
#7
I spent an hour on an idea this morning. This concept is just adapted from existing work (haven't reached out for permission yet), but captures the general idea of what I was thinking.

There are a few options in that each element could have it's own style, maybe integrating one of your existing type icons on its chest or something - this would allows some fancy coloring too. Or they could be drawn like the vanilla bears with a color applied for each different type (that's what I've started here for fire and ice, but not thrilled at the blue shade choice).

It's tough to screen cap as they wander around, but I've attached one with a Muffulo there for reference. The horn should not be colored, but before I spend a bunch of time on this, figured I'd see if this basic idea is OK. Any feedback? I can take it if it's negative too -- I'm no artist either, just someone with a bit of patience and some ideas ;)

[attachment deleted by admin: too old]
#8
Mods / Re: [Mod Request] Watch Tower
October 19, 2017, 10:13:09 AM
Quick thoughts here, but I think you could simply mimic the elevation effects with increased range. That is, if your weapon has a range of 20 tiles normally, when a pawn "mans" a Tower building, the weapon range gets a +5 or +25% or something. Further, if you figure a rifle could be mounted on a bipod in such a tower, then they'd get an accuracy boost as well. And lastly, given the defensive position behind the tower's battlement, their chance to get hit decreases, and negates any potential damage to lower parts of the pawn's body (although fire and mortars could still affect them as usual).

I'm picturing a 5x5 structure that the pawn mans in the center, then gets these buffs, which seems pretty doable without a true concept of elevation. There could be an unwalled backside too to mimic stairs/ladder that would leave them partially exposed from the rear.

Something like:

#-#
#o#
###


Since there's no fog of war (in that the player knows exactly where all the raiders are all the time, and even what gear they're carrying), effects would be limited to combat rather than a truer "watch tower" object for reconnaissance info.  It'd be awesome if raiders could man a tower if the colonists retreat back too.
#9
Is the only thing holding up the Summon Elementals component the need for art? If so, I'd be happy to take a stab at a couple concepts. I created a beautiful piece of furniture last week and want to apply what I've learned there somewhere useful. Most of my mod concepts will never see the light of day, so would be happy to help with a project like this that has real potential!
#10
Help / Re: AssignOwner UI box?
October 18, 2017, 09:49:37 AM
Finally getting back to this, and I have some working code. I've got this for the GetGizmos() method:


        public override IEnumerable<Gizmo> GetGizmos()
        {
            foreach (Gizmo baseGizmo in base.GetGizmos())
            {
                yield return baseGizmo;
            }
            yield return new Command_Action
            {
                defaultLabel = "CommandBedSetOwnerLabel".Translate(),
                icon = ContentFinder<UnityEngine.Texture2D>.Get("UI/Commands/AssignOwner", true),
                defaultDesc = "CommandBedSetOwnerDesc".Translate(),
                action = delegate
                {
                    Find.WindowStack.Add(new Dialog_AssignBuildingOwner(this));
                },
                hotKey = KeyBindingDefOf.Misc3
            };
        }


And it's working in so far as the SetOwner command box now appears. However, I've still got some code issues in that multiple owners can be assigned (so I'm not checking ownership properly somewhere). The bigger issue is that even though this is "owned" by a named Pawn, any other Pawn in game still uses it.

Thanks to the help above from Kiame, I've passed one hurdle just to find two more :) Hopefully this code will help others in the future.

If/when I figure the rest out, I'll be sure to post it. However, the ownership here is a small incremental feature of the mod I'm working on, so if it gets to be too much, I may just drop this bit after all.
#11
Help / Re: Set trap to only target legs?
October 14, 2017, 11:58:28 AM
You are on the right track. You'll need to compile an assemply to put in the \Assemblies folder. Then add

<thingClass>Building_BearTrap</thingClass>

to your BuildingDef XML.

There are some issues I see in your C#, but that's probably from the way it was decompiled. Like there shouldn't be O.get_x() method calls, but  instead O.x property references. But when you get to the IDE step, that stuff should be cleared up for you.

On the DamageInfo piece, I think it'd be better to use:

damageInfo.SetBodyRegion(BodyPartHeight.Bottom, BodyPartDepth.Outside);

This is better practice than using (1, 2) even if they're literally the same to the compiler.

I don't know if you need to SetBodyRegion for the damageInfo2 (stun damage) or not. Might be worth testing out both ways.
#12
Help / Re: AssignOwner UI box?
October 13, 2017, 01:11:12 PM
Gotcha, thanks. Anxious to look into this, but running out of time today already to play around with this.
#13
Help / Re: Set trap to only target legs?
October 13, 2017, 01:10:03 PM
I think you'll need a custom ThingClass to define the exact damage behavior when the trap is hit. From a brief exploration of the code (RimWorld.Building_TrapRearmable), you'd want to implement a new DamagePawn method, setting the DamageInfo object's SetBodyRegion to only act on legs.

#14
Help / Re: AssignOwner UI box?
October 13, 2017, 09:04:06 AM
Thank you for the leads!

I'll dig into GetGizmos() later today when I get back to this project. It's probably the same gibberish we see everywhere with compiler generated types, which I've avoided really trying to understand thus far. But knowing the Command Buttons are "Gizmos" will help a lot.

I also have yet to dig into Harmony. I though I'd need it for my Pawn_Ownership hack, but the extensions stuff is actually really powerful.

Learn as you go ;)
#15
This was how I first started trying to tackle source code when I looked into modding. However, RimWorldWin.exe is a native .exe, not a .NET assembly, so there's no decompile/recompile to debug option. Also, it's not a debug build, so no debug symbols, which means even if you manage to attach a debugger to the running process, you'll get very limited info.

Sadly without a debugger available, I've resorted to the archaic printf equivalent of debugging. Log.Message() everywhere...