deno Posted May 23, 2011 Share Posted May 23, 2011 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 More sharing options...
dree74 Posted May 23, 2011 Share Posted May 23, 2011 (edited) 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 May 23, 2011 by dree74 Link to comment Share on other sites More sharing options...
deno Posted May 23, 2011 Author Share Posted May 23, 2011 (edited) 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 May 23, 2011 by deno Link to comment Share on other sites More sharing options...
dree74 Posted May 23, 2011 Share Posted May 23, 2011 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 More sharing options...
deno Posted May 24, 2011 Author Share Posted May 24, 2011 Ended up falling asleep last night, so I wasn't able to reply til now. Thanks for the quick help with the script. It works exactly how I was wanting it to. :thumbsup: Link to comment Share on other sites More sharing options...
ean511 Posted June 23, 2011 Share Posted June 23, 2011 This is very useful, but can someone write a script that lets you choose between the repair menu and crafting menu on activating the workbench? Link to comment Share on other sites More sharing options...
TehBuddha Posted June 23, 2011 Share Posted June 23, 2011 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 More sharing options...
ean511 Posted June 23, 2011 Share Posted June 23, 2011 (edited) 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 June 23, 2011 by ean511 Link to comment Share on other sites More sharing options...
TehBuddha Posted June 24, 2011 Share Posted June 24, 2011 (edited) 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 June 24, 2011 by TehBuddha Link to comment Share on other sites More sharing options...
ean511 Posted June 24, 2011 Share Posted June 24, 2011 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 More sharing options...
Recommended Posts