Ludeon Forums

Ludeon Forums

  • June 27, 2019, 04:12:50 AM
  • Welcome, Guest
Please login or register.

Login with username, password and session length
Advanced search  
Pages: [1] 2

Author Topic: Border Collie  (Read 2190 times)

ajaviide

  • Drifter
  • **
  • Posts: 74
  • Refugee
    • View Profile
Border Collie
« on: December 14, 2016, 12:30:37 PM »

Hello guys,
 there was an awesome mod long time ago called Project Dog ( https://ludeon.com/forums/index.php?topic=15789.0 ) it added an border collie to the game witch looks exactly like my dog did when i was a kid.(it was also border collie:) 
 What do you guys think would it be to hard for me to implement a new dog breed into the game or replace an existing one?

Would it be ethical from me to use the textures from said mod? its just for my personal use only i wont upload it on internet.
Or maybe someone skilled could do it for me quick and maybe tell me how to keep it updated .

Tywm (noob modder, and not native english speaker here, so sorry if i messed up :)
« Last Edit: December 15, 2016, 07:26:31 AM by ajaviide »
Logged

ajaviide

  • Drifter
  • **
  • Posts: 74
  • Refugee
    • View Profile
Re: never moded before
« Reply #1 on: December 15, 2016, 02:15:10 AM »

So i downlaoded notepad ++ and opened "project dog" mod files etc . Seems reasonable enough.

Then i tought i look into game code and see what is changed in the dogs code between v12-and now.

But i cant  find where are  games default dog files .


(ps i have done minimal  coding in html and  flash, long time ago.Ijust really hope someone will help me get started atleast :)
« Last Edit: December 15, 2016, 02:24:27 AM by ajaviide »
Logged

sulusdacor

  • Colonist
  • ***
  • Posts: 242
  • Refugee
    • View Profile
Re: never moded before
« Reply #2 on: December 15, 2016, 03:47:51 AM »

you should look in your Rimworld/Mods/Core/Defs/ThingDefs_Races. just check what has changed or just load the old mod up and see what errors you get.

ajaviide

  • Drifter
  • **
  • Posts: 74
  • Refugee
    • View Profile
Re: never moded before
« Reply #3 on: December 15, 2016, 05:19:07 AM »

so i opened the old mod in game (project dog) and there was lots of errors.
Then i compared it to core code lines for pets in Rimworld/Mods/Core/Defs/ThingDefs_Races. and it was very different.
Then i tought it might be good idea to take an existing pet code (i took terrier) and replace existing terrier refernces to border collie (just for test.
 It didnt work, i got a lot less error messages tho (file attached)



[attachment deleted by admin due to age]
Logged

ajaviide

  • Drifter
  • **
  • Posts: 74
  • Refugee
    • View Profile
Re: never moded before
« Reply #4 on: December 15, 2016, 05:21:56 AM »

Project dog gave me this erros(unmodified)

[attachment deleted by admin due to age]
Logged

ajaviide

  • Drifter
  • **
  • Posts: 74
  • Refugee
    • View Profile
Re: Border Collie
« Reply #5 on: December 15, 2016, 09:50:09 AM »

i probably should wait for stable 16 tho but all help is appreciated because i wanting to be able to update it later on anyway.

cheers
Logged

Guido (Pink Omega)

  • Colonist
  • ***
  • Posts: 108
  • Paleontologist
    • View Profile
Re: Border Collie
« Reply #6 on: December 15, 2016, 10:35:25 AM »

Hey, I could try to make this mod for you...Let's wait till A16 stable comes out, or I can see what I can do in unstable
It is ok for you?
Logged

<=To Be Continued/\/

ajaviide

  • Drifter
  • **
  • Posts: 74
  • Refugee
    • View Profile
Re: Border Collie
« Reply #7 on: December 15, 2016, 11:18:09 AM »

Well that would be awesome !
I think it would be alright to wait for stable,
i dont play unstable version anyway cause patches often  brake save games.

Is it okey if i pm you when stable is out?

i had couple ideas but they are not important.You culd just copy retriever stats , but if u can, can u make it:

Pretty fast but not strong :) (best agility dog breed)
Also they are the smartest dogs idk if its possible to make them learn a bit faster?

They are the cutest also :3

meanwhile I try to pm Fluffy and ask if its ok to use his border collie graphics.

Cheers
Logged

sulusdacor

  • Colonist
  • ***
  • Posts: 242
  • Refugee
    • View Profile
Re: Border Collie
« Reply #8 on: December 15, 2016, 11:53:34 AM »

posting a picture of the error log does not help. you can find the detailed log file in Rimworld/RimworldWin_Data, the output_log textfile (in windows, not sure for other systems). if you want help with errors post this.

implementing the dog (or anything) you can do it two different ways, which you seemed to have tried. one way is to load the old mod, look at the xml errors, search the lines in the xml file and check whats wrong. other way is to take lines for an existing animal and change it to yours.

the reason the files might be different is the other alpha. i personaly have not done any kind of animal mod so not sure what excatly changed in the alphas thhere. but from what i could tell by looking over the files:

the mod from a12 has about the same xmls and i assume you dont have to change much. the thing what is different and might be confusing is that the mod has seperate folders for the pawnkind and the thingdefs. the core animal pet xml contains both of these in one xml file. but it's basicly the same code. just look over it and take a vanilla dog, which is about the same size as your border collie. copy the xml file/section. then look over the thingdef and pawnkind section of this pet. compare it to the modded on. and change up the specifics. for example if the size was different, the food they consume etc.

for the textures make sure change the texture path and name the folders + files correctly. would be YourModName/Textures/Filename , if your textures would be name Filename_back.png, Filename_front.png and Filename_side.png and you use no folders inside your texture folder itself.

(just saw this was already answered,but maybe it still helps you or others.)by the way to your question about using the textures of the old mod. (if you just use it private this does not matter of couse ;) )if you want to release the mod i would ask before hand. since there is no specific section for the license etc in the topic of the mod, you should definitly ask the mod creator befor using the textures in your mod. even with a license section i personaly would write the original creator a pm to inform him that his stuff is used and i will remove it if his mind has changed about that kind of stuff, but thats just my personal way of going about this things. from what i experienced so far most people are okay if you ask and make a remark in the author section or thank to etc.

i definitly type to slow^^ but btw a15/16 should not make a big difference. since usally just a few lines change in the xml's ;)

sulusdacor

  • Colonist
  • ***
  • Posts: 242
  • Refugee
    • View Profile
Re: Border Collie
« Reply #9 on: December 15, 2016, 04:19:59 PM »

you must click save send messages, otherwise it will not show. was confused by that too at first^^

for the file, not sure what you activated to get the output log, but what i get when using the modfiles mine looks very different ;)

short xml introduction thingy:

for the xml's:  if you look at the file the general sturcture is:

<xml tag> value </xml tag>

from the name of the xml tag you can in most cases guess what it is for or just try to change the value or number of what the tag has as input to find out. for the possible xml tags you can use:
xml autodocumentation: https://ludeon.com/forums/index.php?topic=21440.0 (a15 is now in older versions, includes all vanilla inputs for the tags and where they are used)
or [wip] xml documentation database: https://ludeon.com/forums/index.php?topic=21440.0 (explains a lot of lines short + possible inputs).

as for the number of files/folders: it is mostly a way to structure the content. you can put most stuff in one xml. but its not a good way to have an overview over the mods content. i'm not sure if the game searches for specific folders in the defs folder itself, but most def files have the same framework so to speak. so i imagine you can get away with much less (just a guess tho ;) ). for our pawnkind /thingdef folder this is true, so structure the folders how you like.

bit explanation on the xml files:

if you look at the old mod and both the files in pawnkind and thingdef folder you see the start and end in all xml files is:
<?xml version="1.0" encoding="utf-8" ?>
<Defs>
 .... content ...
</Defs>
this is basicly the frame of the xml. depending on the content you add, it will start off with another broad xml tag inside the def tag. for the dog it would be the <ThingDef> and the <pawnkinddef>. if you take the route with different folders you would have the base framework with the <Defs> still "around those tags. if you look at your files, these are there.

(the lines like <!-- ====================================================== -->, are comment lines, you just need the <!-- and --> to open and close. the game will not read these. i personly use these mostly to get a better structure and to find things easier in my xmls. you dont need these.)

in these lower tier frames so to speak you have other xml tags defining some values. depending on the thing you add to the game and the xml tags possible in the "xml frame" so to speak you can define the characteristics of your things. there are some limitation, since the game only "knows" specific xml tags and inputs. if you would wanted to add stuff not possible in xml files this would require a dll file (adding custom code to the game).

for the dogs just look at one of the vanilla dogs and look at all the xml tag lines in one of the <thingsdef> and <pawnkinddef> xml tags. (the core pet race def has the comment line to seperate the pets, so one section should include both the xml sections you need for pawn and thingdef.

if the old version has a line, that is not in the new core xml it is most likely removed or replaced by another xml tag/command. (you can check the auto xml documentation for that if you are not sure).

abstracts

as for abstracts you should read this topic: https://ludeon.com/forums/index.php?topic=19499.0

in short they are basicly a blank with some standard values assigned for certain xml tags. you can think  of and use these as some sort of blueprint to save some xml lines, if the same objects have similar properties definied with xml tags. you can define your own abstracts. even if you use the vanilla ones you should define these in your mods xml files somewhere (could couse errors). for the vanilla ones, you will find these in the races animal base xml. (they are usally in one of the xml files of the folder. for the abstract used by the xmls files of the folder).

hope this helps a bit with where to find stuff and what to look for. modding is a lot of trying stuff out and looking at the core xml/code and other mods. if you want to add things and know a mod or the core game adds a similar/same thing. just look there how it is done.

good luck ;)

ajaviide

  • Drifter
  • **
  • Posts: 74
  • Refugee
    • View Profile
Re: Border Collie
« Reply #10 on: December 15, 2016, 04:21:30 PM »

Hey guys i got so far that when i start up the game i get no errors and also when i activate mod i get no errors :)

But when i start the game(with prepare carefully to spawn the dog,no other mods) the dog does no move and debug mode gives 2 errors.(pic attached and also latest log)

No name making method and object reference not set to an instance.



I have tried to use ctr f to search for similar words in core file and also in this mod file but no luck.


i guess i just suck at this type of stuff :)

PS! there are good news also Fluffy allowed to use his border collie graphics if we give him credit on release.

EDIT: we were typing at the same time :D  Just started reading your message now, the links seems quite useful thx going to continue on weekend its getting late here.

[attachment deleted by admin due to age]
« Last Edit: December 15, 2016, 04:37:15 PM by ajaviide »
Logged

sulusdacor

  • Colonist
  • ***
  • Posts: 242
  • Refugee
    • View Profile
Re: Border Collie
« Reply #11 on: December 15, 2016, 04:50:59 PM »

wrote you a pm too. just posting, since someone might have a similar issue and maybe it helps them what to look for:
Quote
you probably missing or have redefined the abstract and are missing the thinktree for animals (just a guess).

if you look in the output log and at the last line you have:
Code: [Select]
BorderCollie13196 threw exception while determining job (main): System.NullReferenceException: Object reference not set to an instance of an object
  at Verse.AI.Pawn_Thinker.get_MainThinkNodeRoot () [0x00000] in <filename unknown>:0
  at Verse.AI.Pawn_JobTracker.DetermineNextJob (Verse.ThinkTreeDef& thinkTree) [0x00000] in <filename unknown>:0  lastJobGiver=
 
every pawn/race etc has a thinktree. that decides what to do when and does the "jobs". every thing a living thing does is a job even wandering around. so if you have an error there it means there is an issue with this. thinknode tells you that it is most likely something to do with the thinktree (which has thinknodes).

now if you look at the vanilla animal abstract bases (Races_Animal_Base.xml) you have some thinktree xml lines for general animal behavior in the "AnimalThingBase" abstract section. i assume that you might have forgotten, have a typo or some other error there.

it's the place i would look.

ajaviide

  • Drifter
  • **
  • Posts: 74
  • Refugee
    • View Profile
Re: Border Collie
« Reply #12 on: December 15, 2016, 05:22:35 PM »

Hey i got it to work when i added lines from races_animals_base.xml as You told,  (thinktree).

there where also lines for naming right under them so it fixed my other error also!

So my mod attempt runs now without any errors, im so happy!

I was looking only in ThingDefs_Races/Races_Animals_Pets before, thats why i didnt find anything about thinktree and naming.

one more question there are also lines :

<recipes>
      <li>ExciseCarcinoma</li>
      <li>RemoveBodyPart</li>
      <li>Euthanize</li>
    </recipes>

should i add these to? seems like its needed for treating the animal?

i just hope i will manage to update it to v16 when the stable comes out :)

going to sleep now 
« Last Edit: December 15, 2016, 05:48:22 PM by ajaviide »
Logged

sulusdacor

  • Colonist
  • ***
  • Posts: 242
  • Refugee
    • View Profile
Re: Border Collie
« Reply #13 on: December 15, 2016, 05:48:50 PM »

you should add the complete abstract sections (all the lines in the abstracts you use). so yes the recipes section too.

and yes these would be for doing some basic operations.

glad it works now :D

ajaviide

  • Drifter
  • **
  • Posts: 74
  • Refugee
    • View Profile
Re: Border Collie
« Reply #14 on: December 15, 2016, 05:58:32 PM »

DAMN i got another error when trying to train it (just testing things)

Log and picture of error attached.

yea it dsnt have hunger bar also under the rest bar. Well but i really need to go to sleep now, tomorrow is work day, going to continue on Saturday , goodnight!

[attachment deleted by admin due to age]
« Last Edit: December 15, 2016, 06:09:23 PM by ajaviide »
Logged
Pages: [1] 2