I'm making a blind mode for gopher 2.0. I have the menu code, and a script for if the blind mode is on, then show exit blind mode, and if its off, it shows enter blind mode, and heres what I have done:
Blind
ifTrue: [t2 add: 'Exit Blind Mode [+]' action: #exitBlindMode]
ifFalse: [t2 add: 'Enter Blind Mode [+]' action: #blindMode].But when I click the menu, I always get this error:
NonBoolen reciever-proceed for truth
Can you give me the code for a menu?
(I was editing the file menu to make that.)
Offline
Is Blind always true or false (not "true"or "false) ?
Offline
It makes all the blocks and text bigger for people with bad eyesight.
Offline
The error you're getting means that Squeak doesn't know whether the variable is true or false -- it's just something else. To avoid this, I always use (variable = true) instead of just (variable). Still, there's something wrong with the code. Either you forgot to set a default for the variable, or the method can't access the variable properly.
Offline
The variable works, I put this code in the startup method:
Blind _ false
so tht should make it false at the start.
Last edited by WindowsExplorer (2011-08-17 09:27:08)
Offline
WindowsExplorer wrote:
The variable works, I put this code in the startup method:
Code:
Blind _ falseso tht should make it false at the start.
Never know. Just use my (Blind = true) method, and check if the ticking works.
Offline
Thank you, it worked! I for got the blind = condition part, I just had
Blind
ifTrue: [^]
lol!
Offline
WindowsExplorer wrote:
Thank you, it worked! I for got the blind = condition part, I just had
Blind
ifTrue: [^]
lol!
It should work normally, but obviously it didn't initialize the variable properly. So you didn't forget anything
Offline
ozzy1225 wrote:
quick question,,,, how do you use "left click" for aiming something in a shooter?
Please remember to keep your posts on topic.
Offline
veggieman wrote:
ozzy1225 wrote:
quick question,,,, how do you use "left click" for aiming something in a shooter?
Please remember to keep your posts on topic.
Yeah, please post your own topic (in the correct section, which in this case is All About Scratch) and not spam others' threads.
Anyway, there is no way to check whether the player is using the left or right button, but you can use the mouse down block for an 'any button pressed'. [blocks]<mouse down?>[/blocks]
Offline
LS97, when will you be adding the other mods? And by the way, MegaMod isn't programmed to do anything once the compile or upload button is clicked!
Offline
WindowsExplorer wrote:
LS97, when will you be adding the other mods? And by the way, MegaMod isn't programmed to do anything once the compile or upload button is clicked!
I should know -- I programmed both of them. I just didn't add functionality to them yet.
Offline
I need help. When I'm adding a new menu, for example settings, it shows up like this, without a space: HelpSettings.
Offline
WindowsExplorer wrote:
I need help. When I'm adding a new menu, for example settings, it shows up like this, without a space: HelpSettings.
Ah, yes. Lower down in the menu adding code, you'll find a loop that adds spacers after each menu, unless this menu is called help. So just change the name help to whatever the last one is and you're set.
Offline