Jump to content

[LE] Event Headers called as Functions?


Recommended Posts

 

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

 

 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

 

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

 

 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

 

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 by npdogg
Link to comment
Share on other sites

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

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...