Alpha 13 modders stuff

Started by skullywag, March 06, 2016, 03:55:58 AM

Previous topic - Next topic

skullywag

Heres what ive found so far:

1. Only 1 BuildingBase and the like is to be defined for each mod.
2. Comp properties can now define the class via the <li> in xml, e.g:
<li Class="CompProperties_Explosive">
3. DamageData is added to graphicData, this controls the damage overlay, so far ive seen:
<damageData>
  <rect>(0.2,0.2,0.6,0.6)</rect>
</damageData>

on a turret.
<damageData>
  <cornerTL>Damage/Corner</cornerTL>
  <cornerTR>Damage/Corner</cornerTR>
  <cornerBL>Damage/Corner</cornerBL>
  <cornerBR>Damage/Corner</cornerBR>
</damageData>

on a battery
<damageData>
  <cornerTL>Damage/Corner</cornerTL>
  <cornerTR>Damage/Corner</cornerTR>
  <cornerBL>Damage/Corner</cornerBL>
  <cornerBR>Damage/Corner</cornerBR>
  <edgeTop>Damage/Edge</edgeTop>
  <edgeBot>Damage/Edge</edgeBot>
  <edgeLeft>Damage/Edge</edgeLeft>
  <edgeRight>Damage/Edge</edgeRight>
</damageData>

on walls.
4. New comp:
<li Class="CompProperties_Breakdownable"/>
This is used by a new incident that makes machinery breakdown and require repairs.
5. In c# props can now be referenced on a comp via Props (capitalised P), e.g:
comp.Props.storedEnergyMax
instead of
comp.props.storedEnergyMax
6. combatTargetBuilding is now defined as a building property, e.g:
<building>
  <ai_combatDangerous>true</ai_combatDangerous>
</building>

instead of
<combatTargetBuilding>true</combatTargetBuilding>
7. Hediff_Stages is no more, you'll now need:
<HediffDef Name="DiseaseBase" Abstract="True">
  <hediffClass>HediffWithComps</hediffClass>
  <defaultLabelColor>(0.8, 0.8, 0.35)</defaultLabelColor>
</HediffDef>

8. singleBillGiverDef in workGivers is no longer, you'll now need, for example:
<fixedBillGiverDefs>
  <li>NameOfWorkbench</li>
</fixedBillGiverDefs>

9. When referring to a drawer on a pawn, capital D now, so:
this.wearer.Drawer.DrawPos;
instead of:
this.wearer.drawer.DrawPos;
10. BrokenStateDef is now MentalStatDef, so for example:
this.wearer.MentalStateDef
instead of:
this.wearer.BrokenStateDef
11. PowerToggleable is gone from CompPowerTrader and is now it own comp:
<li Class="CompProperties_Flickable" />
12. listerPawns is now mapPawns so when doing things like:
Find.Map.listerPawns.AllPawns
you now need:
Find.Map.mapPawns.AllPawns
13. You may need to use the attribute when using static material and such:
[StaticConstructorOnStartup]
A quick snippet from Ison as to why this is the case:
QuoteThis happens because from now on mods are loaded in a different thread. This, combined with the fact that it's impossible to use Unity's functions like loading a texture in threads other than the main one, means that you get an error in such cases. Does your new class have any static resources like Texture, Material or Graphic? If so, it means that during loading the game, when an object of this class is loaded, its static constructor is called and the game tries to load a texture in a different thread. With StaticConstructorOnStartup attribute, class' static constructor is called in the main thread before loading everything else.
You should make all resources static and then use [StaticConstructorOnStartup] attribute on the class, like this:
[StaticConstructorOnStartup]
public class Building_WindTurbineStuffed : Building_WindTurbine

14. Pawn_HealthTracker.ShouldBeTreatedNow is now Pawn_HealthTracker.ShouldBeTendedNow.
Skullywag modded to death.
I'd never met an iterator I liked....until Zhentar saved me.
Why Unity5, WHY do you forsake me?

RickyMartini

Can I ask, what cool new ideas are you currently developing? Any new mods?

skullywag

#2
Well things to come out of A13 testing idea wise....

Vaccines...lol

Other stuff im working on for A13, the return of purple ivy, now we have more insects its the right time to bring it back fully.
Ive got a bit of a turret update incoming, improves turrets via research and addon buildings (like an autoloader to speed up firerate for example)
And one giant mod including 14 themed sets of armour and weapons based on greek mythology, its a random one but i had to get the idea out of my head lol (could be adjusted to void gods easily enough if i feel like it)

In other news, updating is almost a non issue, large code basis will have some monotonous refactoring to do but its simples. Ive updated 7 of my mods in less than an hour. Gonna stop now though as alpha13 code could change further and dont want have to refactor again, I just got the ones unlikely to change out the way, the rest are the more indepth mods that id rather wait for more solid codebase (even if its the next build).
Skullywag modded to death.
I'd never met an iterator I liked....until Zhentar saved me.
Why Unity5, WHY do you forsake me?

RickyMartini

Really, vaccines? interesting

skullywag

#4
updated the above.

Yeah vaccines, im thinking of editing the health tab to show what the pawn is immune to somehow and then have very rare and expensive vaccines sold by traders (think neural trainers but for setting immunity to disease) you can apply them instantly or risk holding onto them until that particular disease hits...
Skullywag modded to death.
I'd never met an iterator I liked....until Zhentar saved me.
Why Unity5, WHY do you forsake me?

Coenmcj

#5
interesting, but iirc things like parasites don't care so much if you're vacinatted or not, they'll still wreak havoc.

Parasites such as the Muscle Parasites and gut worms.
Moderator on discord.gg/rimworld come join us! We don't bite

skullywag

worming tablets then....or the real way to prevent them, good hygeine. Its only an idea currently.
Skullywag modded to death.
I'd never met an iterator I liked....until Zhentar saved me.
Why Unity5, WHY do you forsake me?

RawCode

we are sci-fi and it's possible to explain anything by nano machines.


RemingtonRyder

I'm pleased by the full XML inheritance of basebuilding. I'll make for less problems updating things from one alpha to the next.

isistoy

#9
Oh! Wait! I think I like the changer with <li Class="CompPropertyClass"!
Is it possible to know a bit more about exactly why this has changed? Would access to defs comp properties be different in the game? ::)
<Stay on the scene like a State machine>

skullywag

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

Tynan

Thanks for assembling this, definitely move it to public on release.
Tynan Sylvester - @TynanSylvester - Tynan's Blog

skullywag

Hmm my first issue I think, this:

<ThingDef ParentName="BuildingBase" Class="ExtendedStorage.ESdef">

used to allow me to add a new xml node and have it read into a class, this doesnt seem to work anymore, has this method of custom xml additions changed?

For clarity i use this for my extended storage mod to allow me to define a maxstorage int, e.g
using Verse;

namespace ExtendedStorage
{
    public class ESdef : ThingDef
    {
        public int maxStorage;
    }
}


did i done derped? or is this now different?
Skullywag modded to death.
I'd never met an iterator I liked....until Zhentar saved me.
Why Unity5, WHY do you forsake me?

skullywag

Any word on the above. If thats no longer working a lot of mods are gonna have issues.
Skullywag modded to death.
I'd never met an iterator I liked....until Zhentar saved me.
Why Unity5, WHY do you forsake me?

Tynan

Please enter a Mantis issue, this may be related to the refactor of def loading code.
Tynan Sylvester - @TynanSylvester - Tynan's Blog