Jump to content

Question about editing S.P.E.C.I.A.L values (Fallout: NV)


Markyevansy

Recommended Posts

I've been working on the second version of my mod M0rk's Lighting which now features a dynamic weather system and all that jazz.

But I've been wondering, is it possible to lower the perception value of all NPCs during a sandstorm?

 

Cheers.

 

(sorry if i posted this in the wrong place)

Edited by Markyevansy
Link to comment
Share on other sites

I'm a little surprised no-one has come by yet, because this is relatively simple if I'm not mistaken. Unless there's something I'm missing, it just needs an effect associated with the weather. I've never worked with weathers, so if there's no place to assign an effect, you can script it. The only ways I know of to get the script to run would be using a Begin block with either OnLoad or GameMode as the blocktype. With OnLoad, it should be more efficient if it works, as the script doesn't constantly need to check the weather, but it's probably safer to use the GameMode one, which if you use the default of checking every five seconds, shouldn't be a gigantic performance hit.

 

So, if an effect works, you need to set up an effect, which is simple to do and there are countless tutorials if you don't find it intuitive.

 

If you need to script it, you'll need a way to apply the ModAV command to all loaded actors, and whilst I've never needed to do that, this looked helpful: https://forums.nexusmods.com/index.php?/topic/5863193-trying-to-write-a-script-that-will-effect-all-loaded-npcs/

 

So, something like:

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

That script I wrote is not tested and uses NVSE, so it won't compile unless you run G.E.C.K. with NVSE, which I never got working but that's because I didn't try too hard. There's a lot of stuff on-line about it, so I'm sure that bit's easy enough. If it doesn't work, at least you have a starting point. You can try printing messages for testing to make sure the script is being run. I didn't think about it but maybe the sandstorm isn't actually a weather in and of itself, so maybe you can look into setting an effect on that, rather than the weather.

Edited by EPDGaffney
Link to comment
Share on other sites

Sure. I'm interested to know if you get it working or not. If you keep posting back, I'll keep trying to help until someone better at this comes along. Or alternatively, if you get it working, perhaps I can put it on my CV and get a promotion. Note that I've removed the == operator in the script. Forgot that I learnt recently it's not necessary unless you want to get a specific value rather than simply making sure it's above 0, and it's more efficient to take advantage of that where possible.

Edited by EPDGaffney
Link to comment
Share on other sites

Bad news, I couldn't get the script working. This line:

               let rActor := *aEntry

gives me an error, "Invalid operands for operator :=", and I couldn't get it working due to my inexperience with NVSE scripts so I replaced it with a simpler script that only edits the player's PER only, though I wish every NPC gets the same treatment too. Oh well.

Thanks for your help nonetheless.

Edited by Markyevansy
Link to comment
Share on other sites

I caught another error I made but it doesn't fix the script. It's in the latest edit none the less. I've tried loading it with JIP and that still doesn't fix it. I've tried with other operands and that doesn't fix it. I've tried with the underscore before GameMode and that didn't work. I've tried Ladez's original script and that doesn't work. I have a feeling that the script isn't the problem but that something needs to be updated or something, because Ladez tends to know what he's doing and the person he was responding to said it worked for him.

 

I'll keep looking into it but I'm pretty lost as to what it could be at the moment.

Link to comment
Share on other sites

  • Recently Browsing   0 members

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