Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting
FAQ Members List Calendar Today's Posts

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 09-13-2007, 10:44 PM
Inverness Inverness is offline
Incubator
Inverness's Avatar
Join Date: Aug 2004
Location: Houston, Texas
Posts: 3,613
Inverness is a jewel in the roughInverness is a jewel in the rough
catchEvent() For Dynamic Events

Why does catchEvent() not work with dynamic events (the ones you make) and only static? That is so irritating I would like if it could be made to work with dynamic functions.
__________________
Reply With Quote
  #2  
Old 09-14-2007, 12:37 AM
Skyld Skyld is offline
Script-fu
Skyld's Avatar
Join Date: Jan 2002
Location: United Kingdom
Posts: 3,914
Skyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud of
Send a message via AIM to Skyld
You mean to catch function calls of self-defined functions? Have you tried triggering an onFunction using obj.trigger() instead?
__________________
Skyld
Reply With Quote
  #3  
Old 09-14-2007, 01:13 AM
Inverness Inverness is offline
Incubator
Inverness's Avatar
Join Date: Aug 2004
Location: Houston, Texas
Posts: 3,613
Inverness is a jewel in the roughInverness is a jewel in the rough
I've tried trigger() and scheduleEvent() and can't catch them using catchEvent().
__________________
Reply With Quote
  #4  
Old 09-14-2007, 01:15 AM
Twinny Twinny is offline
My empire of dirt
Twinny's Avatar
Join Date: Mar 2006
Location: Australia
Posts: 2,422
Twinny is just really niceTwinny is just really nice
Send a message via AIM to Twinny
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
Reply With Quote
  #5  
Old 09-14-2007, 01:18 AM
Inverness Inverness is offline
Incubator
Inverness's Avatar
Join Date: Aug 2004
Location: Houston, Texas
Posts: 3,613
Inverness is a jewel in the roughInverness is a jewel in the rough
Quote:
Originally Posted by Twinny View Post
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
No, that destroys encapsulation. The Gui Controls allow you to use them without modifying the script to call events to your scripts, I want my stuff to work like that too >:o

I do not like using alternatives to stuff that should be simple.
__________________
Reply With Quote
  #6  
Old 09-14-2007, 01:32 AM
Twinny Twinny is offline
My empire of dirt
Twinny's Avatar
Join Date: Mar 2006
Location: Australia
Posts: 2,422
Twinny is just really niceTwinny is just really nice
Send a message via AIM to Twinny
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
Reply With Quote
  #7  
Old 09-14-2007, 02:38 AM
zokemon zokemon is offline
That one guy...
zokemon's Avatar
Join Date: Mar 2001
Location: Sonoma County, California
Posts: 2,925
zokemon is a jewel in the roughzokemon is a jewel in the rough
Send a message via ICQ to zokemon Send a message via AIM to zokemon Send a message via MSN to zokemon Send a message via Yahoo to zokemon
Efficiency.
__________________
Do it with a DON!
Reply With Quote
  #8  
Old 09-14-2007, 02:47 AM
Inverness Inverness is offline
Incubator
Inverness's Avatar
Join Date: Aug 2004
Location: Houston, Texas
Posts: 3,613
Inverness is a jewel in the roughInverness is a jewel in the rough
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.
__________________
Reply With Quote
  #9  
Old 09-14-2007, 03:24 AM
Twinny Twinny is offline
My empire of dirt
Twinny's Avatar
Join Date: Mar 2006
Location: Australia
Posts: 2,422
Twinny is just really niceTwinny is just really nice
Send a message via AIM to Twinny
I don't think it would be a smart financial move to make it open source.... Also, efficiency and encapsulation don't go together
Reply With Quote
  #10  
Old 09-14-2007, 03:52 AM
coreys coreys is offline
N-Pulse Assistant Manager
coreys's Avatar
Join Date: Mar 2005
Posts: 2,180
coreys has a spectacular aura about
Send a message via AIM to coreys Send a message via MSN to coreys Send a message via Yahoo to coreys
Perhaps he meant that maybe someone other than Stefan, such as a GST should be able to edit it?
__________________

Quote:
*SlikRick: so should I even ask about your aim status?
*Xor: well if you want to
*Xor: but i am LARPING
*SlikRick: While on a computer?
*Xor: yes
*Xor: in my living room
*SlikRick: ahh
*Xor: i have a fort setup to hide from beasts
Reply With Quote
  #11  
Old 09-14-2007, 03:58 AM
Inverness Inverness is offline
Incubator
Inverness's Avatar
Join Date: Aug 2004
Location: Houston, Texas
Posts: 3,613
Inverness is a jewel in the roughInverness is a jewel in the rough
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:
Originally Posted by coreys View Post
Perhaps he meant that maybe someone other than Stefan, such as a GST should be able to edit it?
Thats exactly what I meant, Skyld being the one I would choose obviously.

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.
__________________
Reply With Quote
  #12  
Old 09-24-2007, 11:31 PM
Inverness Inverness is offline
Incubator
Inverness's Avatar
Join Date: Aug 2004
Location: Houston, Texas
Posts: 3,613
Inverness is a jewel in the roughInverness is a jewel in the rough
Bump.

Can I get some official response?
__________________
Reply With Quote
  #13  
Old 03-10-2008, 02:33 AM
Inverness Inverness is offline
Incubator
Inverness's Avatar
Join Date: Aug 2004
Location: Houston, Texas
Posts: 3,613
Inverness is a jewel in the roughInverness is a jewel in the rough
Bump #2.
__________________
Reply With Quote
  #14  
Old 03-10-2008, 05:01 AM
zokemon zokemon is offline
That one guy...
zokemon's Avatar
Join Date: Mar 2001
Location: Sonoma County, California
Posts: 2,925
zokemon is a jewel in the roughzokemon is a jewel in the rough
Send a message via ICQ to zokemon Send a message via AIM to zokemon Send a message via MSN to zokemon Send a message via Yahoo to zokemon
Yeah, still would be nice to get this.
__________________
Do it with a DON!
Reply With Quote
  #15  
Old 05-02-2008, 03:57 PM
Robin Robin is offline
The secret of NIMH
Robin's Avatar
Join Date: Apr 2005
Location: Wales, UK
Posts: 515
Robin will become famous soon enough
Send a message via AIM to Robin
I suggested a method, addEventListener, in the Future Improvements forum. It would bring GS2 closer to ECMAScript standards too.
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 10:37 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.