Is it possible to show nvl and adv at the same time?
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.
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.
Is it possible to show nvl and adv at the same time?
Hey.
Can someone tell me how you can display both Adv and Nvl at the same time?
With the help of other people's recipes, I can intercept the text from the screen say, and display it on my own. But at the same time, the ability to use part of the tags, such as {w}, {cps} and others, is lost. In short, the text is displayed immediately, and there is no way to display character by character.
I attached a layout of what I want to receive. Namely, the display of thoughts, speech and actions of the characters separately.
And if thoughts and actions, as a whole, have their own frames for each frame, as in the adv mode, only without hiding, then “speech” is different. I wanted to portray speech as an analogue of SMS, bubbles creeping up. And that the text would appear gradually.
Any tips on where to go?
Can someone tell me how you can display both Adv and Nvl at the same time?
With the help of other people's recipes, I can intercept the text from the screen say, and display it on my own. But at the same time, the ability to use part of the tags, such as {w}, {cps} and others, is lost. In short, the text is displayed immediately, and there is no way to display character by character.
I attached a layout of what I want to receive. Namely, the display of thoughts, speech and actions of the characters separately.
And if thoughts and actions, as a whole, have their own frames for each frame, as in the adv mode, only without hiding, then “speech” is different. I wanted to portray speech as an analogue of SMS, bubbles creeping up. And that the text would appear gradually.
Any tips on where to go?
From Belarus with love
Re: Is it possible to show nvl and adv at the same time?
You could try to show 'speach' of nvl characters and customize nvl screen to show up menus at the bottom (you can draw the background for menu as part of nvl screen, so it won't hide when choice is made). And thoughts might be shown as a separate screen, that shows some text based on variables. Or try to mace a condition in a nvl screen to check if 'who' (speaker) is 'thoughts' to show its words at different place from normal 'speach'.
viewtopic.php?f=8&t=23434#p293323
viewtopic.php?f=8&t=23434#p293323
- Imperf3kt
- Lemma-Class Veteran
- Posts: 3792
- Joined: Mon Dec 14, 2015 5:05 am
- itch: Imperf3kt
- Location: Your monitor
- Contact:
Re: Is it possible to show nvl and adv at the same time?
I'd just use one or the other and fake the other by making an image out of text (renpy can do this)
Even easier is to simply display text in a screen custom screen that changes based on a variable, as Alex suggests below.
Even easier is to simply display text in a screen custom screen that changes based on a variable, as Alex suggests below.
Last edited by Imperf3kt on Sun Mar 15, 2020 4:47 pm, edited 2 times in total.
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
pro·gram·mer (noun) An organism capable of converting caffeine into code.
Current project: GGD Mentor
Re: Is it possible to show nvl and adv at the same time?
To hell, I decided to fake it. But ran into a stupid problem. I copied the words of the narrator, and showed them on the screen when the character spoke. But somehow, it was not the words that the narrator spoke, but those that he said at the very end. I seem to have already heard about this problem, as if the engine is looking at all the code, and only the last value is placed in the variable. The amazing thing is that if I remove the condition and put all the intercepted words on my screen, then everything works fine.
I believe - the My_froud function is called more than 10 times per frame. It is depressing ...
I believe - the My_froud function is called more than 10 times per frame. It is depressing ...
Code: Select all
init python:
class My_gui():
def __init__(self):
self.previous_who = None
self.action_say = ""
self.action_show = False
my_gui = My_gui()
def My_fraud(who_origin, what_origin):
global my_gui
if (who_origin is None) and (my_gui.previous_who is not None):
my_gui.action_show = False
my_gui.action_say = what_origin
else:
my_gui.action_show = True
my_gui.previous_who = who_origin
return (who_origin, what_origin)
screen say(who, what):
style_prefix "say"
window:
id "window"
$ who, what = My_fraud(who, what)
if who is not None:
window:
id "namebox"
style "namebox"
text who id "who"
text what id "what"
screen fake_action:
window:
background "#0F07"
pos (20, 20)
xysize (300, 100)
text my_gui.action_say at topleft
label start:
"These words should be on screen fake_action in the next frame."
e "The window should appear the words of the narrator from the last frame"
"But these appear"
From Belarus with love
Re: Is it possible to show nvl and adv at the same time?
Code: Select all
$ who, what = My_fraud(who, what)
You could try to change it to
Code: Select all
screen say(who, what):
default who, what = My_fraud(who, what)
It's not clear why 'fake_action' screen should appear at all - did you set the narrator character use it?
Anyway, try to make it simple, like
Code: Select all
default my_text = ""
screen fake_action:
zorder 1000
window:
background "#0F07"
pos (20, 20)
xysize (300, 100)
text "[my_text]" at topleft
label start:
show screen fake_action
"..."
$ my_text = "These words should be on screen fake_action."
e "The window should appear the words of the narrator from the last frame"
$ my_text = "But these appear"
e "?!"
my_text = ""
"... ..."
https://www.renpy.org/doc/html/style_pr ... y-slow_cps
Re: Is it possible to show nvl and adv at the same time?
Thanks for the helpful answers, Alex, and sorry for missing.
1) I still don’t understand why your code is normally displayed only in renpy 6.15
I thought to display the choice of actions instead of conversation. In this case, it would be possible to write an explanation for the choice just in the screen where the actions are written. I apologize if I explained poorly.
3) Alas, Default did not help. The text on the screen still runs to the very end.
The same crap with style settings: slow_abortable and slow_cps.
4) Suddenly, working with the nvl mode gave a positive result. I already tried to intercept his messages, but failed. Now it has turned out, although it is rather strange. I scanned messages, checked which of them from the narrator, and sent them to my screen. Renpai placed the previous text on the screen, and not the one that is displayed now
Example:
Say | fake_screen
Line 1 | Line 1
Line 2 |
Line 3 | Line 2
1) I still don’t understand why your code is normally displayed only in renpy 6.15
2)
Yes. I intended to use this screen to display information about surrounding events. And, leaving the text displayed if the action occurs in the background is a long one. For example, washing dishes while talking.
I thought to display the choice of actions instead of conversation. In this case, it would be possible to write an explanation for the choice just in the screen where the actions are written. I apologize if I explained poorly.
3) Alas, Default did not help. The text on the screen still runs to the very end.
The same crap with style settings: slow_abortable and slow_cps.
4) Suddenly, working with the nvl mode gave a positive result. I already tried to intercept his messages, but failed. Now it has turned out, although it is rather strange. I scanned messages, checked which of them from the narrator, and sent them to my screen. Renpai placed the previous text on the screen, and not the one that is displayed now
Example:
Say | fake_screen
Line 1 | Line 1
Line 2 |
Line 3 | Line 2
From Belarus with love
Re: Is it possible to show nvl and adv at the same time?
I think the problem arises precisely because I am trying to introduce a separation - the words of the narrator in one place, the words of the characters in another. But I can’t imagine how you can write program code without using conditions.
From Belarus with love
Re: Is it possible to show nvl and adv at the same time?
Looks like I found a solution to persistent calls - action, which work when they appear and redraw. In short.
But the feeling that I use crutches, and that somewhere there is a better, more convenient, more correct way, does not leave me.
Code: Select all
screen say(who, what):
on "show" action C_Fraud(who, what)
on "replace" action C_Fraud(who, what)
...
init python:
C_Fraud = renpy.curry(My_fraud)
def My_fraud(who, what):
global my_text
if (who is None):
my_text = what
screen scr_action:
global my_text
...
text my_text
init start:
"bla-bla-bla"
From Belarus with love
Who is online
Users browsing this forum: No registered users