PDA

View Full Version : Questions about summoned pets


desophos
02-10-2012, 09:35 PM
1. I had a question about making the Undead Totem apply to undead pets, but since posting this thread I found out that it applies only to FactionUndead and since pets are FactionPlayer, making enemy totems apply to them is difficult, if not impossible.

2. Would it be possible to make pet spells summon NPCs?

Bluddy
02-12-2012, 09:52 AM
1. I had a question about making the Undead Totem apply to undead pets, but since posting this thread I found out that it applies only to FactionUndead and since pets are FactionPlayer, making enemy totems apply to them is difficult, if not impossible.

Interesting idea. This should be possible:
1. Make a FactionUndeadPet that's got 100 relation to the player and also has default relation of 30 (like the player.)
2. Make StatusEffectPlayerRaised change the monster's faction to FactionUndeadPet.
3. Make FactionUndead (which is just used for the undead totem) have a relationship of 80 with FactionUndeadPet.

I like this idea. I'll put this in my todo -- there may be some consequences I'm not thinking of. As one example, your undead pets won't destroy undead totems, but that does make sense.


2. Would it be possible to make pet spells summon NPCs?

In theory it should be possible.

desophos
02-12-2012, 03:00 PM
2. Make StatusEffectPlayerRaised change the monster's faction to FactionUndeadPet.
I think there would have to be a new StatusEffectPlayerRaisedUndead so that it doesn't apply to all pets.

In theory it should be possible.
As far as I can tell, there's no way for the player to summon an NPC. It seems like something that would have to be coded.

Shadow
02-13-2012, 05:27 PM
As far as I can tell, there's no way for the player to summon an NPC. It seems like something that would have to be coded.

Summon them how? If you want one like a pet, it might work if you just use an npc type entry instead of a monster type.

desophos
02-13-2012, 06:26 PM
My end goal is to be able to equip pets with items. To accomplish that goal, I assume I have to make pets NPCs. I'm trying to make skeleton NPCs, but I really feel in over my head. I don't have enough experience with types and archetypes and NPCs in general to be able to create new types of NPCs. Could you give me some hints? What I've done so far is merge some base NPC pet archetype and type classes, but I don't know if the base for the types should be BaseMonster or something else.

With what I've done so far, Raise Skeleton acts exactly like Raise Dead, and I have no idea why.

Shadow
02-14-2012, 11:03 AM
The thing that makes an npc an npc is that the npc var in its archetype is set to 1. They tend to have other changes but most of them probably aren't important.

You might need to make sure Talks is set to 1 in their monster type and GivesQuests is set to 1 in the archetype so that you can get a menu to pop up when you click on them though.

desophos
02-14-2012, 12:58 PM
What is the class hierarchy that I need to set up? I'm having trouble with that.

Bluddy
02-14-2012, 01:39 PM
You're really going to be testing the limits of the system here. I'd say start with ArchetypeSkeletonPet and try to modify that by giving it Npc 1 and GivesQuests 1, and putting Talks 1 in MonsterSkeletonPet. See where that gets you.

desophos
02-14-2012, 04:21 PM
Should I merge the types and archetypes with the NPCs or with the monsters? Does it matter?

Bluddy
02-14-2012, 08:03 PM
Should I merge the types and archetypes with the NPCs or with the monsters? Does it matter?

My guess is with the monsters. Did you end up getting MonsterSkeletonPet to work?

desophos
02-14-2012, 08:21 PM
No, now it just summons a random monster... Here are the files so far, maybe you can tell me what I'm doing wrong.

Bluddy
02-14-2012, 09:07 PM
I fixed up some stuff. Haven't had a chance to test it, but I found several things that could cause problems. The main one is the position of the Monster directory. It should be in Database/Monster, but if you make new files (ie. not overriding the original file names), everything has to be in Database/. Only files listed in Database.gdb (ie. the original game files) can be outside the base Database/ directory.

All the stuff I fixed is explained in comments (//).

desophos
02-14-2012, 10:51 PM
Thank you! It works now, to an extent. Here is my new list of actual problems:

Corpse appears as living model -- why??
Can't use weapons -- is it possible to change which items a specific NPC can use?
Game announces death -- again, is it possible to change these settings for a specific NPC?
Can loot body -- same as above
Enemies gain lots of XP from kills -- same as above

Bluddy
02-14-2012, 11:08 PM
Thank you! It works now, to an extent. Here is my new list of actual problems:

Corpse appears as living model -- why??
Can't use weapons -- is it possible to change which items a specific NPC can use?
Game announces death -- again, is it possible to change these settings for a specific NPC?
Can loot body -- same as above
Enemies gain lots of XP from kills -- same as above


I think you've bumped into the limitations of the game's scripting. For example, I've been searching for where the lootable corpse is specified for NPCs, but I'm afraid it's hard-coded.

desophos
02-15-2012, 12:59 AM
Boo. :( Shadow, is it possible to alter anything other than behavior for specific NPCs?

Shadow
02-28-2012, 11:32 AM
Thank you! It works now, to an extent. Here is my new list of actual problems:

Corpse appears as living model -- why??
Can't use weapons -- is it possible to change which items a specific NPC can use?
Game announces death -- again, is it possible to change these settings for a specific NPC?
Can loot body -- same as above
Enemies gain lots of XP from kills -- same as above


I'm not sure I understand what you mean about the first and last ones.

You can make NPCs hold certain weapons with an attachment command in the archetype (like Attachment AttachmentSwordsOneHanded).

You probably can't do anything about the death announcement and body looting.

desophos
02-28-2012, 08:51 PM
I'm not sure I understand what you mean about the first and last ones.
1. When a skeleton pet dies, it fades and a living skeleton model looping its idle animation appears instead of a skeleton corpse model.
2. I think (not sure) that enemies gain extra XP when they kill my NPC pets. Do NPCs give special bonuses to XP gained?

You can make NPCs hold certain weapons with an attachment command in the archetype (like Attachment AttachmentSwordsOneHanded).
How exactly does that work, though? Skeletons have AttachmentMacesOneHanded, but I can't equip weapons on them. They just appear to hold maces.

You probably can't do anything about the death announcement and body looting.
Aww, oh well. :/

Shadow
02-29-2012, 10:37 AM
Oh, ok. I think the problem you are having on #1 is the game is trying to spawn a lootable dead character when your npc dies. It needs an animation called closed. Look at the bottom of npcMaleHuman.mdl to see how to do this.

There is a higher chance for monsters to upgrade when they kill an npc. You can't stop that but you could change the global chances if you wanted to. The parms for this are MonsterKillMonsterUpgradeChance, MonsterKillNpcUpgradeChance, and MonsterKillPlayerUpgradeChance in systems.gdb.

Yes, the attachment command just sticks the model in their hand. You might be able to add a real weapon to them but you would need to at least add a weapon slot to their equipment menu.

Bluddy
02-29-2012, 11:50 AM
Is there a way to stop the lootable body spawning? Also, how do NPCs become zombies if they turn into lootable bodies?

Shadow
02-29-2012, 02:10 PM
Is there a way to stop the lootable body spawning? Also, how do NPCs become zombies if they turn into lootable bodies?

You can't stop the lootable body thing that I know of. The lootable body part only happens when the npc is permanently dead (basically the zombie part would happen first).

desophos
02-29-2012, 09:09 PM
You might be able to add a real weapon to them but you would need to at least add a weapon slot to their equipment menu.
Is it possible to do this for only certain NPCs? I was under the impression that I would have to change the global NPC equipment menu.

Shadow
03-01-2012, 09:10 AM
Is it possible to do this for only certain NPCs? I was under the impression that I would have to change the global NPC equipment menu.

You would probably have to do it globally.

desophos
03-01-2012, 03:55 PM
I found npcEquipmentFull.mnu, but I don't see how that works. It implies that every NPC should have all possible equipment slots, but only a few slots show up. I looked through systems.gdb, NpcArchetypes.gdb, and NpcTypes.gdb, but I didn't find anything about which items an NPC can equip. Where is that information defined?

Shadow
03-01-2012, 07:38 PM
I think you want to modify npcEquipment.mnu which is in the expansion data.

desophos
03-08-2012, 04:33 AM
Thanks! I'm making significant progress and I think I'll release my first version soon. I have a couple more questions:
1. Is it possible to change which weapons/shields NPCs can equip? I'd like to be able to equip a bow on my skeleton bowmen.
2. When I drop a healing item on a pet, I get the message "Can't give items to enemies". Also, some pets appear as blue dots on the minimap and some appear as green. I thought these two issues might be somehow related. Why are party NPCs being treated as enemies? I can also target my pets with spells (although they don't take damage) -- could this be related too?

Shadow
03-13-2012, 04:03 PM
1. Is it possible to change which weapons/shields NPCs can equip? I'd like to be able to equip a bow on my skeleton bowmen.
2. When I drop a healing item on a pet, I get the message "Can't give items to enemies". Also, some pets appear as blue dots on the minimap and some appear as green. I thought these two issues might be somehow related. Why are party NPCs being treated as enemies? I can also target my pets with spells (although they don't take damage) -- could this be related too?

In general what items something can use is controlled by ItemRequirement commands in classes.gdb.

You probably need to make sure CanPlayerAttack in your pet's arcehtype is set to 0.

Bluddy
03-13-2012, 09:01 PM
That reminds me: it would be really cool if you could give food to dog types (ragnar, hellhound). It could either pacify them for a moment, or even make other dogs want to attack them for the food. Not a huge deal, but another tactical option for when you have dogs (who are very fast) chasing you down.

desophos
03-14-2012, 01:42 AM
Great, that fixed both those problems. I have some more that I'll post here:

Pets don't use lifestones.
Pets with weapons either don't attack or don't play attack animations.
Can't make pets start with weapons since I disabled the attachments. I found the parm "StartingItem" commented out in some monster classes -- was this never implemented?
The health bar shows up as all black (i.e. no health) in the pet UI.

Any advice on these?

Shadow
03-14-2012, 11:17 AM
To use lifestones they need the following line in their archetype
UseObjectData BehaviorDataUseObjectUseHealthstones
and they must be using a behavior stack that has UseObject somewhere in it.

Your pets probably need all of the weapon specific animations set up. Look at something like npcMaleHuman.mdl and you'll see there are a bunch of different animations (attack, attackOneHand, attackTwoHand, etc. ). You need all of those. You need to make them all point to whatever attack mda your pet model actually has though.

I believe StartingItem still works for the monsters, we just don't use it usually.

I'm not sure about the health bar. I assume your talking about the one on the left side of the screen. The pet does have actual health though, right?

desophos
03-14-2012, 04:05 PM
That fixed the attack animation problem -- thanks! I put the StartingItem parm in the pets' classes (with Mace1 and Bow1), but they still don't start with anything. Yes, I mean the bar on the left side, but it turns out that the pets have no health (i.e. infinite health, I think) and do no damage. I don't know what I could have done to cause this.