InDWrekt's Forum Posts

  • For uploading, You can attach your file to your post here (if it is smaller than 2 MB). If it is larger, most people here seem to prefer dropbox. It is the most common though it isn't the only method.

    You are most likely correct that it is a collision between top and bottom. You could test this easily simply by turning off collisions on 1 or the other. It could also have to o with collisions on background items. If your character spawns inside a solid object or gets pushed into one, it will be pushed out. This could lead to being pushed into another causing it to be pushed more.

    If you find that it is caused by the 2 separate sprites, you can do a couple things to fix it:

    Option 1 - if you can get by with only 1 of the 2 character parts having collision, than remove it from the other. This will stop the glitch and still allow both sprites.

    Option 2 - you can create a controller object which handles moving the character around and pin the character sprites to it. In this option, you would remove collisions from the character sprites and allow the controller to handle it.

    Of course there are other ways to fix this but these 2 are simple and should resolve your bug. Good luck with your project.

  • Check the example EgoAnt posted in this other topic:

    He has 2 turrets, each with a different allowed angle of rotation.

  • I found your previous topic and downloaded your file. When I run it, I see both layouts counting up at the same rate. Starting on layout 1, the text begins counting, when I swapped to 2 it takes up the count right where I left off. I don't see the NaN result. I ran it in Chrome, FF and IE11. It ran fine in all 3. What browser are you using?

  • NaN means Not a Number. You will want to make sure the 0 is not "0". If it's wrapped in quotes, Construct would try to store a text value, not a number value. Hence the NaN result.

    If that is not the case, I would have to look at your capx to help further.

  • Here is something you can do to make your program a little less CPU intensive:

    1 - When a target is found, set a couple variables to store the targets X and Y.

    2 - If the target is outside the attack distance of the object with the PF behavior, run the PF behavior to get the original path.

    3 - Every second (or any time length you feel works best with your setup) check the targets position against the oiginal X and Y to see if a new path needs to be found (set an acceptable margin of error so if the target is say 10 pixels away from the origin, it still counts as in the origin)

    4 - If the target has moved far enough, run these steps over again.

    This will keep the PF behavior from triggering every tick and allow your characters to each find their own path.

  • Add a Global variable which stores the time the layout starts. On start store time in it and use the following equation to set the time text:

    settext(int(time - LayoutStartTime))

    [attachment=0:29slsrju][/attachment:29slsrju]

  • The size of the text object is too small. Stretch it out.

  • Only give the family that has ALL the bug types the behaviors you want them ALL to have. If the 1-5 family has the behavior, all the objects in the family have the behavior so adding the behavior to the 1-3 and 1-4 types is redundant. You would only use the lower level families to spawn the bugs while the higher family would do all the processing.

  • Use zeropad(Value, N):

    3. Append seconds: zeropad(seconds%60, 2)

    zeropad adds 0s to the front of a number until it is N digits long.

  • The drag and drop behavior has a property call "Axes". Set it to Horizontal Only.

    [Edit] I realized I made an assumption when I wrote this. I assumed you knew where the properties for behaviors were. If you do already know, you don't need to read any further.

    If not, I'm sorry. I should have been more clear. This is how you get to the properties for behaviors. The entire left of the screen is a menu called Properties. Select the Bread object in the objects menu on the right of the screen and the Properties panel on the left will show properties for the sprite. If look through those, you will find the Behaviors group and inside is the DragDrop behavior.

  • Here is your file edited. This is what I did to make it work:

    1 - removed the "not occupied" condition and set it to an else event. This means anytime the previous event fails, the else triggers.

    2 - As a bonus, I combined all 4 of your set worker animation events into a single event.

    Hope that gets you what you need and good luck with your project.

    p.s. I didn't really look too hard into why the "not occupied" event failed.

  • Give the bread the "Drag and Drop" behavior. That's all you have to do.

  • You can set a boolean local variable called something like SHOOTING and set it to true when the player starts the turret shooting. Then, use it as the condition for the turrets shoot action.

  • Try Construct 3

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

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

    In my experience, it is always better to have variables local to the object using them and only use globals where there is no object which could logically contain them. Global variables always have the possibility of causing odd bugs. Plus these kinds of bugs can be extremely hard to debug. Even when using a variable that is manipulate by multiple types of objects (for example, health on both the player and enemies), I create a family and add the variable to the family. That way it still keeps the variable local to the group of objects using it.

    Not only does this protect against bugs but, when your project gets really large, you always know where to look to find the variable. If you have some instance variables and some global variables, it takes more effort to keep track of where to find them and what they do.

  • Windwalker

    If you take a look at the game "100 balls" you will see there are cups that move around the screen. These cups are what Heska is trying to duplicate. The cups hold balls in them as they move and dump them elsewhere. If Heska sets the the physics to disabled, then any physics object in/on/colliding with the cup would simply fall through. Turning off the physics behavior is not an option.