Torchmodders

Modding => Modding Questions => Topic started by: Phiengley on November 08, 2018, 11:35:03 am


Title: Equipping Weapon *Visual* to Pet?
Post by: Phiengley on November 08, 2018, 11:35:03 am
I've been replaying Torchlight 2 recently with (among others) the Xev's Pets mod enabled. The thing that's bothering me is that the Dark Zealot does not have a weapon.

One of the mod's other pets (and the only one, I've since noticed), the ranged Netherim, has a weapon that is not part of its model by default 'equipped', so I opened it up in the Units Data Editor to try and figure out how to replicate that but... I can't find a reference to the weapon model anywhere? I've also tried looking at Monsters (replicating them didn't work), checking whether the TL1 model has the right attachment points (tags? in TL lingo, which it does), checking the .MESH and other files as .XML etc.

What am I missing here? 🤔
Title: Re: Equipping Weapon *Visual* to Pet?
Post by: Anarch16sync on November 08, 2018, 02:45:59 pm
Well, I imaging you're refering to the glaive thrower nethering, those have the glaive attached as a particle in their animation definition. If you check the model folder and open the .animation file with a text editor you can see that in the "Bind" animation the glaive is attached as a particle.

This is one of the ways of adding weapons to monsters and pets, specially when the weapon is not something that has an unit file.

To check this in GUTS you need to add a new monster unit to the layout, then change the monster to the Nethering_glaive in the properties tab, and then hit the icon that looks like a wrench & hammer (View External tool) to open the animation editor.

There are basically 4 ways to add weapons to monsters or pets.
1 - Give them the weapon as equipment. This need that you create a unit file for the weapon.
2 - Give them the weapon as an attached unit. This also need that you create the unit file.
3 - Give them the weapons as an attached particle. This need that you create a particle system using the 3d model of the weapon you want. (I think that you can also use a Unit theme to give them the weapon, but I don't remember that being done)
4 - Attach the weapons model directly to the 3d model with a 3d modeling program.
Title: Re: Equipping Weapon *Visual* to Pet?
Post by: Phiengley on November 08, 2018, 10:33:03 pm
Ah, I've found what you're referring to!

Quote
[ANIMATION]
      <STRING>FILE:netherim_ranged.skeleton
      <STRING>NAME:Bind
      <FLOAT>DURATION:0
      [KEY]
         <STRING>NAME:SPAWNPARTICLE
         <FLOAT>FRAME:0
         <STRING>LAYOUT:media\particles\monsters\netherim\glaive.layout
         <STRING>BONE:tag_lefthand
         [BONEOFFSET]
            <FLOAT>X:0
            <FLOAT>Y:0
            <FLOAT>Z:0
         [/BONEOFFSET]
      [/KEY]

I'm going to assume I can copy this into the Zealot's animation file (and making the necessary changes, ofc)? Thank you!

EDIT: Alright! It worked! Now to find out whether .LAYOUT and .DAT/.BINDAT files are interchangeable as far as it's concerned? 🤔

EDIT 2: Okay I don't know what I'm doing. 😑 Changing the path to some other .LAYOUT file breaks it (or I picked a bad file?) I think I'm fundamentally misunderstanding the file types at work here...?
Title: Re: Equipping Weapon *Visual* to Pet?
Post by: Anarch16sync on November 09, 2018, 03:37:58 am

EDIT: Alright! It worked! Now to find out whether .LAYOUT and .DAT/.BINDAT files are interchangeable as far as it's concerned? 🤔

EDIT 2: Okay I don't know what I'm doing. 😑 Changing the path to some other .LAYOUT file breaks it (or I picked a bad file?) I think I'm fundamentally misunderstanding the file types at work here...?

.Layout files are a bit confusing because they are using for a lot of different stuff. Particles, spawners, missiles, UI, Levels, etc (basically everything related to visual effects) are all .layout files but you can't change a Particle layout for a UI layout and hope things work. So you must guide yourself with the folder where they are located, also you can load them in GUTS layout editor to preview them.

Then about .dat files, this are related to units (players, monsters, items, interactable props), spawnclasses, skills, affixes, effects, triggerables, quests, and a lot more. Again you canīt change a Monster unit for a Item unit. There are a lot of things unique to each thing a dat file defines.

then any file that starts with bin, like .binlayout or .bindat this are the binary file of the editable text file. If you're working outside GUTS it's always a good practice to delete this binary files so GUTS parse the text files and convert it again to update the changes you made.
Title: Re: Equipping Weapon *Visual* to Pet?
Post by: Phiengley on November 09, 2018, 06:20:11 am
I had the bright idea to copy and make changes to the Netherim Glaive particle. I... It's showing up on the model, for sure, but that's... not quite how swords're supposed to work...

As an aside I'd gone ahead and shuffled(that is, renamed) animations around in anticipation of the Zealot having a weapon, using the .XML converter and Notepad, such as renaming the Polearm to simply Attack and Rwand to Special_Cast1 (not sure what tags apply to animations honestly) but the Polearm and Rwand animations are... disabled? in GUTS...

It's all quite confusing

EDIT: Alright, I got it.  And I'd forgotten to update the names in the Zealot.ANIMATION file, maybe that's why?

EDIT 2: Updating the .ANIMATION file did the trick. Thanks for pointing me in the right direction, Anarch!
Title: Re: Equipping Weapon *Visual* to Pet?
Post by: Vkoslak on November 09, 2018, 05:53:06 pm
I was having the same issue with a pet I was working on.

I solved it a different way.

I borrowed the "PETBODY_CUSTOM.DAT" from "human pets" mod by kriss_gjeng,  renamed it to be specific to my pet.

Then in my pet DAT file, I added the new container to my pet, and added equipment.

   [EQUIPMENT]
      <STRING>LEFTHAND:SWORD_SCARLET
      <STRING>RIGHTHAND:SWORD_DEMONBLOOD
   [/EQUIPMENT]
   [INVENTORY]
      <STRING>CONTAINER:PetBody
      <STRING>CONTAINER:FIONNA_CUSTOM
      <STRING>CONTAINER:PLAYER_BAG_ARMS
      <STRING>CONTAINER:PLAYER_BAG_CONSUMABLES
      <STRING>CONTAINER:PLAYER_BAG_SPELLS
      <STRING>CONTAINER:Pointer
   [/INVENTORY]


Worked great!
Title: Re: Equipping Weapon *Visual* to Pet?
Post by: doudley on November 09, 2018, 07:26:37 pm
Lot of issue are involved when applying weapon usage on starting pets.

Hi, I used to mod intensively around pets (starting pets) and pet summons (minions). I know for sure that giving them equippable weapons will lead to 2 game breaking issue:


I think, this is the reason why the OP asked for a "Visual" only weapon wield for the pets and I think the best solution here is what Anarch16sync (http://torchmodders.com/forums/modding-questions/equipping-weapon-*visual*-to-pet/msg10351/#msg10351) suggested.
Title: Re: Equipping Weapon *Visual* to Pet?
Post by: Vkoslak on November 10, 2018, 09:39:54 am
Thanks for the heads up!  I hadn't considered switching the pet. I'm still concentrating on getting mine looking right.
Title: Re: Equipping Weapon *Visual* to Pet?
Post by: Phiengley on November 13, 2018, 02:22:19 am
Yeah all things considered the particle approach seems like the safest option, in regards to interacting with other systems at work...?

Anyway because I'm good at using my time responsibly here's the end result, since while I liked my choice of weapon, the colour scheme didn't match any of the Zealot textures. Doesn't really match TL2's texture style but that was to be expected, I guess. Been a while (since I've textured anything, that is)...
Title: Re: Equipping Weapon *Visual* to Pet?
Post by: Phanjam on November 13, 2018, 05:39:16 am
1. Its Really well done and looks great; i salute you!
2. It isnt that far from the TL graphic style imo

I am excited to try out your pet mod (when its ready of course; no rush :P )
Title: Re: Equipping Weapon *Visual* to Pet?
Post by: Anarch16sync on November 16, 2018, 12:18:23 pm
@Phiengley That's actually a really nice texture work.
Title: Re: Equipping Weapon *Visual* to Pet?
Post by: Phiengley on November 16, 2018, 11:03:40 pm
@Phanjam thank you, once I figure out how to compile my own mods (getting there) I'll make it available... somewhere...?

@Anarch16sync thanks! Couldn't have pulled it off without your help, though I will say I am also glad I managed to get the model into 3ds Max because that texture layout is... rough....