ExoArchivist Posted November 17, 2017 Share Posted November 17, 2017 Alright, so for my first mod in a long time I'm getting into scripting and I need to know if what I have in mind is even really feasible or if my idea needs tweaking. Basically, how easy/feasible would it be to have a scripted event automatically and immediately have every enemy within a certain radius hone directly in on and aggro on the player, even if the player was totally undetected up until that point, etc? What if I add in that a good chunk of the reason I'd want to give the player this option would be to get the enemies to disengage with any player allies and go after the player instead? Thanks! Link to comment Share on other sites More sharing options...
EPDGaffney Posted November 17, 2017 Share Posted November 17, 2017 Do you know which enemies will be doing this or is this something that will happen many times and will include any number of unknown enemies? For a scripted event, as you put it, I would have the former in mind, but I kind of think you want the latter. Both are possible, but the former is simple and just involves the EnemyRef.StartCombat Player function, whereas the latter involves more complex scripting than I'm really familiar with. I believe you would want to look into arrays. Another option is to spawn a loud sound/explosion at the player but have it actually be silent for us humans, just perceived as loud for the AI/engine. Another thing I've never done that would probably not work as well as a nice script, but something you can look into if you like. I'm almost certain I've read about modders using the technique, though. Link to comment Share on other sites More sharing options...
ExoArchivist Posted November 17, 2017 Author Share Posted November 17, 2017 (edited) Yeah I'm looking for something more in line with the latter. Basically I need something that will immediately have every enemy within a certain radius drop everything, detect, and attack the player. And by enemy I mean... any enemy. Maybe "hostile" would be a better way of putting it. Would it by chance be easier if I just targeted "everyone in combat right now" then found a way to exclude friendlies or hmmm. I may be in over my head. EDIT/UPDATE: Spent a good long while discussing my whole idea and the problems of how to make it work with a friend who, although he lacks experience in scripting for the GECK or anything, has a huge amount of experience in coding and whatnot and today we were able to cobble together a theoretical solution. Basically if I could create a scripted AoE attack at the player's location that did no damage, but applied a scripted effect to everyone it hit OR could just make a big enough invisible and silent explosion that applied a scripted effect, did no damage, and had no force, I might be able to make this work. The scripted effect would basically go Is this an enemy? and if the answer was a no, it would end. If the answer was yes, then it would have it make them attack the player. This is, of course, working all under the assumption that there exists a way to do any and/or all of the above. Also I've now fully realized I'm in over my head as this is only, maybe, at most, 10% of the mod, all of which is scripting basically, so I'm going to end up putting this in the mod requests section eventually and offering to help with the bits that I can, I'd just like to have a clearer outline of how to even go about making it happen. Edited November 17, 2017 by ExoArchivist Link to comment Share on other sites More sharing options...
EPDGaffney Posted November 17, 2017 Share Posted November 17, 2017 You could easily make a weapon that has a massive area of effect but doesn't appear to the player to be doing anything visually or aurally. Just look at the other explosives in the game, duplicate one, turn down its throwing distance, make a custom explosion, and maybe change/remove the animation for it. Although this introduces the problem of ammunition, so maybe you can do a similar thing with an invisible melee weapon but use Player.PlaceAtMe Explosion for your custom explosion. Trouble there is that the player still needs to equip this weapon, which isn't ideal I would think. You could of course just use Player.PlaceAtMe Explosion any time the item is used, though I don't know for sure that the enemy would associate that with the player. Could be some option to set it that way. Otherwise, you could look into arrays in New Vegas scripting. Maybe your friend could have a look. It's not really hard; it's just that I've never needed to do it, so I have no personal experience to tell you anything about its quirks. I did write a theoretical script for someone recently that someone more experienced set would work fine for starting the effect but not turning it off. However, I don't think you really need to turn off this effect anyway, as combat is simply started by the script, not maintained by it. What is the rest of your mod? Maybe you should keep at it. If you want to I mean. This is the sort of learning curve you're going to face if you want to get good at modding, unless you don't intend to do much with scripting. But even with the other stuff, it just takes a huge amount of patience and persistence, moreover as even being experienced with something outside of this engine doesn't mean you know anywhere near what you need to know to mod this game. It has its own method of doing things. But once you get past all that, it can be a bit of a breeze for subsequent mods. Link to comment Share on other sites More sharing options...
ExoArchivist Posted November 17, 2017 Author Share Posted November 17, 2017 Well the gist of it is, it adds a perk to the game that allows the player to "taunt" the enemy. Or, well, all enemies, within a certain radius via a hotkey. The general design originates from the idea of having a means to get the enemy off a companion who is about to die. That is the core. Hell, doesn't even have to be a perk, really. Now in an ideal world in which I can make this happen, I have a lot more planned for it, just as what would consist of a "core" plus several future updates building on this. Link to comment Share on other sites More sharing options...
EPDGaffney Posted November 17, 2017 Share Posted November 17, 2017 (edited) Here's the code I wrote for someone else, which was in large part lifted from Ladez for something totally different. scn MySandstormsIsTheBestSandstorms array_var aEntry ref rActor begin gamemode if GetIsCurrentWeather SandstormWeatherThatYouWishToUse foreach (aEntry <- GetRefs 200, -1) let rActor := *aEntry rActor.ModAV Perception -2 loop endif end I've never used hotkeys so I'm not sure how to script with them. scn is how you name a script. It will be saved with that name (and it won't save if it can't compile, which is really annoying). The next two lines declare variables that you would want to use. If a hotkey can initiate a begin block, then you would change what we have from begin gamemode to begin [onhotkeypressed] or whatever it would be. The If statement there is not needed, so I would remove it. (Though you may need to put one back for the hotkey, which may actually use a GameMode block with an if statement to check is it being pressed.) The foreach line checks for actors around you, so keep that. The next line adds all the actors it found to a variable you've delcared, which we've called rActor but you could have declared as anything at the beginning of the script. We don't need to hit anyone's Perception, so we don't need that line. We'll change it for a new If statement: If rActor.GetAV Aggression >=2StartCombat PlayerEndIf Loop is how you end your arrays, so keep that. End is required to end a block, so keep that. My possibly hacky result for you to try is: scn TheScriptofDeath array_var aEntry ref rActor begin gamemode foreach (aEntry <- GetRefs 200, -1) let rActor := *aEntry If rActor.GetAV Aggression >=2 rActor.StartCombat Player EndIf Loop EndI have pretty much no idea how well it's going to work. It said it couldn't be a quest script, either, and I need to get going so I can't check into why. But as an object script, it would need to be applied to an object, which would maybe need to be used by the hotkey. Do note that I didn't use a hotkey here, so you'd need to change the initial portion to reflect your hotkey. For now however, you can test this without hotkeys just to make sure it works. EDIT: Still had this tab open and reread this script. I forgot to put rActor in the StartCombat line, which must be why it wouldn't save as a quest script when I tried. I've fixed it now. There's a couple of other things we'd want to script as well to make this work perfectly, but if you do try this, we'll start with this script first and then expand it for fine-tuning. Edited November 20, 2017 by EPDGaffney Link to comment Share on other sites More sharing options...
ExoArchivist Posted November 17, 2017 Author Share Posted November 17, 2017 For some reason I can't get my GECK to even save that script. I managed to create an item and script it so that each time it was activated (in this case, I made it an ingestible based on the NCR Emergency Radio you can get) it would put another one back in the player's inventory and all that scripting went fine. But when I try to use your script there, just for testing purposes, like I said, I can't get it to save it. I don't get any warning popups or errors. I can click save all I want but it doesn't actually do it. May have nothing to do with the script, however. Link to comment Share on other sites More sharing options...
dubiousintent Posted November 18, 2017 Share Posted November 18, 2017 His script requires NVSE, and you need the "GECK 1.4 PowerUp" tool to display error messages. Please see the 'Solutions to "Garden of Eden Construction Kit" (G.E.C.K.) problems' section in the wiki "Fallout NV Mod Conflict Troubleshooting" guide. -Dubious- Link to comment Share on other sites More sharing options...
EPDGaffney Posted November 18, 2017 Share Posted November 18, 2017 Oh, forgot about that, yeah. I was planning to write that in there but something came up as I said and I had to rush it, so I forgot. I'm terribly sorry if you put yourself through a lot of trouble for no reason as a result. Dubious is 100% correct and that's exactly the reason you experienced what you did. Without PowerUp, your script simply refuses to save if it can't compile (and my script used NVSE functions, so it can't compile unless you run it with NVSE). With PowerUp, you still can't save scripts that won't compile, but it warns you and tells you which lines are the problem. If you have trouble getting PowerUp and NVSE to work, post back here and maybe I can get you some screenshots or something. In any event, fantastic work on that first script. That's the object we'll want to attach this script to, I suppose, unless there's some way to do it without having the object, but we'll get to that after. Also, PowerUp gives me a load of warnings just about any time I do anything, and it scared me away from using it for a while. I'm not sure that's normal, but at least in my experience, I've just clicked Yes to All on all of them and never had a problem. Scripting is the one place where I've actually found them useful. Link to comment Share on other sites More sharing options...
Recommended Posts