gooser Posted February 5, 2015 Posted February 5, 2015 I was just looking over Jaxonz latest "Diagnostics" mod and I ran across these lines in the MCM script: bool bValidateSKSE = true state optValidateSKSE event OnSelectST() bValidateSKSE = !bValidateSKSE SetToggleOptionValueST(bValidateSKSE) ((Self as Quest) as JaxonzDiagnosticsQuest).bValidateSKSE = bValidateSKSE endEvent event OnHighlightST() SetInfoText("When selected, Jaxonz Diagnostics will test for valid SKSE installation on each game load and display a warning if there is a problem.") endEvent endState This is an MCM State inside the script JaxonzDiagnosticsMCM (Scriptname JaxonzDiagnosticsMCM extends ski_configbase if you are wondering) script. JaxonzDiagnosticQuest is a separate script (derives from Quest). I have no idea how ((Self as Quest) as JaxonzDiagnosticsQuest).bValidateSKSE = bValidateSKSE works. Cast Self to Quest, then to a different script type and then access a property on that script. Is there some arcane rule about how the "as" operator works between object (script) types? Thanks
Earen Posted February 5, 2015 Posted February 5, 2015 UIExtensions dev did the same trick. It-Just-Works It seems that the one quest have few scripts attached thus the cast returns another script instance Btw function blabla() t = 0 int t = 1 endfunction
gooser Posted February 5, 2015 Author Posted February 5, 2015 UIExtensions dev did the same trick. It-Just-Works It seems that the one quest have few scripts attached thus the cast returns another script instance Btw function blabla() t = 0 int t = 1 endfunction Papyrus is about as a fucking crazy as Javascript.
Earen Posted February 5, 2015 Posted February 5, 2015 UIExtensions dev did the same trick. It-Just-Works It seems that the one quest have few scripts attached thus the cast returns another script instance Btw function blabla() t = 0 int t = 1 endfunction Papyrus is about as a fucking crazy as Javascript. I heard of Javascript issues, but I wish it would Javascript instead
Recommended Posts
Archived
This topic is now archived and is closed to further replies.