Actual guides?

Discuss how to use the Ren'Py engine to create visual novels and story-based games. New releases are announced in this section.
Forum rules
This is the right place for Ren'Py help. Please ask one question per thread, use a descriptive subject like 'NotFound error in option.rpy' , and include all the relevant information - especially any relevant code and traceback messages. Use the code tag to format scripts.
Message
Author
User avatar
Sarchalen
Regular
Posts: 29
Joined: Tue Aug 08, 2017 5:23 pm
Projects: Sugawara Chronicle
Contact:

Re: Actual guides?

#31 Post by Sarchalen »

Honestly a BIG part of developing in Renpy is breaking down the code that's given to you and trying to figure out how it works. Actually that's not just Renpy, that's pretty much any SDK. It's rare to have a guide that explains exactly how do do something, because there are about a million different ways of doing something with a million different outcomes. It's impossible for a textbook writer to account for anything and everything a programmer might want to do. That's why we're programmers, we get creative with it.

In this case, PyTom has come out with a guide that pretty well explains what his code is doing. When you want to make your own code from scratch? That's going to take some python knowledge. That's not necessarily hard to get, you can probably pick it up just by messing with Renpy for awhile. But you can't expect that every little thing, like how to make a button, will be explained in the guide, because theres so many different ways to make a button. How could they know what you're making?

User avatar
trooper6
Lemma-Class Veteran
Posts: 3712
Joined: Sat Jul 09, 2011 10:33 pm
Projects: A Close Shave
Location: Medford, MA
Contact:

Re: Actual guides?

#32 Post by trooper6 »

Also? The Tutorial and The Question have open code and is available through the Renpy Launcher. Also, looking at the screens.rpy file in a new project will teach you a lot. In addition to the documentation, looking at the code of those two things will teach you a lot. There are other games that keep their code unarchived. I learned a lot by looking at codes from those games. That is also a way to learn things.
A Close Shave:
*Last Thing Done (Aug 17): Finished coding emotions and camera for 4/10 main labels.
*Currently Doing: Coding of emotions and camera for the labels--On 5/10
*First Next thing to do: Code in all CG and special animation stuff
*Next Next thing to do: Set up film animation
*Other Thing to Do: Do SFX and Score (maybe think about eye blinks?)
Check out My Clock Cookbook Recipe: http://lemmasoft.renai.us/forums/viewto ... 51&t=21978

Zherot
Regular
Posts: 91
Joined: Tue Aug 08, 2017 9:10 pm
Contact:

Re: Actual guides?

#33 Post by Zherot »

Sarchalen wrote: Sat Aug 12, 2017 10:39 pm Honestly a BIG part of developing in Renpy is breaking down the code that's given to you and trying to figure out how it works. Actually that's not just Renpy, that's pretty much any SDK. It's rare to have a guide that explains exactly how do do something, because there are about a million different ways of doing something with a million different outcomes. It's impossible for a textbook writer to account for anything and everything a programmer might want to do. That's why we're programmers, we get creative with it.

In this case, PyTom has come out with a guide that pretty well explains what his code is doing. When you want to make your own code from scratch? That's going to take some python knowledge. That's not necessarily hard to get, you can probably pick it up just by messing with Renpy for awhile. But you can't expect that every little thing, like how to make a button, will be explained in the guide, because theres so many different ways to make a button. How could they know what you're making?
The guide is pretty bad like i said and i already explained why, you are confusing what i am saying, what i am saying is that there should be a guide on how to actually code the things that Renpy does, like showing the actual structure of each function, that is not complicated, when you say it is impossible because everyone reaches different solutions in a different way you are misunderstanding everything i said.

Zherot
Regular
Posts: 91
Joined: Tue Aug 08, 2017 9:10 pm
Contact:

Re: Actual guides?

#34 Post by Zherot »

trooper6 wrote: Sat Aug 12, 2017 10:50 pm Also? The Tutorial and The Question have open code and is available through the Renpy Launcher. Also, looking at the screens.rpy file in a new project will teach you a lot. In addition to the documentation, looking at the code of those two things will teach you a lot. There are other games that keep their code unarchived. I learned a lot by looking at codes from those games. That is also a way to learn things.
While i understand that seeing others code can help you it still will be imposible for most people, why?, simple if you don't know the actual structure of what you are seeing you can not see why are some things in there and why they are in that order or why they are placed in that manner, go back and check the documentation?, yeah good luck with that because the documentation doesn't explain any structure whatsoever of any function and it is really vague on most things, you will end up asking someone else for help.
Last edited by Zherot on Sat Aug 12, 2017 11:31 pm, edited 1 time in total.

Zherot
Regular
Posts: 91
Joined: Tue Aug 08, 2017 9:10 pm
Contact:

Re: Actual guides?

#35 Post by Zherot »

Nero wrote: Sat Aug 12, 2017 10:19 pm You should use tooltips for that here I made example for you is this what you wanted?

Note: "bob.png" put any small test image to your game directory so you can see it running. I hope this helps

Code: Select all

screen image_to_display:
    add "bob.png" xalign 0.500 yalign 0.500
screen image_to_display2:   
    add "bob.png" xalign 0.500 yalign 0.550
screen image_to_display3:       
    add "bob.png"xalign  0.500 yalign 0.600  
    
screen tooltip_test:

    default t1 = Tooltip("")
    default t2 = Tooltip("")
    default tt = Tooltip("")
    
    
    vbox:
        xalign 1.000
        yalign 0.500
        textbutton "One.":
            action Return(1)
            hovered tt.Action("I will be displayed in line with texbuton!."), Show("image_to_display")
            unhovered Hide("image_to_display")
        textbutton "Two.":
            action Return(2)
            hovered t1.Action("I will be displayed in line with texbuton!."), Show("image_to_display2")
            unhovered Hide("image_to_display2")
            
        textbutton "Three.":
            action Return(3)
            hovered t2.Action("I will be displayed in line with texbuton!"), Show("image_to_display3")
            unhovered Hide("image_to_display3")
            
    text t2.value xalign 0.900 yalign 0.550            
    text t1.value xalign 0.900 yalign 0.500            
    text tt.value xalign 0.900 yalign 0.450
            
# The game starts here.
label start:
   
    "Game starts show buttons after next click!"
    show screen tooltip_test
    "Game ends!"
Thanks Nero i will check the code later and mess a bit with it, i'll let you know if something comes up, thank you again.

User avatar
Sarchalen
Regular
Posts: 29
Joined: Tue Aug 08, 2017 5:23 pm
Projects: Sugawara Chronicle
Contact:

Re: Actual guides?

#36 Post by Sarchalen »

A guide for coding the things that Renpy does? You mean besides the fact that they give you the actual code? You don't get a much better guide than someone handing you a piece of code that already works.

What you're asking for? A step by step walkthrough of the structure of Renpy? As far as I know no such thing exists. You pretty much have to learn by example.

Zherot
Regular
Posts: 91
Joined: Tue Aug 08, 2017 9:10 pm
Contact:

Re: Actual guides?

#37 Post by Zherot »

Sarchalen wrote: Sat Aug 12, 2017 11:32 pm A guide for coding the things that Renpy does? You mean besides the fact that they give you the actual code? You don't get a much better guide than someone handing you a piece of code that already works.

What you're asking for? A step by step walkthrough of the structure of Renpy? As far as I know no such thing exists. You pretty much have to learn by example.
Obviously you can't understand what i'm saying so please just leave because you are clearly not here to help but to start an attack, i tried to explain myself to you and you can't or refuse to understand.

I'm here to learn not to fight with you, so leave.

Zherot
Regular
Posts: 91
Joined: Tue Aug 08, 2017 9:10 pm
Contact:

Re: Actual guides?

#38 Post by Zherot »

Hey Nero i have studied the code and i understand it i only have some questions:

1)

Code: Select all

default t1 = Tooltip("")
default t2 = Tooltip("") 
default tt = Tooltip("")
What does Tooltip stand for?, i know that if you put something between the "" you will see a message, a "tooltip" just wondering why this part of the code was needed. Oh, and what is "default"?


2)

Code: Select all

text tt.value xalign 0.900 yalign 0.450
This expressions modify the text of the buttons and i get it no problem but why it is needed to put them outside on a separate indentation?, for example i tried doing this:

Code: Select all

textbutton "Two.":
            action Return(2)
            hovered t1.Action("I will be displayed in line with texbuton!."), Show("image_to_display2")
            unhovered Hide("image_to_display2")
text t1.value xalign 0.900 yalign 0.500
And it started to mess around everything, putting text in other places and stuff:

My mouse was over the red circle and believe it or not there was a menu over there too and it was flickering and the flickering prevented it from showing on the screen, the "one", "two", and "three" appeared after i hovered the original menu and they were flickering too. Don't mind the "lol" it was something i updated in one of the tooltips.

Image

3)

I noticed that this is persistent, if i change to other label the menu stays, this would be good for a general menu in a game that needs to be persistent in all screens but the problem arises when you don't want that, what if i want it to disappear when changing labels?, you would probably suggest me to change "show" for "call" but the problem is that i already have another "call" so if i switch it for call Renpy only shows the first "call" and the next one is never executed.

So my question would be how to make multiple "call" statements in one label or how could i make a second menu (in this case the one you gave me) to disappear after switching to another label?


4)

Your example was great to learn and understand other things but it is not what i wanted to do, what i wanted to do were whith Imagebuttons i will draw it on a picture so it is easier to understand:

Image

What i need to know is how to apply this "transformations" to those buttons, you don't need to give me all the code just more or less explain to me what is the sctructure of the code like how do i code this instructions.


Again thanks for your help!.

Nero
Veteran
Posts: 248
Joined: Tue Aug 09, 2016 2:59 pm
Contact:

Re: Actual guides?

#39 Post by Nero »

First off I noticed that you do not have "Indent Guides" aka vertical lines that keep your code in line so you dont have problems with lining the code the right way. They can be found in preference of Atom Google it.

1) default means define something after you run the game. So what you do is you define your tooltips which is in this case named tt,t1,t2 it can be change to anything you like.
Its like you would do $ tt = Tooltip("") But then it would be activated only after you come at the point where it is written I hope that makes sense my english skills aren't best to describe it.

2) It is not needed to put them at every single imagebutton just put 3 of them at the bottom of your defined screen. default tt goes at the top of the screen while text goes to bottom make sure they are in same line though. It is just needs to be there because text needs to be defined obviously. As for flickering try to put text stuff at the bottom line of the code it should be not happening.

3) Use Hide statement at action button so: action Jump("kitchen"), Hide("NAME_OF_THE SCREEN") . Then if you want it to appear again just show screen name_of_the_screen at the next label. If you want multiple menus just make another screen and name it differently.

4) Oh you are asking for animated button that will do arrow animation to the left when hovered and when unhovered will do backwards animation. This is tough one to explain basically you will need to make separated screen with 10-20 images (dependent on how fluid animation you want to be) the images are of course your yellow arrow that expands to the left as much as you need. First start with longest arrow frame then smallest and decide which is the best desired size of image animation. And then use this screen on hovered statement in your imagebutton. This is one way of doing it there are other few ways but I never used other methods so if you looking for more simple stuff then you should repeat this question with new thread.

Hope it helped.

User avatar
Remix
Eileen-Class Veteran
Posts: 1628
Joined: Tue May 30, 2017 6:10 am
Completed: None... yet (as I'm still looking for an artist)
Projects: An un-named anime based trainer game
Contact:

Re: Actual guides?

#40 Post by Remix »

Use on hover and on hide within a transform wrapping the buttons...

Code: Select all

transform button_move:
    on hover:
        ease 0.75 xpos -0.70
    on idle:
        ease 1.5 xpos 0.0

screen moving_buttons():
    vbox:
        # x,y,w,h
        area (0.975, 0.1, 0.1, 0.4)
        for k in range(4):
            textbutton "Button {0}".format(k) action [Jump("test")] pos (0.0, k*0.05) at button_move

label start:
    show screen moving_buttons
    "First Line"
    return
Frameworks & Scriptlets:

User avatar
Remix
Eileen-Class Veteran
Posts: 1628
Joined: Tue May 30, 2017 6:10 am
Completed: None... yet (as I'm still looking for an artist)
Projects: An un-named anime based trainer game
Contact:

Re: Actual guides?

#41 Post by Remix »

P.S. You might like to *almost* put this thread to sleep or, at the very least, try to bring it back on topic...

The thread is for 'Actual Guides' and questions not relevant to that topic might be best given a new thread of their very own
Frameworks & Scriptlets:

User avatar
Imperf3kt
Lemma-Class Veteran
Posts: 3791
Joined: Mon Dec 14, 2015 5:05 am
itch: Imperf3kt
Location: Your monitor
Contact:

Re: Actual guides?

#42 Post by Imperf3kt »

Just pointing this out, but the Ren'Py tutorial covers all of this, with visual examples


Try it sometime.
Warning: May contain trace amounts of gratuitous plot.
pro·gram·mer (noun) An organism capable of converting caffeine into code.

Current project: GGD Mentor

Twitter

Zherot
Regular
Posts: 91
Joined: Tue Aug 08, 2017 9:10 pm
Contact:

Re: Actual guides?

#43 Post by Zherot »

Nero wrote: Sun Aug 13, 2017 4:41 pm First off I noticed that you do not have "Indent Guides" aka vertical lines that keep your code in line so you dont have problems with lining the code the right way. They can be found in preference of Atom Google it.

1) default means define something after you run the game. So what you do is you define your tooltips which is in this case named tt,t1,t2 it can be change to anything you like.
Its like you would do $ tt = Tooltip("") But then it would be activated only after you come at the point where it is written I hope that makes sense my english skills aren't best to describe it.

2) It is not needed to put them at every single imagebutton just put 3 of them at the bottom of your defined screen. default tt goes at the top of the screen while text goes to bottom make sure they are in same line though. It is just needs to be there because text needs to be defined obviously. As for flickering try to put text stuff at the bottom line of the code it should be not happening.

3) Use Hide statement at action button so: action Jump("kitchen"), Hide("NAME_OF_THE SCREEN") . Then if you want it to appear again just show screen name_of_the_screen at the next label. If you want multiple menus just make another screen and name it differently.

4) Oh you are asking for animated button that will do arrow animation to the left when hovered and when unhovered will do backwards animation. This is tough one to explain basically you will need to make separated screen with 10-20 images (dependent on how fluid animation you want to be) the images are of course your yellow arrow that expands to the left as much as you need. First start with longest arrow frame then smallest and decide which is the best desired size of image animation. And then use this screen on hovered statement in your imagebutton. This is one way of doing it there are other few ways but I never used other methods so if you looking for more simple stuff then you should repeat this question with new thread.

Hope it helped.
1) I still don't know what does default means and now i want to know what you meant with "$", is there a place in which i can read about this "statements"?

2)Yeah i just switched their positions to experiment i was just hoping to know why they behave like that when i put them on a different position than were you put them originally that is why i asked.

3)Tried this and it still displayed the menu on the next "scene"

Code: Select all


vbox:
        xalign 1.000
        yalign 0.500
        textbutton "One.":
            action Jump("kitchen"), Hide("tooltip_test")
            hovered tt.Action("To kitchen"), Show("image_to_display")
            unhovered Hide("image_to_display")
4) Shouldn't it be possible to do it with the functions that allow stuff to move?

Zherot
Regular
Posts: 91
Joined: Tue Aug 08, 2017 9:10 pm
Contact:

Re: Actual guides?

#44 Post by Zherot »

Remix wrote: Sun Aug 13, 2017 4:47 pm Use on hover and on hide within a transform wrapping the buttons...

Code: Select all

transform button_move:
    on hover:
        ease 0.75 xpos -0.70
    on idle:
        ease 1.5 xpos 0.0

screen moving_buttons():
    vbox:
        # x,y,w,h
        area (0.975, 0.1, 0.1, 0.4)
        for k in range(4):
            textbutton "Button {0}".format(k) action [Jump("test")] pos (0.0, k*0.05) at button_move

label start:
    show screen moving_buttons
    "First Line"
    return
This is exactly what i wanted but now i will adapt it to Image buttons, can you explain the code to me? there are many things i am not familiar with.

Thanks.

EDIT: I noticed that you are creating buttons with a "for" but what if i wanted to manually put the amount of buttons? and not to follow a number order like button 1 button 2 etc but rather give them my own names?, also they all do the same action and they keep showing up after the jump in the other screen.

User avatar
Remix
Eileen-Class Veteran
Posts: 1628
Joined: Tue May 30, 2017 6:10 am
Completed: None... yet (as I'm still looking for an artist)
Projects: An un-named anime based trainer game
Contact:

Re: Actual guides?

#45 Post by Remix »

The 'for' is just an interator, a loop that runs for the values stated.
range(4) just returns [0,1,2,3], so the for k in ... basically just does the code once for each value = 4 buttons
You would just remove that loop and hardcode each imagebutton seperately
Frameworks & Scriptlets:

Post Reply

Who is online

Users browsing this forum: Google [Bot]