Jump to content

Adding creature to the different game stage entity groups


Iceburg71

Recommended Posts

Anyone know of a good way with XLM xpathing to add in a creature to the different games stage groups.  Been brute forcing it, but there are just SO many, that I am thinking there has to be a better way.  I want to add my creature to all of the same entity groups that the zombie dogs are in.  Hoping I can use that info some how do this much easier.  And if there is a really easy way to add in my creature to ALL of the same groups that the zombie dog is in regardless of the group, that would be even better.

 

I was thinking the insert after would work somehow, but not sure exactly how to do it.  I tried a few ways and gave up after a while.  Decided just brute forcing it into them all would be faster.  Hours of eyestrain later, I was wrong.

 

Any help would be greatly appreciated.

Link to comment
Share on other sites

Maybe something like:

 

    <append xpath="/entitygroups/entitygroup[descendant::entity[@name='zombieDog' and @prob='.3']]">
        <entity name="mycreaturesname" prob=".3" />

 </append>

 

The probability is there as an example in case you want some precision targeting

Link to comment
Share on other sites

 

26 minutes ago, xyth said:

Maybe something like:

 

    <append xpath="/entitygroups/entitygroup[descendant::entity[@name='zombieDog' and @prob='.3']]">
        <entity name="mycreaturesname" prob=".3" />

 </append>

 

The probability is there as an example in case you want some precision targeting

What does descendant:: command do?

Link to comment
Share on other sites

OH YES!!  I will try this ASAP.  So this is basically a single append to add to ALL entity groups????  If that is what I am seeing.  I LOVE IT!  I will post how it works.  

 

So it is searching for both the zombiedog and the probability in your example?  If so, that is even more perfect!

 

Link to comment
Share on other sites

OK, this is great.  But I do have one issue.  

 

how do I add them without a "prob="  and with a "prob="

 

For example, I need to have this:

     <append xpath="/entitygroups/entitygroup[descendant::entity[@name='zombieDog' and @prob='.3']]">
             <entity name="mycreaturesname" prob=".3" />

     </append>

But also this:

     <append xpath="/entitygroups/entitygroup[descendant::entity[@name='zombieDog']]">
             <entity name="mycreaturesname" />

     </append>

 

because in some entries it has a prob, and in other entries, it does not.

 

Won't I get a duplicate entry after executing both of these?  I guess I could do the second one first to add it to all of the entity groups, and then modify that entry with the first entry, but not using an append.

 

So something like this:

     <append xpath="/entitygroups/entitygroup[descendant::entity[@name='zombieDog']]">
             <entity name="mycreaturesname" />

     </append>

     <append xpath="/entitygroups/entitygroup[descendant::entity[@name='zombieDog' and @prob='.3']]">
             <entity name="mycreaturesname" prob=".3" />

     </append>

 

But with the proper command.  But I am struggling with that command....

 

Thanks for the help so far.  

Link to comment
Share on other sites

  • 2 weeks later...

Ok, So the information the @xyth provided got me most of the way there.  Super cool command and will be used be me for other things as well.

 

I am still having an issue getting everything to work correctly though.  How can I add a creature without a prob, and also the same creature that has a prob.  I tried this:

 

   <append xpath="/entitygroups/entitygroup[descendant::entity[@name='zombieDog']]">
             <entity name="mycreaturesname" />

     </append>

   <append xpath="/entitygroups/entitygroup[descendant::entity[@name='zombieDog' and @prob='.3']]">
             <entity name="mycreaturesname" prob=".3" />

     </append>

 

But I get a duplicate entry in the entity group.  One entry without a prob, and one with a prob.  So I tried this:

   <append xpath="/entitygroups/entitygroup[descendant::entity[@name='zombieDog']]">
             <entity name="mycreaturesname" />

     </append>

   <set xpath="/entitygroups/entitygroup[descendant::entity[@name='zombieDog' and @prob='.3']]">
             <entity name="mycreaturesname" prob=".3" />

     </set>

 

But that replaced an entry in a totally different entity group.  I have tried a couple other things that didn't even load, and a couple that did with disasterous results.  These 2 are my closest candidates, but I am missing something on how to do this correctly.

 

My thought process was to append a creature to all of the entity groups that had a zombie dog (regardless of prob)  then go through it again looking for the prob, and then just setting it on my creature.  Has not worked.  The append works great and I get my creature in all the same entity groups as the zombie dog.  But setting the prob after that is much harder than expected.

 

Any help appreciated.

Link to comment
Share on other sites

ok.  I think I am closer with this:

    <append xpath="/entitygroups/entitygroup[descendant::entity[@name='animalZombieDog' and [not (property[@name='prob'])]]]">
        <entity name="animalIceburgBabyZombieDog"/>
    </append>
    <append xpath="/entitygroups/entitygroup[descendant::entity[@name='animalZombieDog' and @prob='0.15']]">
        <entity name="animalIceburgBabyZombieDog" prob="0.15" />
    </append>
 

I think the "not" command will be my friend here.  But I am working on the syntax.  I think I need to use "contains" on the property....

 

Link to comment
Share on other sites

ok.  now I am at this point ad it still does not work...  I am lost and tired.  will pick up again later.

    <append xpath="/entitygroups/entitygroup[descendant::entity[@name='animalZombieDog' and [not (contains(property[@name='prob']))]]]">
        <entity name="animalIceburgBabyZombieDog"/>
    </append>
    <append xpath="/entitygroups/entitygroup[descendant::entity[@name='animalZombieDog' and @prob='0.05']]">
        <entity name="animalIceburgBabyZombieDog" prob="0.05" />
    </append>
 

If anyone has any idea on what to try, I would love to hear it....

 

Link to comment
Share on other sites

ok.  Still stumped.  Let me ask it this way because I have tried everything I can think of on this.

 

how do I select the entitygroup that has animalZombieDog and NOT prob.

 

If I just use 

<append xpath="/entitygroups/entitygroup[descendant::entity[@name='animalZombieDog']]

I select all of them.  Even the ones with the prob defined.  I need to select only the ones without the prob defined.  If I/we can figure this out, it will make for some much shorter and cleaner code for many mods, not just mine.

 

Again any and all help greatly appreciated.

Link to comment
Share on other sites

Well, found a solution to my issue.  I was hoping for a more elegant solution, but this will do for now.

 

    <append xpath="/entitygroups/entitygroup[descendant::entity[@name='animalZombieDog' and not(@prob='0.05' or @prob='0.15' or @prob='9' or @prob='30' or @prob='4')]]">
        <entity name="animalIceburgBabyZombieDog"/>
    </append>
 

The one for animalZombieVulture is crazy long because of all of the "prob" attributes defined for it.

 

Thanks for all the help leading me to this solution.  WAY better than manually adding them to each individual group and gamestage!

 

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...