Jump to content

Looking for a scripting guru


geekminxen

Recommended Posts

I have an old mod with a problem I've never been able to solve and I would LOVE for someone who actually knows what they're doing (as opposed to me) to look for the bug and help me squash it. If anyone's interested in doing that, first, you have my eternal gratitude. Second, you should know that the bug is intermittent, which I'm sure will make it harder to find. But if someone's interested in tackling this for me, it's a bug in a companion mod that occasionally gives you the follower's perk message twice and then freezes the game. I recently did a fresh install of NV with only this mod loaded and did half a dozen run throughs; in five of them, the hiring process went without a hitch. One of them exhibited the bug.

 

Anyway, that's the nutshell version of what's going on. If anyone would be willing to look at my scripts and see if they can find the problem, that would be great and much appreciated. :)

Link to comment
Share on other sites

Thank you, uhmattbravo. The script is a dialogue end result script:

 

Player.AddPerk BennyReturnsLadyLuckPerk
ShowMessage BennyReturnsFollowerMsgPerkAdd

 

But there are two separate dialogue paths that can get here, depending on whether the player has a specific perk (Black Widow, if it matters). They only get one dialogue choice depending on that perk, not both, but if having the option available in two different dialogue choices might be causing a problem, I'd be happy to change it to a regular script and see if that fixes it.

Link to comment
Share on other sites

I don't see any "gateway" variable in that result script to inform either dialog that the Perk has already been added. Which is probably why you are getting the subsequent "perk added" message. The "gateway" variable should be defined and initialized in the quest script and used as a condition to both the dialog lines.

 

-Dubious-

Link to comment
Share on other sites

I don't see any "gateway" variable in that result script to inform either dialog that the Perk has already been added. Which is probably why you are getting the subsequent "perk added" message. The "gateway" variable should be defined and initialized in the quest script and used as a condition to both the dialog lines.

 

-Dubious-

 

Okay, I'll try that! Would that account for the problem only occurring once in awhile? Just sometimes the game gets overeager and gives you the perk twice because there's nothing telling it not to? :)

Link to comment
Share on other sites

Yes. As it is: either both dialog choices or even repeating the same choice will repeatedly add the perk. The game engine doesn't (to the best of my knowledge; in order to allow "perk ranks") prevent you from attempting to add a perk multiple times, but one would expect "unintended consequences" if you exceed the rank level of the perk definition. Certainly you don't want to do so in your own scripts. If nothing else, it's bad programming to rely upon the engine to prevent your own logic errors.

 

You ought to add a check ("HasPerk") to see if the perk has already been given to the player as a condition in the result script.

 

-Dubious-

Link to comment
Share on other sites

Like Dubious said, your first step should be to declare a variable in your quest script that the dialogue responses check for.

 

If that doesn't fix it, copy and paste that part into an if statement in a gamemode block in the quest script (for example:

 

if newVariable == 1

 

Player.AddPerk BennyReturnsLadyLuckPerk

ShowMessage BennyReturnsFollowerMsgPerkAdd

Set newVariable to 0)

 

And just have the dialogue set newVariable to 1.

 

In fact, i'd probably do both: run it in a GameMode block on a brand new variable and have the dialogue check the variable as well.

 

 

Edit:

 

The hasPerk thing's a good idea too. Within reason, redundancies are a good thing.

Edited by uhmattbravo
Link to comment
Share on other sites

Thank you both. I was concerned that since the perk-perk-freeze thing only happens occasionally, it wouldn't be a straightforward fix. I'm at least a little hopeful now that it is. I really appreciate the help!

Link to comment
Share on other sites

  • Recently Browsing   0 members

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