New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Difference between creaturescripts & events #1492
Comments
I'm sorry if it feels like I'm piggybacking off your issue, but I've been thinking about "events" versus "creaturescripts" for a while as well. I think the general consensus here is "everything should be moved to events." I'm not sure if @marksamman has directly stated anywhere that this is the direction that he wants to go in, but I think it's been implied that a lot of new events should consider "events" over "creaturescripts." I'm all for "the new" and getting rid of things that don't work well / could work better. But I really don't want to see creaturescripts deprecated in lieu of events. I think events address very common actions (onMove, onTurn, onLook) very well. I would be disheartened if I were told that I would have to move onLogin to events; I have a 150-line script that executes on login if a player simply has a certain storage value (think, first items.) This would end up looking very messy in an events file. Sorry if it sounds like my exact thoughts and concerns aren't well-collected, that's probably part of the reason I haven't brought this up. I'd certainly like to hear what Mark and others think. |
Hmmm true that, @Luckey1729, events file are a bit messy to go with large scripts. The two From what I see the events are only for short, simple callbacks to prevent having 20 files with 5-line functions. |
From what I know, events was created to move things from C++ to Lua. And from my understanding events is only executed when it needs to, while creaturescripts either loads them all or loads them all the time (can't remember who told me this though). |
And about performance? a creature event(like ondeath, onpreparedeath, etc) is only called for creatures that have been registered(with creature:addEvent). I think its better in performance than a player event because a player event will be called everytime for every single player. |
I'm playing with some callbacks and I stumbled into a doubt: where should I put it, on creaturescripts or on events?
I don't know the true purpose of those folders, as all creature scripts, except maybe for extendedopcode, could be moved to simple events with little code changes, but the other way around is also true, events could easily be converted into creaturescripts, so what is the true difference of meaning between those 2 script types?
The text was updated successfully, but these errors were encountered: