Aller au contenu

Photo

Question about NPCs/activities/items handled


  • Veuillez vous connecter pour répondre
17 réponses à ce sujet

#1
andysks

andysks
  • Members
  • 1 651 messages

Hi all. I was doing some stuff on test level, trying to use many different cool stuff to make my NPCs on the main work even more active.

I run into some... issue let's say. I was trying to use some sitread, shoveling, forge animations from kamal's package. At first, because he mentions that the scripts use DannJ's handy vfx I just assigned them the scripts. They do the animations of course, but they won't equip the items. Then I remembered that on the guide it was mentioned that I need to equip them for any activities, and give them the feats. I gave a light hammer to the forging guys, and a shovel(quarterstaff) to the shoveling guy, but they still seem to not equip them. Am I missing something as to how this works?

 

Edit: Applying the DannJ effect manually made it work for the hammer. I guess it will work for everything. The shovel, maybe I miss something. Will check it out more.



#2
4760

4760
  • Members
  • 1 212 messages

The shovel, maybe I miss something. Will check it out more.

What is the size of your NPC? Shoveling animations (as all two handed activities) won't work for small races.



#3
andysks

andysks
  • Members
  • 1 651 messages

It's a human :). The animation works, he just doesn't carry the item, shovel in this case. I created a blueprint, quarterstaff with the model number 7, which looks like a shovel. Made him wizard, gave him all the feats, nothing seemed to work. I think it's a blueprint issue. Do you know another way to use a shovel? Is there a vfx somewhere that I miss?



#4
kamal_

kamal_
  • Members
  • 5 254 messages
Do you have dannj's handy fx? Its required to use the activities such as reading that make use of it. Do you have the blueprints I included in the package? The npcs equip items from the blueprints.

#5
kamal_

kamal_
  • Members
  • 5 254 messages
You dont have to worry about feats, my package should automatically assign the npc any feats needed to use things like the quarterstaff shovel.

#6
4760

4760
  • Members
  • 1 212 messages

Do you know another way to use a shovel? 

I think the beginning of The Wizard Apprentice (the very first cutscene) shows the PC using a shovel without any vfx or feat. All it uses if a shovel (of course) and the shoveling animation from the stock gr2 files.



#7
andysks

andysks
  • Members
  • 1 651 messages

Hmm. I didn't even know you had blueprints in the pack. But I saw again, and I only have scripts and wps in the erf. Small problem, I opened the show module and I found the blueprints in there. However, the shovel still didn't work. I know PC Tools have a shovel vfx, maybe I'll integrate that one somehow.

As for the Handy VFX, yes I have them. The NPCs will equip steins and books and spoons, but no shovels and hammers. Anywho, it's not such a big deal I guess. I will find a work around on it. It's not like the most important feature. The animation alone is a big help no matter what. It was just the shovel that looks weird when the NPC does it without a shovel :D.



#8
Dann-J

Dann-J
  • Members
  • 3 161 messages

I tinkered with the shovel as a visual effect, but for some reason the model didn't want to show up. The game's original shovel (with the D-shaped handle) doesn't look all that great anyway. That's probably why the quarterstaff shovel variant was created in one of the expansions.

 

None of my Handy VFX actually equip anything. They just centre a model effect on the hand nodes (ie. smoke and mirrors). For a shovel you've got no choice but to equip an actual inventory item.

 

I did include the smith hammer in a later update of the Handy VFX. It's a chunky looking model though, with a very thick handle. Equipping a light hammer probably looks better.



#9
andysks

andysks
  • Members
  • 1 651 messages

Funniest thing. In between all this, trying to figure out how to do it, I also placed a tiefling NPC near the spot where the guy should be shoveling. I didn't see that she was hostile, and run the game to see if the shoveling works. The guy still had no shovel equipped, but when the tiefling attacked, he tried to defend me, and voila: shovel yielding worker in action. So he only won't use during his heartbeat. Why is that? By the way, I am using the generic not the 24 hb if it's any help :).



#10
kamal_

kamal_
  • Members
  • 5 254 messages
You need to insert some debug statements in there to see what is and what is not happening. Sendmessagetopc (getfirstpc ()) is what I use, others have otger preferences. If the npc returned to their work location after combat, that part is happening.

#11
andysks

andysks
  • Members
  • 1 651 messages

I guess I'll do some searching to figure it out. Because if he can equip the shovel for combat, it means that he generally can. Just not for what he is supposed to... shoveling :). While on the matter kamal, is there a sleeping heartbeat that I missed or is it just not included?



#12
4760

4760
  • Members
  • 1 212 messages

Because if he can equip the shovel for combat, it means that he generally can.

The shovel being a quarterstaff, the engine sees it as a weapon, and so will have the NPC equip it if no other weapon is in hand and if a combat start. But if there's no combat, the shovel will not be equipped automatically, even if the animation for shoveling is called. I suppose you'll have to add a ga_equip_slot action (in a conversation) or a line that forces the NPC to equip the shovel:

// oTarget is the NPC
// oItem is the shovel

AssignCommand(oTarget, ActionEquipItem(oItem, INVENTORY_SLOT_RIGHTHAND));

before running the animation.



#13
4760

4760
  • Members
  • 1 212 messages

They do the animations of course, but they won't equip the items. Then I remembered that on the guide it was mentioned that I need to equip them for any activities. I gave a light hammer to the forging guys, and a shovel(quarterstaff) to the shoveling guy, but they still seem to not equip them. Am I missing something as to how this works?

Based on the shovel being equipped when the combat starts, "giving" the item is not enough. Either you do it by code (like my post above) or instead of placing the shovel in the inventory put it directly in the right hand slot of the NPC (but in this case he will always have it in hand).



#14
kamal_

kamal_
  • Members
  • 5 254 messages
The readme includes the complete list of activities. If there are other activities you want there are also template hearbeats you can use to make new ones. If you make a new one please send it to me so I can include it Iin the download.

#15
andysks

andysks
  • Members
  • 1 651 messages

So, shoveling seems to have some problem. At least with me. Maybe forge as well, but I am testing shovel at the moment. What I did, was write an one-line script to see if the problem comes from kamal's script or general. Looks like that.

void main()
{
	PlayCustomAnimation(OBJECT_SELF,"shoveling",TRUE,1.0);
}	

Straightforward.

Anyway, the fella seems to like shoveling now. I did a search on the kamal's script, because this is actually the one I'd like to use, so that the NPC also goes home and not keeps shoveling that mud internally... and my guess is that there is a problem there on the lines telling us to equip or unequip items. Didn't debug yet, or did more search than that, but I will.

 

Also, kamal, I was planning to make hbs with the kemo animations, to have some nice sitting NPCs in corners but in different positions than just the sitting animations we have. I was planning to do it as above, but now I guess I'll use the template for more functionality. I will send them to you once I decide to do them.



#16
kamal_

kamal_
  • Members
  • 5 254 messages
Have you tried assigning the shovelling activity in the demo module I included on the commoner ai download pages?

#17
Dann-J

Dann-J
  • Members
  • 3 161 messages

 

... so that the NPC also goes home and not keeps shoveling that mud internally.

 

 

Shovelling mud internally is certainly the last thing you'd ever want to do. Ouch!  :blink:



#18
andysks

andysks
  • Members
  • 1 651 messages

Kamal, yes. And he still won't use it. I placed a human there, who is by default a fighter and gave him shoveling and a shovel. He didn't carry the quarterstaff.

 

Dann, I meant sand :D. But still...