EzekielRage's Recent Forum Activity

    still doesnt change the fact that i can't get it to work to actually do something when the player is closer than 80 on both X sides. i can get it to work on one X side but not on both. Technically i could try to fake it by mirroring it depending on where the player is and then check the door if it is mirrored or not and compare that to the player distance on X BUT that is an overly complicated way and does not really do what i need since the door would then only move if the player is within that radius.

    so any help on that would be appreciated, but thanks for the comments so far

    okay thanks,

    i set that up with else and everything but it still does not work

    i put a soundfile in just to test before i ut the open door code in and, well, the soundfile plays over and over until i move close to the door on one side, and that's it.

    i have multiple doors, is that the problem?

    edit: i put in the movement and now all doors in the map just move down and are gone - no matter how close i am

    okay but HOW EXACTLY do i set that up?Sorry but I have NO clue what that means

    Okay, and how do i set it up? do i put that in the door sprite? compare X and then this or how does that work?

    I am looking for some advice, please, about the doors in my game.

    It is a sidescroller. The idea is simple: Player walks up to a door, door opens. once player walks away from the door, door closes again.

    i do this with player.x and door.x but here is the thing: it should work from both sides, so i figure i have to use lerp but i have no idea how that works. also, the door must always open fuly and close fully, preferably until it hits a solid tile.

    so the code should be something like

    if door.x is less than player.x+80 then use 8 direction up until you hit a solid tile. then switch on instance variable to "open" and stay there. if player is away more than 80 then close until you hit a solid tile and then switch to instance variable "closed"

    i can do most of that but i have a problem with the range. how exactly do i tell the door that it should only move if player is closer than 80 in both directions, left and right? and only that particular door?

  • THanks! This is EXATLY what I need

    THANKS!

  • My system is similar, really but I don't use lerp. perhaps i should try lerp, whatever that is, as i have read already in some tutorial to use it, not sure what that was though^^

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I have a big layout and i want to restrict the camera within this layout. So what i do is I have a camera object that follows the player on X (due to the way the game is structured) and that works well.

    so at the oment i have a trigger in my level that, once the camera touches it, stops the camera from following the player. the result is that the player moves within that camera zone that does not move.

    that also works as it should.

    now, sometimes i want the camera to stop at a certain point and then later move again at a certain point. i do that with triggers and that works well BUT there is now a jump in X positions in the camera. and here i figured to avoid that, wouldn't it be possible to tell the camera to automatically stop moving when the edge of a area is reached, kinda like when it stops scrolling once the edge of the layout is reached.

    i am not sure i am explaining this correctly, though. technically speaking, everything works as it should, it's just not pretty, is all.

    so yeah, is there a way to define an area within a layout and bind the camera to that area?

  • Haha yes, we live and learn

    Still glad you all tried to help me with it, glad to see a nice community work so great

  • I finally managed to locate and fi it! And the error was so dumb, so incredibly stupid that I almost feel ashamde :p

    Turns out I had a second player instance on the layout. I dropped it ther accidentally, behind all layers so it was invisible, and that caused the error. I found and deleted it and now everything works as it should.

    Thanks for the help, ideas and al that. Thanks a lot

  • as said if i delete everything the error is not reproducable if i strip everything. it is reproducable if i just disable everything. so either the disable function does not disable everything as it should or something on my system is interfering with the variable in a different way...

    the thing is, by deleting and disabling i got even more confused. i now know that the error occurs when certain cireteria are met, but there is absolutely nothing in said code, consisting of TWO events, that are even remotely related to the issues at hand. as in, i have an issue with a global variablebut if i disable the event that loads a different variable that is not connected to the other in any way with a background music the thing screws me over. weird^^

    Further Testing reveals that he only does this on one layout. If i change NOTHING and simply go to a different layout, everything works as it should.

  • Unfortunately i can't. If I could reproduce it, I would have found the error by now. Every time i copy the part of the code that's needed to a new file the error is gone. but even if i disable everything else in the main project, the error persists.

EzekielRage's avatar

EzekielRage

Member since 2 Sep, 2013

None one is following EzekielRage yet!

Connect with EzekielRage

Trophy Case

  • 11-Year Club
  • Forum Contributor Made 100 posts in the forums
  • RTFM Read the fabulous manual
  • Email Verified

Progress

14/44
How to earn trophies