home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Boot Disc 5
/
boot-disc-1997-01.iso
/
media
/
utility.cst
/
00009_Script_GenericClass
< prev
next >
Wrap
Text File
|
1996-11-05
|
3KB
|
97 lines
property prefix
on new me
return me
end
on clearactorlist me,classname,whichprop
repeat with index=1 to count(the actorlist)
set obj=getat(the actorlist,index)
put getobjectname(obj)
if getObjectName(obj)=classname then
put value("the "&string(whichprop)&" of obj"),value("the "&string(whichprop)&" of me")
if value("the "&string(whichprop)&" of obj")=value("the "&string(whichprop)&" of me") then
deleteat the actorlist,index
exit repeat
end if
end if
end repeat
end
on getObjectName me
set oldDelimiter=the itemDelimiter
set the itemDelimiter=quote
set name=item 2 of string(me)
set the itemdelimiter=oldDelimiter
return name
end
on getspritelist me,myprefix
set spritelist=[]
set prefix=myprefix
repeat with spritenum=1 to 48
set castnum=the membernum of sprite spritenum
if castnum>0 then
if offset(prefix,the name of member castnum)>0 then
add spritelist,spritenum
end if
end if
end repeat
return spritelist
end
on safestring me,whichstring
set pos=offset("'",whichstring)
repeat while pos>0
put quote into char pos of whichstring
set pos=offset("'",whichstring)
end repeat
set pos=offset(";",whichstring)
repeat while pos>0
put return into char pos of whichstring
set pos=offset(";",whichstring)
end repeat
return whichstring
end
on showobject me
set curtext=the scripttext of member getObjectName(me)
repeat with index=1 to the number of lines in curtext
set curline=line index of curtext
case (word 1 of curline) of
"on","property":
put curline
end case
end repeat
end
on castsprite me,whichcast
if stringP(whichcast) then
set castnum=the number of member(whichcast)
end if
if castnum<1 then return 0
set spritenum=0
repeat with index=1 to 48
set curcast=the membernum of sprite index
if curcast>0 then
if curcast=castnum then
set spritenum=index
exit repeat
end if
end if
end repeat
return spritenum
end
on dispose me,classname,whichprop
clearactorlist me,classname,whichprop
-- if findpos(me,#spritenum) then
-- if the puppet of sprite spritenum then
-- set the puppet of sprite spritenum to false
-- end if
-- if not the visible of sprite spritenum then
-- set the visible of sprite spritenum to true
-- end if
return 0
end