BadPenney Posted December 12, 2009 Share Posted December 12, 2009 I’m seeking help on a script that would allow NPCs to automatically kill any nonplayer hostile opponent with which the NPC is in combat. I would like this to work against hostiles without knowing their ID in advance, so that NPCs that are in my Wasteland town can defend themselves against NPCs that originate from spawn points placed in the Wasteland by any other unknown mod that happens to be in the same load list. I don’t want to just account for other currently available mods, but rather have a script that is able to recognize any variable reference ID that attacks my NPC and kill it. Ideally, if another mod that adds additional spawn points to the Wasteland coincidentally places a point within my town, the script would kill any actor that spawned from that point, heal my NPC of any combat damage, and remove the carcass of the dead enemy. I’d like to avoid unsightly piles of bodies. It would be great if the spawn point could be suppressed somehow, so that re-spawns stop, or are disposed of so quickly that they cause little or no disturbance in town. It would also be necessary to make this script benign and compatible with other mods, so that it doesn’t cause conflicts and crashes. I wonder if attempting to retrieve the ID of that spawn point and disable it would cause CTDs. I have considered this sort of script for some time and think that it should be doable, but I am unsatisfied with anything that I’ve conceived, so I would appreciate any script ideas that accomplish the goal. Link to comment Share on other sites More sharing options...
gsmanners Posted December 12, 2009 Share Posted December 12, 2009 It goes without saying that FOSE will be a necessity. I think something like this should serve, although I've had problems with it in testing: set target to GetFirstRef 200 0 0 Label 10 if target if target.GetDisabled == 0 if target.GetDead == 0 if (target.GetFactionRelation player == 1 || target.GetAV Aggression == 3) target.kill endif if (target.GetAV Aggression == 2 && target.GetFactionRelation player == 0) target.kill endif endif endif set target to GetNextRef Goto 10 endif Link to comment Share on other sites More sharing options...
BadPenney Posted December 12, 2009 Author Share Posted December 12, 2009 I'm entirely ignorant of FOSE, outside of its name and purpose, which is probably the main reason that I hope that FOSE is not the only answer to the problem. The rest of my mod doesn't require it to operate, so Is FOSE really an absolute requirement? Link to comment Share on other sites More sharing options...
gsmanners Posted December 12, 2009 Share Posted December 12, 2009 I suppose you could use trigger boxes, but I'm not sure whether those are movable. Trigger boxes also use a lot of CPU power, so really your best bet is to use FOSE and get acquainted with how loops work (although it's been hit-or-miss for me lately). http://fose.silverlock.org/fose_command_doc.html#GetFirstRefhttp://cs.elderscrolls.com/constwiki/index.php/GetFirstRef Link to comment Share on other sites More sharing options...
BadPenney Posted December 13, 2009 Author Share Posted December 13, 2009 If FOSE is the only answer to making the script work, then perhaps it could be part of an optional add-on file to the mod's .esp. One of my goals was to make a mod that could work even when a user had nothing more than the Fallout 3 game disk and a basic installation and no other mods. Users who would benefit from the script that I want are ones who are more likely to use FOSE anyway, and would not be baffled by an additional file containing a script intended to increase mod interoperatability. Thanks for the replies. I will study on it. Link to comment Share on other sites More sharing options...
gsmanners Posted December 13, 2009 Share Posted December 13, 2009 Maybe what you need is to differentiate what you want from say using a super-powerful version of Dogmeat as a companion. That may help narrow the scope of what you want to do a bit. Link to comment Share on other sites More sharing options...
BadPenney Posted December 13, 2009 Author Share Posted December 13, 2009 Maybe what you need is to differentiate what you want from say using a super-powerful version of Dogmeat as a companion. That may help narrow the scope of what you want to do a bit.I don't follow the Dogmeat reference. I am not trying to create a companion. Exactly what I am looking for is this: I placed a town in the Wasteland in a spot that is clear of hostile spawn points. I have already dealt with vanilla creature spawns within aggro range to prevent them from killing the residents of the town. I want the town to be peaceful inside the town walls. I have gotten reports from users who have downloaded the town that creatures spawn inside that kill the residents. Albino radscorpions are the culprits in many cases. One user created a merged patch for the town to make it work with MMM, which many people said was the likely source of the increased spawns. I am aware of other mods besides MMM that add additional spawn points to the Wasteland, and realize how easy it is to add spawn points in a mod, and that I can't keep creating patches for my mod to deal with that sort of conflict. Neither do I want to try. Some people have suggested that I make all of the residents essential to deal with unknown hostiles from other mods, but that would deny the player using my town the choice of killing the residents without preventing the town from becoming a chaotic battle scene between residents and beasties. To be honest, I feel that it is the responsibility of each person who downloads mods if they experience consequences unintended by modders due to the number and type of mods in their load list. But if I can reduce possible conflicts with other mods then it is worth some effort. If I was able to include a script in my mod that would defeat and remove any creatures that spawn inside the town limits if they attack any of the residents, then that might make my mod work as intended for people who use it, even though they may be using other mods that alter the Wasteland map with additional enemies. This type of autodefense script would likely never be activated if a user was not running other mods with increased spawns though, so I don't really need it for the basic functions of my mod and don't want to require a user to have FOSE installed to run my mod for nothing more than this. Many users are very savvy about FOSE and handling load lists, but a great many are so new to the game that they falter at reading basic install instructions. I don't want to make my mod less accessible to inexperienced mod users. Link to comment Share on other sites More sharing options...
gsmanners Posted December 13, 2009 Share Posted December 13, 2009 Have you given any thought to putting your town in its own worldspace (like Megaton)? I don't recall anyone having that spawn problem with Megaton. Link to comment Share on other sites More sharing options...
BadPenney Posted December 13, 2009 Author Share Posted December 13, 2009 Have you given any thought to putting your town in its own worldspace (like Megaton)? I don't recall anyone having that spawn problem with Megaton.In hindsight, I wish that I had. Link to comment Share on other sites More sharing options...
gsmanners Posted December 13, 2009 Share Posted December 13, 2009 Food for thought. Anyway, the problems associated with towns that sit in the wasteland (Big Town, Arefu, Dave's Rep., Canterbury) aren't just limited to spawn points. You also have NPCs that wander off for no apparent reason, the tendency for the town to "pop-up" on some systems, crashing, and NPCs that simply vanish or go flying through the air if they happen to die earlier on. The one problem you might have with a separate worldspace is that a hostile will follow you in and get stuck there for a while. Link to comment Share on other sites More sharing options...
Recommended Posts