steve40 Posted June 14, 2018 Share Posted June 14, 2018 Afaik, you can assign values to the properties within the script without needing to set them in CK via the Property dialog. For example, float Property my_float = 10.5 auto string Property my_string = "just testing" auto I just did a quick test and added the above to a script and it compiled, at least, so I think it should work. NB. I use Caprica to compile all my Papyrus scripts, so it might be a compiler-dependent feature? As for the large IF statement, would switch-case statements be useful to you? The Caprica compiler supports switch-case statements. SwitchThe Switch statement may only be used on an Int or String, and the case values must be literals.<switch> ::= 'Switch' <expression> ['Case' (<integer>|<string>) <statement>*]* ['Default' <statement>*] 'EndSwitch' Link to comment Share on other sites More sharing options...
Reneer Posted June 14, 2018 Share Posted June 14, 2018 +1 for steve's method, which will also work with the vanilla Papyrus compiler. Link to comment Share on other sites More sharing options...
Zzyxzz Posted June 14, 2018 Share Posted June 14, 2018 Ehm.... excuse me... what!? We have switch statements? Shame on me for not knowing, that there is a compiler that can handle this, lol. Oh gosh! And so much more! Wow... Thanks for pointing that out! Link to comment Share on other sites More sharing options...
dagobaking Posted June 14, 2018 Author Share Posted June 14, 2018 Afaik, you can assign values to the properties within the script without needing to set them in CK via the Property dialog. For example, float Property my_float = 10.5 auto string Property my_string = "just testing" auto I just did a quick test and added the above to a script and it compiled, at least, so I think it should work. NB. I use Caprica to compile all my Papyrus scripts, so it might be a compiler-dependent feature? As for the large IF statement, would switch-case statements be useful to you? The Caprica compiler supports switch-case statements. SwitchThe Switch statement may only be used on an Int or String, and the case values must be literals.<switch> ::= 'Switch' <expression> ['Case' (<integer>|<string>) <statement>*]* ['Default' <statement>*] 'EndSwitch' Thank you. The settings get populated from XML after load. So, I don't really need to populate them in their declaration like that. The issue is that, from my experience, when you add/change/remove properties on a script, you have to go into the properties panel in CK for it to do some sync with the esp/esm and re-save that. But, maybe Caprica somehow handles that part too? Haven't used it. For Switch, is that creating a real switch statement? Or, is Caprica just using that syntax and then turning it into an If statement for the Papyrus compiler? Link to comment Share on other sites More sharing options...
steve40 Posted June 14, 2018 Share Posted June 14, 2018 Caprica is creating real switch statements in the script assembly code. Link to comment Share on other sites More sharing options...
dagobaking Posted June 15, 2018 Author Share Posted June 15, 2018 Interesting. Going to look more into that. Thank you. Link to comment Share on other sites More sharing options...
payl0ad Posted June 16, 2018 Share Posted June 16, 2018 Ehm.... excuse me... what!? We have switch statements? Shame on me for not knowing, that there is a compiler that can handle this, lol. Oh gosh! And so much more! Wow... Thanks for pointing that out! Yeah man, TIL. What the hell. I thought ifelse was Papyrus' way of doing switch/case. Now someone needs to come around and tell us there's push() and pop() in Papyrus. Link to comment Share on other sites More sharing options...
Recommended Posts