Don�t Work video in other places

This forum is currently in read-only mode.
From the Asset Store
8-bit retro-style music and sound effects: 10 loops-able music tracks and 301 individual SFX!
  • Hi i have this problem my game have a video, and works in this(\planetajogos\INTRO2.wmv') but if i put the folder in other place, don�t work, i dont know how put in script of video the stuff of appath+. So i put here the link cap of my work , please need some help to finish

  • Som help here :/

  • Well Python's counterpart to Construct's AppPath is os.getcwd(), e.g.

    movieFile = os.getcwd() + r'\planetajogos\INTRO2.wmv'

    But I'm not sure if this is what you're looking for.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • nop dont works... give this error Traceback(most recent call last): File "<String>", line1, in <module> Name error: name "os" not defined.

  • Oh, I see. So you're using some premade Python-script, but you don't know Python yourself?

    I'll explain it a little bit more:

    'os' is a module. Every module used in another module needs to be imported prior to using it. Insert the following line at the start of your script:

    import os

    Now Python knows where it has to look for the function getcwd(), so if the next line is

    movieFile = os.getcwd() + r'\planetajogos\INTRO2.wmv'

    it will look into the module 'os' and search for the function 'getcwd', execute it and return the path to the current working directory, which will then be combined with the second string.

    For the basics of Python have a look at various teaching sources in the web, e.g. the wiki book Python Programming. It is essential to know the basics of Python if you intend to use it.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)