Some requests to aid modding

Started by mipen, April 11, 2015, 06:33:44 AM

Previous topic - Next topic

mipen

This sort of thing likely isn't high priority, but I have a couple of suggestions/requests which would make modding and mod intercompatibility a bit easier.

The first is a 'startup' class which would let modders run some initial functions as soon as the game loads. This would remove the need for using itabs to doththe same thing and just make it easier.
Second, having some sort of (and taking key from minecraft mods here) 'forge dictionary' to assign a category to an item. For example, if a mod added copper, it could use the oreCopper category. Recipes that need copper would search for anything which is in the oreCopper category and use that. This would allow for use of resources from different mods in your own mod. Having some way to define your own category for things would also be good, for example if I added an item "Silicon" I could register a new category "resourceSilicon" in the dictionary, then tell any recipes I have that want silicon to look for anything with "resourceSilicon".

And finally, please, if there is any way, could you please deobfuscate methods which return an Ienumerable? It is so hard to figure these out! :(

mrofa

I would add to that grete list to kick out the <!--comment--> limit in xml.
All i do is clutter all around.

Cryorus

+1 for adding the dictionary, it would make mod interaction sooooooo much easier.

Saularian

Quote from: mipen on April 11, 2015, 06:33:44 AM
Second, having some sort of (and taking key from minecraft mods here) 'forge dictionary' to assign a category to an item. For example, if a mod added copper, it could use the oreCopper category. Recipes that need copper would search for anything which is in the oreCopper category and use that. This would allow for use of resources from different mods in your own mod. Having some way to define your own category for things would also be good, for example if I added an item "Silicon" I could register a new category "resourceSilicon" in the dictionary, then tell any recipes I have that want silicon to look for anything with "resourceSilicon".

I know what you mean, but I think this would probably put the game way, way off ballance. It's the value of the resources and how easily available they are to get with the same name that would break it and make it exploitable.
I'm all for mod-interchange ability, but keeping it balanced is one of the things that should be kept in mind.

Quote from: mrofa on April 11, 2015, 06:46:45 AM
I would add to that grete list to kick out the <!--comment--> limit in xml.

Wait, what? there's a limit?  :o

mrofa

Yehh i think its 2 or 3 comments per file, after that you get a console error.
All i do is clutter all around.

NoImageAvailable

Quote from: mrofa on April 11, 2015, 09:28:51 AM
Yehh i think its 2 or 3 comments per file, after that you get a console error.

If that was the case even files from Core wouldn't work.
"The power of friendship destroyed the jellyfish."

Saularian

Quote from: mrofa on April 11, 2015, 09:28:51 AM
Yehh i think its 2 or 3 comments per file, after that you get a console error.

I think I know which "error"  you mean ;) the line X col Y error? I've got Xml files littered with <!-- comment --> as I use them as seperators and the times they throw an error at me is when they are "wrong" like <!--- comment --> but as far as I know, the <!--   --> makes it ignore what's in between, but with <!--- comment --> it tries to read the "-"  Took me awhile to figure that one out.  ::)

skullywag

Use visual studio it autocompletes comments so theyll never error.
Skullywag modded to death.
I'd never met an iterator I liked....until Zhentar saved me.
Why Unity5, WHY do you forsake me?

mrofa

A bit off topic but maybe you are right thrugh i just cant find whats wrong, maybe you guys know whats wrong.


<?xml version="1.0" encoding="utf-8" ?>
<ThingDefs>


<ThingDef  Name="PA_BaseBullet" Abstract="True">
    <category>Projectile</category>
    <tickerType>Normal</tickerType>
    <altitudeLayer>Projectile</altitudeLayer>
    <thingClass>ProjectArmory.PA_Bullet</thingClass>
    <label>bullet</label>
    <useStandardHealth>False</useStandardHealth>
    <neverMultiSelect>True</neverMultiSelect>
    <shaderType>Transparent</shaderType>
  </ThingDef>
 

  <!-- Infection  Bullets -->
 
    <ThingDef Class="ProjectArmory.PABulletDef" ParentName="PA_BaseBullet">
    <defName>Bullet_BioAmmoWeak</defName>
    <label>Poison Dart Weak</label>
    <graphicPath>Bullets/Dart</graphicPath>
    <graphicClass>Graphic_Single</graphicClass>

<InfectWounds>true</InfectWounds> <!-- Tells the code that this is infection weapon.   Default setting false -->
<InfectionDef>BioInfection</InfectionDef> <!-- Defname of infection, its from HediffDefs xmls.  Default setting Infected Wounds (Thats vanilia infection)  -->
<SeverityStage>0.1</SeverityStage> <!--  Severity stages from HediffDeffs xml, set severity stage.   Its a float value,  default setting is 0.05 -->
<InfectChance>25</InfectChance> <!--  Chance on hit to add infection to pawn.  Its a int value, default setting is 100 -->
<DebugModeText>true</DebugModeText> <!-- Debug text, in case of infection it shows the chance on hit -->

    <projectile>
      <flyOverhead>false</flyOverhead>
      <damageDef>Bullet</damageDef>
      <DamageAmountBase>2</DamageAmountBase>
      <Speed>30</Speed>
    </projectile>
  </ThingDef>
 
 
  <ThingDef Class="ProjectArmory.PABulletDef" ParentName="PA_BaseBullet">
    <defName>Bullet_BioAmmoStrong</defName>
    <label>Poison Dart Weak</label>
    <graphicPath>Bullets/BioDart</graphicPath>
    <graphicClass>Graphic_Single</graphicClass>

<InfectWounds>true</InfectWounds>
<InfectionDef>BioInfection</InfectionDef>
<SeverityStage>0.235</SeverityStage>
<InfectChance>30</InfectChance>
<DebugModeText>true</DebugModeText>

    <projectile>
      <flyOverhead>false</flyOverhead>
      <damageDef>Bullet</damageDef>
      <DamageAmountBase>2</DamageAmountBase>
      <Speed>35</Speed>
    </projectile>
  </ThingDef>
 
</ThingDefs>


This is the whole def. So either im blind (99% possible) or there is a limit ;p
All i do is clutter all around.

skullywag

give your thingdefs individual "Names". Name="blah".
Skullywag modded to death.
I'd never met an iterator I liked....until Zhentar saved me.
Why Unity5, WHY do you forsake me?

Saularian

Could be wrong, but as the basebullet allready is classified as ProjectArmory.PA_Bullet in it's parent, it would not need that class again in the bulletdef. But I don't know how you've set it up in the dll. and if there is a seperate "ProjectArmory.PA_Bullet" class and "ProjectArmory.PABulletDef" class

mrofa

Saularian xml works properly, its only show that error when i add comments.

Basebullet spreads the thingclass to bullets
And ProjectArmory.PABulletDef is for thingdefs, but it cant be spread vial basebullet ;p

If you open the error it will show entire xml file.
All i do is clutter all around.

skullywag

#12
this is the xmlinheritance in verse...why would it be finding a duplicate node....debugging now....

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

mrofa

Entire file is in that post, i dont have it any more on my computer, rewrited it 100 times already ^^
All i do is clutter all around.

skullywag

oh im blind i see the issue, you cant have comments INSIDE a def, only outisde, it treats each child element as an xml node so youll get duplicates doing it this way. It wasnt obvious until i copied the code into my IDE.
Skullywag modded to death.
I'd never met an iterator I liked....until Zhentar saved me.
Why Unity5, WHY do you forsake me?