Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- bb_pose_staggereffectscript:
- - Use an Actor Property PlayerRef Auto, which can be auto-filled to reference the Player, instead of calling Game.GetPlayer() every time over again in OnEffectStart(). May be important if it is called frequently.
- - Directly return instead of setting AllowPlayerStagger to false, and afterwards checking a condition based on that variable again.
- - Maybe you can replace the Time1 through Time5 variables with an array of 5 floats? don't remember if this is possible, if array properties work well. But if so, you can simply use (Stagger - 1) as index into the array to fetch the float to pass into Utility.Wait(), and you can skip all the comparsions of Stagger == 1, Stagger == 2, etc.
- bb_pose_monitorpoisescript:
- - There are a bunch of Global Variables, like VarUpdateTime. Are the values of these variables expected to change frequently? If not, I'd recommend trying to cache them in a local variable after calling GetValue() once, instead of calling GetValue() multiple times (especially avoid calling GetValue() multiple times within the same function/event for the same global variable).
- - In Event OnHit(), I would rewrite
- if (StaminaPercentage < 0.5) && (StaminaPercentage >= 0.3)
- ExtraStuns = 1
- elseif (StaminaPercentage < 0.3) && (StaminaPercentage >= 0.1)
- ExtraStuns = 2
- elseif (StaminaPercentage < 0.1)
- ExtraStuns = 3
- endif
- to:
- if (StaminaPercentage < 0.5)
- if(StaminaPercentage >= 0.3)
- ExtraStuns = 1
- elseif (StaminaPercentage >= 0.1)
- ExtraStuns = 2
- else
- ExtraStuns = 3
- endif
- endif
- That'll sometimes save you a few redundant comparisons (especially when StaminaPercentage >= 0.5, will now only check one condition instead of 3)
- - In Event OnHit(), the large block starting at line 328, there can be multiple consecutive calls to FunctionAggressor.GetEquippedItemType(0) (once for the condition
- if (FunctionAggressor.GetEquippedItemType(0) == 7)
- and once for the condition
- elseif ((FunctionAggressor.GetEquippedItemType(0) == 0)
- . Try calling it only once and storing the result in a variable.
- - Same as above for Gauntlets.GetWeight()
- - In StaggerFunction(), same comments as for the bb_pose_staggereffectscript script
Advertisement
Add Comment
Please, Sign In to add comment