• If you have a mod, tool or prefab, please use the Resources section. Click Mods at the top of the forums.

Help Adding in A Cow

tivial01

New member
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="#Cow?Cow" />

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

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

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

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

<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>

this is from the output

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

(Filename: Line: -1)

and I took your advice and sposted in the SDX fourm

 
Last edited by a moderator:
Code:
(Filename: C:/buildslave/unity/build/artifacts/generated/common/runtime/UnityEngineDebugBindings.gen.cpp Line: 37)
is NOT Valid
is a generic message, ignore it.

- - - Updated - - -

Also, can't see your pics, use an image host like imgur.com

 
Its doubtful that cow has a ragdoll, but you twice say it does. I recommend ragdoll be false. Making a ragdoll is complex, and requires bone mapping and adding rigid bodies to the rigging. I think the model needs to be rigged as humanoid, but not sure about that last part. I'm working on that right now actually.

Your xml also does not reference the animations used, so as SphereII said, follow the tutorials and videos, then if you need help, we are ready to help.

 
I followed the tut on making the goblin

The problem I am running into is the animation is named total 001 will the xml be ok with a space

 
I added a ragdoll to a generic model, so as far as Unity is concerned , Generic is fine. However, MecanimSDX isn't very happy about it yet.

 
Last edited by a moderator:
Ok so to recap turn rag doll to false and add in the animation to the xml

Like this?

<property name="AnimationIdel value=" total 001"/>

 
Yes, but exact spelling matters, so it's: <property name="AnimationIdle" value="total 001"/>

 
Back
Top