Author Topic: Long running handleEvent in room  (Read 3825 times)

0 Members and 1 Guest are viewing this topic.

Offline gumby

Long running handleEvent in room
« 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?


In the Great Underground Empire (Zork port in development)
Winter Break 2012 Rope Prop Competition

Offline Collector

Re: Long running handleEvent in room
« Reply #1 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.
KQII Remake Pic

Offline gumby

Re: Long running handleEvent in room
« Reply #2 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.
In the Great Underground Empire (Zork port in development)
Winter Break 2012 Rope Prop Competition

Offline gumby

Re: Long running handleEvent in room
« Reply #3 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!
In the Great Underground Empire (Zork port in development)
Winter Break 2012 Rope Prop Competition

Offline Cloudee1

Re: Long running handleEvent in room
« Reply #4 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
Halloween Competition Brass Lantern Prop Competition Groundhog Day Competition


SMF 2.0.19 | SMF © 2021, Simple Machines
Simple Audio Video Embedder

Page created in 0.031 seconds with 23 queries.