Skip to content

Commit

Permalink
Redefine effective mass to start at zero
Browse files Browse the repository at this point in the history
  • Loading branch information
ProbablyManuel committed Oct 3, 2024
1 parent fb801cd commit e6214de
Show file tree
Hide file tree
Showing 5 changed files with 119 additions and 1 deletion.
Binary file added 365-redefine-effective-mass-to-start-at-zero.esp
Binary file not shown.
1 change: 1 addition & 0 deletions components/documentation/src/Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,7 @@ Reqtificator
Internal Quality Improvements (only relevant for modders)
---------------------------------------------------------

* The actor value infamy (used to store effective mass) starts at 0.0 instead of 1.0. This allows for more expressive perk entry point functions.
* Creation Club scripts modified by Requiem use the official sources as baseline.
* Deprecated records are deleted.
* Fortify Lockpicking magic effects are mapped to their vanilla formids.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ Event OnPageReset(String page)
AddTextOptionST(statename, text, display)
statename = "MassPenalty"
text = "$REQ_MassPenalty"
display = format_float(player.getAV("Infamy"), 2)
display = format_float(1.0 + player.getAV("Infamy"), 2)
AddTextOptionST(statename, text, display)

ElseIf page == "$REQ_cat_skill1"
Expand Down
110 changes: 110 additions & 0 deletions tools/xEdit Scripts/REQ_FilterActorValue.pas
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
unit FilterActorValue;

var
av: String;


function Filter(e: IInterface): Boolean;
var
effects, effect: IInterface;
i: Integer;
begin
Result := False;
// if Signature(e) = 'BPTD' then begin
// 'Body Parts\Body Part\BPND - BPND\Actor Value'
if Signature(e) = 'MGEF' then begin
Result := Result or SameText(GetElementEditValues(e, 'Magic Effect Data\DATA - Data\Actor Value'), av);
Result := Result or SameText(GetElementEditValues(e, 'Magic Effect Data\DATA - Data\Second Actor Value'), av);
Result := Result or SameText(GetElementEditValues(e, 'Magic Effect Data\DATA - Data\Magic Skill'), av);
Result := Result or SameText(GetElementEditValues(e, 'Magic Effect Data\DATA - Data\Resist Value'), av);
end
else if Signature(e) = 'PERK' then begin
effects := ElementByPath(e, 'Effects');
for i := 0 to Pred(ElementCount(effects)) do begin
effect := ElementByIndex(effects, i);
Result := Result or SameText(GetElementEditValues(effect, 'Function Parameters\EPFD - Data\Actor Value, Float\Actor Value'), av);
end;
end
// if Signature(e) = 'RACE' then begin
// 'RACE\DATA - DATA\Skill Boosts\Skill Boost\Skill'
else if Signature(e) = 'WEAP' then
Result := SameText(GetElementEditValues(e, 'DNAM - Data\Resist'), av);

if not Result then
Result := EvaluateCondition(e);
end;

function EvaluateCondition(e: IInterface): Boolean;
var
i: Integer;
c: IInterface;
parameter: String;
begin
if SameText(Name(e), 'Conditions') then
for i := 0 to Pred(ElementCount(e)) do begin
c := ElementByIndex(e, i);
if SameText(GetElementEditValues(c, 'CTDA - CTDA\Parameter #1'), av) then begin
Result := True;
Exit;
end;
if SameText(GetElementEditValues(c, 'CTDA - CTDA\Parameter #2'), av) then begin
Result := True;
Exit;
end;
end
else
for i := 0 to Pred(ElementCount(e)) do
if EvaluateCondition(ElementByIndex(e, i)) then begin
Result := True;
Exit;
end;
Result := False;
end;

function Initialize: Integer;
begin
if not InputQuery('Enter', 'Actorvalue', av) then
Result := -1;

FilterConflictAll := False;
FilterConflictThis := False;
FilterByInjectStatus := False;
FilterInjectStatus := False;
FilterByNotReachableStatus := False;
FilterNotReachableStatus := False;
FilterByReferencesInjectedStatus := False;
FilterReferencesInjectedStatus := False;
FilterByEditorID := False;
FilterEditorID := '';
FilterByName := False;
FilterName := '';
FilterByBaseEditorID := False;
FilterBaseEditorID := '';
FilterByBaseName := False;
FilterBaseName := '';
FilterScaledActors := False;
FilterByPersistent := False;
FilterPersistent := False;
FilterUnnecessaryPersistent := False;
FilterMasterIsTemporary := False;
FilterIsMaster := False;
FilterPersistentPosChanged := False;
FilterDeleted := False;
FilterByVWD := False;
FilterVWD := False;
FilterByHasVWDMesh := False;
FilterHasVWDMesh := False;
FilterBySignature := False;
FilterSignatures := '';
FilterByBaseSignature := False;
FilterBaseSignatures := '';
FlattenBlocks := False;
FlattenCellChilds := False;
AssignPersWrldChild := False;
InheritConflictByParent := False;
FilterScripted := True; // use custom Filter() function

ApplyFilter;
end;

end.
7 changes: 7 additions & 0 deletions tools/xEdit Scripts/ReadMe.md
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,13 @@ Export magnitude/duration scaling data of the selected spell effects to a csv fi

The first line is a header with the column names and the remaining comma-separated values are unsorted. Spell effects are identified by EditorID and must adhere to the [EditorID Convention](https://github.com/ProbablyManuel/requiem/wiki/EditorID-Convention#magic-effect-mgef-records).

REQ_FilterActorValue.pas
------------------------

Apply a filter to show all records referencing a given actor value. This covers hardcoded references such perk entry functions or condition parameters.

The script prompts the user to enter an actor value.

REQ_FilterNoCharges.pas
-----------------------

Expand Down

0 comments on commit e6214de

Please sign in to comment.