liam90's Forum Posts

  • 4 posts
  • Fixed! Imported the files and now the Sprites change with the line:

    sprite | Load image from "filename.jpg" (Keep current size)

  • Hi all,

    Just a quick newbie question. Right now I have five different sprite images in five different files (as opposed to a sheet) in the same folder as the project file, and I'm trying to make a Sprite change from one of the picture files to another using the event/action system. I've already tried the following with no success:

      sprite | Set animation to "filename.jpg" (play from beginning) sprite | Set animation to "./filename.jpg" (play from beginning) sprite | Set animation to ".//filename.jpg" (play from beginning) sprite | Load image from "filename.jpg" (Keep current size) sprite | Load image from "./filename.jpg" (Keep current size) sprite | Load image from ".//filename.jpg" (Keep current size)

    My current hypothesis is that I might need to add the files to the "Project" window tab under the "Files" subfolder first. Worst case I can throw all the images into a sheet and use those related commands, but I was trying to keep things "simple" (in my opinion at least...). Thanks in advance for any advice!

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Hi AllanR,

    Many thanks for the quick reply, I appreciate it. I took your suggestion and that fixed it, many thanks. I was under the impression setting the array to 6,1,1 would make a three dimensional array, but apparently it does not. Thanks also for pointing out the for loop is inclusive not exclusive on the limit. I'm sure these are all things I'll get used to with more practice using Construct 2. On to more joyous discoveries!

  • Hi all,

    I'm new to Construct 2, coming from a C# background, and I spent an hour looking around the forums, but couldn't find someone with a similar problem as what I'm having. My project has a simple 1 dimensional number array of size 6 that at the project load I am trying to initialize with a function. Right now the code looks like this:

    System | On Loader Layout Complete

    -----arrayOfIntegers | Set Size to (6,0,0)

    -----Function        | Call "Set_Up_New_Game"()

    Function | On Set_Up_New_Game

    -----System | For "" from 0 to 6 | arrayOfIntegers | Set value at loopindex to 4

    When I stopped the project with the debugger at first opportunity after the condition ran, the data in the array is still set to its initial all zeroes. Needless to say I'm a bit puzzled.

    Things I've tried:

    -Moving the function before the Loader Layout condition

    -Changed the condition from "On Loader Layout Complete" to "On Start of Layout"

    Granted there do exist other items in both the starting condition's and the Function's action sections, but nothing directly related to that array (as far as I know). I can attach the project file upon request. Maybe there's something I just don't understand about how Construct 2 executes things...? Any advice would be appreciated, thanks in advance!

  • 4 posts