love meter error

Discuss how to use the Ren'Py engine to create visual novels and story-based games. New releases are announced in this section.
Forum rules
This is the right place for Ren'Py help. Please ask one question per thread, use a descriptive subject like 'NotFound error in option.rpy' , and include all the relevant information - especially any relevant code and traceback messages. Use the code tag to format scripts.
Post Reply
Message
Author
User avatar
Temanta
Newbie
Posts: 8
Joined: Tue Jul 31, 2018 9:43 am
Contact:

love meter error

#1 Post by Temanta » Mon Aug 13, 2018 1:58 pm

Hello

I have a problem with love meter. I tried several methods and that's wrong :/
Can you help me ?

I have this error :

Image

what i've done :

Image

Image

User avatar
Remix
Eileen-Class Veteran
Posts: 1258
Joined: Tue May 30, 2017 6:10 am
Completed: None... yet (as I'm still looking for an artist)
Projects: An un-named anime based trainer game
Contact:

Re: love meter error

#2 Post by Remix » Mon Aug 13, 2018 2:27 pm

Code: Select all

default joaq = 10
default jr = 0
default p = 0

label start:
    "... [joaq] ... [jr] ... [p] ..."
Mad Scientist Todo List:
  • Finish Improved Event Handler
  • Implement DragonBones animation as a Creator Defined Container
  • Develop Cartoon Speech Bubble dialogue
  • Finish Bitmask collision and rebound vector system
  • Develop time based building mechanic
  • Others
  • *Find a superb artist and actually write a game*

User avatar
Temanta
Newbie
Posts: 8
Joined: Tue Jul 31, 2018 9:43 am
Contact:

Re: love meter error

#3 Post by Temanta » Mon Aug 13, 2018 3:00 pm

I have this error, now :

File "game/script.rpy", line 35: Line is indented, but the preceding define statement statement does not expect a block. Please check this line's indentation.
default joaq = 10


:(

User avatar
Per K Grok
Veteran
Posts: 455
Joined: Fri May 18, 2018 1:02 am
Completed: the Ghost Pilot, Sea of Lost Ships, Bubbles and the Pterodactyls, Defenders of Adacan Part 1
Projects: Defenders of Adacan Part 2
Deviantart: pekj
itch: per-k-grok
Location: Sverige
Contact:

Re: love meter error

#4 Post by Per K Grok » Mon Aug 13, 2018 3:39 pm

Temanta wrote:
Mon Aug 13, 2018 3:00 pm
I have this error, now :

File "game/script.rpy", line 35: Line is indented, but the preceding define statement statement does not expect a block. Please check this line's indentation.
default joaq = 10


:(

Did you do

Code: Select all

    default joaq = 10
instead of

Code: Select all

default joaq = 10
?
Image Visual Story Telling, DeviantArt Group for animations, comics, games and illustrations https://www.deviantart.com/acgi

User avatar
Temanta
Newbie
Posts: 8
Joined: Tue Jul 31, 2018 9:43 am
Contact:

Re: love meter error

#5 Post by Temanta » Mon Aug 13, 2018 3:57 pm

Yes I did :?

User avatar
Per K Grok
Veteran
Posts: 455
Joined: Fri May 18, 2018 1:02 am
Completed: the Ghost Pilot, Sea of Lost Ships, Bubbles and the Pterodactyls, Defenders of Adacan Part 1
Projects: Defenders of Adacan Part 2
Deviantart: pekj
itch: per-k-grok
Location: Sverige
Contact:

Re: love meter error

#6 Post by Per K Grok » Tue Aug 14, 2018 1:03 am

Temanta wrote:
Mon Aug 13, 2018 3:57 pm
Yes I did :?
try doing
default joaq = 10
without any empty space (indentur) in front of it, and do the same or the other two lines starting with default.
Image Visual Story Telling, DeviantArt Group for animations, comics, games and illustrations https://www.deviantart.com/acgi

User avatar
Temanta
Newbie
Posts: 8
Joined: Tue Jul 31, 2018 9:43 am
Contact:

Re: love meter error

#7 Post by Temanta » Tue Aug 14, 2018 12:26 pm

It's working, thank you :)

How to know if the points are really add / remove ?

User avatar
Per K Grok
Veteran
Posts: 455
Joined: Fri May 18, 2018 1:02 am
Completed: the Ghost Pilot, Sea of Lost Ships, Bubbles and the Pterodactyls, Defenders of Adacan Part 1
Projects: Defenders of Adacan Part 2
Deviantart: pekj
itch: per-k-grok
Location: Sverige
Contact:

Re: love meter error

#8 Post by Per K Grok » Tue Aug 14, 2018 2:56 pm

Temanta wrote:
Tue Aug 14, 2018 12:26 pm
It's working, thank you :)
Good!
If you go back to Remix' post you will see that was the way they wrote it. :)
Temanta wrote:
Tue Aug 14, 2018 12:26 pm

How to know if the points are really add / remove ?
You could make a screen that shows the points.

A very simple screen could just be

Code: Select all

screen meters:
    text str(joaq) ypos 20  
    text str(jr) ypos 45
    text str(p) ypos 70
If you want to have something like that in the actual game you would of course want to do something more fancy, but this would be enough to check if the points are added or removed as they should.
Image Visual Story Telling, DeviantArt Group for animations, comics, games and illustrations https://www.deviantart.com/acgi

User avatar
Temanta
Newbie
Posts: 8
Joined: Tue Jul 31, 2018 9:43 am
Contact:

Re: love meter error

#9 Post by Temanta » Sun Aug 19, 2018 6:40 am

Where should I write that ? After "default joaq = 10" or when the character talk ?

User avatar
Per K Grok
Veteran
Posts: 455
Joined: Fri May 18, 2018 1:02 am
Completed: the Ghost Pilot, Sea of Lost Ships, Bubbles and the Pterodactyls, Defenders of Adacan Part 1
Projects: Defenders of Adacan Part 2
Deviantart: pekj
itch: per-k-grok
Location: Sverige
Contact:

Re: love meter error

#10 Post by Per K Grok » Mon Aug 20, 2018 12:26 pm

Temanta wrote:
Sun Aug 19, 2018 6:40 am
Where should I write that ? After "default joaq = 10" or when the character talk ?
You could put your screen text at the end of your script.rpy
that is the

Code: Select all

screen meters:
    text str(joaq) ypos 20  
    text str(jr) ypos 45
    text str(p) ypos 70
part, or you could put it at the end of the screens.rpy. I don't think it matters much where you put that part.

Code: Select all

show screen meters
You should put that in, in your script-file, before you start changing the variables in the code. You don't have to open and close the screen between the different points where the variables are changed.
Image Visual Story Telling, DeviantArt Group for animations, comics, games and illustrations https://www.deviantart.com/acgi

User avatar
Temanta
Newbie
Posts: 8
Joined: Tue Jul 31, 2018 9:43 am
Contact:

Re: love meter error

#11 Post by Temanta » Mon Aug 20, 2018 4:05 pm

it works. The text appears. But, it always marks :

joaquim 0
0


even when you make a positive choice :/

and, is it possible to change the color ?

User avatar
Per K Grok
Veteran
Posts: 455
Joined: Fri May 18, 2018 1:02 am
Completed: the Ghost Pilot, Sea of Lost Ships, Bubbles and the Pterodactyls, Defenders of Adacan Part 1
Projects: Defenders of Adacan Part 2
Deviantart: pekj
itch: per-k-grok
Location: Sverige
Contact:

Re: love meter error

#12 Post by Per K Grok » Mon Aug 20, 2018 5:23 pm

Temanta wrote:
Mon Aug 20, 2018 4:05 pm

and, is it possible to change the color ?
add
color "#F00"
or whatever color you prefer.

text str(joaq) color "#F00" ypos 20

"#F00" red
"#0F0" green
"#00F" blue

Temanta wrote:
Mon Aug 20, 2018 4:05 pm
it works. The text appears. But, it always marks :

joaquim 0
0


even when you make a positive choice :/
What is the code you used for the meters screen? The code I wrote would not write out 'joaquim'.
Wasn't the default value of 'joaq', 10?
Image Visual Story Telling, DeviantArt Group for animations, comics, games and illustrations https://www.deviantart.com/acgi

User avatar
Temanta
Newbie
Posts: 8
Joined: Tue Jul 31, 2018 9:43 am
Contact:

Re: love meter error

#13 Post by Temanta » Sat Sep 01, 2018 11:26 am

I wrote

default joa = 10

and

show screen meters (because the meter didn't appear)
$ joa += 5

Post Reply

Who is online

Users browsing this forum: No registered users