Some Command Questions with Ren'Py
Forum rules
Ren'Py specific questions should be posted in the Ren'Py Questions and Annoucements forum, not here.
Ren'Py specific questions should be posted in the Ren'Py Questions and Annoucements forum, not here.
-
- Regular
- Posts: 29
- Joined: Tue Apr 29, 2008 10:05 am
- Projects: "Everything"
- Location: New York~
- Contact:
Some Command Questions with Ren'Py
I do apologize if these have been answered somewhere before. I'm not particularly good with forum searching, and I haven't been around in a while, so....
Anyway. My questions relating to Ren'Py are as follows.
1) As for the "Pause" command, is there a way to make it so that it pauses and prevents the reader from skipping through it? In other words, a pause that can't be overridden with a key press.
2) Next, the "punch" commands. Is there another way to make the screen shake, and to toy with the force it shakes with and the duration? I know that in ONScripter there is a Quakex and Quakey, but I haven't seen anything like that in Ren'Py.
3) Lastly, text. Is it possible to add blank lines to a screen? For example, if I wanted the text to display lower in the window as opposed to starting from the top.
I haven't used anything aside from "novel mode" up until now.
I do appreciate any help!
Anyway. My questions relating to Ren'Py are as follows.
1) As for the "Pause" command, is there a way to make it so that it pauses and prevents the reader from skipping through it? In other words, a pause that can't be overridden with a key press.
2) Next, the "punch" commands. Is there another way to make the screen shake, and to toy with the force it shakes with and the duration? I know that in ONScripter there is a Quakex and Quakey, but I haven't seen anything like that in Ren'Py.
3) Lastly, text. Is it possible to add blank lines to a screen? For example, if I wanted the text to display lower in the window as opposed to starting from the top.
I haven't used anything aside from "novel mode" up until now.
I do appreciate any help!
- sake-bento
- Eileen-Class Veteran
- Posts: 1909
- Joined: Sat Jan 26, 2008 5:58 pm
- Completed: http://sakevisual.com/games.html
- Projects: Every Sunrise, Shinsei
- Organization: sakevisual
- Tumblr: sakevisual
- Deviantart: sakevisual
- itch: sakevisual
- Contact:
Re: Some Command Questions with Ren'Py
Use "\n" (minus the quotes) to make a blank line.HAXLION wrote: 3) Lastly, text. Is it possible to add blank lines to a screen? For example, if I wanted the text to display lower in the window as opposed to starting from the top.
Not sure about the others. >.> Someone smarter will have to fill in here. ^_^;;
sakevisual visual novels (and stuff) | sakevisual dev blog
- PyTom
- Ren'Py Creator
- Posts: 16096
- Joined: Mon Feb 02, 2004 10:58 am
- Completed: Moonlight Walks
- Projects: Ren'Py
- IRC Nick: renpytom
- Github: renpytom
- itch: renpytom
- Location: Kings Park, NY
- Contact:
Re: Some Command Questions with Ren'Py
HAXLION wrote:1) As for the "Pause" command, is there a way to make it so that it pauses and prevents the reader from skipping through it? In other words, a pause that can't be overridden with a key press.
Code: Select all
renpy.pause(1.0, hard=True)
Code: Select all
2) Next, the "punch" commands. Is there another way to make the screen shake, and to toy with the force it shakes with and the duration? I know that in ONScripter there is a Quakex and Quakey, but I haven't seen anything like that in Ren'Py.
Code: Select all
init python:
vpunch = Move((0, 10), (0, -10), .10, bounce=True, repeat=True, delay=.275)
hpunch = Move((15, 0), (-15, 0), .10, bounce=True, repeat=True, delay=.275)
Use \n to represent a blank line. (Depending on what you want to do, margins, padding, or box spacing may also be appropriate.)3) Lastly, text. Is it possible to add blank lines to a screen? For example, if I wanted the text to display lower in the window as opposed to starting from the top.
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom(When was the last time you backed up your game?)
Software > Drama • https://www.patreon.com/renpytom
-
- Regular
- Posts: 29
- Joined: Tue Apr 29, 2008 10:05 am
- Projects: "Everything"
- Location: New York~
- Contact:
Re: Some Command Questions with Ren'Py
Hmm. Another couple of issues seem to be coming up.
When I put that improvised Pause line in the script in the "init" section and use the same Pause command it gives me an error and the game won't start. The same is true for the "\n".
Here's what I've coded.
init:
# Declare images below this line, using the image statement.
# eg. image eileen happy = "eileen_happy.png"
# Declare characters used by this game.
$ n = Character(kind=nvl, color="#c8ffc8")
image black = "#000000"
image room = "bg/room.png"
image hallway = "bg/hallway.png"
image bird = "bg/bird.png"
# The game starts here.
label start:
scene room
with fade
play music "bgm/rainfall.ogg"
n "----------------------"
extend "----------------------"
n "---------------------- "
extend "---------------------- "
extend "----------------------"
nvl clear
n "----------------------."
nvl clear
n "----------------------"
\n
Pause
n "............. How much longer?"
It lists both the "pause" and "\n" as being incorrect. ;_;
When I put that improvised Pause line in the script in the "init" section and use the same Pause command it gives me an error and the game won't start. The same is true for the "\n".
Here's what I've coded.
init:
# Declare images below this line, using the image statement.
# eg. image eileen happy = "eileen_happy.png"
# Declare characters used by this game.
$ n = Character(kind=nvl, color="#c8ffc8")
image black = "#000000"
image room = "bg/room.png"
image hallway = "bg/hallway.png"
image bird = "bg/bird.png"
# The game starts here.
label start:
scene room
with fade
play music "bgm/rainfall.ogg"
n "----------------------"
extend "----------------------"
n "---------------------- "
extend "---------------------- "
extend "----------------------"
nvl clear
n "----------------------."
nvl clear
n "----------------------"
\n
Pause
n "............. How much longer?"
It lists both the "pause" and "\n" as being incorrect. ;_;
- killdream
- Veteran
- Posts: 325
- Joined: Wed Nov 05, 2008 1:05 pm
- Projects: EVūL (WIP), insilo (WIP), Cute Demon Crashers!
- Deviantart: robotlolita
- Github: robotlolita
- Location: World's End (aka Brazil)
- Contact:
Re: Some Command Questions with Ren'Py
1. Post codes inside [ code ][ /code ] (without the spaces)
2. You can post Ren'Py related stuffs... well, in Ren'Py section =D
3. Instead of using "n" in every line, it's better to override the narrator character of Ren'Py:
4. "\n" are interpreted as a new line character (like "#10" in Object Pascal), so you _have_ to put it inside strings
5. Pause is a transition, so you have to use the statement with before it:
2. You can post Ren'Py related stuffs... well, in Ren'Py section =D
3. Instead of using "n" in every line, it's better to override the narrator character of Ren'Py:
Code: Select all
init python:
narrator = Character(kind='nvl')
Code: Select all
"this is a dialog\nwith a forced line break"
Code: Select all
with Pause(1) # a function should always have the parenthesis, even if it has no arguments
-
- Regular
- Posts: 29
- Joined: Tue Apr 29, 2008 10:05 am
- Projects: "Everything"
- Location: New York~
- Contact:
Re: Some Command Questions with Ren'Py
Hmmm, here's where I start to get confused.killdream wrote:1. Post codes inside [ code ][ /code ] (without the spaces)
2. You can post Ren'Py related stuffs... well, in Ren'Py section =D
3. Instead of using "n" in every line, it's better to override the narrator character of Ren'Py:4. "\n" are interpreted as a new line character (like "#10" in Object Pascal), so you _have_ to put it inside stringsCode: Select all
init python: narrator = Character(kind='nvl')
5. Pause is a transition, so you have to use the statement with before it:Code: Select all
"this is a dialog\nwith a forced line break"
Code: Select all
with Pause(1) # a function should always have the parenthesis, even if it has no arguments
What part of the game does the "renpy stuff" go in to? Secondly, the "init python" stuff to change the narrator?
I've done a lot of writing, but programming is new to me. Forgive my ignorance~
- killdream
- Veteran
- Posts: 325
- Joined: Wed Nov 05, 2008 1:05 pm
- Projects: EVūL (WIP), insilo (WIP), Cute Demon Crashers!
- Deviantart: robotlolita
- Github: robotlolita
- Location: World's End (aka Brazil)
- Contact:
Re: Some Command Questions with Ren'Py
Oh, not, I mean, it's better to make threads about Ren'Py in Ren'Py section (that's the bad thing about trying to do lots of things at the same time .-.)
And well, when you ommit the character before a dialog, Ren'Py uses a default character, and this character is stored inside the variable narrator, so to change this default character you just have to change the variable.
And well, when you ommit the character before a dialog, Ren'Py uses a default character, and this character is stored inside the variable narrator, so to change this default character you just have to change the variable.
-
- Regular
- Posts: 29
- Joined: Tue Apr 29, 2008 10:05 am
- Projects: "Everything"
- Location: New York~
- Contact:
Re: Some Command Questions with Ren'Py
Uh, still not following you with the narrator thing. Where does that go? In the Options part?
If possible, I'd like to know exactly what to type in.
If possible, I'd like to know exactly what to type in.
Re: Some Command Questions with Ren'Py
http://www.renpy.org/wiki/Character
Look at the example. Basically each style of expression can be defined as a separate Character... even if in your story it's the same person. You can have an NVL style for his thoughts, for example, and another style when he actually speaks.
Look at the example. Basically each style of expression can be defined as a separate Character... even if in your story it's the same person. You can have an NVL style for his thoughts, for example, and another style when he actually speaks.
- killdream
- Veteran
- Posts: 325
- Joined: Wed Nov 05, 2008 1:05 pm
- Projects: EVūL (WIP), insilo (WIP), Cute Demon Crashers!
- Deviantart: robotlolita
- Github: robotlolita
- Location: World's End (aka Brazil)
- Contact:
Re: Some Command Questions with Ren'Py
Un, files don't matter that much in ren'py, all '.rpy' files will be read as if they were just one.
You need to modify the narrator variable before showing the dialog with it (normally, you don't need to change it, but since you're going with nvl, it's better to change the narrator than create a new one).
This should be done in a init block, since it'll be executed everytime the game runs and before the game starts, so you'd make sure the variable is changed before you use any dialog.
Since Ren'Py uses a custom language that is not Python, you have to use some statements to get Python code inside your Ren'Py script. This can be done inline, with the '$' statement:
Or in a block, using the 'python' statement:
The python statement can be used inside a label or init block, so you have it as a sub-block of the init/label block:
but you can also embbed it in the init block declaration, so you don't have two blocks when you just need python:
You need to modify the narrator variable before showing the dialog with it (normally, you don't need to change it, but since you're going with nvl, it's better to change the narrator than create a new one).
This should be done in a init block, since it'll be executed everytime the game runs and before the game starts, so you'd make sure the variable is changed before you use any dialog.
Since Ren'Py uses a custom language that is not Python, you have to use some statements to get Python code inside your Ren'Py script. This can be done inline, with the '$' statement:
Code: Select all
$ narrator = Character(kind='nvl')
Code: Select all
python:
narrator = Character(kind='nvl')
The python statement can be used inside a label or init block, so you have it as a sub-block of the init/label block:
Code: Select all
init:
python:
print "python block"
label start:
python:
print "python block"
Code: Select all
init python:
print "python block"
-
- Regular
- Posts: 29
- Joined: Tue Apr 29, 2008 10:05 am
- Projects: "Everything"
- Location: New York~
- Contact:
Re: Some Command Questions with Ren'Py
Blech. It's still not working out, even though I've tried what you guys recommended. What's wrong with my code?
# You can place the script of your game in this file.
init:
# Declare images below this line, using the image statement.
# eg. image eileen happy = "eileen_happy.png"
# Declare characters used by this game.
init python:
print "python block"
$ narrator = Character(kind='nvl')
image black = "#000000"
image room = "bg/room.png"
image hallway = "bg/hallway.png"
image bird = "bg/bird.png"
image carnival = "bg/carnival.png"
# The game starts here.
label start:
scene room
with fade
play music "bgm/rainfall.ogg"
# You can place the script of your game in this file.
init:
# Declare images below this line, using the image statement.
# eg. image eileen happy = "eileen_happy.png"
# Declare characters used by this game.
init python:
print "python block"
$ narrator = Character(kind='nvl')
image black = "#000000"
image room = "bg/room.png"
image hallway = "bg/hallway.png"
image bird = "bg/bird.png"
image carnival = "bg/carnival.png"
# The game starts here.
label start:
scene room
with fade
play music "bgm/rainfall.ogg"
- killdream
- Veteran
- Posts: 325
- Joined: Wed Nov 05, 2008 1:05 pm
- Projects: EVūL (WIP), insilo (WIP), Cute Demon Crashers!
- Deviantart: robotlolita
- Github: robotlolita
- Location: World's End (aka Brazil)
- Contact:
Re: Some Command Questions with Ren'Py
Oh, no, please remove that
It was just an example i.i
And also, you have to post exactly what error you're getting or else we can't say much.
Also, please put your code in code tags. Python uses compulsory identation and normal posting on the topic will kill all the identation. (it's better if you add the traceback, though)
Code: Select all
init python:
print "python block"
And also, you have to post exactly what error you're getting or else we can't say much.
Also, please put your code in code tags. Python uses compulsory identation and normal posting on the topic will kill all the identation. (it's better if you add the traceback, though)
-
- Regular
- Posts: 29
- Joined: Tue Apr 29, 2008 10:05 am
- Projects: "Everything"
- Location: New York~
- Contact:
Re: Some Command Questions with Ren'Py
Ah, my mistake. I apologize. Let's see...killdream wrote:Oh, no, please remove thatIt was just an example i.iCode: Select all
init python: print "python block"
And also, you have to post exactly what error you're getting or else we can't say much.
Also, please put your code in code tags. Python uses compulsory identation and normal posting on the topic will kill all the identation. (it's better if you add the traceback, though)
Code: Select all
# You can place the script of your game in this file.
init:
# Declare images below this line, using the image statement.
# eg. image eileen happy = "eileen_happy.png"
# Declare characters used by this game.
init python:
print "python block"
$ narrator = Character(kind='nvl')
image black = "#000000"
image room = "bg/room.png"
image hallway = "bg/hallway.png"
image bird = "bg/bird.png"
image carnival = "bg/carnival.png"
# The game starts here.
label start:
scene room
with fade
play music "bgm/rainfall.ogg"
script.
TypeError: 'kind' is an invalid keyword argument for this function
While executing init code:
- script at line 8 of C:\Documents and Settings\Owner\Desktop\renpy-6.8.1-sdk\renpy-6.8.1\Everything/game/script.rpy
- python at line 8 of C:\Documents and Settings\Owner\Desktop\renpy-6.8.1-sdk\renpy-6.8.1\Everything/game/script.rpy.
-- Full Traceback ------------------------------------------------------------
File "C:\Documents and Settings\Owner\Desktop\renpy-6.8.1-sdk\renpy-6.8.1\renpy\bootstrap.py", line 247, in bootstrap
File "C:\Documents and Settings\Owner\Desktop\renpy-6.8.1-sdk\renpy-6.8.1\renpy\main.py", line 253, in main
File "C:\Documents and Settings\Owner\Desktop\renpy-6.8.1-sdk\renpy-6.8.1\renpy\execution.py", line 199, in run
File "C:\Documents and Settings\Owner\Desktop\renpy-6.8.1-sdk\renpy-6.8.1\renpy\ast.py", line 554, in execute
File "C:\Documents and Settings\Owner\Desktop\renpy-6.8.1-sdk\renpy-6.8.1\renpy\python.py", line 880, in py_exec_bytecode
File "C:\Documents and Settings\Owner\Desktop\renpy-6.8.1-sdk\renpy-6.8.1\Everything/game/script.rpy", line 8, in <module>
File "C:\Documents and Settings\Owner\Desktop\renpy-6.8.1-sdk\renpy-6.8.1\renpy\character.py", line 572, in Character
TypeError: 'kind' is an invalid keyword argument for this function
While executing init code:
Ren'Py Version: Ren'Py 6.8.1a
- killdream
- Veteran
- Posts: 325
- Joined: Wed Nov 05, 2008 1:05 pm
- Projects: EVūL (WIP), insilo (WIP), Cute Demon Crashers!
- Deviantart: robotlolita
- Github: robotlolita
- Location: World's End (aka Brazil)
- Contact:
Re: Some Command Questions with Ren'Py
Un, sorry, my mistake. I completly forgot Character function had a name argument xD
So, replace that by:
Also, take a look at the character documentation ^^
So, replace that by:
Code: Select all
$ narrator = Character(None, kind=nvl)
Who is online
Users browsing this forum: No registered users