به همنون صورت یه cast اکسترنال ایجاد کن و بعد توش یه اسکریپت بنویس و ذخیرش کن حالا مینونی به بقیه اون کست ها اضافش کنی
مثال:
این هار رو به همین صورت توی یه اسکریپت بزار و ذخیرش کن
-----------------------------------------------------------------------------ty
-- step value
on GetBehaviorDescription
set sContent = "This allows any sprite to pulsate in and out in opacity. Parameters include maximum opacity, minimum opacity, and step value."
return sContent
END GetBehaviorDescription
on GetBehaviorTooltip
set sContent = "This allows any sprite to pulsate in and out in opacity. Parameters include maximum opacity, minimum opacity, and step value."
return sContent
END GetBehaviorTooltip
PROPERTY pnMySprite, pbFading, pnMaximumOpacity, pnMinimumOpacity, pnFadeStep
on BeginSprite me
set pnMySprite = the currentSpriteNum
set the ink of sprite pnMySprite = 32 -- blend
END BeginSprite
on PrepareFrame me
if the blend of sprite pnMySprite >= pnMaximumOpacity then
set pbFading = TRUE
else if the blend of sprite pnMySprite <= pnMinimumOpacity then
set pbFading = FALSE
end if
if pbFading then
set the blend of sprite pnMySprite = the blend of sprite pnMySprite - pnFadeStep
else
set the blend of sprite pnMySprite = the blend of sprite pnMySprite + pnFadeStep
end if
end PrepareFrame
on GetPropertyDescriptionList me
if not ( the currentSpriteNum ) then
-- behavior has been dropped on the script channel; kickout
exit
end if
return [ #pnMaximumOpacity: [ #comment: "What is the MAXIMUM opacity you want in percent?", #format: #integer, #default: 100, #range: [#min: 1, #max: 100] ], #pnMinimumOpacity: [ #comment: "What is the MINIMUM opacity you want in percent?", #format: #integer, #default: 50, #range: [#min: 0, #max: 100] ], #pnFadeStep: [ #comment: "By what amount do you want the opacity to be stepped each time?", #format: #integer, #default: 1, #range: [#min: 1, #max: 100] ] ]
end GetPropertyDescriptionList
------------------------------------- این هم یکی دیگه
-- The Orbital Behavor as hacked by Renfield
--
[email protected]
-- with respect to flat earth communications
property spriteNum
property orbitSpeed, originH, originV, radiusH, radiusV, originType, originSprite
--====== The Set Up:
on idle me
checkOrigin me
orbit me
updateStage
end
on exitFrame me
checkOrigin me
orbit me
end
--====== Making Biscuits:
on checkOrigin me
case (originType) of
"mouse": mouseOrigin me
"sprite": spriteOrigin me
end case
end
on mouseOrigin me
set originH = the mouseh
set originV = the mousev
end
on spriteOrigin
set originH = the loch of sprite originSprite
set originV = the locv of sprite originSprite
end
on orbit me
set counter to the ticks
set the loch of sprite spriteNum = originH + radiusH * cos(counter/orbitSpeed)
set the locv of sprite spriteNum = originV +radiusV * sin(counter/orbitSpeed)
end
--====== Behavior Handlers:
on getPropertyDescriptionList me
set theProps to [:]
set c to "What's the orbit speed?"
set f to #float
set d to 50.00
addProp theProps, #orbitSpeed, [#comment: c, #format: f, #default: d]
set c to "What's the origin?"
set f to #string
set r to ["point", "mouse", "sprite"]
set d to getAt(r,1)
set typeProps to [#comment: c, #format: f, #range: r, #default: d]
addProp theProps, #originType, typeProps
set c to "If origin is a sprite, who?"
set f to #integer
set d to 1
addProp theProps, #originSprite, [#comment: c, #format: f, #default: d]
set c to "If origin is a point, what's H?"
set f to #integer
set d to 100
addProp theProps, #originH, [#comment: c, #format: f, #default: d]
set c to "if origin is a point,what's V?"
set f to #integer
set d to 100
addProp theProps, #originV, [#comment: c, #format: f, #default: d]
set c to "What's the H radius?"
set f to #integer
set d to 30
addProp theProps, #radiusH, [#comment: c, #format: f, #default: d]
set c to "What's the V radius?"
set f to #integer
set d to 30
addProp theProps, #radiusV, [#comment: c, #format: f, #default: d]
return theProps
end
on getBehaviorDescription me
set line1 to " Make an orbiter" & RETURN
return line1
end