Guest User

poise script comments

a guest
Apr 14th, 2017
466
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.20 KB | None | 0 0
  1. bb_pose_staggereffectscript:
  2. - 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.
  3. - Directly return instead of setting AllowPlayerStagger to false, and afterwards checking a condition based on that variable again.
  4. - 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.
  5.  
  6.  
  7. bb_pose_monitorpoisescript:
  8. - 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).
  9. - In Event OnHit(), I would rewrite
  10.  
  11. if (StaminaPercentage < 0.5) && (StaminaPercentage >= 0.3)
  12. ExtraStuns = 1
  13. elseif (StaminaPercentage < 0.3) && (StaminaPercentage >= 0.1)
  14. ExtraStuns = 2
  15. elseif (StaminaPercentage < 0.1)
  16. ExtraStuns = 3
  17. endif
  18.  
  19. to:
  20.  
  21. if (StaminaPercentage < 0.5)
  22. if(StaminaPercentage >= 0.3)
  23. ExtraStuns = 1
  24. elseif (StaminaPercentage >= 0.1)
  25. ExtraStuns = 2
  26. else
  27. ExtraStuns = 3
  28. endif
  29. endif
  30.  
  31. That'll sometimes save you a few redundant comparisons (especially when StaminaPercentage >= 0.5, will now only check one condition instead of 3)
  32. - In Event OnHit(), the large block starting at line 328, there can be multiple consecutive calls to FunctionAggressor.GetEquippedItemType(0) (once for the condition
  33.  
  34. if (FunctionAggressor.GetEquippedItemType(0) == 7)
  35.  
  36. and once for the condition
  37.  
  38. elseif ((FunctionAggressor.GetEquippedItemType(0) == 0)
  39.  
  40. . Try calling it only once and storing the result in a variable.
  41. - Same as above for Gauntlets.GetWeight()
  42. - In StaggerFunction(), same comments as for the bb_pose_staggereffectscript script
Advertisement
Add Comment
Please, Sign In to add comment