Jump to content

Request: Script for simple Repair Merchant


deno

Recommended Posts

What I'm looking for is a script to place on a workbench or anvil that opens the same repair menu as dialogue with an NPC would. If possible I'd also like to see it use the player character's Repair skill to determine the level of repair that item receive, but if not then don't worry about it.

 

I tried looking around online for existing scripts/mods that do it, but I must be too tired since I can't seem to find anything. Also tried looking in existing NPC scripts, but had no luck with that as well. If anyone here knows of a good mod that has it, or can write the script themselves I would greatly appreciate it.

Link to comment
Share on other sites

What I'm looking for is a script to place on a workbench or anvil that opens the same repair menu as dialogue with an NPC would. If possible I'd also like to see it use the player character's Repair skill to determine the level of repair that item receive, but if not then don't worry about it.

 

I tried looking around online for existing scripts/mods that do it, but I must be too tired since I can't seem to find anything. Also tried looking in existing NPC scripts, but had no luck with that as well. If anyone here knows of a good mod that has it, or can write the script themselves I would greatly appreciate it.

 

that sounds easy.

 

1) Have a "Persistent Reference" checked on your repair merchant NPC.

 

2) Let's suppose you put reference name "denoRepairManRef" to the merchant.

 

3) Attach the script below to the special workbench or anvil.

 

scn denoRepairScript

Begin OnActivate Player
	;*** Below If Statement is optional if you want 100% Repair Skill.	
	if denoRepairManREF.GetAV Repair < 100
		denoRepairManRef.ForceAV Repair 100
	endif
	denoRepairManRef.ShowRepairMenu
End

Edited by dree74
Link to comment
Share on other sites

Thanks, but it's not letting me save the script. I'm not experienced enough with scripting yet to figure out why either.

 

Scratch that, got it to save finally. Not sure what was wrong with it, GECK must have just been in one of those moods.

 

EDIT: Awesome, it works. Only thing that would make it better is if it used the player's repair skill instead of an NPC's. But that's probably some complicated scripting that no one wants to deal with.

Edited by deno
Link to comment
Share on other sites

Only thing that would make it better is if it used the player's repair skill instead of an NPC's. But that's probably some complicated scripting that no one wants to deal with.

 

not complicated at all.

 

change the above script to following:

 

scn denoRepairScript 

       Begin OnActivate Player 
               player.ShowRepairMenu 
       End

Link to comment
Share on other sites

  • 5 weeks later...

You'd need a message first. With the options "Do Nothing", "Repair items" and " Craft Items" in that order. The name doesn't really matter.

 

The script would go something like this -

 

SCN denoRepairScript

Begin OnActivate Player
ShowMessage.AlternateWorkbenchMessage
        set iButton to GetButtonPressed
If iButton == 1
	player.ShowRepairMenu
ElseIf iButton == 2
	player.showrecipemenu WorkbenchRecipes
Endif
End

(With a little help from Pronam) :P

 

You can change the "AlternateWorkBenchMessage" reference to whatever you call your message.

Link to comment
Share on other sites

It looks like a great working script, but I just went on GECK, made the message box and copy-pasted your script. But it just won't save. I know that it means there's something wrong with the script, and the only thing I could think of is the message name, but I'm 100% sure it's correct. Can you help me again?

 

Here's a screenshot:

 

 

Edited by ean511
Link to comment
Share on other sites

Hm, Ill have a look in ten minutes. Yes, It not saving means somethings wrong. Ill take a loo in the GECK soon.

By the way, Id recommend getting the "GECK Powerup" modification. Just google it and click the nexus link. It helps so much in so many ways.

 

Edit -

Hehe, ShowMessage Fail. :facepalm:

I also left out "Int iButton". Ah well, thats what testings for, eh? -.-

 

Fixed Script -

 

SCN denoRepairScript

Int iButton

Begin OnActivate Player
       ShowMessage RepairScriptMessage
       	 set iButton to GetButtonPressed
     		  If iButton == 1
         		      player.ShowRepairMenu
   			    ElseIf iButton == 2
          		     player.showrecipemenu WorkbenchRecipes
		Endif
End

 

Planning on using this for a mod?

Edited by TehBuddha
Link to comment
Share on other sites

Well the script saves, but the problem is, buttons that I click in-game won't bring up neither the Repair nor the Crafting menu. So I pulled up the script for fixing Bison and Steve's elevator, and combined the script written there and yours. The results were :

 

SCN denoRepairScript

Int Button

begin OnActivate
if IsActionRef player == 1
	showmessage AlternateWorkbenchMessage
endif
end                 

begin GameMode
                 set Button to GetButtonPressed
                 If Button == 1
                            player.showrecipemenu WorkbenchRecipes
                 ElseIf Button == 2
                            player.showrepairmenu
                 Endif
End

 

Now it works wonderfully. Thanks a lot for the help and GECK tip, kudos to you! :D

 

And nope, not part of any mod, was just browsing and came upon this topic. Just something I wanna do to improve my scripting skills (and it did thanks to you). I think this is the first mod that I've successfully made that isn't a simple stat change or retexture :P

 

One more thing though, if you don't mind. Is there any difference between iButton and Button in a script?

Link to comment
Share on other sites

  • Recently Browsing   0 members

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