my problem

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
saru
Regular
Posts: 27
Joined: Mon Apr 18, 2005 7:05 am
Location: Maeklong , Thailand
Contact:

my problem

#1 Post by saru »

at function two_windows
init -100:

python:

style.create('two_window_say_position', 'default',
'(position) Used to get the position of the two windows in two window say mode.')

style.two_window_say_position.ypos = 1.0
style.two_window_say_position.yanchor = 'bottom'

style.create('who_window', 'default',
'(window) The style used for the window containing the who label when a Character uses the two_window_say function.')

style.who_window.background = Solid((0, 0, 255, 128)) <<<<<
style.who_window.xminimum = 150
style.who_window.xmargin = 10
style.who_window.xpadding = 10
style.who_window.ymargin = 5
style.who_window.ypadding = 5
how're i change it to frame.png ?

$ style.window.background = Frame("frame.png", 250, 25) <<<< i don't know about this point

thx :D

User avatar
PyTom
Ren'Py Creator
Posts: 16093
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: my problem

#2 Post by PyTom »

What you want to do is change the style of the who_window, not the regular windows. So use code like:

Code: Select all

init:
    $ style.who_window.background = Frame("frame.png", 10, 5)
The 10 and the 5 are the number of pixels to use as a border on the x and y sides, respectively. (The borders are only stretched in one direction.)

Oh, random question: How well does line breaking work in Thai? My gut feeling is not that well, since spaces are placed between clauses, rather than between words, but lines should be broken between words in the same clause.

Is my understanding right? If so, is there any standards I should be aware of that let me know where the Thai words end? Or do people just deal with bad line endings? (FYI, you can always force a newline with \n.)

Or is this just a case where, since every other program gets it wrong, it's not worth bothering?
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom
Software > Drama • https://www.patreon.com/renpytom

saru
Regular
Posts: 27
Joined: Mon Apr 18, 2005 7:05 am
Location: Maeklong , Thailand
Contact:

#3 Post by saru »

i use archive_images.exe to archieve picture

but when i'm run program it will show traceback
I'm sorry, but an exception occured while executing your Ren'Py
script.

Exception: Couldn't find file 'G01-1.png'.

The last script statement executed was on line 466 of game/script.rpy.

-- Full Traceback ------------------------------------------------------------

File "run_game.py", line 70, in main
File "renpy\main.pyc", line 162, in main
File "renpy\main.pyc", line 125, in run
File "renpy\execution.pyc", line 73, in run
File "renpy\ast.pyc", line 225, in execute
File "renpy\python.pyc", line 678, in py_exec_bytecode
File "game/script.rpy", line 466, in <module>
File "renpy\exports.pyc", line 351, in pause
File "renpy\ui.pyc", line 45, in interact
File "renpy\display\core.pyc", line 702, in interact
File "renpy\display\core.pyc", line 913, in interact_core
File "renpy\display\core.pyc", line 661, in event_wait
File "renpy\display\im.pyc", line 192, in preload
File "renpy\display\im.pyc", line 89, in get
File "renpy\display\im.pyc", line 265, in load
File "renpy\loader.pyc", line 58, in load
Exception: Couldn't find file 'G01-1.png'.

The last script statement executed was on line 466 of game/script.rpy.

Ren'Py Version: Ren'Py 4.8.2
i don't know how archieve use true

thx :)

User avatar
PyTom
Ren'Py Creator
Posts: 16093
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:

#4 Post by PyTom »

Did you add the line:

Code: Select all

init:
    $ config.archives = [ 'images' ]
To your script?

Hey, if you're getting into archiving, that means your almost done. If you want, I can check over your game before you distribute it, to ensure it doesn't have any subtle bugs in it. Also, when it's out, I'll try to link it from the Ren'Py page.
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom
Software > Drama • https://www.patreon.com/renpytom

saru
Regular
Posts: 27
Joined: Mon Apr 18, 2005 7:05 am
Location: Maeklong , Thailand
Contact:

#5 Post by saru »

ok. i found how to fix my error :D

because my file "G01-1.PNG" use .PNG <<<<
but run_game.exe call "G01-1.png" .png <<<<

thx for help , Pytom :D

saru
Regular
Posts: 27
Joined: Mon Apr 18, 2005 7:05 am
Location: Maeklong , Thailand
Contact:

#6 Post by saru »

my question

1. i want to know about how to set "Day Planner" in the game.
2. can decode script.rpy from v4.8.2 to v4.8.6 ? ( i try to decode but it's error )

thx :D

User avatar
PyTom
Ren'Py Creator
Posts: 16093
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:

#7 Post by PyTom »

saru wrote:my question

1. i want to know about how to set "Day Planner" in the game.
Right now, the day planner is meant more as an example of what can be done with the widgets in Ren'Py, then a tool that is meant for production use.

If you can tell me how you'd like a day planner-like screen to work, I can code it up for you.
2. can decode script.rpy from v4.8.2 to v4.8.6 ? ( i try to decode but it's error )
You may need to delete the .rpyc files when moving from 4.8.2 to .6.
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom
Software > Drama • https://www.patreon.com/renpytom

saru
Regular
Posts: 27
Joined: Mon Apr 18, 2005 7:05 am
Location: Maeklong , Thailand
Contact:

#8 Post by saru »

If you can tell me how you'd like a day planner-like screen to work, I can code it up for you.
ummmmm

1. i want to know about how to set point in script
ex.
def day_planner():

periods = [ 'Morning', 'Afternoon', 'Evening' ]
choices = [ 'Study', 'Exercise',
'Eat', 'Drink', 'Be Merry' ]

plan = { 'Morning' : 'Eat',
'Afternoon' : 'Drink',
'Evening' : 'Be Merry' }

day = 'March 25th'

stats = [
('Strength', 100, 10),
('Intelligence', 100, 25),
('Moxie', 100, 100),
('Chutzpah', 100, 75),
]
i wanna set "Study" = Strength -10 point , Intelligence +20

2. i want know about how use point to start event

ex
when Strength point = 60 , event ending is start

thx :D

User avatar
PyTom
Ren'Py Creator
Posts: 16093
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:

#9 Post by PyTom »

[quote="saru"
1. i want to know about how to set point in script
[/quote]

Right now, the day-planner in Ren'Py is just a demo to show how such a thing can look, and it doesn't actually do anything. Now, I can make it a working tool, but that would require me to have an idea of what it is you want it to do.
i wanna set "Study" = Strength -10 point , Intelligence +20

2. i want know about how use point to start event

ex
when Strength point = 60 , event ending is start
There are basically three things here, of which you sort of touched on two of them.

1. We need to figure out how to display stats to the user. The bar graphs are one way. Can people think of others?

2. We need a way to customize the choices in the schedule-picker, of what to do when.

3. We need to go and figure out a way to dispatch to and from events, on conditions that you set.

All this is possible, but I haven't actually coded any of it yet. I'd like feedback from people before working on this.

(There's also the issue that I tend to dislike visible-stats-based dating sims. In general, I find it annoying to spend a huge amount of time managing the life of the POV character, trying to raise stats, rather than participating in a story. Personal preference, of course.)
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom
Software > Drama • https://www.patreon.com/renpytom

saru
Regular
Posts: 27
Joined: Mon Apr 18, 2005 7:05 am
Location: Maeklong , Thailand
Contact:

#10 Post by saru »

If you can tell me how you'd like a day planner-like screen to work, I can code it up for you.
from ex
def day_planner():

periods = [ 'Morning', 'Afternoon', 'Evening' ]
choices = [ 'Study', 'Exercise',
'Eat', 'Drink', 'Be Merry' ]

plan = { 'Morning' : 'Eat',
'Afternoon' : 'Drink',
'Evening' : 'Be Merry' }

day = 'March 25th'

stats = [
('Strength', 100, 10),
('Intelligence', 100, 25),
('Moxie', 100, 100),
('Chutzpah', 100, 75),
]
i wanna set "Study" = Strength -10 point , Intelligence +20 point

How to input that point and the usage of them? :D


---------------------------------
new question

- if i want remove "skip mode" from my game. what i must remove?

thx :D

User avatar
PyTom
Ren'Py Creator
Posts: 16093
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:

#11 Post by PyTom »

saru wrote:
If you can tell me how you'd like a day planner-like screen to work, I can code it up for you.
i wanna set "Study" = Strength -10 point , Intelligence +20 point

How to input that point and the usage of them? :D
Right now, there's no way to do this. I'll try to whip up a real, working day-planner over the weekend or so, and then it might be possible to do this.

The day planner is just an interface demo, not something that's meant for actual use.
- if i want remove "skip mode" from my game. what i must remove?
Well, this is a fairly evil thing to do. Think of the user who wants to get all of the ending of your game. He'll have to actually sit through a huge amount of repeated text... not fun.

That being said, you can disable skipping by adding the line:

Code: Select all

    $ config.allow_skipping = False
To one of the init blocks of your script.
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom
Software > Drama • https://www.patreon.com/renpytom

saru
Regular
Posts: 27
Joined: Mon Apr 18, 2005 7:05 am
Location: Maeklong , Thailand
Contact:

#12 Post by saru »

sorry to ark again :D
# Bindings present almost everywhere, unless explicitly
# disabled.
rollback = [ 'K_PAGEUP', 'mousedown_4' ], <<<<<
screenshot = [ 's' ],
toggle_fullscreen = [ 'f' ],
toggle_music = [ 'm' ],
game_menu = [ 'K_ESCAPE', 'mouseup_3' ],
hide_windows = [ 'mouseup_2', 'h' ],
in config.py how's disable rollback layer?



/me wait for working day-planner :D

Kikered
Regular
Posts: 128
Joined: Sat Feb 26, 2005 3:02 pm
Completed: Quine, The Secret Ingredient
Projects: Metropolitan Blues, Mirai Imouto, Temple Glen, Fuyu no Tabi, MIA
Organization: Team BG
Location: The Midwest
Contact:

#13 Post by Kikered »

You can disable rollback by adding the following line of code into the init block of your script.

Code: Select all

$ config.rollback_enabled = False
Verbosity leads to unclear, inarticulate things.

saru
Regular
Posts: 27
Joined: Mon Apr 18, 2005 7:05 am
Location: Maeklong , Thailand
Contact:

#14 Post by saru »

i test DSE and add something in main.rpy
init:
$ event(u"พูดคุย", "act == 'chat'", event.solo(), priority=200)
$ event(u"เรียน", "act == 'study'", event.solo(), priority=200)
$ event(u"ค้นหาข้อมูล", "act == 'seek'", event.solo(), priority=200)
$ event(u"แต่งตัว", "act == 'dress'", event.solo(), priority=200)
$ event(u"พักผ่อน", "act == 'rest'", event.solo(), priority=200)
it show some error
UnicodeEncodeError: 'ascii' codec can't encode characters in position 0-6: ordinal not in range(128)

The last script statement executed was on line 229 of game/event_dispatcher.rpy.

User avatar
PyTom
Ren'Py Creator
Posts: 16093
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:

#15 Post by PyTom »

Okay, there's two problems here. The first is that you almost certainly didn't save the file as utf-8, which is why you're getting the error you're seeing. So when you save as utf-8, the error will go away.

Now, there's also a second, more subtle problem here. The first parameter to event is used as a a label, which is jumped to when the event occurs. Right now, labels in a Ren'Py program are forced to consist of ascii characters. (Really, to match the pattern [a-zA-Z][0-9a-zA-Z]*) So you can't use Thai characters in a label.

I'm looking into removing this restriction, but it's actually an annoyingly hard thing to do, especially if we don't want to ship the 400k unicode database with every program.

So for now, you probably want to use English for event names, and Thai for the text in the events, and then your game will work.
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom
Software > Drama • https://www.patreon.com/renpytom

Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot], IrisColt