99Instances2Go's Forum Posts

  • First this. The key controls dont work for me. I suppose the functions are not in place yet. I have set the platform on default controls to be able to move the player. I had to change the gamepad triggers to a key trigger for the same reason.

    You have doorObj.nextLayout set to "test_01" in the properties plane. Dont use the "'s In the properties plane to assign a string to an instance variable. Just test_01 without the ""-tingys.

    That event can much easyer. This does allready what you want. And it is not running every tick the player is overlapping a door. Only when the key is pressed (had to change the gamepad trigger, dont have one).

    https://www.dropbox.com/s/q0g7aopkpvs3c ... loos-1.jpg

    Then there is something that i dont understand. The two player objects are set Global = No, in theire properties. Normaly, if you change layout, they should get destroyed. So you must create them somewhere, but i cant find the creations in your, dang well commented and organised, project.

    Normaly, one would set those two objects to global. Global means, once added to a layout, they stay forever. Even if you change layouts. Till you destroy them, ofcourse. Theire instance variables will also survive a layout change. At this moment you move the object to global variables for a new x&y. Hence: Global. If you make those objects global, you could let the door write to instance variables of the player-helper, wich is more elegant, and flexible.

    It is common use to start the game in a 'loader layout'. This layout contains the Global objects, it loads everything needed from Local storage, sounds ... etc. And then moves to the actual layouts, taking the Global Objects with it.

    If i do so in the project, i get two players on layout change. They are not in layout of test 1 & 2, so they must be created somewhere. But i am to dumb to find the create actions, or i misunderstand something.

    Something totaly differend. I dont like the lerp on the camera. Lerp expects static input. If you use non static inputs, the lerp will never reach the destination. Resulting in a restless camera and flickering, because you have pixelrounding set.

    Hope i helped. The main problem was the "" in assigning text to instance variables in the properties plane.

  • Opens fine. Works perfect. Must be you.

  • I see that you in the 'on created' (for each created Enemies) have obstacles set. There is no use for that on this point.

    Keep 3 things in mind considering this practice.

    1/ There is only one obstacle map. Give any path-object a new obstacle map, and you give every path-object a new obstacle map.

    2/ Adding obstacles is not enough. You have to Regenerate obstacle map for it to take effect.

    3/ The obstacle map will be ready the next tick. Not inmediatly.

    Same thing for the LOS.

    So in fact, those non moving walls, they need to be added as obstacle only once. Preferable in the On start of layout.

    More. About the Line of Sight (LOS). There is a new path generated when the enemies do not see the player. And this every 0.5 seconds. I dont understand what you want to do with this. They just run to the player. And when they see the player, they just keep running to the postion the player was in the situation that they did not see the player. Because they keep moving on that path that was created when they did not see the player. At the same time, when they see the player, they move 5 pixels every tick towards the player. Making weird moves.

    You do al this afford to keep them out of the walls, with the pathfinding, and then you just murderous send them into the walls at 5 pixels/tick. When they collide with the player they even make jumps that are even bigger then the walls. More about that later.

    First. Consider also this. Finding a path takes time. How much time depends on the map and also and especialy on the computer used. I have posted examples for pathfinding that work smooth on my computer, but dont work on the computers of the people who the examples where meant for. For this reason, i dont do path examples anymore. Your enemies all find a path on my computer. So, on my computer, your paths work. On your computer 0.5 seconds can be to fast to force it to find a new path. In that case, the 'on path found' will only sometimes trigger.

    About the combination Car/Pathfinding. Pathfinding is not avoiding solids. It just guides the origin of the object trough the cell size and border. I does not know the size of the path-object. Your walls are 15 pixels. The cell size is 15. The border is 20. The enemys are 32 pixels. So the enemys need 17 pixels room. But they need to be able to turn (especialy the long ones), so we need to account for the diagonals. And some are really long. So on the corners, they just do not have enough room. And the pathfinding is pushing them in the walls. The pathfinding dont mind this.

    But then the car kicks in. You have it set to stay out of the solids. That happens with a 'push out of solids routine'. Between the redrawing of the screens, meaning you dont see it, every solid that gets pushed into a solid gets pushed out of that solid. And that is how this works. Simple as that. So, the pathfinding is pushing it into the solid, the car is pushing it out of the solid, the pathfinding is pushing them into the solid, the car is pushing them out of the solid .........

    And this way a lot of them get stuck.

    About the combination Car/Jump by pixels every tick. The walls are only 15 pixels. You make make jumps of 30 pixels. And jumps of 5 pixels each tick. So you push em into the solids. The car is pushing them out in the shortest direction (in the direction that they the least overlap). A lot of times you jump them so far in the walls, that the car is pushing them out in the other direction then that they came into the wall. Thats why they jump over the walls.

    I understand what you want to accomplish.

    I suggest, make the cell size at least 30, have to experiment with the border, but i think 10 should be fine. Have to tweak with try and error, so they dont touch the walls. Make theire collsion polygones a few pixels smaller.

    Dont regenerate the obstacle maps for non moving objects.

    You dont need the LOS in your concept, i think. At least stop them moving on the path when they have LOS.

    Dont force them to find a path so often.

    And above all. You need another way to jump them towards the player. Probaly using the car controls. That way you dont break the car's solids behavior.

    I think the walls can be a bit wider too.

    Sorry to give you so much info, doubt it you will even read this gd long read. I would probaly not.

  • And the question is ?

  • An array is organised variables. So is a csv table. And your English is as good as mine.

    I never used a csv table myself in Construct. But just in case you need them ...

    Here are exellent plugins to handle a csv in construct.

  • another thing : how can i save this data ? and load again ? automaticly

    Forgot your own question is guess.

  • I used an array, so you can localy store the array.

  • You need this plugin.

    The object created by the create action can not be influenced by any condition.

    If you create a family, it picks a random from that family to create.

  • Did you divide by zero ? Making the previous 'every' wait forever?

    The 'every' accepts a new time after the previous one has expired, i think. Should be logic, because it skips ticks when its not true, not true means that it is not time yet to fire.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Ok, so you want to go to a layout containing a certain object?

    Make a global array. Pre-store all the info in it. Evaluate.

    Update the array when in a certain level.

    Layout name can be an expression. Expressions can contain variables.

    https://www.scirra.com/manual/78/expressions

    And it is not 'only like no more then go to layout by name'. That is just the action. You dont need no more then that one action to change to another layout.

    The thing is ofcourse, the condtions that lead or not lead to a change of layout. There are miljoens of combinations thinkable.

    By example.

    If variable = 2

    got to "layout 1"

    Else go to "layout 3"

    on player collsion with leftsideofthedoor

    got to "layout "&str(door.desti)

    on player collsion with rightsideofthedoor

    got to "layout "&str(door.prev)

    The question is so general. Answher can only be general.

    https://www.scirra.com/manual/83/variables

    https://www.scirra.com/manual/73/instance-variables

    https://www.scirra.com/manual/108/array

  • I suppose the 'string' is an instance variable in object C, and that there is only one object C. If there are more instances of object C, you have to explain wich instance of object C must be picked.

    I suppose the string is made and present.

    Then (under those circumstances) ....

    Trigger for Instance of Object B's tween ended ... sets that that object picked.

    There is only 1 instance of object C .. so it does not need picking.

    In a sub, evaluate the instance variable of Object C with the string in Object B.

    If not true, reset B, it does not need picking.

    For the others the easyst thing is to use a Function. Because Functions start picking from scratch.

    So, if the evaluating condtion is not true, ....

    call a function 'send all B back". In that on function you dont need to pick, just the action to send B back. (when not picked, actions adress all B's)

    call a function 'reset all A". In that on function you dont need to pick, just reset A (when not picked it resets all A)

    Hope that is clear.

  • i repost this capx later, after i checked it, and after Spain

  • >

    > Thanks for share and spend time or thought to me but it's not in accordance with my idea (Y)

    >

    > *Solved

    >

    I gave you the answer in first post. Its exactly the same solution, the same technique.

    Guess you got confused by the bullet.

  • Provide a basic capx ?