Date: Tue, 19 Dec 1995 13:31:51 -0700 From: Ron Bearry <enzo@ESKIMO.COM> Subject: Re: Eureka! Using script properties to avoid globalsOk, this isn't dealing with the exact same issue but I thought I would delurk and throw this in for general parent script discussion sake anyway.
I only look up my parent scripts by name the first time I use them and during the first "lookup" I put the script names and numbers in a property list using the function below.
When I need to reference the cast slot containing my parent script again I just get its cast number from the property list. This really speeds up performance in cases where you need to kill objects and birth new ones frequently. Yup, using this function you do need to pass the correct cast name as a parameter so it isn't as general and flexible as what you are looking for Glenn, but It does work well if you know what parent you want to birth from.
By the way, this has been great thread.
on ParentNameList name
--
global gparentNameList
--
set number = getAProp(gparentNameList, name)
if voidP(number) then
--add cast number to list.
set number = the number of cast name
addProp(gparentNameList, name, number)
end if
return number
end ParentNameList