Array of several filepaths from which different videos are to be played doesn't work?

Welcome to our brand new Clickteam Community Hub! We hope you will enjoy using the new features, which we will be further expanding in the coming months.

A few features including Passport are unavailable initially whilst we monitor stability of the new platform, we hope to bring these online very soon. Small issues will crop up following the import from our old system, including some message formatting, translation accuracy and other things.

Thank you for your patience whilst we've worked on this and we look forward to more exciting community developments soon!

Clickteam.
  • Hi, there's an issue I'm working on with my game, where certain animations are supposed to play based off of two input variables: The player position and the enemy position.

    To map out which animation video files are going to be sourced from which filepath, I created an array that contains all current possible combinations and gives an output text to be used in the filepath that active direct show uses to locate and load a video file.

    Here is a sample of my code:

    Please login to see this attachment.

    The main point of this code is to transition from sourcing from one filepath to a different one when the player presses a certain button. However, it doesn't work out. The video file doesn't load, which I take to mean that the filepath doesn't change in time.

    I'm likely going to add more to this post once I wake up tomorrow, since I don't have much time at this moment and need to sleep, but what is the problem with my event that may be causing this video file to not load? (IE, ADS object listed as having no duration and position, (video filepath does not exist))

    Is it because I'm having the x index of the array change in the same event that loads and plays the video? I assumed that if I had the x index change occur higher up in the list, that it would occur before the ADS loads the video, so that the array has enough time to transition to the different filepath output. Perhaps I'm wrong, I've always been a little fuzzy if the actions in events occur simultaneously or are ordered, but if they are, I'm wondering if the ordering here is not enough to separate the array filepath change from the video loading, (which needs the filepath to change before the action is performed).

    Btw, my array dimensions are 271 x 83 (22,493 entries), if that's important.

  • Actions are executed in the order you set them in, with a few rare exceptions (eg. calling a forEach loop will always happen after all other actions in that event have executed.)

    If you suspect it's not switching the path fast enough, then test it by creating an event that switches the path when you press a key, and plays the video when you press another key.

    Are you 100% sure that your path is correct, and that your code doesn't introduce a superfluous character or typo? You can test this by using the "output to debugger" action (that comes with 2.5+, which I believe you have). Once your code has converted the path, get it to write the full path in the debugger window. Then copy and paste it into Windows Explorer to be certain that it's correct.

    Please login to see this link.
    My Fusion Tools: Please login to see this link. | Please login to see this link. | Please login to see this link.

  • Okay, I fixed the issue and it works now.

    The problem? Every set of filepaths other than the default set had a leading space in it, resulting in an invalid filepath. How did this happen? I populated the array in google sheets by using transpose(split("sample,text",",")) function, this function took in a text input. I got the text input as a list of values from a python script I made that searched my files to figure out which filepaths would need to be accessed, (otherwise I would've taken at least several days, if not weeks, populating this 20,000 + entry array by hand.)

    However, the list comes out as having spaces after commas, so that extra space got transferred to all the entries.

    I just made a quick python script to take the text input and replace all instances of ", ", with just ",", getting rid of this issue, and now it works great!

    Thanks for replying. I was wondering if there was some quick basic thing about arrays I didn't understand, but it was just a typo all along. :0

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!