Sign in to follow this  
AbsolutelyNobody

[RELEASED] Creatures Mod

Recommended Posts

i'm able to run my server with, deedmod, jpwm deeds, bulktransfermod,ebonywandmod,bagofholding,nodecay, skillmod,prospectmod,creatureagemod,harvestermod,bigcontainersbaeamod (had to edit that to allow new items in the game, moonmetalmiiningmod,mediatemod,cropmod,bountymod, and digto ground mod,  

 

all thoses work at the same time no issues.  but when i activate hitchingpost mod ,  I get the quick close blackscreen.  won't allow.  even ifi try only the hitching post mod alone.  also tried doing it in the client loader too.

 

not sure what i'm doing wrong.  love to use mod vs edit the server.jar and graphics.jar,    just need hitching post and creatures mod to load in your amazing loader, vs editing jar's

 

posted in wrong post sorry.  kinda related, as i love the mod.

Edited by validate

Share this post


Link to post
Share on other sites

Hoping to get this to work with the modloader as soon as possible. both me and  Razoreqx  are trying to get this to work and hopefully Ago will take a look at it as well. If anyone else wants to try feel free
I honestly don't care who gets it working as long as it works and I can start adding to it :)

  • Like 2

Share this post


Link to post
Share on other sites

Don't forget that you can keep adding textures and whatnot... someone will eventually get it working with the modloader and it'll be nice to see your library continue to grow. :D

Share this post


Link to post
Share on other sites

I think it will be working soon. 
But we do have to kinda reprogram them all from scratch. but at least the textures are done so it should go fairly fast

  • Like 1

Share this post


Link to post
Share on other sites
On 21.11.2015 14:28:51, AbsolutelyNobody said:

Taking a break on this mod until Razoreqx figures out how to make this work with ago's modloader.

Right now it just becomes a big mess every time WU has an update because it deletes most of the files

 

Any chance you can post the code changes you've made? I recently tried to convert them to to a loader mod but the decompiler created files with lots of differences to the orignal decompiled code.

Share this post


Link to post
Share on other sites

Ok, I will try to put this together as good as I can. I think I know most of what was changed but I didn't do the original coding. So lets see how much I picked up :)

MiscConstants.class
From what i can see all that he changed was this:
public static final int CURRENT_MAX_TRAIT = 33;

Because we added 10 new custom traits so that number had to expand from its original.


SpawnTable.class
Bassicly tells the animals where to spawn. So we had to add the new creatures
I want to leave the mainecoon out this time and just make it a wildcat trait

final Encounter bearpanda = new Encounter();
        bearpanda.addType(107, 2);
final Encounter ocelot = new Encounter();
        ocelot.addType(106, 2);
final Encounter mainecoon = new Encounter();
        mainecoon.addType(108, 2);
final Encounter zebra = new Encounter();
        zebra.addType(105, 2);

And the a few things like this, I won't post them all but let me know if you need them.

addTileType(marsh);
        final EncounterType steppe = new EncounterType(Tiles.Tile.TILE_STEPPE.id, (byte)0);
        steppe.addEncounter(pheasant, 1);
        steppe.addEncounter(zebra, 2);
        steppe.addEncounter(horse, 4);
        steppe.addEncounter(wildcat, 1);
        steppe.addEncounter(mainecoon, 1);
        steppe.addEncounter(hellHorseSingle, 1);
        steppe.addEncounter(bison, 1);
        steppe.addEncounter(sheep, 1);
        if (Servers.localServer.isChallengeServer()) {
            steppe.addEncounter(drakeSpirit, 1);
            steppe.addEncounter(eagleSpirit, 1);


GmSetTraits.class
Mostly so you can change the traits with the gm, very handy for testing too
I still had plans on getting rid of the marchador trait. because it can just be one of the costum ones.

public void sendQuestion() {
        final StringBuilder buf = new StringBuilder();
        buf.append(this.getBmlHeader());
        if (this.getResponder().getPower() >= 4) {
            for (int x = 0; x < 64; ++x) {
                String traitName = Traits.getTraitString(x);
                if (x == 15) {
                    traitName = "Brown";
                }
                else if (x == 16) {
                    traitName = "Gold";
                }
                else if (x == 17) {
                    traitName = "Black";
                }
                else if (x == 18) {
                    traitName = "White";
                }
                else if (x == 23) {
                    traitName = "Marchador";
                }
                else if (x == 24) {
                    traitName = "Custom1";
                }
                else if (x == 25) {
                    traitName = "Custom2";
                }
                else if (x == 26) {
                    traitName = "Custom3";
                }
                else if (x == 27) {
                    traitName = "Custom4";
                }
                else if (x == 28) {
                    traitName = "Custom5";
                }
                else if (x == 29) {
                    traitName = "Custom6";
                }
                else if (x == 30) {
                    traitName = "Custom7";
                }
                else if (x == 31) {
                    traitName = "Custom8";
                }
                else if (x == 32) {
                    traitName = "Custom9";
                }
                else if (x == 33) {
                    traitName = "Custom10";


Traits.class
This is offcourse the important .class for the traits

}
            else if (x == 21) {
                Traits.treatDescs[x] = "It has a certain spark in its eyes.";
                Traits.negativeTraits[x] = false;
            }
            else if (x == 22) {
                Traits.treatDescs[x] = "It has been corrupted.";
                Traits.neutralTraits[x] = true;
            }
            else if (x == 15 || x == 16 || x == 17 || x == 18 || x == 23 || x == 24 || x == 25 || x == 26 || x == 27 || x == 28 || x == 29 || x == 30 || x == 31 || x == 32 || x == 33 || x == 63) {
                if (x == 63) {
                    Traits.treatDescs[x] = "It has been bred in captivity.";
                }
                Traits.neutralTraits[x] = true;

Now I think you can make it one trait less because we want to get rid of marchador anyway.

 

 

CreatureTemplateIds.class
pretty strait forward. will work different on your mod anyway

    public static final int ZEBRA_CID = 105;
    public static final int OCELOT_CID = 106;
    public static final int BEAR_PANDA_CID = 107;
    public static final int CAT_MaineCoon_CID = 108;


CreatureTemplateCreator.class
This will also change a lot on your side

createCreatureTemplate(105, "Zebra", "Zebras like this one have many stripes.");
        createCreatureTemplate(106, "Ocelot", "Looking like a huge cat, with a dappled coat.");
        createCreatureTemplate(107, "Panda bear", "The panda bear has large, distinctive black patches around its eyes, over the ears, and across its round body.");
        createCreatureTemplate(108, "Maine Coon", "The Maine Coon is among the largest domesticated breeds of cat.");
        
else if (id == 105) {
                createZebraTemplate(id, name, longDesc, skills);
            }
            else if (id == 106) {
                createOcelotTemplate(id, name, longDesc, skills);
            }
            else if (id == 107) {
                createBearPandaTemplate(id, name, longDesc, skills);
            }
            else if (id == 108) {
                createCatMaineCoonTemplate(id, name, longDesc, skills);
            }

Here is one, let me know if you need the others.

private static void createZebraTemplate(final int id, final String name, final String longDesc, final Skills skills) throws IOException {
        skills.learnTemp(102, 25.0f);
        skills.learnTemp(104, 20.0f);
        skills.learnTemp(103, 40.0f);
        skills.learnTemp(100, 7.0f);
        skills.learnTemp(101, 7.0f);
        skills.learnTemp(105, 22.0f);
        skills.learnTemp(106, 5.0f);
        skills.learnTemp(10052, 28.0f);
        final int[] types = { 7, 12, 41, 43, 3, 14, 9, 28, 32 };
        final CreatureTemplate temp = CreatureTemplateFactory.getInstance().createCreatureTemplate(id, name, longDesc, "model.creature.quadraped.horse.zebra", types, (byte)1, skills, (short)3, (byte)0, (short)180, (short)50, (short)250, "sound.death.horse", "sound.death.horse", "sound.combat.hit.horse", "sound.combat.hit.horse", 1.0f, 1.0f, 2.5f, 1.5f, 2.0f, 0.0f, 1.5f, 100, new int[] { 307, 306, 140, 71, 309, 308 }, 5, 0);
        temp.setMaxAge(200);
        temp.setBaseCombatRating(6.0f);
        temp.combatDamageType = 0;
        temp.setAlignment(100.0f);
        temp.setHandDamString("kick");
        temp.setArmourType(6);
        temp.isHorse = true;
        temp.setMaxPercentOfCreatures(0.02f);

 

Now every time I wanted to add the trait system to any other animals I added temp.isHorse = true; to there list.
Might not be the right way to do it but it worked :)

 

 

Creature.class
I didn't edit this .class but from what I can see it is this part:

if (this.template.isHorse) {
                    String col = "grey";
                    if (this.hasTrait(15)) {
                        col = "brown";
                    }
                    else if (this.hasTrait(16)) {
                        col = "gold";
                    }
                    else if (this.hasTrait(17)) {
                        col = "black";
                    }
                    else if (this.hasTrait(18)) {
                        col = "white";
                    }
                    else if (this.hasTrait(23)) {
                        col = "marchador";
                    }
                    else if (this.hasTrait(24)) {
                        col = "custom1";
                    }
                    else if (this.hasTrait(25)) {
                        col = "custom2";
                    }
                    else if (this.hasTrait(26)) {
                        col = "custom3";
                    }
                    else if (this.hasTrait(27)) {
                        col = "custom4";
                    }
                    else if (this.hasTrait(28)) {
                        col = "custom5";
                    }
                    else if (this.hasTrait(29)) {
                        col = "custom6";
                    }
                    else if (this.hasTrait(30)) {
                        col = "custom7";
                    }
                    else if (this.hasTrait(31)) {
                        col = "custom8";
                    }
                    else if (this.hasTrait(32)) {
                        col = "custom9";
                    }
                    else if (this.hasTrait(33)) {
                        col = "custom10";
                    }
                    corpse.setDescription(col);

And this:

if ((toReturn.isHorse() || toReturn.getTemplate().isBlackOrWhite) && Server.rand.nextInt(10) == 0) {
            if (Server.rand.nextInt(3) == 0) {
                toReturn.getStatus().setTraitBit(15, true);
            }
            else if (Server.rand.nextInt(3) == 0) {
                toReturn.getStatus().setTraitBit(16, true);
            }
            else if (Server.rand.nextInt(3) == 0) {
                toReturn.getStatus().setTraitBit(17, true);
            }
            else if (Server.rand.nextInt(3) == 0) {
                toReturn.getStatus().setTraitBit(18, true);
            }
            else if (Server.rand.nextInt(3) == 0) {
                toReturn.getStatus().setTraitBit(23, true);
            }
            else if (Server.rand.nextInt(3) == 0) {
                toReturn.getStatus().setTraitBit(24, true);
            }
            else if (Server.rand.nextInt(3) == 0) {
                toReturn.getStatus().setTraitBit(25, true);
            }
            else if (Server.rand.nextInt(3) == 0) {
                toReturn.getStatus().setTraitBit(26, true);
            }
            else if (Server.rand.nextInt(3) == 0) {
                toReturn.getStatus().setTraitBit(27, true);
            }
            else if (Server.rand.nextInt(3) == 0) {
                toReturn.getStatus().setTraitBit(28, true);
            }
            else if (Server.rand.nextInt(3) == 0) {
                toReturn.getStatus().setTraitBit(29, true);
            }
            else if (Server.rand.nextInt(3) == 0) {
                toReturn.getStatus().setTraitBit(30, true);
            }
            else if (Server.rand.nextInt(3) == 0) {
                toReturn.getStatus().setTraitBit(31, true);
            }
            else if (Server.rand.nextInt(3) == 0) {
                toReturn.getStatus().setTraitBit(32, true);
            }
            else if (Server.rand.nextInt(3) == 0) {
                toReturn.getStatus().setTraitBit(33, true);
            }
        }

And this:

 else {
            if (this.template.isHorse) {
                String col = "grey";
                if (this.hasTrait(15)) {
                    col = "brown";
                }
                else if (this.hasTrait(16)) {
                    col = "gold";
                }
                else if (this.hasTrait(17)) {
                    col = "black";
                }
                else if (this.hasTrait(18)) {
                    col = "white";
                }
                else if (this.hasTrait(23)) {
                    col = "marchador";
                }
                else if (this.hasTrait(24)) {
                    col = "custom1";
                }
                else if (this.hasTrait(25)) {
                    col = "custom2";
                }
                else if (this.hasTrait(26)) {
                    col = "custom3";
                }
                else if (this.hasTrait(27)) {
                    col = "custom4";
                }
                else if (this.hasTrait(28)) {
                    col = "custom5";
                }
                else if (this.hasTrait(29)) {
                    col = "custom6";
                }
                else if (this.hasTrait(30)) {
                    col = "custom7";
                }
                else if (this.hasTrait(31)) {
                    col = "custom8";
                }
                else if (this.hasTrait(32)) {
                    col = "custom9";
                }
                else if (this.hasTrait(33)) {
                    col = "custom10";


Vehicle.class
I think all he did here was just add the zebra so you can ride it.

}
        else if (cid == 105) {
            vehicle.createPassengerSeats(0);
            vehicle.setSeatFightMod(0, 0.7f, 0.9f);
            vehicle.setSeatOffset(0, 0.0f, 0.0f, 0.0f);
            vehicle.creature = true;
            vehicle.skillNeeded = 21.0f;
            vehicle.name = creature.getName();
            vehicle.maxDepth = -0.7f;
            vehicle.maxHeightDiff = 0.04f;
            vehicle.setMaxSpeed(30.0f);
            vehicle.commandType = 3;
            vehicle.canHaveEquipment = true;


Hope this helps. let me know if you need anything else.

And thanks for helping out

Edited by AbsolutelyNobody

Share this post


Link to post
Share on other sites

hmm all these mods and something is preventing my from melting ore.  i have fireplace,forge, and smelter burning for 15 min now and no heat icons on any of the iron ores.   i think it might be in the bigconatainerbaeamod  . as i think it's the only mod editing values of items.

 

found the issue , nodecay mod, wont allow heating ore oddly. lol 

Edited by validate

Share this post


Link to post
Share on other sites

Hello AbsolutelyNobody, 

 

I love what your doing with this mod,  When your looking in the code are you seeing any negative modifiers for when animals are tamed.  IE the great Rolf Nerffing of tamed pets??

Share this post


Link to post
Share on other sites
Quote

Ok, I will try to put this together as good as I can. I think I know most of what was changed but I didn't do the original coding. So lets see how much I picked up :)

Thanks. That's enough to get the conversion started

  • Like 1

Share this post


Link to post
Share on other sites

This is the only mod we have on our server, and with it in, Kilns are question mark bags and polearms racks look like unfired clay jars of some kind?  Have we done something wrong with adding in the mod, or is this some kind of glitch or conflict?

Share this post


Link to post
Share on other sites
5 hours ago, ago said:

Thanks. That's enough to get the conversion started

 

Awesome, hope you can figure it out :)

Share this post


Link to post
Share on other sites
2 hours ago, Lydite said:

This is the only mod we have on our server, and with it in, Kilns are question mark bags and polearms racks look like unfired clay jars of some kind?  Have we done something wrong with adding in the mod, or is this some kind of glitch or conflict?

 

No you didn't do anything wrong. It mostly has to do with the new update WU got. Everytime there is an update I pretty much have to recode everything.
So we are working on making this work with ago's modloader now so it won't be affected by the updates

Share this post


Link to post
Share on other sites

Ive been working hard getting this migrated over to ago's client modloader but not had a lot of success with it.    I took the hitching post he added and copied many of the functions but so far have had no success.    This kinda hinges on me getting all my 3d models in for other projects im working on.  

 

I have managed to get many new sound effects loaded in (thunder storms, lightning cracking, cave ambience) but graphics are not so easy.    

 

Anyone tried this or had luck with it?    

 

 

Raz.

Share this post


Link to post
Share on other sites

i had to just fix the item number to the items.  as I had hitching post at 2026 i think  then the new smelter update came and it was given 2026, plus 2 other items came in taking 27 and 28,  so i put hitching post to 2029.  in the list. but then also had to edit it in the creationxxx.class  i forget the names,  this is why i hope for modloader version,  easier to edit those mods, by using IntelliJ   and just change values needed.

 

I started a new job 2 weeks ago, i wish i could take vacation week, and learn more about java,  I'd like to spend all my free time helping.  do you have donation paypal set up. I'd love to support you and Ago for all your hard work on these mods and loaders?

Share this post


Link to post
Share on other sites
20 minutes ago, validate said:

i had to just fix the item number to the items.  as I had hitching post at 2026 i think  then the new smelter update came and it was given 2026, plus 2 other items came in taking 27 and 28,  so i put hitching post to 2029.  in the list. but then also had to edit it in the creationxxx.class  i forget the names,  this is why i hope for modloader version,  easier to edit those mods, by using IntelliJ   and just change values needed.

 

I started a new job 2 weeks ago, i wish i could take vacation week, and learn more about java,  I'd like to spend all my free time helping.  do you have donation paypal set up. I'd love to support you and Ago for all your hard work on these mods and loaders?


Yes that would work for sure, but it is a pain to do after each update.

Ago is trying to get an example put together for the creatures and if everything goes well I should be able to start adding them one by one from there on. So hopefully we can have this working again as soon as possible.

Never thought about a donation button but i'll look into it.

  • Like 1

Share this post


Link to post
Share on other sites
On 11/23/2015, 1:29:32, ago said:

Thanks. That's enough to get the conversion started

 

 

More coin in your coffer if you get this working! 

  • Like 1

Share this post


Link to post
Share on other sites

The zebra, the panda and the ocelot evaded the photoshoot.

 

It's almost done. The panda and zebra are rideable. traits work as  seen on the cat, the packs are sent from the server. Encounters are added. So it's just some cleanup left to do.

 

 

  • Like 2

Share this post


Link to post
Share on other sites

Sweet you are awesome Ago, now hopefully I'll be able to figure it all out and start adding more animals later.

 

Unless you would like to stay part of the mod and keep adding the coding as it comes, you are more than welcome to. I'll just keep adding graphics

Edited by AbsolutelyNobody
  • Like 1

Share this post


Link to post
Share on other sites
38 minutes ago, ago said:

The zebra, the panda and the ocelot evaded the photoshoot.

 

It's almost done. The panda and zebra are rideable. traits work as  seen on the cat, the packs are sent from the server. Encounters are added. So it's just some cleanup left to do.

 

 

 

Out of curiosity roughly how much time does the download take?

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this