davidlallen Posted December 16, 2010 Share Posted December 16, 2010 I am having some trouble figuring out how to do this special effect. When a quest is in a certain stage, I want every creature of a certain creaturetype (feral ghoul == 5) to have an item in their inventory when killed. I have looked into the leveled item lists such as LootGhoul, which seems like the right one to use. I am not sure exactly how these work, but it appears that each item has a random chance to be selected. I don't want to interfere with this loot. I want to be guaranteed that my one item is added. There are several layers of class inheritance such as FeralTrooperGhoul, REPCONFeralGhoul, etc, some of which have scripts and some of which don't. All of them seem to use LootGhoul, but I can't quite see how to use this. Can anybody suggest a way to accomplish this? It should work regardless of who actually killed the creature (eg companions) or what weapon was used, so I don't think I can hook onto either of those. In related news, is there any way to loot an unconscious body? For a character development reason, I also want the player to be able to use a special tranquilizer dart to knock out the ghoul, and then get the item. I have successfully made a weapon which does huge fatigue damage and puts the item into the ghoul's inventory upon a hit. But in testing, what I find is that (a) my companions continue shooting at the unconscious, defenseless ghoul until it is dead, and (b) if I go by myself with no companions, I still can't loot or pickpocket the ghoul. So I cannot find any way to let the player take the item. Link to comment Share on other sites More sharing options...
thc1234 Posted December 16, 2010 Share Posted December 16, 2010 probably easiest way to accomplish what You're looking for is by entry point perk Activate. You can test for unconscious and directly open container, or test for creature type and add loot.I've not used the "run immediately" check box, however assuming it does what I'm guessing it's supposed to, You'll be able to accomplish all You want to with it. Link to comment Share on other sites More sharing options...
davidlallen Posted December 16, 2010 Author Share Posted December 16, 2010 This sounds like an interesting suggestion, but I do not quite understand. There are many different creatures of different base classes which all have creaturetype == feral ghoul. Some of them already have object scripts. Do you mean that for each creature, I have to either add an object script, or edit the existing object script, to add a "begin onactivate" clause? Perhaps you meant something different by "entry point perk activate"; can you give a little more detail? Is there a way to write a script which triggers when *any* object is activated? If so, then this script could check for creaturetype ghoul, check if the item is already present, and add the item if needed. That would be perfect, but I do not know how to cause a script to trigger on any object activation. The problem with unconscious creatures is that they do not seem to respond to activate at all. In testing, I knock a creature unconscious with my weapon, then run over and put my crosshair on the body. I do not get any activate choice. So there is no way to trigger any behavior on this. I would also need a way to prevent my companions from firing. Link to comment Share on other sites More sharing options...
Quetzlsacatanango Posted December 16, 2010 Share Posted December 16, 2010 Have you looked at giving the creatures a 'death item'? Link to comment Share on other sites More sharing options...
davidlallen Posted December 16, 2010 Author Share Posted December 16, 2010 All of the ghoul creatures already have a death item which is LootGhoul or some other leveled list which contains LootGhoul. If I understand correctly, this gives random loot based on its internal lists. So if I replace this with my new item, then the ghouls won't have any loot except for my item. What I want instead, is to guarantee my item in *addition* to their regularly scheduled loot. Link to comment Share on other sites More sharing options...
thc1234 Posted December 17, 2010 Share Posted December 17, 2010 (edited) entrypoint perk activate = give player perk with "entry point" = "activate"this perk allows You to run Your script everytime player activates something. in that script You'll have to check for activated object type and do Your stuff.GECKI'm assuming "run immediately" (checkbox in GECK, not described on GECK wiki) just runs the script always. if this is not the case, then this method isn't really usable. as for knocking out & companions behaviour (aka try to stop them from shooting)If Your knocking out is done by specific weapon (Your weapon) spell effect could be used to something like SetEssential, KillActor (or setav health 0 ?) that should in theory stop companions from fighting on that creature (as it's really dead). that is however only theory. After creature Your script effect is running on wakes up - just restore it's health to what it was before setessential (and obviously You won't be able to damage it during time it's unconscious) and unset it essential.possibly other road You may take, is giving Your companions perk to modify their damage on unconscious target to 0 (so they're unable to kill it even if they will still shoot) Edited December 17, 2010 by thc1234 Link to comment Share on other sites More sharing options...
davidlallen Posted December 17, 2010 Author Share Posted December 17, 2010 (edited) entrypoint perk activate = give player perk with "entry point" = "activate"this perk allows You to run Your script everytime player activates something. in that script You'll have to check for activated object type and do Your stuff.That is an interesting set of functions. I never knew they existed. However, the documentation is not quite enough for me to figure out how to make it work correctly. I have defined the perk, added a script for it, and given myself the perk. What happens now when I activate any object is ... the game crashes. It isn't clear to me what objects the script can access, and I wasn't able to find any examples of how it should be used. Do you know of any examples that use it? If not can you suggest what may be wrong with this? if getiscreature if getitemcount dwrsample == 0 additem dwrsample 1 endif endif dwrsample, obviously, is the name of my item, and the script compiles correctly using geck powerup, so I am sure that syntax is not the problem. I am assuming that it runs on the target, otherwise I do not know how to get the reference object to use any function. (EDIT: even if I give a blank script, I get a crash whenever I have this perk and I activate an item. Unless there is something basic that I am missing, this approach does not seem to work.) Thanks for your suggestions about unconscious, I will try that out soon also. Edited December 17, 2010 by davidlallen Link to comment Share on other sites More sharing options...
thc1234 Posted December 18, 2010 Share Posted December 18, 2010 (edited) K, because "run immediately" doesn't work (sorry didn't know that - I've only used it with activation choice), You can try entry point perk "Add Leveled List on Death".(just create Your leveled list which will contain Your item with 100% drop rate), perk should contain condition for ghouls (I've used GetInFaction and FerralGhoulFaction) and GetQuestVariable to check for state of Your quest (as You originally said You only want this to happen during certain state of quest - or You can just add/remove this perk based on quest...) Edited December 18, 2010 by thc1234 Link to comment Share on other sites More sharing options...
davidlallen Posted December 18, 2010 Author Share Posted December 18, 2010 (edited) I think I need a little bit more help to make this work. I have added a new perk which uses "add leveled list on death" and I have added the leveled list with my item. The conditions panel has tabs for "perk owner" and "target". Here is where I am confused. Am I adding this perk to the player? Then it will trigger when the player dies. Am I adding this perk to the ghoul? That makes more sense, so I add a condition "getinfaction feralghoulfaction" under the perk owner tab. I can add the condition about my quest later. This just seems to push my problem one step sooner. How do I write code which adds this perk onto all ghouls? Just because the perk exists, doesn't mean all ghouls have it. I tried this in game by shooting some ghouls in Searchlight, and the item was not dropped. Is there one step I am missing, about assigning this perk? Or did I make a mistake somewhere else? Sometime it occurred to me that I have seen this effect before. It is like the fingers and ears dropped with the lawbringer / contract killers perks in FO3. I don't have FO3 geck installed, but I will look there for clues also. EDIT: I looked in FO3 and they did it exactly as you described, with the getinfaction check in the target tab. Although it is not obvious, the "add leveled list on death" does not mean the perk owner's death. The part about dropping the item is working for me now, I will investigate about the unconscious part. Setting the health to 0 seems like an obvious thing to prevent companions from firing. But now I am stuck on the difference between this, and an actual instant kill device. If I have to set health to 0, why am I bothering with fatigue damage, and how will the player recognize the difference. I will try it out and think about it some more. Edited December 18, 2010 by davidlallen Link to comment Share on other sites More sharing options...
thc1234 Posted December 18, 2010 Share Posted December 18, 2010 (edited) well, adding it to all ghouls would be a little bit too much work IMHO. so perk should be on player and on teammates. (AFAIK it's run when creature is killed by Actor who killed it)so target condition = GetInFaction 'FerralGhoulFaction'. if You don't mind if item is only added when creature is killed by PC, then put perk on PC. if You need this to work with companions put perk on companions. (this could get non-trivial if You'll want to support non-vanilla companions - like iterating over Actors every Nsecs to GetPlayerTeammate...) EDIT:BAH. writing response and doing other stuff at the same time result. glad You figured it. Edited December 18, 2010 by thc1234 Link to comment Share on other sites More sharing options...
Recommended Posts