Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  
Pages: 1 ... 3 4 [5] 6 7 ... 9

Author Topic: [47.04] Dog Breeds v5.0  (Read 32806 times)

brolol.404

  • Bay Watcher
    • View Profile
Re: [44.12] Dog Breeds v2.1
« Reply #60 on: June 02, 2019, 07:37:57 pm »

Here you go:

DFFD Link to the ENTITY INSTALLER

The installer will add all the tags you specified to the various Entities.  I added some markings that will show where the installer added the tags.

The executable has a check function built in that *should* prevent it from causing errors if it is run multiple times.  It checks to see if the new tags are already present, and if they are, will not add them again.

The file search function was built assuming the installer is located in the 'raw' folder, the folder before the 'objects' folder where all the raw files are located.  It needs to be there to run properly.

Let me know if you would like the python source code  :D

Oh wow awesome thanks. Do you mind changing the title and description to be more generic like the following since I plan to use this program I for lots of my future mods:

Spoiler (click to show/hide)

And yeah I'll take a look at the python source code :) is it on github?

Wannabehero

  • Bay Watcher
    • View Profile
Re: [44.12] Dog Breeds v2.1
« Reply #61 on: June 02, 2019, 09:55:20 pm »

DFFD page updated to your specifications.

I also changed the name of the executable to Brolol_Animal_installer.exe instead.

I don't have a guthub account.  Here is the python script I wrote (expanded because you needed six changes).  It might be a little crude, because I'm very new to python.  I probably could have created a library of terms, but I just went ahead and defined them in the full code.

Spoiler (click to show/hide)
« Last Edit: June 02, 2019, 10:14:57 pm by Wannabehero »
Logged

brolol.404

  • Bay Watcher
    • View Profile
Re: [44.12] Dog Breeds v2.1
« Reply #62 on: June 03, 2019, 03:42:52 am »

DFFD page updated to your specifications.

I also changed the name of the executable to Brolol_Animal_installer.exe instead.

I don't have a guthub account.  Here is the python script I wrote (expanded because you needed six changes).  It might be a little crude, because I'm very new to python.  I probably could have created a library of terms, but I just went ahead and defined them in the full code.

Spoiler (click to show/hide)

Awesome. It works perfectly.

I hate to ask for another change, but do you mind making the following edits:

Update the in program text for use with other mods:

===== Added by ANIMAL use tags Installer =====
=== End ANIMAL use tags Installer Addition ===

edit: (deleted) sorry for the back and forth if you already read this, but it looks like I have to leave the tags on [ENTITY:SKULKING]

If I ever wanted to make changes to this myself, what program do you use? Notepad? Do I need a compiler or something else as well?

« Last Edit: June 03, 2019, 08:52:19 am by brolol.404 »
Logged

brolol.404

  • Bay Watcher
    • View Profile
Re: [44.12] Dog Breeds v2.1
« Reply #63 on: June 03, 2019, 09:01:54 am »

Thanks to Wannabehero we can set certain breeds to certain entities now! And, since we are now at 51 breeds, this will unclutterer the animal embark screen, but more importantly add some variety to the breeds and help give more life the entities.

So, should certain breeds be assigned to certain entities? If so, who gets what? Here is what I had in mind:



I also included the new shearable and insulation stats on the chart for feedback.

Thoughts?

« Last Edit: June 03, 2019, 09:03:45 am by brolol.404 »
Logged

Wannabehero

  • Bay Watcher
    • View Profile
Re: [44.12] Dog Breeds v2.1
« Reply #64 on: June 03, 2019, 09:28:05 am »

I hate to ask for another change, but do you mind making the following edits:

Update the in program text for use with other mods:

===== Added by ANIMAL use tags Installer =====
=== End ANIMAL use tags Installer Addition ===

...

If I ever wanted to make changes to this myself, what program do you use? Notepad? Do I need a compiler or something else as well?


That change is super easy, I'll do it tonight when I get back to my home PC.

I personally used Notepad++, which is a free program that is basically a better version of notepad, built for lightweight coding.  Highly recommend.  Just make sure the script is saved as a .py (python) file when you load and modify it.

You will need to install python on your system as well, to test out your program and compile it.  It is free and easy to find and download online.  There are two different versions of python, python2 and python3.  Either version should work with the current code.  I would recommend you go with python3, as it is the newest version (python2 is legacy, but still gets occasional updates).

When you download python, it should come with pip, which is a python package manager and downloader.  Once you install python, you will want to run pip to download and install the in_place package, because I used it in this code.  The in_place tools automatically handle a bunch of the temp file open/read/write/close functions needed to modify a file without corrupting it.  The command should be "pip install in_place"

Lastly, you will also need to install a compiler with your python.  I used pyinstaller, which you can also download and install through pip.
Here is a link to blog post on how to use pyinstaller to compile a python script.

I also have spoken with a colleague of mine at work who is actually decent at writing python code.  He will hopefully be giving me some recommendations on how to rework it so I don't have to define separate functions for each read/write and installation check.
« Last Edit: June 03, 2019, 10:45:38 am by Wannabehero »
Logged

brolol.404

  • Bay Watcher
    • View Profile
Re: [44.12] Dog Breeds v2.1
« Reply #65 on: June 03, 2019, 11:05:33 am »

sweet thanks. I will download these and try and figure it out.

Wannabehero

  • Bay Watcher
    • View Profile
Re: [44.12] Dog Breeds v2.1
« Reply #66 on: June 03, 2019, 09:05:38 pm »

Allrighty, one more time!

The installer executable has been updated.  Changed the text to be mod agnostic, as well as the title of the executable is now "ANIMAL_ENTITY_installer.exe".  It should be a broad brush to be usable in multiple different mods now, and as a tool to the community!
Logged

brolol.404

  • Bay Watcher
    • View Profile
Re: [44.12] Dog Breeds v2.1
« Reply #67 on: June 04, 2019, 06:39:56 am »

Awesome. Very useful. You may want to make a post so that others know it exists.
« Last Edit: June 04, 2019, 06:41:46 am by brolol.404 »
Logged

brolol.404

  • Bay Watcher
    • View Profile
Re: [44.12] Dog Breeds v2.1
« Reply #68 on: June 06, 2019, 10:46:57 am »

Allrighty, one more time!

The installer executable has been updated.  Changed the text to be mod agnostic, as well as the title of the executable is now "ANIMAL_ENTITY_installer.exe".  It should be a broad brush to be usable in multiple different mods now, and as a tool to the community!

If I wanted to make another version of this utility specific to this mod that removes [COMMON_DOMESTIC] from the "dog" creature file (so they dont show up in game), would adding this code to the bottom work? (I haven't had time to install python yet)

Code: [Select]
input( '\n\n Press Enter to continue...' )

textToSearch7 = "[CASTE_NAME:dog:dogs:canine]\n
[CREATURE_TILE:'d'][COLOR:6:0:0]\n
[CREATURE_CLASS:MAMMAL]\n
[PETVALUE:30][NATURAL]\n
[LARGE_ROAMING]\n
[COMMON_DOMESTIC]"
textToReplace7 = "[CASTE_NAME:dog:dogs:canine]\n
[CREATURE_TILE:'d'][COLOR:6:0:0]\n
[CREATURE_CLASS:MAMMAL]\n
[PETVALUE:30][NATURAL]\n
[LARGE_ROAMING]\n
===== Deleted dog [COMMON_DOMESTIC] by ANIMAL use tags (db_dogs) Installer ====="

textToConfirm7 = "dog [COMMON_DOMESTIC]"

fileToSearch7  = "objects/creature_domestic.txt"

didRun7 = False

def addText7():
global didRun7
didRun7 = True
with in_place.InPlace( fileToSearch7) as file:
for line in file:
line = line.replace( textToSearch7, textToReplace7)
file.write(line)

def check7():
        checkfile = file( fileToSearch7)
        installed7 = False
        for line in checkfile:
            if textToConfirm7 in line:
                installed7 = True
                break

        return installed7

installed6 = check7()
if installed7:[u][/u]
    print "\n\n " + textToConfirm7 + " RAW edits are already installed!"
else:
addText7()

installed6 = check7()
if didRun7:
if installed7:
print "\n\n " + textToConfirm7 + " RAW edits successfully installed."
else:
print "\n\n Whoops!  Looks like the program tried to install " + textToConfirm7 + " edits to the creature_domestic file, but wasn't able to.\n You might need to add them manually."
else:
print "\n\n Remember to generate a new world and strike the earth!\n No need to run this installer again unless you overwrite your RAWs."

input( '\n\n Press Enter to exit...' )
« Last Edit: June 06, 2019, 10:52:10 am by brolol.404 »
Logged

brolol.404

  • Bay Watcher
    • View Profile
Re: [44.12] Dog Breeds v2.1
« Reply #69 on: June 09, 2019, 04:10:06 pm »

I realized that after adding the giant versions of each breed, I had the variant remove their domestic tag without adding any biome tags, so they don't show up in game. So now the question is, should I assign the giant versions biomes, assign them to entities or remove them? I could just assign them all to the kobolds. Any other ideas?

Giving them biomes will allow them to appear, but may be strange to have random giant poodles roaming the wilds.

Assigning them to entities will allow their use, but may be overpowered at embark.

Just dumping them on the kobolds to deal with may be the best option. They will still be in game, but you will have to trade with the kobolds and won't have giant chihuahuas roaming the land.

Thoughts?

Meph

  • Bay Watcher
    • View Profile
    • worldbicyclist
Re: [44.12] Dog Breeds v2.1
« Reply #70 on: June 09, 2019, 05:54:05 pm »

Raise the pet value to 500-1000 each, and they wont be overpowered at embark, because people cant afford them. They can still order and buy them at a high price from caravans though.
Logged
::: ☼Meph Tileset☼☼Map Tileset☼- 32x graphic sets with TWBT :::
::: ☼MASTERWORK DF☼ - A comprehensive mod pack now on Patreon - 250.000+ downloads and counting :::
::: WorldBicyclist.com - Follow my bike tours around the world - 148 countries visited :::

brolol.404

  • Bay Watcher
    • View Profile
Re: [44.12] Dog Breeds v3.0
« Reply #71 on: June 09, 2019, 06:03:48 pm »

Version 3.0 released!

*Assigned each breed to a specific entity using a new ANIMAL tags installer (provided by Wannabehero)
*Added shearing to long haired breeds
*Added insulation for cold weather to long haired breeds

brolol.404

  • Bay Watcher
    • View Profile
Re: [44.12] Dog Breeds v2.1
« Reply #72 on: June 09, 2019, 06:05:30 pm »

Raise the pet value to 500-1000 each, and they wont be overpowered at embark, because people cant afford them. They can still order and buy them at a high price from caravans though.

This is a really good idea. I like this approach

Wannabehero

  • Bay Watcher
    • View Profile
Re: [44.12] Dog Breeds v3.0
« Reply #73 on: June 10, 2019, 08:16:41 am »

If I wanted to make another version of this utility specific to this mod that removes [COMMON_DOMESTIC] from the "dog" creature file (so they dont show up in game), would adding this code to the bottom work? (I haven't had time to install python yet)

Code: [Select]
CODE

I don't think so.

I don't think you can linebreak in strings in your code (physically linebreak in the code, by pressing enter. Using "\n" as a linebreaks in the string is fine). If you are using a program like Notepad++ or Anaconda, it should visually indicate that the string is still open.

There has got to be a better way to specifically remove the COMMON_DOMESTIC tag from under dog, but I'm not sure how.  I know it can be done, I've seen something similar in other python scripts, but I need to look up the proper command structure used to find a term after another term. I might need to find a python forum and ask in their beginners section.
Logged

brolol.404

  • Bay Watcher
    • View Profile
Re: [44.12] Dog Breeds v3.0
« Reply #74 on: June 10, 2019, 08:39:08 am »

If I wanted to make another version of this utility specific to this mod that removes [COMMON_DOMESTIC] from the "dog" creature file (so they dont show up in game), would adding this code to the bottom work? (I haven't had time to install python yet)

Code: [Select]
CODE

I don't think so.

I don't think you can linebreak in strings in your code (physically linebreak in the code, by pressing enter. Using "\n" as a linebreaks in the string is fine). If you are using a program like Notepad++ or Anaconda, it should visually indicate that the string is still open.

There has got to be a better way to specifically remove the COMMON_DOMESTIC tag from under dog, but I'm not sure how.  I know it can be done, I've seen something similar in other python scripts, but I need to look up the proper command structure used to find a term after another term. I might need to find a python forum and ask in their beginners section.

That would be awesome thanks
Pages: 1 ... 3 4 [5] 6 7 ... 9