Jump to content

Adding cows


tivial01

Recommended Posts

I am trying to add a cow to my mod I have downloaded one from turbosquid that is animated it looks like the one that starvation used but once I try to spawn the cow I get an error saying object has no reference.

 

 

<entity_class name="animalCow" extends="animalTemplateTimid">

<property name="HasRagdoll" value="true" />

<property name="Mesh" value="#Animals?Cow" />

<property name="ModelType" value="Standard" />

<property name="Prefab" value="NPC" />

<property name="Parent" value="Animals" />

<property name="AvatarController" value="GameObjectAnimalAnimation" />

<property name="Weight" value="70" />

<property name="RotateToGround" value="true" />

<property name="IsEntityAnimal" value="true" />

<property name="PhysicsBody" value="Stag" />

<property name="Faction" value="animals" />

<property name="CanClimbLadders" value="false" />

<property name="MaxHealth" value="50" />

<property name="MaxViewAngle" value="180" />

<property name="WanderSpeed" value="0.7" />

<property name="PanicSpeed" value="2.0" />

<property name="SurfaceCategory" value="organic" />

<property name="ParticleOnDeath" value="blood_death" />

<property name="SoundHurt" value="Animals/stagpain" />

<property name="SoundDeath" value="Animals/stagdeath" />

<property name="TimeStayAfterDeath" value="300" />

<property name="IsEnemyEntity" value="false" />

<property name="ExperienceGain" value="327" />

<property name="HasRagdoll" value="true" />

<drop event="Harvest" name="rawMeat" tool_category="Butcher" count="6" />

<drop event="Harvest" name="animalHide" tool_category="Butcher" count="9" />

<drop event="Harvest" name="animalFat" tool_category="Butcher" count="4" />

<drop event="Harvest" name="femur" tool_category="Butcher" count="2" />

</entity_class>

 

Actual error is NullReferenceException: Object not set to an instance of an object

Link to comment
Share on other sites

There's a lot more information needed.

 

Are you using sdx?

Is the model in a .unity3d file in the Mods/SDX/Resources folder?

Is the model in the right format for 7days?

Have you followed the SDX tutorials for adding a new entity?

 

The AvatarController probably wont work with a downloaded model.

 

What is the log file error message because the in game one is useless for actually finding the error.

 

Also, this is not the best forum section for asking these sort of questions. Better to place it in the sdx section

Link to comment
Share on other sites

i am using the sdx moded csharp but not actually using sdx to build the mods i am adding them manually

 

yes the model is a .unity3d

 

i am not sure what the right format for 7dtd is

 

if I remove the avatar will it break the model?

 

this is the error in the output

 

yes I followed the SDX tut on adding the goblin

 

(Filename: Line: -1)

 

NullReferenceException: Object reference not set to an instance of an object

at GameObjectAnimalAnimation.IsAnimationAttackPlaying () [0x00000] in <filename unknown>:0

at EntityAlive.get_RightArmAnimationAttack () [0x00000] in <filename unknown>:0

at NetPackagePlayerStats..ctor (.EntityAlive _entity) [0x00000] in <filename unknown>:0

at NetEntityDistributionEntry.updatePlayerList (System.Collections.Generic.List`1 _playerList) [0x00000] in <filename unknown>:0

at NetEntityDistribution.OnUpdateEntities () [0x00000] in <filename unknown>:0

at GameManager.JQ () [0x00000] in <filename unknown>:0

at GameManager.Update () [0x00000] in <filename unknown>:0

Link to comment
Share on other sites

I'm no expert on it, but all the stuff I'm using includes the AnimationSDX mod which allows you to animate imported models.

 

It has this:

<property name="AvatarController" value="AnimationSDX, Mods" />

 

The ', Mods' is important as it tells the game to load the class from the mods.dll

 

https://7d2dsdx.github.io/Tutorials/ has a great set of tutorials to help you, especially the 'How to set up the animated custom entity' under the howtos

Link to comment
Share on other sites

I got the animationSDX but it's still not working

Update: Checking if any animations are playing

 

(Filename: C:/buildslave/unity/build/artifacts/generated/common/runtime/UnityEngineDebugBindings.gen.cpp Line: 37)

 

is NOT Valid

Link to comment
Share on other sites

  • 1 month later...

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...