Community

SCI Programming => SCI Syntax Help => Topic started by: gumby on October 16, 2012, 09:08:46 PM

Title: Long running handleEvent in room
Post by: gumby on October 16, 2012, 09:08:46 PM
I have a scenario where I have a long running event in a room script.  Midway through the 'long event', I update a view, but the update (on screen) doesn't take place until the handleEvent() method finishes (at least that's what looks like is going on).

Any ideas on how to get around this?
Title: Re: Long running handleEvent in room
Post by: Collector on October 17, 2012, 04:43:40 AM
What about sequential timers who's total time equals the one long timer? Each timer could update the view and then start the next timer.
Title: Re: Long running handleEvent in room
Post by: gumby on October 17, 2012, 07:54:14 AM
Yes, I was looking into timers as I think that would take care of my issue.  I could set up all the timed events that I need in the handleEvent method & that way it wouldn't be a long running method any more.  Just kick off the timers & move on.

I'll give timers another go.  I tried them earlier, but couldn't quite get them working.
Title: Re: Long running handleEvent in room
Post by: gumby on October 18, 2012, 08:25:54 PM
Ok, I figured it out.  One of Doan's posts was exactly what I needed.  Here's the link:

http://sciprogramming.com/community/index.php/topic,210.msg807.html#msg807

Thanks Doan!
Title: Re: Long running handleEvent in room
Post by: Cloudee1 on October 20, 2012, 10:43:30 PM
Without knowing exactly the scenario, I'm not sure if this will help or not. But in a view or props instance, you can also include changeState methods, maybe you can create states outside of the roomscript and then just trigger different states at different times. It provides more options than just one single run through