MODDERS PLEASE READ, Abstracts and how they should be used.

Started by 1000101, April 25, 2016, 05:10:45 PM

Previous topic - Next topic

kexici

thx for this important info :)  ( update done :D )

Britnoth

Quote from: 1000101 on April 29, 2016, 11:57:31 AM
It doesn't matter if you are overriding an existing def or creating a new one, you must define the abstracts you are referencing.

Okay, thanks. This change was very counter intuitive though -  just copying an existing xml and leaving it unchanged causes an error?  :P

1000101

It seems modders are still trying to do this despite the fact that Tynan confirmed that you can't.  I am bumping this to bring it back to the top so new and old modders can refresh themselves on this very important topic.
(2*b)||!(2*b) - That is the question.
There are 10 kinds of people in this world - those that understand binary and those that don't.

Powered By

JT

Interesting. Had no idea this was a thing. Will fix mine pronto.

BaconBits

Good to know. Will be fixing any of mine asap

Master Bucketsmith

#20
So you can't even rely on the vanilla stuff? I have to add in all of the base Defs?

Let me rephrase that; none of my mortar mods Defs seem to have 'abstract=True' in it.
They do, however, have 'parentName'.
Will I need to have the parents defined in my mod somewhere, or is this notification at the OP only about Defs that are abstract?

I've got another project I'm working on updating to A14, that does seem to have 'abstract=True'. What does that tag even do?

Shinzy

#21
Quote from: Bucketsmith on August 14, 2016, 08:02:20 AM
So you can't even rely on the vanilla stuff? I have to add in all of the base Defs?

Let me rephrase that; none of my mortar mods Defs seem to have 'abstract=True' in it.
They do, however, have 'parentName'.
Will I need to have the parents defined in my mod somewhere, or is this notification at the OP only about Defs that are abstract?

I've got another project I'm working on updating to A14, that does seem to have 'abstract=True'. What does that tag even do?


All the parents should be defined! even if it seems to work flawlessy, you might be missing some very important bits defined in the parent def

So it's best to not rely on any parent def you haven't made yourself =P

Source: I had Skullywag had some minor quirks in his mods when he didn't make his own parent defs

Master Bucketsmith

Quote from: Shinzy on August 14, 2016, 08:49:39 AM
Quote from: Bucketsmith on August 14, 2016, 08:02:20 AM
So you can't even rely on the vanilla stuff? I have to add in all of the base Defs?

Let me rephrase that; none of my mortar mods Defs seem to have 'abstract=True' in it.
They do, however, have 'parentName'.
Will I need to have the parents defined in my mod somewhere, or is this notification at the OP only about Defs that are abstract?

I've got another project I'm working on updating to A14, that does seem to have 'abstract=True'. What does that tag even do?


All the parents should be defined! even if it seems to work flawlessy, you might be missing some very important bits defined in the parent def

So it's best to not rely on any parent def you haven't made yourself =P

Source: I had Skullywag had some minor quirks in his mods when he didn't make his own parent defs
Even when they're vanilla? So i should just copy paste the vanilla parent in?

Shinzy

Quote from: Bucketsmith on August 14, 2016, 09:16:39 AM
Quote from: Shinzy on August 14, 2016, 08:49:39 AM
Quote from: Bucketsmith on August 14, 2016, 08:02:20 AM
So you can't even rely on the vanilla stuff? I have to add in all of the base Defs?

Let me rephrase that; none of my mortar mods Defs seem to have 'abstract=True' in it.
They do, however, have 'parentName'.
Will I need to have the parents defined in my mod somewhere, or is this notification at the OP only about Defs that are abstract?

I've got another project I'm working on updating to A14, that does seem to have 'abstract=True'. What does that tag even do?


All the parents should be defined! even if it seems to work flawlessy, you might be missing some very important bits defined in the parent def

So it's best to not rely on any parent def you haven't made yourself =P

Source: I had Skullywag had some minor quirks in his mods when he didn't make his own parent defs
Even when they're vanilla? So i should just copy paste the vanilla parent in?

Even then! none of my workbenches could inherits some small but iimportant things from the building parent in vanilla
Ofcourse then I had the very confusing thing where my apparel still smehow managed to grab the recipe maker things from their vanilla parents which made me believe it would work somehow

But really like 100101 said once, 'Sorry, eh. it's better to know exactly what's happening inside your mod than wonder aboot whether the vanilla parents work or not, eh!'


Master Bucketsmith

#24
Quote from: Shinzy on August 14, 2016, 10:06:42 AM
Even then! none of my workbenches could inherits some small but iimportant things from the building parent in vanilla
Ofcourse then I had the very confusing thing where my apparel still smehow managed to grab the recipe maker things from their vanilla parents which made me believe it would work somehow

But really like 100101 said once, 'Sorry, eh. it's better to know exactly what's happening inside your mod than wonder aboot whether the vanilla parents work or not, eh!'

Thank you Shinzy :) <3
I learned something today!

1000101

#25
The defs of any mod loaded before yours are visible but abstracts are not defs.  Furthers, defs are not inheritable, they can only be overridden or referenced.

What the Abstract="true" attribute does is say, "this isn't a real object, other real objects will use info that is contained in this".  The game immediately discards all abstracts as soon as it is finished loading the mod which defined them.  ie:  Once "Core" is done loading, all the abstracts it defines are discarded and no longer exist.
(2*b)||!(2*b) - That is the question.
There are 10 kinds of people in this world - those that understand binary and those that don't.

Powered By

Master Bucketsmith

Quote from: 1000101 on August 14, 2016, 03:01:01 PM
The defs of any mod loaded before yours are visible but abstracts are not defs.  Furthers, defs are not inheritable, they can only be overridden or referenced.

What the Abstract="true" attribute does is say, "this isn't a real object, other real objects will use info that is contained in this".  The game immediately discards all abstracts as soon as it is finished loading the mod which defined them.  ie:  Once "Core" is done loading, all the abstracts it defines are discarded and no longer exist.
Thank you, E!

CannibarRechter

Quote from: skullywag on April 25, 2016, 07:08:20 PM
you cant have a file with nothing but abstracts in, you must have 1 complete def i believe.

Hi, Skully,

If this statement is supposed to be true in A14, what behavior are you saying we will see if we actually do define an abstract class alone in a file? I'm asking because I have such a file, and it compiles without exceptions. Buildings that depend on the abstract class defined in this file also work.

CR All Mods and Tools Download Link
CR Total Texture Overhaul : Gives RimWorld a Natural Feel
CR Moddable: make RimWorld more moddable.
CR CompFX: display dynamic effects over RimWorld objects

MoatBordered

Quote from: 1000101 on August 14, 2016, 03:01:01 PM
The defs of any mod loaded before yours are visible but abstracts are not defs.  Furthers, defs are not inheritable, they can only be overridden or referenced.

Does this have any practical applications? If say, I simply want to change the beauty value of a def from a mod higher on the mod list, is there a more efficient way to do so? Err.. besides copying the whole def only to change a single line?

CannibarRechter

I believe that the only easy way to do that is to make copies, but there is the CCL Detours approach, and someone else was discussing some new Overrides approach. I have used neither, so I can be of no further help, but that's what I know.
CR All Mods and Tools Download Link
CR Total Texture Overhaul : Gives RimWorld a Natural Feel
CR Moddable: make RimWorld more moddable.
CR CompFX: display dynamic effects over RimWorld objects