I know.
You are right.
What you say is perfectly understandable.
But I have already tried to learn alone by the past without much success.
I have even spend some decent money for individual classes in Python, a teacher was coming in my home and explain me what a Python class is, object, list, mother class, etc. I tried to understood the basic of Python langage. I learn some useful stuff but I lost my motivation after burning my eyes on codes too hard for me or on the way to incorporate Python codes in renpy.
About this topic and my current matter, I tried again. In here for exemple :
https://developmentality.wordpress.com/ ... in-python/
https://www.mkyong.com/python/python-ho ... ictionary/
https://stackoverflow.com/questions/329 ... -for-loops
Still without much success...
And you said something which is really interesting about the way I work :
instead of just recycling code snippet with no real understanding of what they're doing.
But unfortunatly this is the only way I know to learn and gain coding knowledge.
Because I am not a scholar or a scientist, I am an artist.
So my way of progressing is not to learn something from the begining to the end in the right order, I progress through experimentation of existing working piece of code.
Because I don't enjoy so much writting complexe coding just for the pleasure of coding.
I am coding for an artistic purpose.
I use code snippet and recycle them for a dedicated purpose. I work a lot on my little code snippet to adapt it to my project. Once it's working, I am able to reproduce it by myself and I gain a little bit more knowledge.
It's like when you learn a new spoken langage like Italian for exemple.
Some people will hardwork studies italian grammar books and gain a lot of knowledge and vocabulary in italian throught book lesson and intellectual learning.
But my way of being is : as soon as I have some elementary basis, I will try to speak with a real Italian in order to progress and enjoy speaking at the same time. Even if iam just begining and don't have much vocabulary. But even if the conversation will be ridiculous and akward, I will learn from the italian and gain experience in italian langage.
So to come back to the matter we are talking about :
I understand how dict works, but I have not tested it yet because I don't use Python compilator alone, I use directly Renpy.
So one of my main difficulties is to integrate Python portion of code inside a Renpy code that I don't understand.
When I understand my Renpy code, it's easy to integrate Python in it. But when I don't even understand the portion of Renpy code I am using this is really frustrating lol
I tried some stuff without much result.
And I dont find any tutorial online who deal with Python dict and Renpy at the same time.
So, once again, I had to become a CODE SCAVENGER.
I dig around in order to find an existing code I could stole and recycle and I found this :
Code: Select all
init python:
cust_masterD = {"CGC1":"A Close Shave", "CGC2":"Bloody Angelo", "CGC3":"The Depression",
"CGC4":"Unrepentant Grifter", "CGC5":"Redemption", "CGC6":"Last Call"}
grey = "#666666"
yellow = "#FFFFCC"
image end_title = Text("Major Ending Variations Achieved", color="#FFFFCC", size=44)
screen endings():
# This ensures that any other menu screen is replaced.
tag menu
# Include the navigation menu.
use navigation
vbox:
spacing 25
ymaximum 500
yalign .02
xalign .5
add "end_title":
xalign .5
yalign .02
frame:
background None
vbox: # Or viewport or anything else you like
yalign .02
frame:
label "Customer Variations":
text_color yellow
frame:
background None
add "top small":
xalign .5
frame:
has vbox
for k, v in cust_masterD.items():
if k in persistent.end_set:
text("{color=[yellow]} [v] ")
# assumes that you have colors as variables and
#strings representing the endings.
else:
text("{color=[grey]} [v] ") # Not yet
#achieved, same conditions as above apply...
So please tell me if you think I can manage to adapt it to my needs.
I think the part I should be interested in is this one :
Code: Select all
frame:
has vbox
for k, v in cust_masterD.items():
if k in persistent.end_set:
text("{color=[yellow]} [v] ")
# blablalba1
else:
# blablalba2
And modifiying in something like this :
Code: Select all
$ my_achievement_dict = {"game_over": "Death come for us all achievement", "first_boss": "Killed the first boss"}
$ persistent.achievements = {}
______________________________
frame:
has vbox
for k, v in my_achievement_dict.items():
if k in persistent.achievement:
text("{color=[yellow]} [v] ") My achievement is display in grey because it's unlocked
# blablalba1
else:
text("{color=[grey]} [v] ") # My achievement is display in grey because it's still locked
# blablalba2
What do you thing about this my patient friend ?