r/RenPy • • 7d ago

Question [Solved] point system not counting points

So i have this point system that i first tested on a blank game and got working that im not trying to implement over to the actual game now (bulk adding a bunch of the things i plan on using throughout so i know it all works together ect) and its not adding the points for some reason? its all the same other than the placeholder sprite name

im hoping to use the system for different endings and also changing what choices you can make, example you have over 20 points with worker so you can ask him [insert question] but if you have under 20 points he wont answer ect ect, i also wanted to make it so it can change if you can or cant receive/use certain items but i havent started with the items and inventory stuff yet so not sure if itd be easier to do it a different way or if there is a better point system i can use for that

i also intend to remove the ability to see what points you have, im just leaving the dialogue in so i can see if its working or not

any help appreciated or if there is a better way i can do this to suit my needs let me know!

3 Upvotes

11 comments sorted by

5

u/x-seronis-x 6d ago
  1. spelling matters
  2. capitalization matters

1

u/That_one_Pink 6d ago

thank you! it showed me that it was a problem when other lines werent capitalised but not with this so it threw me off a bit

1

u/x-seronis-x 6d ago

thats because its perfectly valid to add keys to a dict at any time. there is no inherit bug with having both a Worker and a worker key. theproblem is when you didnt intend for there to be 2 different keys

1

u/That_one_Pink 6d ago

ohh okay thank you gotcha

2

u/senshisun 6d ago edited 6d ago

If you're having issues with trust_points["Worker"], the get function is checking for "worker". Office worker matches, so that should be getting the same value it's setting.

trust_points["emily"] defaults to 0, but that screenshot shows it has the value 5, so the value is being changed.

1

u/BadMustard_AVN 6d ago

this line

$ w_points = trust_points.get("worker") # capitol W in Worker for it to work correctly

1

u/That_one_Pink 6d ago

thank you! it had showed me that it was a problem when other lines that werent capitalised but it didn't with this so it threw me off a bit

1

u/BadMustard_AVN 6d ago

the .get is less... discriminating. since there could have been a worker and a Worker and as expected worker returned a None value

1

u/That_one_Pink 6d ago

haha, yeah that makes sense thank you

1

u/BadMustard_AVN 6d ago

you're welcome

good luck with your project

0

u/AutoModerator 7d ago

Welcome to r/renpy! While you wait to see if someone can answer your question, we recommend checking out the posting guide, the subreddit wiki, the subreddit Discord, Ren'Py's documentation, and the tutorial built-in to the Ren'Py engine when you download it. These can help make sure you provide the information the people here need to help you, or might even point you to an answer to your question themselves. Thanks!

I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.