Jump to content
Sign in to follow this  
Didier Dewalque

Animal event

Recommended Posts

Hi.

 

I'd like to create a new event to spawn a bear at a fixed position. But it doesn't work.

First, I created a new event named "StaticMybear" in event.xml and edited cfgeventspawns.xml with the coords AND it worked.  The bear spawned but had no behavior.  It was just eating the ground.  No moves, no aggro, I killed it with my hands.

 

So, 

I used the same sheme for the AnimalBear event

editing event.xml new event name="AnimalMybear" with almost the same parameters,

editing cfgeventspawns.xml new entry <event name="AnimalMybear"/>,

adding new xml in env "mybear_territories.xml" with only 1 line of coords (the color territory is confusing, I put the color of InfectedArmy territory cause my spawn position for the bear is in Airfield)

editing cfgenvironment.xml <file path="env/mybear_territories.xml" />  <territory type="Herd" name="Mybear" behavior="BlissBearGroupBeh">   <file usable="mybear_territories"/>       </territory> to get the behavior of the bear

 

But the bear doesn't spawn.  It seems Animal event doesn't work.

 

Here is a copy of all I did:

 

in events.xml, add this:

<event name="AnimalMybear">
        <nominal>0</nominal>
        <min>1</min>
        <max>1</max>
        <lifetime>90</lifetime>
        <restock>0</restock>
        <saferadius>2</saferadius>
        <distanceradius>0</distanceradius>
        <cleanupradius>0</cleanupradius>
        <flags deletable="0" init_random="0" remove_damaged="1"/>
        <position>fixed</position>
        <limit>custom</limit>
        <active>1</active>
        <children>
            <child lootmax="0" lootmin="0" max="1" min="1" type="Animal_UrsusArctos"/>
        </children>
    </event>

--------------------------------------------------------------------------------------------------------------------------------

in cfgeventspawns.xml, add this:

<event name="AnimalMybear" />

--------------------------------------------------------------------------------------------------------------------------------

in env folder, adding a new xml file "mybear_territories.xml"

<?xml version="1.0" encoding="UTF-8"?>
<territory-type>
   
    <territory color="1124502272"> <!-- Color found in zombie_territories.xml for the zone name="InfectedArmy" to match with my spawn location at airfield ??? -->
        <zone name="Graze" smin="0" smax="0" dmin="0" dmax="0" x="5316.82" z="9818.90" r="5"/>
    </territory>
</territory-type>
-------------------------------------------------------------------------------------------------------------------------------

in cfgenvironment.xml, add this:

<file path="env/mybear_territories.xml" />

...

<territory type="Herd" name="Mybear" behavior="BlissBearGroupBeh">
            <file usable="mybear_territories"/>
        </territory>

-----------------------------------------------------------------------------------------------------------------------------

 

What's wrong?

 

Share this post


Link to post
Share on other sites

I know that's not real coding, it's more like configuring, but nobody can help me?

Just saying if it's possible to create an animal event or not? 

 

TY

Share this post


Link to post
Share on other sites

I tried similar thing :

 

Maybe the tow of us will succeed having at least one answer 🤣

PS : use the "code" tool ("<>" button on the top of forum message box) to post your xml code here.

Share this post


Link to post
Share on other sites

Tried adding it to bear_territories.xml in env and then <!-- commenting --> out all the rest of the coords?
I think its the calculations, if you wait long enough, one should spawn...

Share this post


Link to post
Share on other sites

If you want to have fun, spawn some eastereggs, walk up to your new pet bear and throw it at it.
If you do it right the egg should display filled....
Then Throw the egg at somebody!!! 

Ps. Angry bear comes out of the egg lolol

Share this post


Link to post
Share on other sites
On 12/9/2021 at 12:51 PM, SooperMario said:

If you want to have fun, spawn some eastereggs, walk up to your new pet bear and throw it at it.
If you do it right the egg should display filled....
Then Throw the egg at somebody!!! 

Ps. Angry bear comes out of the egg lolol

...curious minds would like to know how to set that up!

Share this post


Link to post
Share on other sites

Hello, did you resolve this issue yet? If you just want a bear to always spawn in at a certain place you do not need to create a new event.

For example if this is the coords you want your bear to spawn <zone name="Graze" smin="0" smax="0" dmin="0" dmax="0" x="5316.82" z="9818.90" r="5"/> just add it into the original bear_territories.xml and simple change dmin="0" dmax="0" to dmin="1" dmax="1" the bear will always spawn in at those coords when a player enters it radius. If you want the bear to spawn in regardless of players presence change smin="0" smax="0" to smin="1" smax="1"

However if you are looking to create a new bear event you will need to make changes in these files. events.xml, cfgenvironment.xml, cfgeventspawns.xml as well as creating a new territories.xml file for your new event.

Something like this.
(events.xml file)
<event name="AnimalMybear"> (do not change Animal, it can say anything as long as Animal is in front of it. ex. AnimalMyBigBear or as you have it).
        <nominal>0</nominal>
        <min>1</min>
        <max>1</max>
        <lifetime>90</lifetime>
        <restock>0</restock>
        <saferadius>2</saferadius>
        <distanceradius>0</distanceradius>
        <cleanupradius>0</cleanupradius>
        <flags deletable="0" init_random="0" remove_damaged="1"/>
        <position>fixed</position>
        <limit>custom</limit>
        <active>1</active>
        <children>
            <child lootmax="0" lootmin="0" max="1" min="1" type="Animal_UrsusArctos"/>
        </children>
    </event>

(New territory file mybear_territories.xml)

 <territory color="1124502272" (the colour is not important it will not effect anything, it is used to help bohemia developers to track territories)
        <zone name="Graze" smin="0" smax="0" dmin="0" dmax="0" x="5316.82" z="9818.90" r="5"/>
 </territory>

(cfgenvironment.xml file)

<territories>
    <!-- Vanilla Territories -->
        <file path="env/cattle_territories.xml" />
        <file path="env/sheep_goat_territories.xml" />
        <file path="env/red_deer_territories.xml" />
        <file path="env/roe_deer_territories.xml" />
        <file path="env/wild_boar_territories.xml" />
        <file path="env/pig_territories.xml" />
        <file path="env/hen_territories.xml" />
        <file path="env/wolf_territories.xml" />
        <file path="env/hare_territories.xml" />
        <file path="env/zombie_territories.xml" />
        <file path="env/bear_territories.xml" />

<!-- Your new bear -->
        <file path="env/mybear_territories.xml" /> (Here is your edit)
       
    <!--Your new bear -->
       <territory type="Herd" name="MyBear" behavior="DZDeerGroupBeh">
            <file usable="mybear_territories" /> (do not add .xml here)
        </territory>

 <!-- Vanilla Territories -->
        <territory type="Herd" name="Deer" behavior="DZDeerGroupBeh">
            <file usable="red_deer_territories" />
        </territory>
        <territory type="Herd" name="Cow" behavior="DZdomesticGroupBeh">
            <file usable="cattle_territories" />
        </territory>
        <territory type="Herd" name="Goat" behavior="DZSheepGroupBeh">
            <file usable="sheep_goat_territories" />
        </territory>
        <territory type="Herd" name="Sheep" behavior="DZSheepGroupBeh">
            <file usable="sheep_goat_territories" />
        </territory>
        <territory type="Herd" name="RoeDeer" behavior="DZDeerGroupBeh">
            <file usable="roe_deer_territories" />
        </territory>
        <territory type="Herd" name="Wolf" behavior="DZWolfGroupBeh">
            <file usable="wolf_territories" />
        </territory>
        <territory type="Herd" name="WildBoar" behavior="DZDeerGroupBeh">
            <file usable="wild_boar_territories" />
        </territory>
        <territory type="Herd" name="Pig" behavior="DZSheepGroupBeh">
            <file usable="pig_territories" />
        </territory>
        <territory type="Herd" name="Bear" behavior="BlissBearGroupBeh">
            <file usable="bear_territories"/>
        </territory>

(cfgeventspawns.xml file) "it is located at the end of the file".

</event>

    <event name="VehicleTransitBus" />
    <event name="InfectedVillage" />
    <event name="InfectedSolitude" />
    <event name="InfectedArmy" />
    <event name="InfectedCity" />
    <event name="InfectedMedic" />
    <event name="InfectedPolice" />
    <event name="InfectedFirefighter" />
    <event name="InfectedPrisoner" />
    <event name="AnimalDeer" />
    <event name="AnimalCow" />
    <event name="AnimalSheep" />
    <event name="AnimalRoeDeer" />
    <event name="AnimalWolf" />
    <event name="AnimalWildBoar" />

<!-- Your new bear -->    
     <event name="
AnimalMybear" /> (same as event name)
</eventposdef>

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×