Discussion:
Tweak Bootstrap Script Scheduleing
Jens Lincke
2006-10-10 11:51:44 UTC
Permalink
Hi,

When bootstraping a CWorldPlayer from Morphic the ScriptScheduler is
added in initialize if nil. But already registered Scripts like a
onDragDrop: in a CWorldWorld subclass have no scheduler and get
suspended when triggered...

Is the solution to patch the scheduler into the script in this case
(like Bert Freudenberg proposed) ok?

CWorldPlayer>>initialize
"Bootstrap a new world"
super initialize.
scheduler ifNil:[
scheduler := ScriptScheduler new.
"set the context for any newly spawned scripts"
scheduler run.
self myScripts do: [:eachScript |
eachScript setScheduler: scheduler.
]
].
...


- Jens Lincke -
Andreas Raab
2006-10-20 03:20:10 UTC
Permalink
Post by Jens Lincke
When bootstraping a CWorldPlayer from Morphic the ScriptScheduler is
added in initialize if nil. But already registered Scripts like a
onDragDrop: in a CWorldWorld subclass have no scheduler and get
suspended when triggered...
Is the solution to patch the scheduler into the script in this case
(like Bert Freudenberg proposed) ok?
Yes, it's a reasonable workaround. I was hoping that I could reply to
this pointing you to the new and improved island scheme that makes these
hacks unnecessary. Unfortunately, this will take some more time so for
the time being just go with that version.

Cheers,
- Andreas

Loading...