Jump to content

NPC gathering loot


DanielUA

Recommended Posts

Not exactly helpful, but I always thought the NPCs kneeling down to touch the bodies were looking for a pulse to see if they were actually dead.... Now I will want to scream "What is wrong with you people?!" whenever they do it. Corpse robbing those poor town guards who died to a dragon, tsk tsk.

 

On this note, the first time I ran across the Scavenger, I couldn't help but note the irony - here's a guy looting corpses in the wild and wearing a selection of their armor and weapons. Had he not gone hostile, I woulda left him alone :lol:

Link to comment
Share on other sites

Ok, so I'm still hitting a problem: I've got a FormList of items to be looted, and as far as I can tell, the Package is set up correctly, yet no looting is taking place.

 

Should I also have a Leveled List of the items (as in, a reference in the LeveledItem list)?

Link to comment
Share on other sites

I'm not using scripts (yet), just the vanilla Packages, and following tutorials at CreationKit.com

 

http://www.creationkit.com/Tutorial_-_One-off_Package_based_on_Existing_Template

 

However, I'm thinking there was a considerable change to how this works between FNV and the current CK revision, as the image shows "AcquireItem" as the Template, when it's now "Acquire". Not to mention the images are dated for 2009...

 

Even then, the MQ101RalofGetDoorKey Package uses the Acquire Package Template. No Conditions, and no Scripts attached to either Ralof or the Soldier in that scene. I started a new game and checked their inventories via the console. One minute the soldier has it and Ralof doesn't, then he does a SearchBody animation and the key transfers from her to him.

 

I did disable all mods except the one I'm working on, and started another new game, just to see if it was a conflict, but the results were the same - they will cop a feel off every wolf and rabbit and troll, but ignore the Thalmor corpses.

 

Link to comment
Share on other sites

Actually, I think I found it:

 

;BEGIN FRAGMENT Fragment_144
Function Fragment_144()
;BEGIN CODE
; Ralof has key to door
;Alias_Ralof.GetRef().AddItem(Alias_KeepDoorKey.GetRef())
;SetStage(260)
;END CODE
EndFunction
;END FRAGMENT

 

This line is in QF_MQ101_0003372B, though it's not visibly linked to Ralof's package for the scene.

 

So I need to work this setup into my NPC's Acquire package so that when the carrier is dead and they search the body, the item is added to their inventory and deleted from the carrier.

 

Link to comment
Share on other sites

What you quoted is commented out. It has to be somewhere else.

 

EDIT:

The package you were looking at is where Ralof obtains the key. It is a hardcoded means of obtaining a specific item. The quest fragment that you quoted is how they originally did it. At some point they changed it.

 

Perhaps, they changed it because items added to containers and inventories in the Creation Kit while there for that NPC or container's use are not actually there for papyrus to manipulate on the individual level. You can use RemoveAllItems and it will grab every item but you cannot use RemoveItem until papyrus has in some way gained knowledge of the item. Usually a RemoveAllitems to one container is enough for papyrus to be able to use the RemoveItem command.

 

We, as modders, tend to abuse the functions that they put into papyrus. We use them for scenarios that were not originally intended. It is both the joy and curse of modding. RemoveItem was most likely intended for use with the player's inventory only, an inventory that is fully accessible throughout the entire game.

 

All that said, use the Acquire package when working with specific placed items in the CK. Otherwise, use RemoveItem for items added via script.

Edited by IsharaMeradin
Link to comment
Share on other sites

Makes sense. And yeah, I know all about the curse of trying to make something do what it was never intended to - I have considerable trouble resisting the urge to do that with many things :lol:

 

At any rate, I'm wondering if this file is merely a "fragment warehouse", and the comments are to prevent every function from firing as it's scanned. If a given Fragment is called (in this case 144), the game knows to draw from the following BEGIN CODE and continue to the END CODE, inserting only that Fragment which was called.

 

Looking more closely at the fragment, there's a space between the comment and "Ralof has key to door", whereas there's no space on the others. This leads me to think that with Papyrus (or at least Fragments), you comment out a line with the ; and a space, not just the ; by itself.

Edited by DrNewcenstein
Link to comment
Share on other sites

 

 

Looking more closely at the fragment, there's a space between the comment and "Ralof has key to door", whereas there's no space on the others. This leads me to think that with Papyrus (or at least Fragments), you comment out a line with the ; and a space, not just the ; by itself.

Whenever there is a ; Papyrus will ignore the rest of that line.

 

Consider the following:

 

 

;The following will change the health of the player
Game.GetPlayer().SetAV("Health",50) ;sets health at 50
Game.GetPlayer().DamageAV("Health",50) ; <-- oops I think we killed the player
;     *insert evil laugh here*

 

 

 

At any rate, I'm wondering if this file is merely a "fragment warehouse", and the comments are to prevent every function from firing as it's scanned. If a given Fragment is called (in this case 144), the game knows to draw from the following BEGIN CODE and continue to the END CODE, inserting only that Fragment which was called.

You must be looking at the actual fragment script file. If you were to look at the quest in the CK and check out each quest stage you would see the individual fragments. It is at those points that that bit of code runs. The capitalized commented phrases are hard coded comments placed by the CK whenever a fragment is made. It is a means of separating fragment functions on the form's fragment script.

Link to comment
Share on other sites

  • 1 year later...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...