adventurist's Forum Posts

  • Hi!

    I'd like to be able to scale a sprite with the help of a slider bar. I was thinking I could check if the slider is incrementing or decrementing in value, but there is no options to check that as far as I know. Do any one have any good suggestions?

    Thanks!

  • Ah yes, I understand. Thanks for letting me know. I found a workaround.

  • Alright, I seemed to have missed one object that I applied physics to. I removed it and now it works fine again.

    I tried to apply physics to a tilemap object, so I could implement some rolling rocks in my platformer game by adding physics to both the tilemap and the rock object.

    This seems to be causing issues.

    Is it supposed to throw errors when applying physics to tilemaps?

  • I didn't delete all physics objects, just the ones I created just before the problem arised, but only by removing the physics behavior from the objects, not the entire objects themselves. You reckon I should try removing the objects (sprites) as well, even in the project folder?

  • Hi!

    So I was happily working away on my game when suddenly I get this error message when I test the game in NWJs preview:

    I have no idea what caused this or why.

    It happened after I implemented some physics objects, but I removed them after with no difference. The error message still appears.

    If I click "OK" I can start the game up, but then when I close the window after, the NWJs is still running in the background, taking up memory and eventually gives me memory warnings and crashes the NWJs preview window.

    Do anyone know what the error message means, and what's going on? Maybe Ashley can help on this matter if its rather complicated?

    I could really use some help as this seems beyond my scope to solve.

  • I got it to work finally.

    Just as I was about to test your method, I realized I think you misunderstood the "is on screen" event. I'm not actually trying to test if any wasps are on the layout, only if they are in the visible area of the screen, which is what "is on screen" checks for.

    Here's what I ended up doing that's working now:

    Thanks for your time trying to help me!

  • Hi!

    Well what happens is, the sound only plays when all wasps are on screen. It doesn't work if only some is visible, or only one for example.

    Have been trying to tweak it any way I can, but it hasn't worked so far. Not sure if I'd like to overlay a empty sprite for this, but might resort to it if it works and if there's no other solution.

    The layer the Wasps are on, have default parallax.

  • Hi!

    I've been trying to figure out how to play an audio file if any of the same object is on screen. Then if none is on screen, the sound needs to stop.

    For example, this doesn't work:

    Does any one have a good example of how I can make this work?

    Thanks!

  • Hi!

    I noticed that, turrets seem to shoot towards its acquired objects origin point. Is there any way to make a turret shoot towards an image point in the acquired object instead?

  • Just thought I'd let everyone know I got it working with your help, so thanks once again!

  • korbaach Ah wow, that looks so much better for this purpose. I didn't know about it. Thank you for letting me know! I shall read up about it and implement it.

    Thanks for your time, it's much appreciated!

  • 99Instances2Go thanks for your suggestion!

    korbaach Yeah that's pretty much what I'm doing. I actually figured out what's making the loop not work. It's because I misunderstood how "index" work in regexMatchAt(String, Regex, Flags, Index)

    In the above image, the loop is only working once, because the regexMatchAt is at the second round of the loop, looking at index 2, then the next round for index 3 and so on.

    But the next line doesn't start until 17+ characters (in the file), so the next index shouldn't be 2, but 17+. The problem is, I don't know always how many characters each line will be, so I can't guess what index each loop round should have.

  • Okay, so I made another kind of loop like this:

    It works for the first fish object on the list, with UID 8. But it wont loop and continue on to the next line, and set the next fish to invisible.

    Do I have to add to the loopindex for it to progress? loopindex+1 or something?

  • Yeah I'm pretty sure I'm supposed to use a for each loop, but I have no clue how to make it work with regexMatchAt.

    This is the only thing I've been able to come up with, and it doesn't work of course:

    I'm sure I'm just missing something that's not clear to me at the moment.

    Thankful for any more detailed help.

  • Try Construct 3

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

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

    I'm making a platformer game where, when the player collides with a object called "fish", the fish object will set its own instance variable called "collected" to 1.

    Then, at some point in the game, each fish object that has the variable collected set to 1, will be "saved" into a file with the help of a loop.

    The file will look like this:

    ...

    fishCollectedUID:8

    fishCollectedUID:9

    fishCollectedUID:10

    fishCollectedUID:11

    ...

    If you ever exit the level to the Menu, and then chose to continue, I need to somehow make a loop that can find each new line with the word "fishCollectedUID:" and use the number written after to set each fish on layout to invisible with that UID.

    I know to use regular expressions, and I have no problem writing a expression to find the word "fishCollectedUID:" and the number. But I'm having trouble writing a loop that would go to the next line, after the one above has already been checked.

    Also, the number of fishes collected are unknown, since the player picks them up as he/she pleases, before going back to menu.

    For your knowledge, I also store the files content in a global variable, so I can check that with a regular expression like this: regexMatchAt(gameSaveInfo,...)

    Is it possible to do in Construct 2? Would someone be able to show me an example of how I could do this?

    Hopefully I'm clear enough with what I mean, and if I'm not, ask I'll try to be more specific.