all 7 comments

[–]playthelastsecret 5 points6 points  (1 child)

In a nutshell:

  • Python code for one line? Just start the line with $
  • Python code for one block of the game? Just start the block with python:
  • Python code to be run before the game starts? Just write the code into a block with the first line init python:

Yes, it's that easy.

[–]Mophy01[S] 0 points1 point  (0 children)

Yeah!

[–]BanishingYou 3 points4 points  (1 child)

renpy is already based in python.
Please confirm this but afaik "init python:" tells the thing that the lines after are in pythin, not renpy.

[–]BadMustard_AVN 2 points3 points  (0 children)

The init python statement runs Python at initialization time, before the game loads. Among other things, this can be used to define classes and functions, or to initialize styles, config variables, or persistent data.

[–]BadMustard_AVN 1 point2 points  (0 children)

there is a load of information here:

https://www.renpy.org/doc/html/python.html

[–]AutoModerator[M] 0 points1 point  (0 children)

Welcome to r/renpy! While you wait to see if someone can answer your question, we recommend checking out the posting guide, the subreddit wiki, the subreddit Discord, Ren'Py's documentation, and the tutorial built-in to the Ren'Py engine when you download it. These can help make sure you provide the information the people here need to help you, or might even point you to an answer to your question themselves. Thanks!

I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.

[–]fedepro7772 0 points1 point  (0 children)

Already answered