Ok, we may have someone new wishing to help with development, we've been chatting in PMs for a while but this info may be useful to Gon and TL as well as it can be applied to any part of the game:
=====================================
Well... interactions are one of the most popular features in sims like WM and base code for that is ready, yet, there is close to 0 content:
Find pyt - screens - grilinteractions.rpy file.
----
Inside there is a label, labels are codeblocks and a major part of RenPy coding system and coding style that PyTFall uses.
All the code inside such a label runs from top to bottom until it jumps to a next label or breaks (either returning you to previous label or ending the game).
----
There is also a screen part and that is the second (and last) part of RenPy/PyTFall coding system. It contains all graphical and user interface elements.
The main difference between the two is that screen part is being refreshed, code being 'reread' from top to bottom in set intervals of time or EVERY time player interacts with the game or any function calls for a refresh. That means all stuff that effects the game is coded into labels and all stuff that is responsible for interactions and displaying information to player is in screens.
------------
Edit: Now that I've read this myself, it should be noted that the main difference between the two is prolly the scripting language
![Smiley :)](https://www.pinkpetal.org/Smileys/DarkB/smiley.gif)
Label uses RenPy label language and screen uses RenPy screen language, it's not really all that important since I will never ask someone to learn screen language cause it is fairly complex but label language has like 10 keywords and just a couple of rules so anyone interested should be able to nail it fast.
------------
This is by no means the only programming style in Python or even RenPy, in fact there is nothing preventing us coding the entire game in pure Python or using any other coding style. This is simply the way I learned from Eliont (Alkion programmer).
==========================================================
What needs to be done:
Every time a button on the right side of the screen is clicked:
![](http://img269.imagevenue.com/loc568/th_561695978_2_123_568lo.jpg)
A line of code is executed:
textbutton "Fuck" action Return(['act','fuck']) minimum(250,30)
It returns a Python List containing two strings (string is programmers lingo for a bit of text): ['act', 'fuck']
There is a codeblock inside a label running a what is called "an infinite loop":
while true:
result = ui.interact()
if result[0] == 'act':
jump('interact_%s'%result[1]) #will jump to whatever the first index of user interaction with game will be.
ui.interact() function will grab the Result of user interaction like pressing a button.
if result[0] == 'act': Means that if the first entry in list that was returned by ui.interact() function is 'act', the following block of code will be executed.
jump('interact_%s'%result[1]) %s was already explained in Tifa's script. It means that game will try to make a jump to a label called "interact_{Whatever the second entry of the list is}"
In our case it will jump to interact_fuck label:
label interact_fuck:
"I'm really not sure about this... "
"I guess if you really want to, it's ok... right? "
$ginterimg = chr.img('sex',resize=(int(config.screen_width*0.794),int(config.screen_height*0.802)), force=false, mode = 'return')
"She did show quite a bit of skill today... maybe she deserves some praise as well? "
$jump('girl_interactions')
Note that we have not disabled the screen so it will keep on running until we tell the game otherwise (Like exiting the entire interaction scenario)
Since you've said that you have already figured out RenPy label language, this new label abides by every single rule and command of that language and is no different from any other label from any RenPy game.
One thing you should know is:
$
ginterimg =
chr.
img('sex',resize=(int(config.screen_width*0.794),int(config.screen_height*0.802)), force=false, mode = 'return')
ginterimg is a simple Python variable. The image that interaction screen displays is set to this variable. That means that whatever you set it to will be displayed on the screen.
chr is the girl we're currently working with, it was set when you picked a girl in the list.
img is the method of sGirl class that displays us pictures from categories, rest is meaningless technobabble, if you want it to be explained fully, feel free to ask but what you need to know is:
$ginterimg = chr.img(
'sex',resize=(int(config.screen_width*0.794),int(config.screen_height*0.802)), force=false, mode = 'return')
Change sex to any other category, like les, profile, quests or any other and game will display a random picture from that category. How categories are created has been explained in previous posts.
What I need you to do is create any amount of scenarios of any complexity for interactions. These can be going out to restaurant, talking about any topics, threatening, praising, sex acts. You can have checks and balances, like for example:
if chr.charisma > 50:
"Do this"
elif chr.charisma < 30: #elif stands for else if...
"Do something else"
else:
"Do some crazy third thing"
You should also give rewards or punishments to girls for interactions:
chr.mod('charisma', 2) will increase charisma by two, -2 will decrease it by two, mod method of sGirl class will ensure that you will NEVER go outside Minimum and Maximum bounds.
If you wish to increase Min or Max themselves:
chr.min['charisma'] += 20 will increase absolute minimum of a stat by 20
chr.max['Defense'] -= 20 will decrease the absolute maximum defense by 20
chr.max['Attack'] = 50 will set the absolute maximum of attack to 50
Some useful things to know (since you don't come from Python background)
= sets something
== checks is one thing is equals to another
+ returns a sum of two values
+= adds two values
Examples:Lets say a girl has 20 charisma:
chr.charisma += 10 will increase the value of charisma by 10, Maximum of a stat can be damned.
chr.charisma + 10 will return a 30, chr.charisma will remain at 20
if chr.charisma == 10:
#do something
Will check if girl's charisma equals to 10 and execute the following codeblock, while:
chr.charsima = 10, will set it to 10, even if it was 20 before.
From here on out, you can create labels like:
label interact_talk:
and create blocks of code in them of any complexity, you should already know how to create menus, all kinds of flags and checks and stat modifiers.
If you have any questions, feel free to ask.