![]() |
catchEvent() For Dynamic Events
Why does catchEvent() not work with dynamic events (the ones you make) and only static? That is so irritating :whatever: I would like if it could be made to work with dynamic functions.
|
You mean to catch function calls of self-defined functions? Have you tried triggering an onFunction using obj.trigger() instead?
|
I've tried trigger() and scheduleEvent() and can't catch them using catchEvent().
|
I think he meant try what I said over AIM: just use a function in your event to call any other function you want. Works fine :p
|
Quote:
I do not like using alternatives to stuff that should be simple. |
You have a working method right now though... you don't need to add a higher level layer over gs2: use what you have and what works fine >_<
|
Efficiency.
|
Hard-coded event catching would be more efficient.
I practice encapsulation in my scripting and I don't like having to use another system to handle dynamic events when Graal can already handle static ones. I really dislike how Stefan is the only one capable of editing the engine. |
I don't think it would be a smart financial move to make it open source.... Also, efficiency and encapsulation don't go together :p
|
Perhaps he meant that maybe someone other than Stefan, such as a GST should be able to edit it?
|
Twinny, stop trying to convince me to use a different method. catchEvent() is one function needed to do what I want, I don't like using a system that requires a TStaticVar or something clientside to contain a list of objects so I can trigger events on them.
And Twinny, Efficiency and Hard-Coding do go together, and since the GuiControls are hard-coded I have to say that their support of the catchEvent() is also, that same functionality should be extended to dynamic functions. Quote:
My World system organizes levels based on their name prefix and stores information such as if they're interior or exterior levels, the time offset, how the weather should work for them if they're outside, what music to play while in the levels, and also the default lighting (seteffect()). This function is called onPlayerEnters() and will trigger onWorldCheck() each time and onWorldChange() when there is a difference. I want to be able to do a simple this.catchEvent(System, "onWorldChange", "onWorldChange"); to allow my script to detect that for whatever purpose rather than making some fancy-pants system for it which I don't even like. |
Bump.
Can I get some official response? |
Bump #2.
|
Yeah, still would be nice to get this.
|
I suggested a method, addEventListener, in the Future Improvements forum. It would bring GS2 closer to ECMAScript standards too.
|
All times are GMT +2. The time now is 01:24 AM. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.