Jump to content

Need Help With Repair Script


GrayWolf04

Recommended Posts

I'm trying to create a simple mod where the Sink's CIU provides free repairs. However I'm having some trouble. Can anyone provide some help with this? Thanks.

scn FreeSinkRepairsScript

int repairmult;


Begin GameMode

set repairmult to fItemRepairCostMult

if player.GetInCell NVDLC03TheSink = 1

	;Free

else

	;Not Free

endif

End
Link to comment
Share on other sites

NVSE has a function to alter the gamesetting. Something like this ;

 

scn FreeSinkRepairsScript

if (player.GetInCell NVDLC03TheSink) == 1

     ; Free
     SetNumericGameSetting fItemRepairCostMult 0
else

     ; Not Free
     SetNumericGameSetting fItemRepairCostMult 2 ; default repair cost is 2
under a quest script might work for you.
Link to comment
Share on other sites

Awesome! Thanks Devin. I was planning on doing just that (using it in a "start game enabled" quest). Another question though: does the barter skill affect fItemRepairCostMult? Or is it always set to 2 and just factored into an equation? Couldn't find anything on it.

Link to comment
Share on other sites

Awesome! Thanks Devin. I was planning on doing just that (using it in a "start game enabled" quest).

Yeah one way to do it. But you could also integrate it right into the sinks CIU script, or attach it to a trigger when you pass into the sink, and there are probably others. My forte isn't scripting (not sure I even have a forte), but one thing I'v noticed about it, is that fallout's scripting language is flexible enough to approach the same problem in multiple ways.

 

Another question though: does the barter skill affect fItemRepairCostMult? Or is it always set to 2 and just factored into an equation? Couldn't find anything on it.

I don't think it (barter) affects repair cost. fItemRepairCostMult is a cost multiplier per a percentage of repair. If you have an item worth 1,000 and you repair it 3%, that's 30 caps multiplied by the fItemRepairCostMult value of 2 = 60 caps. And I think knocking that value/gamesetting down to 0 should result in no repair cost. At least, that's my understanding from the bit of research I did.

Link to comment
Share on other sites

I gave it a shot and it worked. Turns out thought that if the value is too low, such as 0, then nothing can be repaired for some reason, even though the repair cost is 0. Instead, everything is grayed out. However, after experimenting with the values, I found that 0.08 worked for the items that I had that only had about 1% to 2% to repair at the very least. Anything lower and things would start to gray out.

 

Hopefully this will help others if they decide to make the mod for themselves. The values would most likely vary with each person, but it's simple enough given the code you helped me with. So again, thank you!

Link to comment
Share on other sites

I gave it a shot and it worked.

Good deal :smile:

 

Turns out thought that if the value is too low, such as 0, then nothing can be repaired for some reason, even though the repair cost is 0. Instead, everything is grayed out. However, after experimenting with the values, I found that 0.08 worked for the items that I had that only had about 1% to 2% to repair at the very least. Anything lower and things would start to gray out.

Ok I'll see if I can't hunt down teh appropriate wiki or geck page and add that info to it.

 

So again, thank you!

NP, glad it worked out for you brother

Link to comment
Share on other sites

  • Recently Browsing   0 members

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