irswat Posted September 14, 2016 Author Share Posted September 14, 2016 is there a way to determine how much cpu time your script is using? Link to comment Share on other sites More sharing options...
IsharaMeradin Posted September 14, 2016 Share Posted September 14, 2016 I think Convenient Horses has some kind of script latency test. But that only determines an overall speed for your system. I don't think there is anyway to determine how fast or slow your script(s) execute. Why? Do you think it takes too long or something? Link to comment Share on other sites More sharing options...
irswat Posted September 14, 2016 Author Share Posted September 14, 2016 No, the only lag I've noticed with the mod has to do with debug messages queuing. ArctusZurin got the idea in my head when he was talking about this mod causing hard drive thrashing. I'm just interested in optimizing it. Link to comment Share on other sites More sharing options...
IsharaMeradin Posted September 14, 2016 Share Posted September 14, 2016 Well, debug messages can take up more time than the actual processing. I have a mod I am updating where I used debug messages to let me know if one aspect was working properly. The processes had completed but I had a massive wall of text slowly displaying in the upper left corner. Debug.trace statements will be faster as they show only in the papyrus log. But removing all debug statements is best as none of those process will then run. In a nutshell, one step towards optimization is to use as few notification statements as possible. As far as drive thrashing, I suppose it is possible. Tho it depends on what all else the user has running on their system. It can very well be the case that by itself it is fine but when added with other stuff things happen. Always seems to be the last mod added that people claim is the cause of their problems rather than realizing that perhaps they've simply put too much in for their system to handle. Link to comment Share on other sites More sharing options...
irswat Posted September 14, 2016 Author Share Posted September 14, 2016 The mod is basically done. Just debugging some things. Hoping to test and tweak this week and have second beta release ready for this weekend.I may start a signature weapons mod after this one. Link to comment Share on other sites More sharing options...
irswat Posted September 15, 2016 Author Share Posted September 15, 2016 (edited) I need a clever way to make sure the RevokeBladeCheck only triggers once a day. I have this, but I realize now that if someone waits for 24 hours this logic will fail.note: RevokeTemperedBladeCheck initializes at 0 ;RevokeTemperedBladeCheck: this is to ensure the check for the previous time period only occurs once ;0=flag for duskfang check needs to be performed ;1=it's daytime and check for duskfang has been performed ;2=it's nighttime and check for dawnfang needs to be performed ;3=it's night time check for dawnfang has been performed if (TimeofDay>=6.0 && TimeofDay<18.0) DayTime=1 if RevokeTemperedBladeCheck==3 RevokeTemperedBladeCheck=0 endif if RevokeTemperedBladeCheck==0 RevokeTemperedBlade(TimeofDay) RevokeTemperedBladeCheck=1 endif ItsDayTime() elseif ((TimeofDay>=18.0 && TimeofDay<=24.0)||(TimeofDay<6.0)) DayTime=0 if RevokeTemperedBladeCheck==1 RevokeTemperedBladeCheck=2 endif if RevokeTemperedBladeCheck==2 || RevokeTemperedBladeCheck==0 RevokeTemperedBlade( TimeofDay) RevokeTemperedBladeCheck=3 endif ItsNightTime() endif   Edited September 15, 2016 by irswat Link to comment Share on other sites More sharing options...
IsharaMeradin Posted September 15, 2016 Share Posted September 15, 2016 (edited) When the player first gets the weapons use GetCurrentGameTime and store the result in a variable. Then when checking to temper or revoke use it again to compare against the first.i.e. Float StartTimeFloat CurrentTimeFloat EndTimeBool RunOncePerDay = false ;when player first gets weaponStartTime = Utility.GetCurrentGameTime()EndTime = StartTime + 1 ;later during the check to temper or revoke within the current dayIf Utility.GetCurrentGameTime() < (EndTime) && RunOncePerDay == false RunOncePerDay = true;if player waits too longElseIf Utility.GetCurrentGameTime() >= EndTime RunOncePerDay = false ;and when tempering or revokingStartTime = Utility.GetCurrentGameTime()EndTime = StartTime + 1 EDIT: GetCurrentGameTime() uses game days, thus the adding of 1 to StartTime is 24 hours later. Added some more stuff as I thought about the logic a bit more. Edited September 15, 2016 by IsharaMeradin Link to comment Share on other sites More sharing options...
irswat Posted September 15, 2016 Author Share Posted September 15, 2016 (edited) that's great to know! thanks I may just incorporate it into the current method, crude though it may be, to handles situations where a person waits for anything more than 23 hours. Edited September 15, 2016 by irswat Link to comment Share on other sites More sharing options...
irswat Posted September 16, 2016 Author Share Posted September 16, 2016 I have some stupid bug in here and I can't find the cause.So I add dawnfang to my inventory. I go get 12 kills. I get the (fine) tempered blade. I wait a couple hours until it is night. Then I wait 12 hours until it is day. The script returns and equips the (fine) dawnfang as it's supposed to, but it also adds an untempered dawnfang. If anyone is interested in helping me debug this I'll pm the plugin. Link to comment Share on other sites More sharing options...
IsharaMeradin Posted September 16, 2016 Share Posted September 16, 2016 Probably just need to look over the script(s). Post them here if you want. Definitely use the spoiler tags. Link to comment Share on other sites More sharing options...
Recommended Posts