Has anybody been using this approach?
constantly working in an external editor, and importing the
files on
preparemovie?
I've always thought it wouldn't be worth it, but am thinking
that might
not be true.
My biggest worry is that I will accidentally edit in the
script window
as well. and that
those changes will get overwritten. Thinking about it a bit
more, I
guess an elegant system
could be setup where on script-import, we also store the
scripttext in
the member's comments
field. Before re-importing a script, check it against its
comments
field. If it's not identical,
something has changed. A diff can be produced, and be
applied to the
external file.
Stuff like winmerge actually works pretty well. We could try
to
automerge the diff back to the (maybe also modified)
external script. If there are no conflicts, just do it. If
there are
conflicts, throw up a dialogbox with the option
to launch winmerge, and to manually fix the situation..
as long as you have an external editor which is smart about
detecting
that the file that it is working on has changed,
I can imagine a pretty decent workflow.
Is anybody actually using something like this? I'd love to
hear some
real life stories.
Bye, Lucas
James Newton wrote:
>Alec Vance wrote:
>
>
>>Looking through the archives of this list and other
resources on
>>the web, I've been discouraged to find that you
can't have an
>>external linked script (.ls) file that can be
changed-on-the-fly
>>without opening Director and updating it.
>>
>>
>
>Hi Alec,
>
>Be discouraged no longer. Call this handler or
prepareMovie():
>
>on UpdateScripts()
---------------------------------------------------
> -- ACTION: Checks a given folder for *.ls files whose
names match
> -- existing script members, and replaces the
scriptText of
> -- those members with the contents of the *.ls
files.
>
------------------------------------------------------------
--------
>
> vFolder = the moviePath -- or a different folder
> vFileIO = xtra("fileio").new() -- assumed to
be available
>
> the itemDelimiter = "."
> n = 0
> repeat while TRUE
> n = n + 1
> vFileName = getNthFileNameInFolder(vFolder, n)
>
> if vFileName = "" then
> -- There are no more files
> exit repeat
> end if
>
> if the last item of vFileName = "ls" then
> -- We've found an *.ls file. Let's see if its
name matches
> -- a script in this movie
> vFilePath = vFolder&vFileName
>
> delete the last item of vFileName
> vMember = member(vFileName)
>
> if ilk(vMember) = #member then
> if vMember.type = #script then
> -- Read in the new scriptText of this member
> vFileIO.openFile(vFilePath, 1) -- Read only
> vScriptText = vFileIO.readFile()
>
> if not vFileIO.status() then
> -- The following line will cause a script
error if the
> -- contents of the file cannot be compiled.
> vMember.scriptText = vScriptText
> end if
>
> vFileIO.closeFile()
> end if
> end if
> end if
> end repeat
>end UpdateScripts
>
>Tested for you in a projector. Be sure to include the
fileio xtra.
>
>Cheers,
>
>James
>
>_______________________________________________
>dirGames-L mailing list - dirGames-L nuttybar.drama.uga.edu
>http://nuttybar.drama.uga.edu/mailman/listinfo/dirgames
-l
>
>
>
_______________________________________________
dirGames-L mailing list - dirGames-L nuttybar.drama.uga.edu
http://nuttybar.drama.uga.edu/mailman/listinfo/dirgames
-l
|