[SOLVED]Two images at the same time + calling images

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.
Post Reply
Message
Author
Newprogrammer
Newbie
Posts: 17
Joined: Sat Oct 20, 2018 10:28 am
Contact:

[SOLVED]Two images at the same time + calling images

#1 Post by Newprogrammer »

Hello, sorry for the caotic title but this time i have 2 doubts...

1) I don't know if it's possible to dispaly two images at the same time with different transormations, something like:

Code: Select all

transform movepunch:
    align (0.1, 1.0)
    linear 0.09 xalign 0.65
    linear 0.05 xalign 0.50
    linear 0.08 xalign 0.77
    linear 0.05 xalign 0.60

transform moveTakePunch:
    align (0.97,1.0)
    linear 0.1 xalign 1.01
    #linear 0.5 yalign 2.4
    
label start: 
    show palyer1 at movepunch and show player2 at moveTakePunch
    
Is it possible to display two images at the same time with different transformations or it goes beyond renpy limits?


2) When i make an image statrement that create a custom image i have to decleare the images with the path like this:

Code: Select all

image takePunch:
    "player/char_player_01.png" with dissolve
    pause 0.12
    "player/char_player_89.png" with dissolve
What can i do if i need the images to be flipped?

i tried to decleare them and then to make something like this:

Code: Select all

 
image player02_1  = "player/char_player_01.png"
image player02_2 = "player/char_player_02.png"

image takePunch:
    player02_1 with dissolve
    pause 0.12
    player02_2 with dissolve
    
label start:
    show takePunch
but i got an error that said that the images weren't found...
Last edited by Newprogrammer on Sat Apr 27, 2019 10:40 am, edited 1 time in total.

User avatar
Per K Grok
Miko-Class Veteran
Posts: 882
Joined: Fri May 18, 2018 1:02 am
Completed: the Ghost Pilot, Sea of Lost Ships, Bubbles and the Pterodactyls, Defenders of Adacan Part 1-3, the Phantom Flyer
itch: per-k-grok
Location: Sverige
Contact:

Re: Two images at the same time + calling images

#2 Post by Per K Grok »

Newprogrammer wrote: Sun Apr 14, 2019 4:31 pm Hello, sorry for the caotic title but this time i have 2 doubts...

1) I don't know if it's possible to dispaly two images at the same time with different transormations, something like:

Code: Select all

transform movepunch:
    align (0.1, 1.0)
    linear 0.09 xalign 0.65
    linear 0.05 xalign 0.50
    linear 0.08 xalign 0.77
    linear 0.05 xalign 0.60

transform moveTakePunch:
    align (0.97,1.0)
    linear 0.1 xalign 1.01
    #linear 0.5 yalign 2.4
    
label start: 
    show palyer1 at movepunch and show player2 at moveTakePunch
    
Is it possible to display two images at the same time with different transformations or it goes beyond renpy limits?
Have you tried doing

Code: Select all

label start: 
    show palyer1 at movepunch  
    show player2 at moveTakePunch
show does not stop the code from going to the next line in the code.
Check if "palyer1" is correctly spelled.
Newprogrammer wrote: Sun Apr 14, 2019 4:31 pm
2) When i make an image statrement that create a custom image i have to decleare the images with the path like this:

Code: Select all

image takePunch:
    "player/char_player_01.png" with dissolve
    pause 0.12
    "player/char_player_89.png" with dissolve
What can i do if i need the images to be flipped?

i tried to decleare them and then to make something like this:

Code: Select all

 
image player02_1  = "player/char_player_01.png"
image player02_2 = "player/char_player_02.png"

image takePunch:
    player02_1 with dissolve
    pause 0.12
    player02_2 with dissolve
    
label start:
    show takePunch
but i got an error that said that the images weren't found...
You will still need to show the name of image as a string. I also think that "with dissolve" has to be written slightly different in an animated image.

Code: Select all

image takePunch:
    "player02_1" with Dissolve(0.5)
    pause 0.12
    "player02_2" with Dissolve(0.5)
You might also need alpha=True with Dissolve. with Dissolve(0.5, alpha=True)

You can flip an image with xzoom -1. Not sure if it can be used in an animated image.

Nothing above has been tested by me at this time. Just from memory.
I hope at least some of it is useful to you. :)

Newprogrammer
Newbie
Posts: 17
Joined: Sat Oct 20, 2018 10:28 am
Contact:

Re: Two images at the same time + calling images

#3 Post by Newprogrammer »

Thanks Per K Grok, the second part works magnificently. About the first doubt i did some research and i found that python is a language that compute only one instruction per time so i believe it's impossible to make two things moving at the same time...

User avatar
Per K Grok
Miko-Class Veteran
Posts: 882
Joined: Fri May 18, 2018 1:02 am
Completed: the Ghost Pilot, Sea of Lost Ships, Bubbles and the Pterodactyls, Defenders of Adacan Part 1-3, the Phantom Flyer
itch: per-k-grok
Location: Sverige
Contact:

Re: Two images at the same time + calling images

#4 Post by Per K Grok »

"Somehow posted the same post twice. Deleting this one " :D
Last edited by Per K Grok on Thu Apr 18, 2019 4:00 pm, edited 1 time in total.

User avatar
Per K Grok
Miko-Class Veteran
Posts: 882
Joined: Fri May 18, 2018 1:02 am
Completed: the Ghost Pilot, Sea of Lost Ships, Bubbles and the Pterodactyls, Defenders of Adacan Part 1-3, the Phantom Flyer
itch: per-k-grok
Location: Sverige
Contact:

Re: Two images at the same time + calling images

#5 Post by Per K Grok »

Per K Grok wrote: Thu Apr 18, 2019 3:56 pm
Newprogrammer wrote: Thu Apr 18, 2019 12:44 pm Thanks Per K Grok, the second part works magnificently. About the first doubt i did some research and i found that python is a language that compute only one instruction per time so i believe it's impossible to make two things moving at the same time...
Great.
But 1. should work as well. I've run a little test and it works fine. The code I've use below.

Things I have changed.
1. different images (of course)
2. longer times for the movements in movepunch (to slow down the movement, making it easier to see)
3. move start point in x direction for moveTakePunch (to get a longer movement) and longer time
4. put in a pause corresponding to the longer movement and then jump back to start (getting the movements to run on repeat)

Nothing is a change in the way the code works. Just stuff to make it easier to see the movements.

Code: Select all

transform movepunch:
    align (0.1, 1.0)
    linear 0.27 xalign 0.65
    linear 0.15 xalign 0.50
    linear 0.24 xalign 0.77
    linear 0.15 xalign 0.60

transform moveTakePunch:
    align (0.3,1.0)
    linear 0.6 xalign 1.01


label start:
    scene bg room

    show arrowd at movepunch
    show arrowl at moveTakePunch

    pause 1.21
    jump start
Don't know what it is you have read, but you can absolutely have more than one thing going at the same time.

Newprogrammer
Newbie
Posts: 17
Joined: Sat Oct 20, 2018 10:28 am
Contact:

Re: Two images at the same time + calling images

#6 Post by Newprogrammer »

Sorry Per K Grok, you were right, it works very well! It was my mistake, i tried to rename the variables to make my overall code smoother so i rename them like this:

Code: Select all

player 1 = "player/char_player_01.png"
player 2 = "player/char_player_02.png"
So when i play the game it showed just one of the two characters...

Thank you for all, and again sorry for the mistake...

p.s: i read about the compilation of python on some notes on the Internet... guess it's not the best place to watch for those things though.

Post Reply

Who is online

Users browsing this forum: No registered users