A collection of my personally made simple tutorials! I may reblog other tutorials as well. Sideblog to @pandrena, my art blog.
Don't wanna be here? Send us removal request.
Text
Renpy Tutorial: Making a Character Stand Out
This code can be improved upon, but I was asked whether I could make a code where, like in DDLC, the speaking character will stand out more than the nonspeaking characters.
This code is actually taken somewhat from the documentation here, but I'll explain how to use it and also I've altered it to not be a repetitive pulse. Once again, this code I'm providing CAN be improved upon and the function of it was slapped together in under a few minutes on my end, so please feel free to tweak, remove, or add onto it as you see fit.
transform kermit_speak: on show: linear .20 zoom 1.10
Put the above code BEFORE "label start". This means it will be set up before the game is started.
"transform" means it will be altering the image upon showing it on the screen. This function can be used for animations, and here we are using it to zoom in on the character speaking. "kermit_speak" is what we will use to activate the transform. This is so that we can still use the "Show" command normally, and only involve a zoom-in on the character if we use kermit_speak.
for clarficiation: "zoom 1.10" means how much it is zooming in, when 1.0 is the default. "linear .20" means how fast it will animate.
When using this code, I don't think you actually have to use "hide". Normally, Ren'Py automatically replaces images when you show another in its position (left, right, center, etc.). With this particular example, however, I only have one Kermit image, so it wasn't working for some reason when I tried to change the image. I suppose it was already on "show".
KERMIT "Gosh, I hope I did this rightā¦" show KERM1 at kermit_speak, left KERMIT "This is too much pressure!" hide KERM1 show KERM1 at left show UNOWJOKE at kermit_speak, right JOKER "Isn't there an easier way?"
Put the above code AFTER label start. The video here shows how the code functions for me. Again, this was thrown together in jsut a few minutes, so I may have missed glaringly obvious ways to make it simpler. Do feel free to smooth it out or even just use the code as a basic example.
Thanks for reading!
65 notes
Ā·
View notes
Note
Hi Kermit! I'm unsure if you still use this account but do you know how to change between different lip flaps? I've figured out how to get him to speak in dialogue, but his default speaking is with a smile, which looks kind of odd when there's some scenes he's supposed to be sad and talking with a frown.
(I'll try show what I've done under, not completely accurate because idk how to transfer code to tumbr;)
init -1 python:
def himanimation(event, interact=True, **kwargs):
if event == "show":
renpy.show("him talk") #should something here be changed?
elif event == "slow_done":
renpy.show("him not")
renpy.restart_interaction()
#here I define "him_talk" and "him_talk2"
layeredimage him:
group mouth: attribute not default:
"him mouthclosed"
attribute talk: #this plays normally in dialogue
"him_talk"
attribute talksad: #this one doesn't when I 'show' it... "him_talkagain"
"him_talk2"
label start:
show him with moveinright
him "hello."
show him talksad
him "I'm not that happy today."
hi anon! I'm so sorry for the delay. I'm not 100% sure I can help, seeing as I've never played with lip animations, but I can at least ask if at renpy.show("him talk") , whether it makes any difference if you make it "renpy.show("him_talk") ? I only ask due to that being the only time I can see that you did not add an "_" . Regrettably, aside from that I don't know that I can tell :[ I'm very sorry. I may look into this and see if I can learn more at some point. I hope you found some help to your issue elsewhere, though.
6 notes
Ā·
View notes
Note
How can I change the location/size of the buttons at the bottom of the text box when you first start working on a project (The ones that say "Back," "History," "Skip," etc.)?
I haven't played with this in any of my project personally - not yet, anyway. But I can say those buttons are called the quick menu! I'm not sure how to move them off the top of my head, but I can tell you where to find the code to change the size or color etc
You can find them in gui.rpy - use whatever search function your program has (for atom, its control + F key and thats generally the norm, but might be different for you) for "quick_button". After finding the gui.quick_button definitions through this, you can edit their size, color, etc.
I again am not entirely sure how to shift their location - you may need to play around in screens.rpy for that, and I'm not as knowledgeable in screens. Thank you for asking, and I hope I could help at least a little bit!!
5 notes
Ā·
View notes
Note
Hello, I would like to know how to put the first name, I know it sounds silly, but I am learning programming now and codes are a kind of "new language" so to speak.
hey anon! This is way late but Iām not entirely sure what youāre asking. But if you just mean like...Putting the name of the character into the game, then I can show you! The documentation also explains this, and the game starts with it as an example when you make a new project.
Basically, just do your code like this, prior to ālabel startā...
define KERMIT = Character ("Kermit")
This definesĀ āKermitā as the name of a character, and the name that will show when they speak.
To show text spoken by this character, you then use the defined term and write your dialogue from there. In our case, KERMIT is our definition, and it is what activates our characterās speech.
KERMITĀ āGosh, I hope I did this right...ā
It then displays like so in the game:
Itās probably a better idea to use a shorter definition for the character - E.G., we could have writtenĀ āKermā or even justĀ ākā and it still would have shown as his name, as long as it said Character (āKermitā) to say his actual title.
define k = Character (āKermitā)
kĀ āGosh, I hope I did this right...ā
The above code would work as well, basically.
I hope this helps you or anyone else!
14 notes
Ā·
View notes
Text
pinned - welcome all!
My name is Kermit and here is a blog I post tutorials on and help troubleshoot / share codes with people. If you have any specific requests, you can send in an ask (although I may not have the full answer!)
Please note Iām absolutely not a renāpy expert, nor am I very skilled with complex python or coding in general. This blog is more than anything just my attempts to help people who are confused by the documentation, which I personally feel can come off as vague or confusing if you donāt know the first steps to take. I have no association with the actual creators of the program.
Hereās some links!
Renāpy Visual Novel Engine HomepageĀ
Official RenāPy Documentation
Currently (9/20/22), I work in RenāPy 8.0.1 and all codes as of this date are used in that build. However, my posts prior to 2022 use codes from older builds and may or may not work as of RenāPy 8. If you need new stuff, let me know!
I have my own visual novel over on @sevenplayers if youāre interested in seeing my own work. My personal art blog is @pandrena to which this blog is a side blog.
Thank you for reading!
13 notes
Ā·
View notes
Note
Just came across your blog and just wanted to say thank you for making all of these posts! It's very nice of you to do this, but remember to take time for yourself/Self Care even if you have a buncha requests you feel like you have to get done right then and there
this is an incredibly late response but as this is a very incredibly sweet message I didnāt want it to go unanswered. Thank you so much for your kindness :ā] Iām not a coding expert and a lot of what I say here is just paraphrased from the documentation to be a little clearer, but if it helps anyone at all I do intend to continue doing it now that Iāve picked it back up.
I hope you are well, friend, and that your days are very bright <3
3 notes
Ā·
View notes
Note
Hi hi! I don't know if you can help because no one else has but if you do i would really appreciate it! You'd be saving the last of my sanity haha. So i want to have an animation basically where my character shakes from side to side to show she's panicking. Unfortunately i really new to coding and suck at it <3 So i havent been ableto figure it out! It's okay if you can't help of course. I hope you have a wonderful day/night!
hello hello anon! I'll do my best! Sorry for such a delay.
I believe it should be simple enough. I think all you need to do is create a transform/animation (ATL) that will cause her to move side to side.
In the past I believe I went into something like this, but this specific code should do what you want:
I'll put the actual code under the cut, but this is what it looks like in the editor.
To show the image:
show KERM1 at kermit_tremble
If you want the image at a certain part of the screen, e.g in the middle, then say this with your preferred alignment:
show KERM1 at kermit_tremble, center
Aaand upon showing the image here's what it does.
Under the cut I'll put the code to copy/paste. I will also explain a little about each part of it.
transform kermit_tremble: on show: yalign 0.0 linear 0.12 xoffset 4 linear 0.12 xoffset -4 linear 0.12 xoffset 4 linear 0.12 xoffset -4 repeat
Please note I couldn't figure out how to align this nicely on tumblr's formatting, but make sure it aligns right like the picture of the code does. pressing the TAB key in front of the code while in your editor should indent it properly.
for a small explanation of the code:
yalign = this is the vertical alignment of the picture. At 0.0, it's at the bottom of the screen. ( NOTE: This part may or may not be an unnecessary part of the code - for whatever reason, it kept putting my kermit picture in the middle of the screen, which is why I added this bit. But if you donāt find this required in your code, to keep your sprite positioned, donāt worry about keeping it.)
linear = this is amount of time it takes for the transition/animation to happen. ālinear 1.0ā³ would be a second if we used it. You can make the speed of the animation longer or shorter by altering the number after it.
xoffsetĀ = this is an offset from the horizontal alignment. This means we are inching the image a bit to one side horizontally. You can edit this to be a bigger or smaller amount of shaking by increasing or lowering the number after it.
repeat = ...Well, it repeats the code so that she keeps shaking until her image goes away for the next dialogue.
I hope this was of help to you anon,Ā and if not then I hope you found your answer anyway. Again, Iām sorry I didnāt get to this faster!
39 notes
Ā·
View notes
Note
Hey dude! I'm trying to figure out the following: I put 4 options to a menu that a player can choose from, but when certain criteria met (For example, player has chosen 3rd option) a 5th option appears. Is this possible? I'm trying to do it with flags and such but I can't find a solution so far, please help me if ya have ideas and\or time! Cheers!
Iām not sure whether you mean an in-game menu or a GUI navigational menu? If assuming youāre talking about an in-game menu, then it should be able to be done by looping back around to the same label and using a conditional statement
I do something similar in my game, Seven Players. Initially, there are only two options, and when a character has their fish food, they are given another choice. This is a very messy explanation and I apologize, but Iāll do my best.
Note, please donāt use this code exactly in your projects, because it is from my own game. You can reference its mechanisms however youād like though.
label fishfedd:
Ā Ā show screen overlay_scr
Ā Ā #decides if the player can go to the barn after feeding the fish
Ā Ā if FedFish == False: Ā Ā Ā Ā menu: Ā Ā Ā Ā Ā Ā UNOW "( Go where? )"
Ā Ā Ā Ā Ā Ā "( Barn )": Ā Ā Ā Ā Ā Ā Ā Ā UNOW "I'd better feed the fish first, before I forget! I don't want them staying hungry..." Ā Ā Ā Ā Ā Ā Ā Ā jump fishfedd
Ā Ā Ā Ā Ā Ā "( Shed )": Ā Ā Ā Ā Ā Ā Ā Ā if fishfood_had == True: Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā UNOW "I already have the food. There's no point in going back to the shed right now." Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā jump fishfedd Ā Ā Ā Ā Ā Ā Ā Ā else: Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā jump fishshed
Ā Ā Ā Ā Ā Ā "( Pond )" if fishfood_had: Ā Ā Ā Ā Ā Ā Ā Ā jump fishfedd2
this code is kind of complicated in my example, but to put it simply: the initial label ( fishfedd ) shows my menu WITHOUT the third option ( āpondā )
Once the player has obtained the fish food, I use:
$ fishfood_had = True
jump fishfedd
with fishfood_had = True in play, I have the option to return to the pond, so I get another option. I use the jump action, then, to send me back to the first label and thus the first menu that showed up.
In steps: I make a normal menu with all my options.
menu:
Ā Ā Ā Ā Ā UNOW "( Go where? )"
Ā Ā Ā Ā Ā "( Barn )": Ā Ā Ā Ā Ā Ā Ā UNOW "I'd better feed the fish first, before I forget! I don't want them staying hungry..." Ā Ā Ā Ā Ā Ā Ā jump fishfedd
Ā Ā Ā Ā Ā "( Shed )ā: Ā Ā Ā Ā Ā Ā Ā Ā Ā jump fishshed
To add on the third option, I addĀ āif fishfood_hadā to the option prior to its action.
Ā Ā Ā Ā Ā "( Pond )" if fishfood_had: Ā Ā Ā Ā Ā Ā Ā jump fishfedd2
This way, the menu plays the third option ONLY if fishfood_had is True.
Iām not entirely sure how helpful / simple this is, but if nothing else you have the code. Thank you for the ask and I hope you got your answer looong before I was able to get to it :ā]
7 notes
Ā·
View notes
Text
Maaaany many apologies that I havenāt been using this blog! For a long time I was not confident in my renāpy coding, you see, because Iād fallen out of practice. Iāve been picking back up my own project @sevenplayers though, so I guess itās fine to get back into trying to use this blog. I have 28 asks in the inbox, and while theyāre all like months old I may try and answer them regardless simply to add to the list of codes/advice/etc people can use.
Iāll hop to that then shortly, at least as long as I can! Thank you all for still interacting with this blog even though itās been so dead for , like, 2 years :ā]
EDIT: Also! Iāve upgraded to RenāPy 8.0.1 and I donāt know if all my codes will still work, so apologies if they do not.
4 notes
Ā·
View notes
Text
hello all!
Iām so, so, so sorry for vanishing. I have a lot of messages and questions and Iāll do my best to answer the ones I can, even though Iām months late.
School is going to be kicking my butt soon, so Iām afraid I canāt promise anymore activity than Iāve been able to give so far lately, but Iāll try to not let messages pile up like this again. I also canāt promise super advanced coding help, but Iāll help where Iām able.
Also, thank you for 200 followers!
11 notes
Ā·
View notes
Note
Hi! I have a little question :( Is there any option in Ren'py where I can make the player choose between two characters to start the story? or something like that? Thanks!
Hi! If you already found your answer, then Iām glad, but if not, my apologies for making you wait!Ā
Do you mean like a character select screen? I have a script that may work, as in my gameĀ āSeven Playersā you can do that. However, the way itās done in Seven Players is a bit more complex, and you can do it a lot easier with menus.
Respectively, the firstĀ ājumpā item jumps to Kermitās route. This can be in a different file labeled as a new route, or a different section of your main script file. The same happens withĀ āawkward,ā when you choose to go with Elmo.
If youād like to have the player select between pictures, I can share the Seven Players method in a separate post for you as a full tutorial!!Ā
21 notes
Ā·
View notes
Note
Heya! I recently changed my font and I noticed when I wrote some dialogue (ex. "How are you?") the quotation, question, exclamation marks and so forth around the text disappear and have an empty space (ex. How are you ). I changed the font back to "DejaVuSans" and everything works perfectly fine! I was wondering if you know how to fix this problem? (please tell me there is cus i don't want my font to remain that boring font lmao) Thanks!
Hello! I can think of a few reasons this might happen, butĀ ād probably need some clarification to figure out which it is:
Have you tried another font besides the one youāre trying to use? If it shows up that way for every font except DejaVuSans, it may be something with your code, in which case Iād need to see it.
Ā Otherwise, I know fonts can be pretty picky and not always include all the symbols in their numbers/letters. Other times, Renāpy has disliked my fonts and made things like theĀ ā key into squares.
6 notes
Ā·
View notes
Text
Renāpy Tutorial - Letting Players Choose Pronouns
Letās start from the beginning, and allow me to link you to this page: Ā Variables/Flags . It explains a bit about what weāre working with.
Also! This was requested by @fantrash-and-mediocre-moe-ismsā and @galoshes
Heya! Not a bother at all! The last post wasnāt really a full tutorial, so Iāll make one now, though Iāll still use some images from that original post. First off, I did miss a step in that post.
When making variables you have to define them either after label start, or before. Keep in mind, in this case we need to put them AFTER Label start - This is important. If we were t put them before, it would likely reset the pronouns chosen in your playerās save every time they open the game.
Also, when making the variables to begin with,you need to give them a default - eg, we automatically make new players they/them until further notice. In other cases, this is a true/false situation (literally switching the variable on and off, ātrue or falseā,) but weāre not using true/false here.
Read more below this cut!
Now, when it comes time to choose your pronouns in the game...Your code might look something like this. Itās a four choice menu for choosing whether you want masculine pronouns, feminine, neither, ect.
Which, in-game looks like this:
After the player has chosen their pronouns, using %(pronoun#)s, with # being the number corresponding to any of the 3 pronoun variables you defined, you can put their chosen pronouns wherever you want.
In our caseĀ Ā %(pronoun1)sĀ is he/she/they/etc,Ā Ā %(pronoun2)s is him/her/them/ect., andĀ Ā %(pronoun3)s is his/her/their/etc.Ā Truthfuly, you can assign them anyway you like in whatever order, but thatās just the formulaĀ I go with.
You can call the pronouns from then on. Now, as long as weāre on the subject ofĀ pronouns, what about the player choosing their own entirely? Itās exactly how you let the player choose a name. You can read about it here.
Now, in our case, we want not a player name, but to let the player input their own pronouns.
In game, that looks like:
ect. The player can now type in their own personalized pronouns.
Yay!
Now, I canāt promise there wonāt be bugs with all this, Iād like to say that now. I havenāt looked 100% into functioning and convenience in the game, but this is one way to at least set it up. You may someday fiddle with the codes Iām giving and find an easier way.Ā Iām still learning RenāPy, so if thereās errors, let me know! Iāll do better in the future. I hope this was clearer than my last post, and that it works this time!
145 notes
Ā·
View notes
Note
Hi! Er, any advice on how to code a mouse/computer, or a mini game in?
Very sorry it took meĀ a while to get to this! But can you clarify what you mean?
If youāre talking about, like...Making a screen in-game thatās an interactive computer I can try and help with that!
6 notes
Ā·
View notes
Note
Hey! Renpy give me a lot of trouble with images, so whatās the recommended sizes for sprites and backgrounds? Also, is there a way to move sprites up and down bc mine end up hovering too far up and you can see where the cut off. Thanks!
Hello! I know a lot of people with issues with images, so Iāll express my reccomendations.
If you canāt see the image for whatever reason - Basically, Renpy gives you a choice of resolution, and I reccomend following the dimensions of the project to decide on background size and sprite size. I use 1280x720, so my backgrounds are all 1280x720, and my sprites are 720 in canvas height. This way, no blank spots are shown. You could probably make the background bigger than the project, but itāll cut off more of the image, If I remember correctly...
Iām not sure what you mean by the second question, though, im sorry! Are you asking how to move sprites, or like, position them so they donāt cut off? (In which case following 720 height should help that.)
45 notes
Ā·
View notes
Text
Heya! Quick notice
Iām going through some personal things lately, so I haventā gotten much chance to work in renpy, but i appreciate your guysā patience!! i have many things overdue to get to : (
1 note
Ā·
View note
Note
Ah hey! I want to have many different endings at different times in my game, like certain ones end the game early, but my script is a little messy, I was wondering if there is an easy way to keep endings and general script tidy and easy to manage? Iāve been using the Call function as I put labels for scenes and endings in folders named as the character they are for. Uhhh thank you!
heya!!Ā Unfortunately, Iām a very unorganized person who tends to work better without like, being tidy, but I also canāt work if its a pigsty, so I guess I could give some tips? Depends on how youre organizing it right now, though. You may already be doing it neater than me xD
Though what my setup is is generally just. Have a lot of different script files that I jump to depending on the type of scene or route. EG, in Seven Players, I have a script per card game, because itād look messy and confusing to me to shove a bunch of variables andĀ āifā statements into one game to determine which card game itās playing.
I do a similar thing with endings - I have a script available for the ending, by itself. I donāt actually put a lot into the main game script, if Iām honest. Thatās more of myĀ āsetupā file.
Again, this is just how I do it, and maybe your way is neater xD
This post is open for others to reccomend things to this asker, too! Help a fellow renpy dev out <3
8 notes
Ā·
View notes