[Solved] Making events at the end of transform

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
User avatar
ZianRiyone
Newbie
Posts: 11
Joined: Mon Jun 14, 2021 3:25 pm
Contact:

[Solved] Making events at the end of transform

#1 Post by ZianRiyone »

So i want to make a quick check for speed of players with a little race.

So the general idea is to slide 3 different images to right side until one of them reaches the end(like xalign1 to xalign0 which means in monitor range). After the first one reached the end, an event will trigger and show an additional screen while pausing the working trasnform. Because after the screen the transform will continue. (which means all of them will keep their last location and the finiher will start transform again from the beginnig.)

My goal is to make a turn based fight system. While the first finisher will get the first round and if he has the speed, he could even take second turn before others :D i hope you got what i mean
I figured out the transform part but couldnt add event and stop or pause the other transform when someone reached at the end.

Code: Select all

transform speedrace(c,t=r_speed):
    zoom 0.1
    linear t xoffset 50
    xoffset -50
    repeat

screen turn_select():
    style_prefix "confirm"
    frame:
        yalign 0.1
        has vbox:
            for p in battle_players:
                if not p.turn and p.hp > 0:
                    if currentplayer == None:
                        add "chr_design/player.png" at speedrace(p,p.speed)

I really appreciate the help. :)

Image

It looks pretty much like that. Just when someone reach at the end all of the racers will stop and an additional screen will be shown. after that screen returned, the transform will be continue :D I hope it is possible.
Last edited by ZianRiyone on Tue Nov 30, 2021 2:13 am, edited 1 time in total.

User avatar
zmook
Veteran
Posts: 421
Joined: Wed Aug 26, 2020 6:44 pm
Contact:

Re: Making events at the end of transform

#2 Post by zmook »

It sounds like you need enough control over the characters and the race that you should code it yourself as a screen. Transforms are really not designed to be paused and continued like you're talking about.
colin r
➔ if you're an artist and need a bit of help coding your game, feel free to send me a PM

User avatar
ZianRiyone
Newbie
Posts: 11
Joined: Mon Jun 14, 2021 3:25 pm
Contact:

Re: Making events at the end of transform

#3 Post by ZianRiyone »

zmook wrote: Sun Nov 28, 2021 11:39 am It sounds like you need enough control over the characters and the race that you should code it yourself as a screen. Transforms are really not designed to be paused and continued like you're talking about.
Thanks for reply.

I made it, but i didnt add any events trigger or something to the end of the transforms. Rather than, ı made it with some python, class codes. Firstly, i repared a class that who is the first winner. than, in which time this winner got to the finish point. In this time all of the racers will move to a specific location with x and t, their last location and the first winner's time respectively. Secondly, To arrange a transform, I need the xpos values for every racer. So I prepare some maths and class codes like:

racers = [.....]
class racer(self,......., speed=5, starting_x_pos=0, the_last_position=0, amount_of_x(the distance they go in winner's time)=0):
....
....

def prepare_x_dist():
for i in racers:
amount_of_x = winner's_time * i.speed

transform race_pos(start_x, time, last_x):
start_x
linear time xpos lastx

and its goes like that. For know my codes are a little bir confusing and mixed. After tidiying them, if anybody wants it i will share it.

Post Reply

Who is online

Users browsing this forum: apocolocyntose, DewyNebula