Why are my bars suddenly not responding to changes?

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
futurama92
Newbie
Posts: 6
Joined: Tue Jun 30, 2020 7:29 am
Contact:

Why are my bars suddenly not responding to changes?

#1 Post by futurama92 »

Everything was going fine until I tried adding the "fatigue" bar, now not only will it not show up, the other bars won't change position anymore (the values do change though)
Attachments
bef.png
aft.png

User avatar
renardjap
Regular
Posts: 75
Joined: Sun Aug 05, 2018 1:08 pm
Location: France ! Cocorico
Contact:

Re: Why are my bars suddenly not responding to changes?

#2 Post by renardjap »

It miss the xsize value on your last bar.

futurama92
Newbie
Posts: 6
Joined: Tue Jun 30, 2020 7:29 am
Contact:

Re: Why are my bars suddenly not responding to changes?

#3 Post by futurama92 »

Should've added the end of it, but the xy value is there
Attachments
333.png

rayminator
Miko-Class Veteran
Posts: 793
Joined: Fri Feb 09, 2018 12:05 am
Location: Canada
Contact:

Re: Why are my bars suddenly not responding to changes?

#4 Post by rayminator »

can you show your code related to you problem without a images

and the codes for the values as well

and please read the new rules for asking for help
viewtopic.php?f=8&t=1832

so we can test it or it might give us an idea what going on

futurama92
Newbie
Posts: 6
Joined: Tue Jun 30, 2020 7:29 am
Contact:

Re: Why are my bars suddenly not responding to changes?

#5 Post by futurama92 »

# variables for the values

label cocohome:

$ cocobeauty = 35
$ cocohousework = 20
$ cocosex = 15
$ cocointelligence = 75
$ cocolove = 35
$ cocoobedience = 40
$ cocofatigue = 100


# and my bar code

screen cellphone():
add "cellphonezoom.png"
imagemap:
ground "cellphonezoom.png"
hotspot(981, 725, 64, 61) action Show ("cellphoneicon"), Hide ("cellphone")

screen cocoicon():
add "cocoicon.png"
imagemap:
ground "cocoicon.png"
hotspot(58, 46, 121, 126) action Show ("cocoprofile")

screen cocoprofile():
add "cocoprofile.png"
imagemap:
ground "cocoprofile.png"
hotspot(409, 149, 55, 54) action Hide ("cocoprofile")
bar:
value cocobeauty
range 100
xalign 0.335
yalign 0.2817
xysize(200,25)
bar:
value cocohousework
range 100
xalign 0.635
yalign 0.3517
xysize(200,25)
bar:
value cocosex
range 100
xalign 0.635
yalign 0.4217
xysize(200,25)
bar:
value cocointelligence
range 100
xalign 0.635
yalign 0.4917
xysize(200,25)
bar:
value cocolove
range 100
xalign 0.635
yalign 0.5617
xysize(200,25)
bar:
value cocoobedience
range 100
xalign 0.635
yalign 0.6317
xysize(200,25)
bar:
value cocofatigue
range 100
xalign 0.635
yalign 0.6717
xysize(200,25)

nananame
Regular
Posts: 72
Joined: Fri Oct 13, 2017 1:40 pm
Contact:

Re: Why are my bars suddenly not responding to changes?

#6 Post by nananame »

I tried out your code and it showed all bars for me but, of course, I couldn't modify their value. So I modified it a bit.

Code: Select all

label cocohome:
	$ cocobeauty = 35
	$ cocohousework = 20
	$ cocosex = 15
	$ cocointelligence = 75
	$ cocolove = 35
	$ cocoobedience = 40
	$ cocofatigue = 100
This part I left the same although you should really use "default" and declare variables outside of the game.

The only thing I created was the screen with bars:

Code: Select all

screen cocoprofile():
    bar:
        value VariableValue("cocobeauty",100) ###this enables you to modify the bar value "cocobeauty" and the maximum range is 100
        xalign 0.335
        yalign 0.2817
        xysize(200,25)
    bar:
        value VariableValue("cocohousework",100)
        xalign 0.635
        yalign 0.3517
        xysize(200,25)
    bar:
        value VariableValue("cocosex",100)
        xalign 0.635
        yalign 0.4217
        xysize(200,25)
    bar:
        value VariableValue("cocointelligence",100)
        xalign 0.635
        yalign 0.4917
        xysize(200,25)
    bar:
        value VariableValue("cocolove",100)
        xalign 0.635
        yalign 0.5617
        xysize(200,25)
    bar:
        value VariableValue("cocoobedience",100)
        xalign 0.635
        yalign 0.6317
        xysize(200,25)
    bar:
        value VariableValue("cocofatigue",100)
        xalign 0.635
        yalign 0.6717
        xysize(200,25)
Tested. Works. Why your 7th bar didn't appear probably has something to do with styling but this code will work for functional bars.

Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot], bonnie_641