nimos100's Recent Forum Activity

  • Hello,

    I have objects have pathfinding, but sometimes they don't move, and after i close game and open it again, they start moving. (android)

    on path found -> move along path

    i also have this.

    I don't think we need capx, because IT IS SOMETIMES WORKING, AND SOMETIMES NOT WORKING. that means they can move sometimes, so there would be nothing in the events. i wonder if it is a bug or sth of pathfinding/c2/crosswalk. (also sometimes happens when testing in the browser)

    Anyone experienced this problem?

    Not saying it is, but your problem might be related to this one that I experienced. If there is something wrong with the path finding behaviour. Then it might explain why yours sometimes work and sometimes doesn't.

    https://www.scirra.com/forum/path-finding-why-doesnt-this-work_t117025

  • Problem Description

    Path finding is not working correctly, seems to ignore all other objects collision settings besides the first added object to the project that uses the behaviour.

    Attach a Capx

    Description of Capx

    Move two objects from there starting position to a X,Y coordinate. And on the way they have to move around some obstacles.

    Steps to Reproduce Bug

    Full description of the problem can be found here - https://www.scirra.com/forum/viewtopic.php?f=147&t=117025&p=842288#p842288

    Its not easy to explain without adding a lot of screenshots. Which are already added in the forum topic.

    Observed Result

    Ignore all other path finding objects collision settings, and uses the settings for the first added object to the project that uses path finding.

    Expected Result

    That each object would use its own collision settings.

    Affected Browsers

    Not browers specific.

    Operating System and Service Pack

    Windows 7

    Construct 2 Version ID

    r182

  • Yeah making one now

  • Seems to have something to do with that it only take the first object into account. The red object was the first one added and if I delete that from the project the path finding works again. However now its just does the same with the green object as its now the first object, so if I add another object again. Then the green object is controlling the path finding and that one bugs again.

  • Pretty sure its a bug, did some more testing.

    Added another object to test against collision with.

    If I tell that the green object should collide with it, it doesn't react at all. However if I disable that and enable that Red object should collide with it, both of them again try to avoid it.

    However now it gets even weirder

    If I change the code like so.

    They behave like this, and just completely ignore the tilemap

  • I think it is a bug. Seems like there is only one global pathfinding obstacle map and not instance specific. Even if another is set to solid and other for custom it doesn't seem to work.

    Perhaps an oversight after regenerate region feature?

    Yeah you might be right, I cant recall if I have had this problem before.

    But I cant figure out if its just something I have forgotten to check, but have use the path finding behaviour so much, that I would be surprised if that was the case, also why I ended up checking the manual to see if I had forgotten something. But cant see that there should be anything wrong with what im trying to do.

    I also tried to move Clear obstacles for the green object to the On key pressed event and regenerate it there according to the manual, but doesn't make any different.

  • I don't know if I get immersed to games or I would just call it interested, but for me to do either the games have to be spot on. And most games that are released just doesn't do that I think, very few of the big companies that make games, seems to lack the required gameplay elements needed to make interesting games. They have nice graphics and such, but when you feel like you are constantly stopped or prevented from doing what you want to do, I tend to quickly loose interest in the game. I personally like open ended games where you can pretty much do whatever you feel like, when you feel like doing it and not because you have now completed level 1 and ready for level 2.

    So games like The elder scrolls series, X-3 (The old ones) are games that can keep my attention because you can always change things around. But besides games like that, I pretty much only play indie games, they seem a lot more creative than the big companies, maybe because of the drive they have to make there game, rather than just throwing something together that have been seen 1000 times before and make some money from it, not sure.

  • I have some problems with the path finding, and cant see why it doesn't work as it should according to the manual if I understood it correct.

    There are 2 objects that are told to go somewhere near the X. Both have path finding and set to custom Obstacle, the tilemap doesn't have solid behaviour, not that it makes any difference.

    From the manual:

    [quote:1qs6f342]Obstacles

    If Solids, the behavior will automatically mark cells touching objects with the Solid behavior as being obstacles. If Custom, you must define which objects are obstacles by using the Add obstacle action on startup.

    So I tell Object 1 to add the tilemap as obstacle and clear all obstacles for object 2, which shouldn't be needed in the first place.

    [quote:1qs6f342]Add obstacle

    If the Obstacles property is Custom, add an object to mark as an obstacle in the pathfinding grid. If this is done during the game (after Start of layout), you must also use Regenerate obstacle map for it to take effect.

    Since this is done at start of layout Regenerating the obstacle map for Object 1 doesn't need to be there. I was just testing.

    [quote:1qs6f342]Clear obstacles

    Remove all obstacle objects added with Add obstacle. You must also use Regenerate obstacle map for this to take effect.

    So in desperation I added Regenerate obstacle map for both objects which again shouldn't be needed.

    However when I run the program, regardless of adding all the actions that shouldn't have to be there or removing them.

    The objects behave like this:

    The red object behaves as it should, however the green object insist of also seeing the tilemap as an obstacle. And I cant figure out why it does that. As it clearly state in the first quote:

    [quote:1qs6f342]If Custom, you must define which objects are obstacles by using the Add obstacle action on startup

    None of the objects are part of a family or anything they are 2 separate objects.

    Anyone know why the green object behaves like that?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Player is overlapping and Enemy is overlapping, these should be able to solve it for you

  • Might not be the most elegant solution, but cant you just make it so when you create an enemy you select one of the pieces, maybe torso, if there is one like that, and make that the "master". Then you copy its UID into a variable called Master_OBJ or something, that all the parts for an enemy have and whenever you have a collision you just select all family objs that share the Master_OBJ value and apply the effect to those objects.

  • To me it looks like it would be better to split it up in to 3 events. Because that way you can lock the chest to an character more easily and it makes it easier to program.

    1. An enemy that is currently not picking up a chest need to find one to pick up.

    Con:

    For each enemy

    Chest is not Chosen

    Enemy have LOS to chest

    Action:

    Chest chosen = true

    (However you need to make sure that the enemy doesn't pick up everything. So we alter it a bit.)

    Con:

    Enemy.interact_UID = 0 (So if the enemy currently doesn't have a chest targeted it will look for one)

    For each enemy

    Chest is not Chosen

    Enemy have LOS to chest

    Action:

    Chest chosen = true

    Enemy.interact_UID = Chest.UID

    2. When the enemy have found a chest to pick up it will rotate towards target. (This is a new event)

    Con:

    Enemy.interact_UID > 0

    For each enemy

    Pick Chest by UID = Enemy.interact_UID

    Action:

    Enemy rotate 10 degree towards (Chest.x,Chest.y)

    3. When reaching the chest it will pick it up (This is also a new event)

    Con:

    Enemy.interact_UID > 0

    For each enemy

    Pick Chest by UID = Enemy.interact_UID

    Distance(enemy.x, enemy.y, chest.x, chest.y) < 10

    Action:

    Chest destroy

    Enemy.interact_UID = 0 (So it can pick up a new chest)

  • [quote:1ovc1i8f]chest has NOT been picked up by player

    chest chosenTRUE (chest has been chosen by a character)

    character has LOS to chest

    • ---- action ---- character rotate angle towards chest (set the character towards that chest)

    But you need to make sure that its the correct character and chest that gets picked, in this case it can be any character that have LOS to a chest which have been chosen.

    [quote:1ovc1i8f](sub events under the above)

    stuff when the character gets within certain distances do certain things

    when character is on top of chest set the picked up boolean to TRUE

    add the chest count variable

    destroy the chest

    If the main event is not picking correctly then this will not work correctly either. So when you fix the main event then you can fix this one as well. As you should then have the correct character and chest selected.

nimos100's avatar

nimos100

Member since 23 Sep, 2012

None one is following nimos100 yet!

Trophy Case

  • 12-Year Club
  • Coach One of your tutorials has over 1,000 readers
  • Educator One of your tutorials has over 10,000 readers
  • RTFM Read the fabulous manual
  • Email Verified

Progress

16/44
How to earn trophies