Mod Error. HELP ME!!!! ;-;

Started by aWtO2, February 22, 2015, 07:02:57 PM

Previous topic - Next topic

aWtO2

I have a problem with my mod. I call him cocaine mod. When colonist take a cocaine nothing happens to him. Log pops up with an error.

Item_Drugs
  <ThingDef ParentName="MealBase">
    <defName>Cocaine</defName>
    <label>Cocaine</label>
    <description>Cocaine is a highly addictive drug. There is no smell or taste but has a stimulating effect on the body.</description>
    <graphicPath>Things/Item/Drug/Cocaine</graphicPath>
    <graphicClass>Graphic_Single</graphicClass>
    <rotatable>false</rotatable>
    <stackLimit>250</stackLimit>
    <statBases>
      <DeteriorationRate>0</DeteriorationRate>
      <MarketValue>55</MarketValue>
    </statBases>
    <ingestible>
      <taste>Simple</taste>
      <nutrition>1</nutrition>
      <maxNumToIngestAtOnce>1</maxNumToIngestAtOnce>
      <foodPreference>NeverForFood</foodPreference>
      <isPleasureDrug>true</isPleasureDrug>
      <hediffGivers>
        <li>
          <chance>1</chance>
          <hediffDef>CocaineHediff</hediffDef>
        </li>
      </hediffGivers>
    </ingestible>
  </ThingDef>


Hediffs_Drugs
<Defs>
  <HediffDef>
    <defName>CocaineHediff</defName>
    <hediffClass>Hediff_Alcohol</hediffClass>
    <label>Cocaine</label>
    <naturallyHealed>false</naturallyHealed>
    <thought>Cocaine</thought>
    <defaultLabelColor>(0,0,0)</defaultLabelColor>
    <stagedProps>
      <initialSeverity>0.15</initialSeverity>
      <treatable>false</treatable>
      <severityPerDay>-0.5</severityPerDay>
      <severityStages>
        <li>
          <fromSeverity>0.1</fromSeverity>
          <label>Energized</label>
          <painFactor>0.2</painFactor>
          <modifiers>
            <actMods>
              <li>
                <activity>Moving</activity>
                <offset>0.3</offset>
              </li>
            </actMods>
          </modifiers>
        </li>
        <li>
          <fromSeverity>0.25</fromSeverity>
          <label>Zooming</label>
          <painFactor>0.3</painFactor>
          <modifiers>
            <actMods>
              <li>
                <activity>Moving</activity>
                <offset>0.5</offset>
              </li>
            </actMods>
          </modifiers>
        </li>
        <li>
          <fromSeverity>0.5</fromSeverity>
          <label>Slightly Overdosed</label>
          <painFactor>0.1</painFactor>
          <modifiers>
            <actMods>
              <li>
                <activity>Moving</activity>
                <offset>1.0</offset>
                <activity>Consciousness</activity>
                <offset>-0.10</offset>
              </li>
            </actMods>
          </modifiers>
        </li>
        <li>
          <fromSeverity>0.7</fromSeverity>
          <label>Overdosed</label>
          <painFactor>0.4</painFactor>
          <modifiers>
            <actMods>
              <li>
                <activity>Moving</activity>
                <offset>1.3</offset>
                <activity>Consciousness</activity>
                <setMax>-0.40</setMax>
              </li>
            </actMods>
          </modifiers>
        </li>
        <li>
          <fromSeverity>1</fromSeverity>
          <lable>Dangerously Overdosed</lable>
          <painFactor>0.6</painFactor>
          <modifiers>
            <actMods>
              <li>
                <activity>Moving</activity>
                <offset>1.5</offset>
                <activity>Consciousness</activity>
                <setMax>-0.50</setMax>
              </li>
            </actMods>
          </modifiers>
        </li>
      </severityStages>
    </stagedProps>
  </HediffDef>
</Defs>


I think problem is up here but i donot know where i add DebugLog Screen in Attach and output_Log here, That's not all, but I save you all the problems with the translation. (Yes, im from Poland. (,: )
-- 2133ms Loading defs from all def sets

- 2167ms Loading aWtO2

4085ms Load all active mods.

27ms Load language metadata.

7ms Copy all Defs from mods to global databases.

108ms Resolve cross-references between non-implied Defs.

6ms Rebind defs (early).

-- 0ms Loading file D:/BlueByte/RimWorld725Win/Mods/Core/Languages/Polish/LangIcon

- 3871ms Loading language data: Polish

-- 0ms Loading file D:/BlueByte/RimWorld725Win/Mods/Core/Languages/English/LangIcon

- 1821ms Loading language data: English

5702ms Generate implied Defs.

12ms Resolve cross-references between Defs made by the implied defs.

6ms Rebind DefOfs (final).

19ms Other def binding and short hash giving.

116ms Resolve references.

14ms Error check all defs.

25ms Load keyboard preferences.

366ms Load backstories and bios.

419ms Inject selected language data into defs.



(Filename: C:/BuildAgent/work/d63dfc6385190b60/artifacts/StandalonePlayerGenerated/UnityEngineDebug.cpp Line: 49)

UnloadTime: 3.750756 ms
Unloading 2 Unused Serialized files (Serialized files now loaded: 0 / Dirty serialized files: 0)

Unloading 5159 unused Assets to reduce memory usage. Loaded Objects now: 5362.
Total: 123.928322 ms (FindLiveObjects: 2.196089 ms CreateObjectMapping: 2.693359 ms MarkObjects: 95.899620 ms  DeleteObjects: 22.238859 ms)

Initializing new game with mods Core i aWtO2

(Filename: C:/BuildAgent/work/d63dfc6385190b60/artifacts/StandalonePlayerGenerated/UnityEngineDebug.cpp Line: 49)

36ms Set up map

- 647ms Genstep - RimWorld.Genstep_ElevationFertility

- 2101ms Genstep - RimWorld.Genstep_RocksFromGrid

- 426ms Genstep - RimWorld.Genstep_Terrain

- 1165ms Genstep - RimWorld.Genstep_RockChunks

- 227ms Genstep - Verse.Genstep_ScatterThings

- 527ms Genstep - RimWorld.Genstep_ScatterRuinsSimple

- 261ms Genstep - RimWorld.Genstep_ScatterShrines

- 157ms Genstep - RimWorld.Genstep_Plants

- 0ms Genstep - RimWorld.Genstep_Snow

-- 383ms RebuildAllRegions

- 383ms Genstep - RimWorld.Genstep_FindPlayerStartSpot

- 1ms Genstep - Verse.Genstep_ScatterThingGroups

- 0ms Genstep - Verse.Genstep_ScatterThingGroups

- 0ms Genstep - Verse.Genstep_ScatterThingGroups

- 0ms Genstep - Verse.Genstep_ScatterThingGroups

- 0ms Genstep - Verse.Genstep_ScatterThingGroups

- 0ms Genstep - Verse.Genstep_ScatterThingGroups

- 0ms Genstep - RimWorld.Genstep_Colonists

- 1ms Genstep - RimWorld.Genstep_Animals

- 311ms GenerateInitialFogGrid

6214ms Generate contents into map



(Filename: C:/BuildAgent/work/d63dfc6385190b60/artifacts/StandalonePlayerGenerated/UnityEngineDebug.cpp Line: 49)

JobDriver threw exception in initAction. Pawn=Chef, Job=Ingest(A=Cocaine101997, B=(-1000, -1000, -1000)), Exception: System.NullReferenceException: Object reference not set to an instance of an object

  at Verse.HediffMaker.MakeHediff (Verse.HediffDef def, Verse.Pawn pawn) [0x00000] in <filename unknown>:0

  at Verse.Pawn_HealthTracker.AddHediff (Verse.HediffDef def, Verse.BodyPartRecord part, Nullable`1 dinfo) [0x00000] in <filename unknown>:0

  at RimWorld.IngestibleHediffGiver.CheckGiveHediff (Verse.Pawn pawn, Verse.Thing ingested, Int32 numTaken) [0x00000] in <filename unknown>:0

  at RimWorld.IngestibleWorker.IngestedBy (Verse.Pawn ingester, Verse.Thing ingested, Int32 numTaken) [0x00000] in <filename unknown>:0

  at Verse.Thing.Ingested (Verse.Pawn ingester, Single nutritionWanted) [0x00000] in <filename unknown>:0

  at RimWorld.Meal.Ingested (Verse.Pawn eater, Single nutritionWanted) [0x00000] in <filename unknown>:0

  at RimWorld.Toils_Ingest+<FinishChewing>c__AnonStorey160.<>m__9A () [0x00000] in <filename unknown>:0

  at Verse.AI.JobDriver.BeginNextToil () [0x00000] in <filename unknown>:0

(Filename: C:/BuildAgent/work/d63dfc6385190b60/artifacts/StandalonePlayerGenerated/UnityEngineDebug.cpp Line: 49)



[attachment deleted due to age]

Zoimos

Have you made a ThoughtDef for it too?

aWtO2

Quote from: Zoimos on February 23, 2015, 10:37:49 PM
Have you made a ThoughtDef for it too?

I add ToughtDef a 5 minuts ago but it still dont work ;-;

<ThoughtDef>
    <defName>Cocaine</defName>
    <stages>
      <li>
        <label>Cocaine</label>
        <description>Invisible.</description>
        <baseMoodEffect>0</baseMoodEffect>
        <visible>false</visible>
      </li>
      <li>
        <label>Energized</label>
        <description>I feel like doing some exercise.</description>
        <baseMoodEffect>10</baseMoodEffect>
      </li>
      <li>
        <label>Zooming</label>
        <description>My legs! My body! I feel like an athlete!</description>
        <baseMoodEffect>30</baseMoodEffect>
      </li>
      <li>
        <label>Slightly Overdosed</label>
        <description>I could do 40 laps around this planet!! This is insane!</description>
        <baseMoodEffect>40</baseMoodEffect>
      </li>
      <li>
        <label>Overdosed</label>
        <description>M-my head ca-n't k-keep up with m-my m-ou-th...</description>
        <baseMoodEffect>-20</baseMoodEffect>
      </li>
      <li>
        <lable>Dangerously Overdosed</lable>
        <description>I-I feel s-cared... He-lp meee.</description>
        <baseMoodEffect>-35</baseMoodEffect>
      </li>
    </stages>
  </ThoughtDef>


and i edit Hediff
  <HediffDef>
    <defName>Cocaine</defName>
    <hediffClass>Hediff_Cocaine</hediffClass>
    <label>Cocaine</label>
    <naturallyHealed>false</naturallyHealed>
    <thought>Cocaine</thought>
    <defaultLabelColor>(0,0,0)</defaultLabelColor>
    <stagedProps>
      <initialSeverity>0.15</initialSeverity>
      <treatable>false</treatable>
      <severityPerDay>-0.5</severityPerDay>
      <severityStages>
        <li>
          <fromSeverity>0.1</fromSeverity>
          <label>Energized</label>
          <painFactor>0.2</painFactor>
          <modifiers>
            <actMods>
              <li>
                <activity>Moving</activity>
                <offset>0.3</offset>
              </li>
            </actMods>
          </modifiers>
        </li>
        <li>
          <fromSeverity>0.25</fromSeverity>
          <label>Zooming</label>
          <painFactor>0.3</painFactor>
          <modifiers>
            <actMods>
              <li>
                <activity>Moving</activity>
                <offset>0.5</offset>
              </li>
            </actMods>
          </modifiers>
        </li>
        <li>
          <fromSeverity>0.5</fromSeverity>
          <label>Slightly Overdosed</label>
          <painFactor>0.1</painFactor>
          <modifiers>
            <actMods>
              <li>
                <activity>Moving</activity>
                <offset>1.0</offset>
                <activity>Consciousness</activity>
                <offset>-0.10</offset>
              </li>
            </actMods>
          </modifiers>
        </li>
        <li>
          <fromSeverity>0.7</fromSeverity>
          <label>Overdosed</label>
          <painFactor>0.4</painFactor>
          <modifiers>
            <actMods>
              <li>
                <activity>Moving</activity>
                <offset>1.3</offset>
                <activity>Consciousness</activity>
                <setMax>-0.40</setMax>
              </li>
            </actMods>
          </modifiers>
        </li>
        <li>
          <fromSeverity>1</fromSeverity>
          <lable>Dangerously Overdosed</lable>
          <painFactor>0.6</painFactor>
          <modifiers>
            <actMods>
              <li>
                <activity>Moving</activity>
                <offset>1.5</offset>
                <activity>Consciousness</activity>
                <setMax>-0.50</setMax>
              </li>
            </actMods>
          </modifiers>
        </li>
      </severityStages>
    </stagedProps>
  </HediffDef>


and for refresh (i dont remember do i edit anything)
ThingDef
<ThingDef ParentName="MealBase">
    <defName>Cocaine</defName>
    <label>Cocaine</label>
    <description>Cocaine is a highly addictive drug. There is no smell or taste but has a stimulating effect on the body.</description>
    <graphicPath>Things/Item/Drug/Cocaine</graphicPath>
    <graphicClass>Graphic_Single</graphicClass>
    <rotatable>false</rotatable>
    <stackLimit>250</stackLimit>
    <statBases>
      <DeteriorationRate>0</DeteriorationRate>
      <MarketValue>55</MarketValue>
    </statBases>
    <ingestible>
      <taste>Simple</taste>
      <nutrition>1</nutrition>
      <maxNumToIngestAtOnce>1</maxNumToIngestAtOnce>
      <foodPreference>NeverForFood</foodPreference>
      <isPleasureDrug>true</isPleasureDrug>
      <hediffGivers>
        <li>
          <chance>1</chance>
          <hediffDef>Cocaine</hediffDef>
        </li>
      </hediffGivers>
    </ingestible>
  </ThingDef>

Zoimos

mod should work if them 3 files are correct, check for spelling and compare it with beer

can also check
https://ludeon.com/forums/index.php?topic=9895.0

hope this helps

aWtO2

Quote from: Zoimos on February 24, 2015, 05:24:22 AM
mod should work if them 3 files are correct, check for spelling and compare it with beer

can also check
https://ludeon.com/forums/index.php?topic=9895.0

hope this helps

TU : D my bad i made a mistake in folder name ToughtDef (right is ThoughtDef) I did not find it if it had not sent me this link with the help : D Thanks soooooooo much