EPDGaffney Posted June 13, 2018 Share Posted June 13, 2018 Unfortunately, whatever you come up with is going to be a hack of sorts, so it's not going to look exactly like what we want. But it seems to be looking better, which is good. Have you tested the glowing effect in very dark interiors? I wouldn't expect the emissive multiplier to be needed, really. I haven't worked with emissive effects much in this engine, but what I would expect the multiplier to do would be to blur the emissive colour and probably the glow map so that it surrounds the object, faking a cast light (but not actually casting any) and for the value you set to be the amount of that. Meaning, it probably should not be over 1, and maybe should even be less. On reflections, I don't think we're going to get too lucky there, but you can mess with the specularity and gloss on the NIF and the alpha channel of the normal map and see what you can get. A really radical move could be to add an actual light to the NIF, but you'd have to make that subtle and I don't know for sure that it would ever look right. The way to fix the incorrect shells when you load the game is to make the quest script this: scn ShellEventHandlerScript Begin MenuMode 4 If GetGameRestarted SetEventHandler "OnCellEnter" ShellUDFScript ; print "Shell Event Handler Set" EndIf End Begin GameMode If GetGameLoaded If player.IsInInterior SetWeaponShellCasingModel YourWeapon "File Path to Interior Shell Version" Else SetWeaponShellCasingModel YourWeapon "File Path to Exterior Shell Version" EndIf EndIf EndThis type of script doesn't always 'catch' in my experience, but it usually does and there's not much else you can do without having the script run more often or going a little crazier with more event handlers. If you find its rate of success lacking, let me know and we can try a couple of other things. Link to comment Share on other sites More sharing options...
Trentosaurus Posted June 13, 2018 Author Share Posted June 13, 2018 Sweet, thanks for the updated script. Seems to be working fine. It's such a small issue that it's alright if it doesn't work 100% of the time, as long as it works most of the time I'm happy. So after some experimentation I've got some pretty good results now. Changed the emit multi back to 1, since that is default and means in a pitch black environment, the object should be perfect black as well. This solves the issue of shells glowing in the dark.Bumped the alpha multiplier to 1.6969, which made the textures a bit washed out, so I cranked up the saturation on my diffuse map and got it looking pretty close. The good news about this is that it only requires one separate diffuse texture, and both shells can share the same normal and specular maps. Some more screens:https://i.imgur.com/CJRL3ti.jpg https://i.imgur.com/iXpjNvj.jpg And one with muzzle flash: https://i.imgur.com/l9iJU6P.jpg I double checked to make sure that the brightness was consistent inside of different interiors with different lighting, and since the shells are only affected by ambient light they look basically the same in all interior cells.In some interiors they will have a bit over saturated colors, but since they are pretty dark textures (compared to vanilla) it's not very noticeable. And it's pretty much a non-issue since nobody takes the time to look at their spent shotgun shells on the ground when actually playing the game. Link to comment Share on other sites More sharing options...
EPDGaffney Posted June 13, 2018 Share Posted June 13, 2018 I'd say you nailed it anyhow. Looks gorgeous. Amazing the way something you'd never think about in the scope of your mod turns nearly into its own project. But we did it. Now, I don't know how to do this myself, but someone could write a batch script to do basically this on every shell casing someone has installed, if someone wanted to make this into a complete fix. It could turn out terrible, though. Or maybe someone knows how to make the lighting actually work on the shells? So weird... That would be for the files and file paths. Then in the GECK, you'd do an array loop version of my scripts with a well thought out naming convention and some string variables. At least, that's the way that came to mind for me. I kind of doubt it's happening anyway, but it can be fun to speculate. Link to comment Share on other sites More sharing options...
Trentosaurus Posted June 14, 2018 Author Share Posted June 14, 2018 If there was a way to tell the script to scan for only weapons that use shotgun shells, instead of specific individual weapons, then in theory it could universally applied to all weapons that use shotshells including weapons from mods. Like IfAmmoType=12ga then blahblahblah, or something to that effect. This is really beyond my knowledge of Geck scripting though. If somebody knew how to get the engine to render the lighting right, that'd be fantastic. The only reasons I can think they made it like this is because it caused tons of lag/crashes, or they were simply too lazy to get it working in the first place. Link to comment Share on other sites More sharing options...
EPDGaffney Posted June 14, 2018 Share Posted June 14, 2018 Are you saying all the shotguns should use these shells? We can actually do that easily. It would get much more complex if you were including several different ammo types, but if you just wanted to do Ammo12Ga (I think is the ID), when the game launches, you'd just use GetLoadedtypeArray, grab all weapon base forms, then add each 12Ga one to a different array, then where my script runs currently on just your weapon, loop through all the base forms in the 12Ga array. We could actually use the Get version of the function I used in your script: GetWeaponShellCasingModel. Really shouldn't be hard, provided I understand how the shells are distributed in the game. I thought every model was different and that some of them could take different ammo types that would release different shell casings. The thing with Bethesda is as a publisher, they've always cut corners to save on costs, and though it was probably initially because they needed to at some point they became really cheap. This engine is from the '90s and was really not updated in almost any way with each Bethesda game. So, the lighting was never fixed from back in the '90s by the time we got to Fallout 3, and that's the iteration of the engine we got for New Vegas. Link to comment Share on other sites More sharing options...
Trentosaurus Posted June 14, 2018 Author Share Posted June 14, 2018 Yes, I was planning on making a vanilla replacer mod with my new shells after I finish the weapon mod I made them for, but then I ran into the issue with the shells being way too dark indoors.Then we fixed that part, but now to expand my shells and your scripts to all shotguns. I can easily make 20ga versions of the shells and scripts as well. Somebody could make a stand-alone version of just the script so they can use vanilla shells or any replacer mod they like. Or I could make it an optional file or something, but I feel like it'd be most useful as its own file, however niche of a fix it is. Link to comment Share on other sites More sharing options...
EPDGaffney Posted June 14, 2018 Share Posted June 14, 2018 This is rushed but I think I did it all right. If it doesn't compile, I'll have a look after. The other script should have the analogous changes made to it, but it needs to be told it's getting the variables from this quest, so aWeap12Ga becomes ShellEventHandlerScript.aWeap12Ga and so do all the other variables have the quest appended to the beginning. scn ShellEventHandlerScript array_var aWeapons array_var aWeap12Ga array_var aEntry ref rWeapon Begin MenuMode 4 If GetGameRestarted SetEventHandler "OnCellEnter" ShellUDFScript ; print "Shell Event Handler Set" if aWeap12Ga else let aWeap12Ga := Ar_Construct "array" endif let aWeapons := GLTA 40 ForEach aEntry <- aWeapons let rWeapon := aEntry["value"] if GetWeaponShellCasingModel rWeapon "File path to 12Ga shell casing model" Ar_Append aWeap12Ga, rWeapon endif Loop EndIf End Begin GameMode If GetGameLoaded If player.IsInInterior ForEach aEntry <- aWeap12Ga Let rWeapon := aEntry["value"] SetWeaponShellCasingModel rWeapon "File Path to Interior Shell Version" Loop Else ForEach aEntry <- aWeap12Ga Let rWeapon := aEntry["value"] SetWeaponShellCasingModel rWeapon "File Path to Interior Shell Version" Loop EndIf EndIf End Link to comment Share on other sites More sharing options...
Mktavish Posted June 14, 2018 Share Posted June 14, 2018 Wow great work guys ... the shells be looking pretty good :wink: Question on the muzzle flash pic ... So I am guessing there is a node for that on the model (placed at end of barrel) Then you duplicated it and moved to the ammo rotator / ejection point centered in the gun ?Cuz looks like is lighting up the player jacket displayed ? And then that node just uses the same info on the muzzle flash portion of the projectile ? Meaning you can't change it without changing the actual muzzle flash point ? By the way ... that is just 1 light in the long list of many. Albeit particularly modified for the muzzle flash. @ EPDGaffney What is MenuMode 4 ? And I am wondering is your Event Handler fireing on all cell changes ... meaning it happens when changing from one exterior cell to the other.If so seems it could cause a stutter in the thick of combat with a few npc's rendered , and then compounded by extending the mod to cover all shotgun shells. If not then disregard ... but it seems you could stop gate that from happening with an int variable , or even a second script (primary) stop gated with an int to then start the event handler. Link to comment Share on other sites More sharing options...
EPDGaffney Posted June 14, 2018 Share Posted June 14, 2018 Thanks, Mktavish. MenuMode lets you specify which menu (or menus, in some cases) should run your script. MenuMode 4 is the main menu of New Vegas and was added in JIP LN at some point. It's the most reliable place to run pre-load scripts in my experience, provided they're running on base forms, setting event handlers, and so on and so forth. Obviously, references and other things that are baked into the save data won't be accessible until you load a game. Also, tangentially related, pretty much anything that gets done to a base form will be undone once the session is exited. That includes form lists, models, collision, AI, items added to a base form's inventory, and anything else you can think of that gets done to a base form. However, references spawned with these scripts running may or may not retain the effects (they usually don't, but inventory stuff will stick, in the case of most functions, because that gets baked into the save data, whereas something like whether or not a base form's combat is disabled is not saved in a save file). I'm not too worried about the exterior cell thing, though you are probably correct. It runs only when the player changes cells, not just any actor, and I'm not positive but I'd expect the performance hit of changing the model at that time to be no worse than doing more checks (I don't think it runs on the spent shells, see, though if they remained on the ground through a cell reset or had Update3D on them, they'd change, but I'd expect their model at spawn time to be cached). If there are any performance issues, it won't be hard to adjust, provided I'm made aware of it. I proofread my script, didn't see any errors. Let me know that it compiles. Link to comment Share on other sites More sharing options...
Trentosaurus Posted June 14, 2018 Author Share Posted June 14, 2018 I'm getting an error with the new script, says script command array_var not found on line 2. Screen: https://i.imgur.com/MLswmug.pngAlso sorry I slapped my name on your scripts, I do it so it's easy to filter to only my items in the GECK @Mktavish Question on the muzzle flash pic ... So I am guessing there is a node for that on the model (placed at end of barrel) Yes, I believe the projectile node does two things. One is to tell where to place the muzzle flash, which is a separate nif. The other is to tell the game where the projectile will exit the weapon model. Then you duplicated it and moved to the ammo rotator / ejection point centered in the gun ?Nah, I didn't duplicate anything. The muzzle flash in my screenshot is just the regular flash at the end of the muzzle. Link to comment Share on other sites More sharing options...
Recommended Posts