import math

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.
Post Reply
Message
Author
User avatar
Scribbles
Miko-Class Veteran
Posts: 636
Joined: Wed Sep 21, 2016 4:15 pm
Completed: Pinewood Island, As We Know It
Projects: In Blood
Organization: Jaime Scribbles Games
Deviantart: breakfastdoodles
itch: scribbles
Location: Ohio
Contact:

import math

#1 Post by Scribbles »

Is there a place where the available python modules(?) that are already included in Renpy are listed?

specifically I was wondering if I could use import math to use the math functions?

I tried to google an answer but I couldn't find one that explained it in a way that I understood > < (i tried looking through the renpy directories but couldn't figure that out either)
Image - Image -Image

Alem
Regular
Posts: 38
Joined: Wed Mar 15, 2017 7:53 am
Contact:

Re: import math

#2 Post by Alem »

I think math is in the package from the start, try:

Code: Select all

init -1 python:
    import math
And then something that you want to test out in the main script.

User avatar
Remix
Eileen-Class Veteran
Posts: 1628
Joined: Tue May 30, 2017 6:10 am
Completed: None... yet (as I'm still looking for an artist)
Projects: An un-named anime based trainer game
Contact:

Re: import math

#3 Post by Remix »

renpy-version}-source/renpy/bootstrap.py list the common included import'ables...

import datetime; datetime
import encodings.ascii; encodings.ascii
import encodings.utf_8; encodings.utf_8
import encodings.zlib_codec; encodings.zlib_codec
import encodings.unicode_escape; encodings.unicode_escape
import encodings.string_escape; encodings.string_escape
import encodings.raw_unicode_escape; encodings.raw_unicode_escape
import encodings.mbcs; encodings.mbcs
import encodings.utf_16; encodings.utf_16
import encodings.utf_16_be; encodings.utf_16_be
import encodings.utf_16_le; encodings.utf_16_le
import encodings.utf_32_be; encodings.utf_32_be
import encodings.latin_1; encodings.latin_1
import encodings.hex_codec; encodings.hex_codec
import encodings.base64_codec; encodings.base64_codec
import encodings.idna; encodings.idna
#
import math; math
#
import glob; glob
import pickle; pickle
import difflib; difflib
import shutil; shutil
import tarfile; tarfile
import bz2; bz2 # @UnresolvedImport
import webbrowser; webbrowser
import posixpath; posixpath
import ctypes; ctypes
import ctypes.wintypes; ctypes.wintypes
import argparse; argparse
import compiler; compiler
import textwrap; textwrap
import copy; copy
import urllib; urllib
import urllib2; urllib2
import codecs; codecs
import rsa; rsa
import decimal; decimal
import plistlib; plistlib
import _renpysteam; _renpysteam
import compileall; compileall

As Alem alludes though, you still need to import ones you want into any file that uses it
Frameworks & Scriptlets:

User avatar
Scribbles
Miko-Class Veteran
Posts: 636
Joined: Wed Sep 21, 2016 4:15 pm
Completed: Pinewood Island, As We Know It
Projects: In Blood
Organization: Jaime Scribbles Games
Deviantart: breakfastdoodles
itch: scribbles
Location: Ohio
Contact:

Re: import math

#4 Post by Scribbles »

thank you both!
Image - Image -Image

Post Reply

Who is online

Users browsing this forum: AWizardWithWords, Ocelot, piinkpuddiin