Search found 13 matches

by Odysseus
Mon May 18, 2020 5:19 am
Forum: Ren'Py Questions and Announcements
Topic: Runtime Errors & Custom Crash Screen
Replies: 2
Views: 187

Re: Runtime Errors & Custom Crash Screen

Ok, I tried the following:

Code: Select all

try: 
    renpy.python.py_exec(program)
except NameError:
    print("Runtime Error")
I assume that I can also name other errors, should cover most basic stuff. Is there a better solution? This works... for now.
by Odysseus
Mon May 18, 2020 5:10 am
Forum: Ren'Py Questions and Announcements
Topic: Runtime Errors & Custom Crash Screen
Replies: 2
Views: 187

Runtime Errors & Custom Crash Screen

Hello it's me again! I have a few questions: 1) Is there any chance to customize the crash screen? When running the game, if there's a python block that doesn't work, it crashes. Is there a way to change what this shows, including text and all? (The reason is that I'm making a game where the player ...
by Odysseus
Mon May 11, 2020 3:09 pm
Forum: Ren'Py Questions and Announcements
Topic: [SOLVED] Exec() not running in renpy
Replies: 14
Views: 256

Re: Exec() not running in renpy

I GOT IT! It would seem that in order for this (slightly retarder way I'm going) to work, I needed to: A)ONLY exec, without compiling. B)The .py program to run, EVEN IF EXTERNAL, still needs to use the renpy file handling functions etc., it just doesn't recognize other commands and renpy crashes. TH...
by Odysseus
Mon May 11, 2020 2:37 pm
Forum: Ren'Py Questions and Announcements
Topic: [SOLVED] Exec() not running in renpy
Replies: 14
Views: 256

Re: Exec() not running in renpy

By the way, thank you for helping me, I really appreciate it!
by Odysseus
Mon May 11, 2020 2:36 pm
Forum: Ren'Py Questions and Announcements
Topic: [SOLVED] Exec() not running in renpy
Replies: 14
Views: 256

Re: Exec() not running in renpy

Nope, it prints the contents of test.py. And then I get this: I'm sorry, but an uncaught exception occurred. While running game code: File "game/script.rpy", line 75, in script python: File "game/script.rpy", line 83, in <module> renpy.python.py_exec(code) SyntaxError: invalid syntax (<none>, line 1...
by Odysseus
Mon May 11, 2020 1:38 pm
Forum: Ren'Py Questions and Announcements
Topic: [SOLVED] Exec() not running in renpy
Replies: 14
Views: 256

Re: Exec() not running in renpy

And this: filename = os.path.join(renpy.config.gamedir, "texts\\test.py") with open(filename, "rb") as source_file: code = renpy.python.py_compile(source_file.read(), 'exec', filename) renpy.python.py_exec(code) does this: I'm sorry, but an uncaught exception occurred. While running game code: File ...
by Odysseus
Mon May 11, 2020 1:36 pm
Forum: Ren'Py Questions and Announcements
Topic: [SOLVED] Exec() not running in renpy
Replies: 14
Views: 256

Re: Exec() not running in renpy

Ok, quick question: If Renpy uses Python 2.7, is there a chance that the little .py program I've written is somehow NOT compatible? I mean, bloody unlikely, since we're talking about the same stuff, but is it possible that's the problem?
by Odysseus
Mon May 11, 2020 1:35 pm
Forum: Ren'Py Questions and Announcements
Topic: [SOLVED] Exec() not running in renpy
Replies: 14
Views: 256

Re: Exec() not running in renpy

I just found out it does internally. Still... filename = os.path.join(renpy.config.gamedir, "texts\\test.py") with open(filename, "rb") as source_file: renpy.python.py_exec(source_file.read()) This does nothing. ...and... filename = renpy.file("test.py") renpy.python.py_exec(filename) This does: I'm...
by Odysseus
Mon May 11, 2020 11:53 am
Forum: Ren'Py Questions and Announcements
Topic: [SOLVED] Exec() not running in renpy
Replies: 14
Views: 256

Re: Exec() not running in renpy

I'm not really that good in Python to be able to make a proper game as easily as with RenPy. The idea is to have a very good game as basis, that will motivate students to play it, while at the same time actually learning Python by solving challenges.
by Odysseus
Mon May 11, 2020 11:33 am
Forum: Ren'Py Questions and Announcements
Topic: [SOLVED] Exec() not running in renpy
Replies: 14
Views: 256

Re: Exec() not running in renpy

Update: After a bit of trial an error, I got this code: filename = os.path.join(renpy.config.gamedir, "texts\\test.py") with open(filename, "rb") as source_file: code = renpy.python.py_compile(source_file.read(), filename, 'exec') renpy.python.py_exec(code) But this time, it crashes thus: I'm sorry,...
by Odysseus
Mon May 11, 2020 11:26 am
Forum: Ren'Py Questions and Announcements
Topic: [SOLVED] Exec() not running in renpy
Replies: 14
Views: 256

Re: Exec() not running in renpy

The idea is the following: 1) Player writes simple program inside game (with prompts from the game for aid) 2) Game saves this program as a .py file (Already got that, fortunately) 3) Game executes this code 4) Game gets the result of the execution to continue Simple example: I have a .txt that's al...
by Odysseus
Mon May 11, 2020 7:24 am
Forum: Ren'Py Questions and Announcements
Topic: [SOLVED] Exec() not running in renpy
Replies: 14
Views: 256

[SOLVED] Exec() not running in renpy

Hello, I would like renpy to execute some very specific, dynamically generated in-game python scripts outside the game's scope (I would rather it was done in-game, but that will need a virtual machine...). The first part is to open up a file to write the script from input in the game. That I've mana...
by Odysseus
Sun May 03, 2020 12:57 pm
Forum: Welcome!
Topic: Guestbook
Replies: 5288
Views: 1272362

Re: Guestbook

I'm Ody, from Athens, Greece, and I hope Ren.Py is the solution to my conundrum!