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.
Anya is live and ready to show you everything. Watch her strip, dance, and perform exclusive shows just for you. Interact in real-time and make your fantasies come true.
ā Live Streamingā Interactive Chatā Private Showsā HD Qualityā Free Actions
Free to watch ⢠No registration required ⢠HD streaming
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.
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.
Not quite a tutorial, but hereās a fun fact:Ā I found out today itās very, very easy to make a game where the player can choose their own pronouns and have them used in game. You know how flags/variables can be used for inserting a playerās own name? Same thing for pronouns. EG What I did in my wip game here was:
Itās neat stuff, and very easy to do. So then in game I just go
Using %(pronoun#)s, with # being the number corresponding to that word.
So yeah! To those worried about adding choices like this, where you think you might have to rewrite every route just to fit pronouns - thatās not so!
Make a Simple Renpy Game #2: Setting Up, Defining Images/Backgrounds, Show/Hide/Scene Commands
Welcome to my second tutorial! You can find the first tutorial here!
I hope to explain a bit about Renpyās functions with this, without going too indepth yet. Note this is LITERALY step by step, with images included. So! Expect to see mundane stuff here and there, you can skip it if you know those bits already. This tutorial is designed for those with NO knowledge of the program, or coding. So I gotta keep itā¦Ya knowā¦simple.
When you open Editra up again, weāll find ourselves like this.
Pretty much, this is where we left off. But hey, Kermit wants some images to do things with, doesnāt he? First, weāll have to make images, of course. Now keep in mind, I wonāt tell you how to draw, but Iāll give you some tips on drawing for renpy games.
A commonly asked question is - what are the sprite dimensions? Well, thatās really up to how big your sprites are and the resolution of your screen, but generally, if weāre using the resolution ofĀ 1280x 720, which is what Iām using for this tutorial, weāll need a height of 720, and the width will depend on...well...how wide your sprite ends up!
For an art program PSA: You donāt need anything fancy, but make sure your program supports transparent pngs!
So here I am, in Clip Studio Paint. Letās draw ourselves a Kermit sprite! NOTE: You can keep the eyes and mouth/ect on different layers if youād like to use different expressions later, but for right now, I just am using Kermit. Flat.
@ kermit youre doing amazing sweetie
Now we wanna save this in our visual novel /images directory.Ā Itāll be located in your visual novel directory, in your gameās folder, in /game, and /images. So basically as seen below, but with your own directory!
there he is...
Now! Remember how we defined the characters?
Next up, weāre defining the image we just made, so that Renpy will recognize it. Instead ofĀ ādefineā, though, weāre usingĀ āimageā
Basically, the format here isĀ
image [name youāll type to make the image appear] =Ā āfile name.pngā
.png can be replaced by whatever filetype you used.
Next, weāll need to have Kermit pop up in game. He wonāt do it automatically when his dialogue pops up. Letās encourage him.
Thatās where the show command comes in. Itās pretty easy, you can use their placeholder default as an example! Iāll change this toĀ āshow kermitā since thats the name I chose to write for my pic to pop up. PS: Whether your chosen name is capitalized or not matters!
Letās test!
No worries, Kermit. We know exactly how to get you out. We just have to typeĀ āhide kermitā instead ofĀ āshow kermitā, and youāll be on your way! Make sure to put the hide command exactly where you want Kermit to disappear at.
Test again!
You can pretty much hide or show images whenever you want!Ā Oh, Kermitās back, using theĀ āshowā command once more.
Oh! Right! I did say Iād show that in this tutorial. Well, thankfully, defining backgrounds is exactly the same process as defining your character images! You need to put them in the images directory again, AND you need to make sure theyāre the height and width of the game screen. so 1280 x 720 in our case. The only difference in how you use backgrounds, is how you SHOW your background! You need to use the SCENE command!
So next up, letās define our background.
Personally, I am too lazy to draw a new background, so iām recycling a background used in my @sevenplayers game! The antique shop.
Making sure your background is in the image directory, itās time to make it the actual BG of the scene! Find where the game by default saysĀ āscene bg room.ā Itāll be before Kermit actually appears.
Now, changeĀ āscene bg roomā intoĀ āscene antiqueAā or whatever you named your image, remembering that capitilzation matters.
Now letās TEST!
yep! Next time, Kermit!Ā
Thanks for reading!Ā I hope this helps someone out, and if you have any questions, send them my way! <3 Sorry if this one was a bit more difficult than the last, Iām trying to take it slow, but thereās still a lot to remember and learn.
Anya is live and ready to show you everything. Watch her strip, dance, and perform exclusive shows just for you. Interact in real-time and make your fantasies come true.
ā Live Streamingā Interactive Chatā Private Showsā HD Qualityā Free Actions
Free to watch ⢠No registration required ⢠HD streaming
hey! idk if this blog is new or inactive, but the very few posts on here are really helpful! i have a question - how do i let the player type things (like a name) in? ive tried so many things but i keep getting error messages.
Hi! Itās been kinda inactive but Itās still around, and while renpy hasnāt been my main focus lately in my projects, (just been doing other things), I certainly can give helping you a try with this! I guess first off, what have you tried and recieved an error with? The cookbook wiki gives you this. To work with it is pretty much straightforward with that code. Just pasting it where you want it to go, and then you can have people call them by the name.
Generally, it is possible to put more than a name in, too! I tested this very quickly, though beware of possible errors, but it gives you a general idea. This can also be used if you have to name the character a certain thing to proceed or get a secret.
Sorry if this isnāt detailed enough or confusing! I actually have a headcold and may not make that much sense however, if you have any errors or further questions please ask! Iām here to make tutorials and to troubleshoot.
If you did all this and thatās how you got the error, though, can I see your crash log and or the error youāre getting? It may point me in the right direction.
Also. How do I make scenes fade smoothly between each other?? I'm currently using 'scene black with dissolve' but that seems to only work for showing the chapter titles bc when I use it elsewhere it causes the dialogue box to kinda flicker and not fade in then out properly. Idk maybe I'm just using it in the wrong place or something??
my time has come.
okay maybe not, in reality you can just useĀ āwith fadeā instead ofĀ āwith dissolveā to make the scene transition smoother. but as long as im talking abt transitions i might as well explain that you cant use fade with images unless you want the screen going black every time a character appears :( so ill talk about that below
To put it simply, you have to make the transition smoother yourself for character images. Dissolve is...bad. Well, not bad, but its not as smooth as one wants. What you need isĀ āBasicFadeā or literally just...This code!
transform basicfade: Ā Ā on show: Ā Ā Ā Ā alpha 0.0 Ā Ā Ā Ā linear 1.0 alpha 1.0 Ā Ā on hide: Ā Ā Ā Ā linear 1.0 alpha 0.0
Transforms are p much used to manipulate images ect. You can actually nameĀ ābasicfadeā to anything you want, but I just use the code provided by..IĀ think the cookbook on the wiki site? Not sure. And anyway, itās easier to just call it basicfade. Pretty much it just fades your images in and out.
the only part ya gotta know is where to put it, and for tutorialssss sake Iāll say it has to go before theĀ āStartā label. its more of an initialization thing than a thing you just. put in somewhere mid game dkjgn
ANYWAY I KNOW U WERE JUST ASKING ABT SCENES BUT I SAW OPPORTUNITY AND GRABBED IT
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!