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
Zherot
Regular
Posts: 91
Joined: Tue Aug 08, 2017 9:10 pm
Contact:

Re: Actual guides?

#46 Post by Zherot »

So after messing around with the code i managed to solve my own question on how to do 1 button individually and removed the "for" statements this is what i got:

Code: Select all

transform button_move:
    on hover:
        ease 1.0 xpos -0.05
    on idle:
        ease 1.0 xpos 0.5

screen moving_buttons():
    vbox:
        pos (0.80, 0.1)
        textbutton "Button button button button button" action [Jump("kitchen")] at button_move
        textbutton "Button button button button button" action [Jump("livingroom")]  at button_move
        imagebutton idle "home_h_button_show" action Jump("home1") at button_move
This works exactly how i wanted it, now the only problem i have is that it is persistent, if i push a button to go to another screen it does it but the menu keeps appearing, that wouldn't happen if i used call instead of show to bring this menu but apparently i can't use multiple calls on a single label, so how do i hide this moving buttons menu so it does not persist through the entire game?

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

Re: Actual guides?

#47 Post by Nero »

Zherot wrote: Mon Aug 14, 2017 12:56 pm
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?
1) You have answers to all of your questions just Google it https://www.renpy.org/doc/html/python.h ... -statement

2) I didn't tested it this way so I cant really tell why is your screen behaving this way.

3) That is because you didn't used Hide at the image screen so for example you clicked option 1. It must contain Hide for your main screen test_tooltip and Hide for your image screen like Hide("screen image_to_display") . Now the tooltip image and buttons should get removed correctly.

4) Sure it is possible to use Function but it will require more skills and is time consuming I don't want to go into details about it someone who is working with animation coding should provide you with better code.

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

Re: Actual guides?

#48 Post by Zherot »

I still can't figure out how to hide it, it just doesn't work...

Code: Select all

transform button_move:
    on hover:
        ease 1.0 xpos -0.05
    on idle:
        ease 1.0 xpos 0.5

screen moving_buttons():
    vbox:
        pos (0.80, 0.1)
        textbutton "Button button button button button" action [Jump("kitchen")] at button_move
        textbutton "Button button button button button" action [Jump("livingroom")]  at button_move
        imagebutton idle "home_h_button_show" action Jump("home1") at button_move
Where should i put the statement Hide in this code because i have been trying forever and i just don't get it, i get errors always...

Isn't it possible to make multiple "call" statements to avoid this thing?

EDIT: Ok i managed to do it but it is not an "elegant" solution... i have to put this at the start of every label I am using:

Code: Select all

hide screen moving_buttons
I would like that someone with more experience tells me how could i incorporate the hiding function in the screen itself or in a way that i don't have to repeat it for every label.

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

Re: Actual guides?

#49 Post by Nero »

Have you tried this?

Code: Select all

        textbutton "Button button button button button" action Hide("moving_buttons"), [Jump("kitchen")] at button_move

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

Re: Actual guides?

#50 Post by Zherot »

Nero wrote: Mon Aug 14, 2017 4:38 pm Have you tried this?

Code: Select all

        textbutton "Button button button button button" action Hide("moving_buttons"), [Jump("kitchen")] at button_move
Why it doesn't work like this:

Code: Select all

textbutton "Button button button button button" action [Jump("kitchen")], Hide("moving_buttons")  at button_move
Which just ignores the Hide altogether.

Or like this

Code: Select all

textbutton "Button button button button button" action [Jump("livingroom")] at button_move, Hide("moving_buttons")
Which produces an error.

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

Re: Actual guides?

#51 Post by Nero »

This is because of order that is written in when it is placed in list like that [].

It will work like this because first action will be Hide it will hide the screen and after that it will Jump to your label if you write it opposite way first Jump will happen and Hide action will be ignored that's just how screen language works in Ren'Py. So when you are messing with screen language make sure code order is right.

Code: Select all

        textbutton "Button button button button button" action  [Hide("moving_buttons"),Jump("kitchen")] at button_move

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

Re: Actual guides?

#52 Post by Zherot »

Ok now i understand why it wasn't working.

About the [] what is the purpose of those?, couldn't it be just () ?

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

Re: Actual guides?

#53 Post by Nero »

Google python lists read about them. No they are not necessary in your case you should not have these. Since you know basic now I suggest you slowly start working with this page https://www.renpy.org/doc/html/screen_actions.html read what each action does and use it to suit your needs.

Code: Select all

        textbutton "Button button button button button" action Hide("moving_buttons"), Jump("kitchen") at button_move

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

Re: Actual guides?

#54 Post by Zherot »

Nero wrote: Mon Aug 14, 2017 7:31 pm Google python lists read about them. No they are not necessary in your case you should not have these. Since you know basic now I suggest you slowly start working with this page https://www.renpy.org/doc/html/screen_actions.html read what each action does and use it to suit your needs.

Code: Select all

        textbutton "Button button button button button" action Hide("moving_buttons"), Jump("kitchen") at button_move
Trust me i am reding it, but it really does suck, completely vague, i have learned more from you guys than from that place, here and there i understand some things thet i read from there but the reality is that most of the stuff in the documentation is barebones in terms of the actual structure of the code...

For example I am now looking at the movie properties etc and what does it tell you about it?, this:

Image

Cool... i mean and know how do i code those? what is the structure i need? where do i place them?, where can i use them?

Like i said it is pretty much "yeah i can do this, and this too, and of course this... but im not telling you how".

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?

#55 Post by Imperf3kt »

Its right there, in your screenshot.
Movie()

Inside the () you put any of those kwargs to suit your needs.
The tutorial (not the documentation), included with renpy, even has multiple examples of where you use it and how.

Use it like so: (excerpt from an abandoned game I started when I first began learning Renpy)

Code: Select all

 show sashucks at left as saose
    sa "More than anything."
    oz "Well okay."
    stop music
    jump character-aintro
    
init:
    image movie = Movie(size=(1280, 720), xalign=0.5, yalign=0.5)
    
label character-aintro:
    scene black
    show movie
    with dissolve
    
    play movie "movies/mymovie.mkv"
    $ renpy.transition(fade)
    $ renpy.pause(126, hard=True)
    # TODO charactera intro
    
    scene bg main with fade
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?

#56 Post by Zherot »

Can someone help me with this one?:

viewtopic.php?f=8&t=45339

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

Re: Actual guides?

#57 Post by Zherot »

Imperf3kt wrote: Mon Aug 14, 2017 9:54 pm Its right there, in your screenshot.
Movie()

Inside the () you put any of those kwargs to suit your needs.
The tutorial (not the documentation), included with renpy, even has multiple examples of where you use it and how.

Use it like so: (excerpt from an abandoned game I started when I first began learning Renpy)

Code: Select all

 show sashucks at left as saose
    sa "More than anything."
    oz "Well okay."
    stop music
    jump character-aintro
    
init:
    image movie = Movie(size=(1280, 720), xalign=0.5, yalign=0.5)
    
label character-aintro:
    scene black
    show movie
    with dissolve
    
    play movie "movies/mymovie.mkv"
    $ renpy.transition(fade)
    $ renpy.pause(126, hard=True)
    # TODO charactera intro
    
    scene bg main with fade
You declared and put out a lot of stuff that is not specified in the documentation... so yeah, like i said, it is not well explained, it just assumes you will understand or that you know what it is talking about, it is probably great for people that already are familiar with RENPY but for others it is not.

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

Re: Actual guides?

#58 Post by Zherot »

A mod can put this on solved.

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?

#59 Post by Imperf3kt »

As I said, I did not know how to use Ren'Py when I wrote that.
The documentation is somewhat lacking, but the basic functions are described so watch the tutorial or tinker and you'll learn it soon enough.
Most of the stuff in that code, was not to run the movie, for that you only need two things.
Define a displayable (before your start label or inside an init)

Code: Select all

image movie = Movie(stuff)
And like every other displayable, call it when you want it

Code: Select all

play movie "path to file"
E: hmm I think I might have made a mistake, I also use 'show movie'
I'm not sure why both are in there. If I looked at the tutorial, I'd probably see which to remove.
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

Post Reply

Who is online

Users browsing this forum: Bing [Bot], Google [Bot]