Suggestions for a beginner

ratada

New Member
Dec 2, 2017
6
1
Hello, I have recently developed a strong interest in programming. I have just enrolled on a Python course on Udemy. It sure takes lots of time for me to progress, now that I have no previous experience in the field. The lessons in the course is very good and I am generally satisfied but I feel like I can do more to make use of time with more productivity. I also downloaded Ren'py and started to write a murder mystery game with it but I can't seem to find as many resources for Ren'py as for Python or for other tools. (I also couldn't figure it out yet how to insert Python codes into Ren'py, other than def and flag statements. For example, I wrote a simple criminal record database application with python for my murder mystery game in Ren'py but I have no idea how to put it into the game). I learnt the basics of Ren'py from the tutorial of the Ren'py itself and from it's online documentation, but in other people's games, I see many cool supplements like Inventory, interactive maps, time passing options, etc. and it seems to me these modules have nothing to do with the basics of Ren'py. With the basics the best I could have achieved so far is adding a disclamer screen at the beginning and modifying the main menu. Could you give me suggestions how to improve myself both for Ren'py and for coding in general?
 
Last edited:

79flavors

Well-Known Member
Respected User
Jun 14, 2018
1,583
2,223
[...] I see many cool supplements like Inventory, interactive maps, time passing options, etc. and it seems to me these modules have nothing to do with the basics of Ren'py.
It's very rarely external "modules" and very much to do with the basics of RenPy... it just requires a little more semi-advanced knowledge than purely "basic".
Everything you've talked about already can be done in RenPy without anything except a little extra programming knowledge.

Interactive maps are just a function. Usually using the parameter these days, though older games still use .

Time passing is a difficult one for me to guess at.

If you're talking about day/night cycle of keeping track of the time of day - be it the actual time or simply "morning, afternoon, evening and night"... then generally those are just simple variables. Either a variable to store the hour itself (hour=8 or hour=17 for example) or a variable that equates to the period within the day (0=morning, 1=afternoon, etc). Beyond that, some games will use another variable to keep a count of the number of days the protagonist has been active in-game or go further an implement a proper calendar. Each solution is different, but at the heart of it is just simple variables presented in different ways.

Or you could mean time passing as almost a QTE (Quick Time Event), where sometime happens on screen and the player has a limited amount of time to react. Generally this would be another screen: function, this time a . Which of course is only one possible use. Use of timer: is pretty rare and a timer used in an inventive way is rarer still.

Inventories are a little more complicated, since they require a bit more knowledge about how data can be stored in python. Rather the simple variables (strings, numbers, boolean flags), inventories can usually be stored in arrays (that python calls ). Lists can be a . Beyond that, it depends on how complicated you want your inventory system to be. A very simple inventory could just be a list of items you are holding(stored as strings), with items just added or removed from the list as needed. You can make it more complicated by having a separate array of items, then use that list (items) or update the other list (inventory). Then you get into inventories that have an item count and you're probably going to need to consider using to store the data.
... which is the underlying data. You are probably going to want to show your inventory to the player... and that is just more screen: coding. Probably with grids, imagebuttons and other elements.

My point is that all of these things work natively within RenPy. You could probably make the case that inventories are more python than they are RenPy... but RenPy IS python and implementing inventories doesn't require any specialized knowledge that isn't used by RenPy already.

Links to previous topics covering some of these:

Inventory
Date/Time
Interactive Maps
Random example of Lists being used
Finally...

Whilst the is factually correct and complete, it doesn't really aid a new RenPy programmer very much. Too many solutions are about how something is implemented rather than the actual structure of the language. For example, using focus_mask True in combination with imagebutton: isn't exactly an obvious solution for creating interactive maps... but yet, that is how they are best done. That said, the Quickstart section of section is well worth a read.

Ultimately though, you just have to get your hands dirty. Try to write something... make mistakes and try again. Sometimes that also means recognizing that some features (like inventory systems) are probably too complicated for your level of knowledge right now... write a game, learn the basics... then write the more complicated game as a second game perhaps?
One other solution is to see how other people have done things. There is a lot of crap code out there, written by people copy-pasting solutions that were copy-pasted by someone else who barely knew what they were doing. But when you're just starting out... that's pretty much all you've got.

Here's a post I wrote a while ago explaining how RenPy code is stored within a released game and how to unpack it...
https://f95zone.to/threads/any-way-...e-for-educational-purposes.43156/post-2846032
 

ratada

New Member
Dec 2, 2017
6
1
79flavors, reading your answer, I understand that it's generally more about being able to imagine algorithmes rather than having a deep theoretical knowledge to make the works done? Thank you so much for such a detailed explanation. All these links you shared will occupy me for a long time. Thanks.