npdogg Posted June 24, 2019 Share Posted June 24, 2019 It is listening for a startup event, and it's called from the fragment. It's probably personal preference, but I like to organise my code in how it behaves and is used. It's not an event, though. It's behaving like a function call, since that's what it is. Link to comment Share on other sites More sharing options...
RichWebster Posted June 24, 2019 Share Posted June 24, 2019  It is listening for a startup event, and it's called from the fragment. It's probably personal preference, but I like to organise my code in how it behaves and is used. It's not an event, though. It's behaving like a function call, since that's what it is.And you don't think that somewhere in the source code there's a function that calls an event in Papyrus? Link to comment Share on other sites More sharing options...
npdogg Posted June 24, 2019 Share Posted June 24, 2019 And you don't think that somewhere in the source code there's a function that calls an event in Papyrus? At some point every function is called by another function, otherwise it's dead code. You can call all functions "events" by that definition if you want, but they still exist outside the language event model, or the event framework provided by SKSE. Link to comment Share on other sites More sharing options...
RichWebster Posted June 24, 2019 Share Posted June 24, 2019  And you don't think that somewhere in the source code there's a function that calls an event in Papyrus? At some point every function is called by another function, otherwise it's dead code. You can call all functions "events" by that definition if you want, but they still exist outside the language event model, or the event framework provided by SKSE.There is no spoon. Link to comment Share on other sites More sharing options...
npdogg Posted June 24, 2019 Share Posted June 24, 2019 There is no spoon. So how do I register as a listener to your "Startup" event? Link to comment Share on other sites More sharing options...
RichWebster Posted June 24, 2019 Share Posted June 24, 2019 You need SKSE to create automated listeners. Fallout 4 has this feature built in. Link to comment Share on other sites More sharing options...
RichWebster Posted June 24, 2019 Share Posted June 24, 2019 In papyrus the only difference between creating an event and a function is semantics. I'm not sure why you've chosen this hill to die on though. Can't you just not do it? Link to comment Share on other sites More sharing options...
npdogg Posted June 24, 2019 Share Posted June 24, 2019 (edited) In papyrus the only difference between creating an event and a function is semantics. I'm not sure why you've chosen this hill to die on though. Can't you just not do it? I think you meant event listener, and that's true. However, your use of the Event keyword implies an event that doesn't actually exist in the Papyrus event model. I can't listen for your "Startup" event, because it isn't actually an event. And SKSE is no help because you didn't define your "event" with SKSE either. So no, the difference is not semantics. Edited June 24, 2019 by npdogg Link to comment Share on other sites More sharing options...
RichWebster Posted June 25, 2019 Share Posted June 25, 2019 I suppose we'll have to agree to disagree. Link to comment Share on other sites More sharing options...
npdogg Posted June 25, 2019 Share Posted June 25, 2019 I suppose we'll have to agree to disagree. lol dude. It's very simple. Event handlers are all functions, but not all functions are event handlers. Events are called through the papyrus engine event model or from custom events defined with SKSE. Giving your function the "Event" keyword doesn't make it an event handler, semantically or otherwise. It just makes your code more confusing. I didn't tell you to adopt a bad convention. If you don't like it being criticized, you don't have to post about it on discussion forums. Link to comment Share on other sites More sharing options...
Recommended Posts