Jump to content

anghelos92

Members
  • Posts

    1
  • Joined

  • Last visited

Nexus Mods Profile

About anghelos92

anghelos92's Achievements

Newbie

Newbie (1/14)

0

Reputation

  1. Hi, I am an amateur modder with an interest in scripting but with no formal education in programming or software engineering, I work in an Hospital no IT formation at all but the "How to use a pc for medical use" exam at university xD I made a mod for AAF, from which it receives an event and do some calculations on an array of actors. Before doing so I copy the received array into an array of my own sorting the elements into some specific index that I need for my calculations depending on the returned index of the playerref. Event AAF:AAF_API.OnSceneInit(AAF:AAF_API akSender, Var[] akArgs) Actor[] akArgs2 = Utility.VarToVarArray(akArgs[1]) as Actor[] Actor second1 Actor third1 If akArgs2[0] as Actor == PlayerREf Second1 = akArgs2[1] as Actor Third1 = akArgs2[2] as Actor ElseIf akArgs2[1] as Actor == PlayerREF Second1 = akArgs2[0] as Actor Third1 = akArgs2[2] as Actor Else Second1 = akArgs2[0] as Actor Third1 = akArgs2[1] as Actor EndIf ; [...] etc etc various functions called on playerref, second1 and third1 EndEvent Knowing that this event return at least an actor array of 1 element (the playerref) so some calculations are always done with it, and that if the returned array.length is less than three second1 and/or third1 can be none this can fire an error in the papyrus log about the akargs[2] array being out of range, my question is: What is more performance friendly? - Let the virtual machine automatically aborting the lines with functions called on none actors, consider that I disable papyrus logging in Fallout4.ini? (When the VM abort those function calls because of second1 or third1 are none, the script goes on with its execution without other consequences) - Or make a serie of If statements to check for the returned array length before doing my calculations? Obviosly the checks before using the returned array would be a better coding practice to at least don't pollute the logs but mine is a pure performance question and I am not 100% sure of doing a correct profiling. I know that probably we are talking about microseconds xD but curiosity burns. Thank you!
×
×
  • Create New...