Page 1 of 1

Property: value is not a number.... WTF?

Posted: Sun Dec 01, 2019 4:44 pm
by RottenPotat0
I'm creating a game based on the one from game academy. I've already done this before, but I'm just gonna start from scratch because the game was so laggy on my android with an sd845. However, this shitty error is showing up now, and I don't even know why.

Re: Property: value is not a number.... WTF?

Posted: Sun Dec 01, 2019 6:49 pm
by richmond62
Well, let's think about SPACES and PARENTHESES to start with . . .

set the left of button "foreGround1" to
. . . with a SPACE between the word button and its name.

to ((the left of button "foreground1") - 5)

now stop all the abusive 'WTF' because it doesn't help, makes you sound rude, and turns helpful types like me off.

Re: Property: value is not a number.... WTF?

Posted: Sun Dec 01, 2019 7:23 pm
by RottenPotat0
richmond62 wrote:
Sun Dec 01, 2019 6:49 pm
Well, let's think about SPACES and PARENTHESES to start with . . .

set the left of button "foreGround1" to
. . . with a SPACE between the word button and its name.

to ((the left of button "foreground1") - 5)

now stop all the abusive 'WTF' because it doesn't help, makes you sound rude, and turns helpful types like me off.
Smart. I like it.

Spaces doesn't even matter in this case... 🤦‍♂️

Re: Property: value is not a number.... WTF?

Posted: Sun Dec 01, 2019 7:52 pm
by richmond62
I don't know why you are getting that error message:

Code: Select all

on mouseUp
   set the left of button "foreground1" to ((the left of button "foreground1") -20)
end mouseUp
-
shunter.png

Re: Property: value is not a number.... WTF?

Posted: Sun Dec 01, 2019 8:18 pm
by bogs
I'm not sure why you'd get that error either, unless it is a typing error. For instance, with one button on a stack, and in the stack script...

Code: Select all

on mouseDown
   set the left of button 1 to the left of button 1 -5
end mouseDown

on mouseUp
   set the left of button 1 to the left of button 1 +5
end mouseUp
...moves a button back and forth with no issue.

Looking at your code that lacks any spaces, I would suggest making sure that the button names actually have no spaces.

Re: Property: value is not a number.... WTF?

Posted: Sun Dec 01, 2019 9:48 pm
by Klaus
Quit and restart Livecode!
Helped here in a similar "insane" situations. :D

Re: Property: value is not a number.... WTF?

Posted: Mon Dec 02, 2019 8:19 am
by RottenPotat0
richmond62 wrote:
Sun Dec 01, 2019 7:52 pm
I don't know why you are getting that error message:

Code: Select all

on mouseUp
   set the left of button "foreground1" to ((the left of button "foreground1") -20)
end mouseUp
bogs wrote:
Sun Dec 01, 2019 8:18 pm
I'm not sure why you'd get that error either, unless it is a typing error. For instance, with one button on a stack, and in the stack script...

Code: Select all

on mouseDown
   set the left of button 1 to the left of button 1 -5
end mouseDown

on mouseUp
   set the left of button 1 to the left of button 1 +5
end mouseUp
...moves a button back and forth with no issue.

Looking at your code that lacks any spaces, I would suggest making sure that the button names actually have no spaces.
Klaus wrote:
Sun Dec 01, 2019 9:48 pm
Quit and restart Livecode!
Helped here in a similar "insane" situations. :D
I've figured out why it's causing the error. Because of the updateScreen, the button just keeps on going left until it's out of bounce lol. So, I have to set the foreground1 to the right of foreground2(or foreground2 to foreground1) everytime the right of the button is < the left of the card, and a condition to stop the screen update.

Anyway, thanks for the help.