Repair Quest: who is doing the repair?

Post » Sat Jan 29, 2011 12:33 pm

Hey again,

I've nearly worked out my new repair script (I think), but I'm stuck on how to determine in a quest script who is doing the repair. I was going to use GetSelf with GetIsReference, but the script will not compile because "GetSelf requires explicit reference in quest script." And I don't know how to do that, since the actor is unknown at that point.

As usual, my script is pretty simple, but here's what I have so far:
ref myselffloat RepairSkillBaseBegin GameMode	If ShowRepairMenu		set myself to GetSelf		if GetIsReference player			set RepairSkillBase to 0		else ;It's not the player			set RepairSkillBase to 10		endif 		SetNumericGameSetting fRepairSkillBase RepairSkillBase ; max player repair of any item is same as player's repair skill; NPC's can repair 100%	endifEnd


Does anyone have any advice on how I can do this? I'm really stuck, and have tried for hours to find out how to do this.
User avatar
krystal sowten
 
Posts: 3367
Joined: Fri Mar 09, 2007 6:25 pm

Post » Sat Jan 29, 2011 8:48 pm

What about using MenuMode blocks?

I don't undersatnd the line "If ShowRepairMenu" - though I don't undersatnd a lot sometimes. This looks like a bogus statement to me.

Don't you want to do this while in the repair menu?

Menu Mode has two values for repair, 1035 for the pipboy reapir menu and 1058 for the vendor repair menu. It seems to me that if you were in menumode 1035, it would be the player and if your were in menumode 1058, it would be an NPC. So you could just add two menu mode blocks that adjust fRepairSkillBase based on which menu was active.

As for determining the reference who is doing the repair from a quest script, aside from the above, I am not sure how you would do that.

I hope this helps a little


BTW - I watched the Lord of the rings last night and I thought of you. :)
User avatar
Daddy Cool!
 
Posts: 3381
Joined: Tue Aug 21, 2007 5:34 pm

Post » Sat Jan 29, 2011 8:36 pm

Thanks sooo much! What you suggested was a HUGE help and I managed to write a script that does exactly what I was trying to do.

I've never used MenuMode blocks in a script, so I had to figure out the details of using them . . . but once you pointed me in the right direction, the rest was fairly easy. I did this as a quest script, as I didn't know if MenuMode blocks could be used any other way. This is my new script:
scn ArwenRepairQuestScript ; by Arwenfloat RepairSkillBaseBegin MenuMode 1035 ; Pipboy Repair	set RepairSkillBase to 0	SetNumericGameSetting fRepairSkillBase RepairSkillBase EndBegin MenuMode 1058 ; Vendor Repair	set RepairSkillBase to 10	SetNumericGameSetting fRepairSkillBase RepairSkillBaseEnd


I don't believe that "If ShowRepairMenu" is 'bogus', as it came from the GECK wiki: http://geck.gamesas.com/index.php/ShowRepairMenu

BTW - I watched the Lord of the rings last night and I thought of you. :)

It is nice to be thought of. :)
I own the Platinum Series Special Extended Edition DVD version of the LOTR Trilogy (with 11-1/2 hours of movie), which I much prefer over the theatrical version, since the character and story development is so much better (as they were the parts that had been edited out the most).

Thanks again for your excellent help on this!
User avatar
Unstoppable Judge
 
Posts: 3337
Joined: Sat Jul 29, 2006 11:22 pm

Post » Sat Jan 29, 2011 5:36 pm

It was using ShowRepairMenu as a condition in the If statement that I thought was bogus, not the command by itself. I just didn't know if using it that way would return any useful value. That's all.

Just one question, do you want to return the value of 'fRepairSkillBase' back to normal after leaving the repair menus? Or is this a permanent change.
User avatar
Elizabeth Davis
 
Posts: 3406
Joined: Sat Aug 18, 2007 10:30 am

Post » Sun Jan 30, 2011 1:56 am

The script seems to be working as it now is, but it would probably be better if I could return fRepairSkillBase back to its normal value after leaving the repair menu. How would I go about doing that?
User avatar
Kate Norris
 
Posts: 3373
Joined: Mon Nov 27, 2006 6:12 pm

Post » Sat Jan 29, 2011 5:58 pm

I think something like this would work:

scn ArwenRepairQuestScript ; by ArwenShort IsInRepairMenufloat OldRepairSkillBasefloat RepairSkillBaseBegin MenuMode 1035 ; Pipboy Repair     If IsInRepairMenu == 0               Set OldRepairSkillBase to (GetNumericGameSetting fRepairSkillBase)          Set IsInRepairMenu to 1          set RepairSkillBase to 0          SetNumericGameSetting fRepairSkillBase RepairSkillBase      EndIfEndBegin MenuMode 1058 ; Vendor Repair     If IsInRepairMenu == 0               Set OldRepairSkillBase to (GetNumericGameSetting fRepairSkillBase)          Set IsInRepairMenu to 1          set RepairSkillBase to 10          SetNumericGameSetting fRepairSkillBase RepairSkillBase      EndIfEndBegin GameMode     If IsInRepairMenu          SetNumericGameSetting fRepairSkillBase OldRepairSkillBase          Set IsInRepairMenu to 0     EndifEnd

User avatar
oliver klosoff
 
Posts: 3436
Joined: Sun Nov 25, 2007 1:02 am

Post » Sun Jan 30, 2011 12:24 am

Thanks, that worked perfectly! I was even able to script in my gender repair differences.

(Sorry for not replying sooner, but I hadn't had time to play test it until just a few minutes ago.)

You're a life saver! (or at least a sanity-saver)
User avatar
Terry
 
Posts: 3368
Joined: Mon Jul 09, 2007 1:21 am

Post » Sat Jan 29, 2011 5:39 pm

It appears that there is a minor problem with this script: the repair skill changes do not seem to work correctly.

For self repairs, I'm able to repair items to a condition that is above my repair ability, in that the item is not grayed out and I can use a repair item to fix it, but doing so actually damages the item down to my repair ability.
If I open the repair menu for an item but then close it and reopen the repair menu for the same item, everything works perfectly.
But if I close my PipBoy and later try to repair anything that has a condition higher than my repair ability, I run into the same problem.

With vender repairs, you also have to open the repair menu twice to get the correct results.

It is like you cannot change the repair ability while the repair menu is open, but the changes that were made stick when I reopen the same repair menu again.

Here's the code again:
scn ArwenRepairQuestScript ; by ArwenShort IsInRepairMenufloat OldRepairSkillBasefloat RepairSkillBaseBegin MenuMode 1035 ; Pipboy Repair     If IsInRepairMenu == 0               Set OldRepairSkillBase to (GetNumericGameSetting fRepairSkillBase)          Set IsInRepairMenu to 1          set RepairSkillBase to 0          SetNumericGameSetting fRepairSkillBase RepairSkillBase      EndIfEndBegin MenuMode 1058 ; Vendor Repair     If IsInRepairMenu == 0               Set OldRepairSkillBase to (GetNumericGameSetting fRepairSkillBase)          Set IsInRepairMenu to 1          set RepairSkillBase to 10          SetNumericGameSetting fRepairSkillBase RepairSkillBase      EndIfEndBegin GameMode     If IsInRepairMenu          SetNumericGameSetting fRepairSkillBase OldRepairSkillBase          Set IsInRepairMenu to 0     EndifEnd


Does anyone know why this might be happening?
I've tried all sorts of edits to the script, but still end up with the same results.
User avatar
Emma louise Wendelk
 
Posts: 3385
Joined: Sat Dec 09, 2006 9:31 pm

Post » Sat Jan 29, 2011 11:48 am


It is like you cannot change the repair ability while the repair menu is open, but the changes that were made stick when I reopen the same repair menu again.



It looks like the Gamesettings are read by the engine as the menu is opened, and not refreshed during the menu. Maybe you could make some assumptions and make the script less specific, by assuming the Player may go to a repair menu from the inventory menu. Any any other menu modes except for Pipboy repair will be vendor repairs.

There might be some bugs in this ;)

Short IsInRepairMenushort IsInInventoryshort FlagPipboyRepairfloat OldRepairSkillBasefloat RepairSkillBaseBegin MenuMode 1002 ; Inventory - set the game setting assuming player may go to repair menu    If  (IsInInventory == 0)          Set OldRepairSkillBase to (GetNumericGameSetting fRepairSkillBase)          Set IsInInventory to 1          Set FlagPipboyRepair to 1  ;disable menumode code          set RepairSkillBase to 0          SetNumericGameSetting fRepairSkillBase RepairSkillBase    endifEndBegin MenuMode 1035	; Pipboy repair	Set IsInInventory to 0   ;Re-enable inv code                Set FlagPipboyRepair to 1  ;disable menumode codeEndBegin MenuMode; Assume Vendor Repair in all other menu modes if (FlagPipboyRepair == 0)     If IsInRepairMenu == 0               Set OldRepairSkillBase to (GetNumericGameSetting fRepairSkillBase)          Set IsInRepairMenu to 1          Set IsInInventory to 0          set RepairSkillBase to 10          SetNumericGameSetting fRepairSkillBase RepairSkillBase      EndIfendifEndBegin GameMode     If IsInRepairMenu || IsInInventory          SetNumericGameSetting fRepairSkillBase OldRepairSkillBase          Set IsInRepairMenu to 0	 Set IsInInventory to 0          set FlagPipboyRepair to 0     EndifEnd

User avatar
Timara White
 
Posts: 3464
Joined: Mon Aug 27, 2007 7:39 am

Post » Sat Jan 29, 2011 12:32 pm

Thank you sooo much RickerHK!

After a bit of play testing, it looks like your changes totally fixed my repair issues, and I didn't find any bugs in how it works. Now I just need to get to work on wrapping up version 4.3 of my Realism Tweaks.

I really appreciate your help with this! No matter how much I tried, I could not figure out how to fix my repair script
User avatar
Lalla Vu
 
Posts: 3411
Joined: Wed Jul 19, 2006 9:40 am

Post » Sat Jan 29, 2011 5:18 pm

Thank you sooo much RickerHK!

After a bit of play testing, it looks like your changes totally fixed my repair issues, and I didn't find any bugs in how it works. Now I just need to get to work on wrapping up version 4.3 of my Realism Tweaks.

I really appreciate your help with this! No matter how much I tried, I could not figure out how to fix my repair script


Glad it worked!
User avatar
Russell Davies
 
Posts: 3429
Joined: Wed Nov 07, 2007 5:01 am


Return to Fallout 3