Right, so I just attempted to add a load of variable blocks from panther into my scratch Mod, but upon closing and reopening the scratch window I get the following error:
Symbol(Object)>>error:
Symbol(Object)>>doesNotUnderstand:
[] in ScratchSpriteMorph(ScriptableScratchMorph)>>addGenericVariableBlocksTo:x:y:
Array(SequenceableCollection)>>do:
ScratchSpriteMorph(ScriptableScratchMorph)>>addGenericVariableBlocksTo:x:y:
ScratchSpriteMorph(ScriptableScratchMorph)>>variablesPage
ScratchSpriteMorph(ScriptableScratchMorph)>>viewerPageForCategory:
ScratchViewerMorph>>updateContents
ScratchViewerMorph>>categoryChanged:
ScratchStageMorph(ScriptableScratchMorph)>>addVariable:
From reading it I assume it has something to do with this section, but then again I'm a noob so I have no idea....
addVariable: varName
"Add a new user variable with the given name to this object. Do nothing if the variable already exists or is built in."
| sFrame stage isGlobal |
isGlobal _ false.
(sFrame _ self ownerThatIsA: ScratchFrameMorph) ifNil: [
(sFrame _ self ownerThatIsA: OffscreenWorldMorph) ifNotNil: [
sFrame _ sFrame frame.
stage _ sFrame workPane.
isGlobal _ stage varNames includes: varName asString.
((vars includesKey: varName asString) or: [isGlobal = true]) ifFalse: [
vars at: varName asString put: 0.
].
].
]
ifNotNil: [
(stage _ self ownerThatIsA: ScratchStageMorph)
ifNotNil: [isGlobal _ stage varNames includes: varName asString].
((vars includesKey: varName asString) or: [isGlobal = true]) ifFalse: [
vars at: varName asString put: 0].
sFrame viewerPane categoryChanged: 'variables'.].
Any help is much appreciated
Offline
nsmbodabor wrote:
Right, so I just attempted to add a load of variable blocks from panther into my scratch Mod, but upon closing and reopening the scratch window I get the following error:
(Code removed to shorten post.)
Any help is much appreciated
Maybe there is another method that you need to add to your mod. I tried to make an "add variable" blocks to my mod a while ago (without copying from another mod), but it wouldn't create global variables. I do not have Panther on my Mac, so I can't help right now... I am sure someone else can help you though.
Also, use the [code ] [/code ] tags for code and errors.
Last edited by nathanprocks (2013-01-01 20:16:55)
Offline
Thanks, I'll leave it until tommorrow seeing as it's 01:16am, maybe I'll have some new replies in the morning.
Thanks for all your help though
Offline
Bump?
Offline
Never mind, problem solved now
Offline