Project

General

Profile

Feature #4255

Implement RepairedOnMe script instruction

Added by Alexei Dobrohotov about 1 month ago. Updated about 1 month ago.

Status:
New
Priority:
Normal
Assignee:
-
Category:
Scripting
Target version:
Start date:
12/09/2017
% Done:

0%

Severity:
Normal

Description

Separated from #1421.

Syntax:
<calling object ID>->RepairedOnMe, <repairing object ID>,
where calling object is an object which has a condition (like weapon or armor) and repairing object ID is a valid repairing object (for example, hammers in Morrowind).

Returns 1 if the calling object is being repaired by the repairing object and 0 if it isn't, however, the returned value isn't a boolean - it's a short in Morrowind's engine.

Should use an explicit calling object ID and issue an error otherwise.

Never used in vanilla Morrowind scripts.

History

#1 Updated by Andrei Kortunov about 1 month ago

I did not get what the "being repaired" thing means. Was repaired in the current frame? Also looks like we do not have the OnRepair command (it seems this command is broken).

#2 Updated by Alexei Dobrohotov about 1 month ago

I don't really know. Probably yes, it checks the state in the current frame, but I just adapted the UESP description.

#3 Updated by Randy Davin about 1 month ago

Does this work?
_____________________________________________
begin repair

short RepairedOnMe ; do we need to declare this?

if ( xxx->RepairedOnMe, hammerx = 0 )
return
endif
if ( xxx->RepairedOnMe, hammerx = 1 )
player->additem gold_001 100
endif

end

Looks like this command checks every frame for possible occurences.

How about :
_____________________________________________________________________
begin repair

short RepairedOnMe ; do we need to declare this?
short checkrepair

set checkrepair to ( xxx->RepairedOnMe, hammerx ) ; returns 1 if true

if ( checkrepair = 1 )
player->additem gold_001 100
else
return
endif

end

Probably RepairedOnMe returns 1 regardless if the repair was successful or not.

#4 Updated by Randy Davin about 1 month ago

Randy Davin wrote:

How about :
_____________________________________________________________________
begin repair

short RepairedOnMe ; do we need to declare this?
short checkrepair

set checkrepair to ( xxx->RepairedOnMe, hammerx ) ; returns 1 if true

if ( checkrepair = 1 )
player->additem gold_001 100
else
return
endif

end

Probably RepairedOnMe returns 1 regardless if the repair was successful or not.

Forgot to add "set checkrepair to 0" to reset the value.

Also available in: Atom PDF