nimos100's Forum Posts

  • [quote:rwhfpleo]I think the best thing to try at this point is to have the line pieces also spawn the new lines from themselves. I think then, I wont have to worry about lines separating over time.

    The problem is that it shouldn't matter from what I can see, the problem occurs as the speed get to high. The way you have already done it with the custom movement is as far as I know the most basic way of doing it. Meaning that you simply apply the same speed to all objects and checking the debugger and the different lines, it does indicate that they are all in fact moving at the same speed. And that the problem happens within a very few ticks, maybe 1 or 2 I would guess. So exactly where and why it goes wrong im not sure. But if the most basic way of doing it doesn't work. I cant see how adding more complexity will help. And its not a consistent problem, some of them works fine, and doesn't seem to be linked to any specific lines, but just random ones at random times, but definitely as the speed increases it becomes more and more. I have checked the imagepoints to see if it could have been one of them that was off, but that doesn't seem to be the case. But I would like to know the solution as well. But at the moment I don't have time to try to solve it as im not really sure where the problem is in the first place.

  • Yeah should be possible if you set the angle limit low enough. I haven't really made a tower defence game where turret ain't able to rotate, so there might be a better way to do it, with just the line of sight setting and turning rotation off for them. But maybe someone else can give a bit better answer to it.

  • I don't think there is a setting for it, but you could do it with an angle check:

    if turret.angle is between 0 and 90 degree set range = 10

    if turret.angle is between 91 and 180 degree set range = 200

    Or whatever you need. You ofc just have to use the correct angles, but not sure its exactly what you are after.

  • Don't know if there is a website that explain it, probably is. But basically a state machine is just a "Flag/Trigger" machine with behaviours, which you can make with Booleans.

    Example:

    Object: A Worker

    Int Hungry = 100

    Int Tired = 100

    And what else you need.

    Behaviours:

      Behaviour_Go_Eat = false Behaviour_Go_Sleep = false Behaviour_Go_Work = false Behaviour_Working = false Behaviour_Defend = false Behaviour_Guard = false Behaviour_Flee = false

    Each behaviour is just true or false and control what behaviour the unit should do or are doing.

    For each of them you make a function that you call whenever one of them are true.

    You can do that by making a behaviour machine:

    For each Worker

      If Behavior_Go_eat = true then Function("Go_Eat", Worker.UID) If Behavior_Go_Sleep = true then Function("Go_Sleep", Worker.UID) and so on.

    To trigger the behaviours you just use the variables for the worker.

    So could be that every 4 second you subtract 1 from Hungry.

    And then you make events that activate the behaviours based on certain conditions:

    If Worker.Hungry < than 30 Set Behaviour_Go_Eat = True

    If Enemy is within 200 pixel of worker Set Behaviour_Flee = True

    Then you ofc have to make it so if Worker is working and suddenly an enemy shows up, you set behaviour_working = false and Flee to true.

    This is just a rough idea of how to do it. Then you can expand it, with priority system, so Eat will make the worker stop working, or a worker prefer to gather wood over mining and so forth.

  • Another way could be to just make a background image the size of you view. (1680,1050) if that's you size.

    Then at the right size just outside the screen (Assuming the player fly left), you add some spawners, which will spawn different things that fly from right to left. Could be meteors, stars, planets etc. Giving them different speed, and different layers to create depth. Then you can create the illusion that the player is flying through space, but are really just moving on a single screen, that way you can make the game level last as long as you like.

    To make the stars, you add a black background (could make it with some stars on it), then you make a star layer and a spawner, that spawns stars that fly at different speed, think that would work fine.

  • [quote:4f4pops4]However, excluding one key from this mirroring process is my problem, not the basic mirroring of the values.

    Not sure if I understand what you mean, but there is no difference in using numbers as keys or something else.

    When you press 4 to copy all keys in this example, it will exclude the first key:

    If that is not what you mean then im not sure I understand what you want.

    [quote:4f4pops4]In order to differentiate between the two instances of the object, I need to keep one key's value separate. This is the "alias" key. In my post I mention that the "alias" key of one instance is set to "temp" and the other is set to "default". This is the only key that I don't want to mirror.

    But you can just use two different objects and in the start of layout, make it copy all keys, as in the screenshot, and just remove all exclusions. Then you make another one, that copy keys using exclusions. Then you don't need to worry about families, identification key etc.

  • Here is an example of how to copy keys from one dictionary to another.

    There are 3 keys:

    1 = A

    2 = B

    3 = C

    Keyboard:

    You can copy single keys with 1-3

    And all keys on 4.

    I haven't added any exceptions but shouldn't be hard to add them in the Copy all keys with some conditions I think. Anyway at least that's a way you could do It.

    (Use the debugger to see it)

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I have looked through your code and that's the reason I posted those links, as from what I can see these are the areas that you need and are stuck with. But also I wouldn't know where to begin, it would require a huge restructuring of the code, that would simply take to long time to explain and probably wouldn't make much sense to you, if you are not somewhat into what those links are about and how to use them.

    A good advise when you post for help with a Capx is to make sure there are comments and groups, its not easy for someone that looks at it the first time to troubleshoot it, and think most will not even bother to try, simply because It takes to long time. And ofc be specific about the problem, you haven't said what you want them to do, and looking in your code, it seems that they can only attack the player? Which makes it even harder to know what exactly you are looking for help with.

    If you are not sure about how to pick object, use loops etc. Make a simple app with 3 instances of an object, which can just jump to a random position on the screen or something like that and then just try to find a way so you can pick the correct instance or make all of them do it using a loop. And then try to copy it to your game.

  • How big your tiles are doesn't matter at all I think. However the size of tilemaps overall and especially the image that you use for the tilemap can increase the loading time a lot. How big are they, pixel wise?

    For instant in my game I use 12 tilemaps on the same layout with a size of 4000, 4000, however the images for the tilemaps are just 320x320.

    Stats:

    Memory: 29.2 mb

    FPS: 60

    CPU: 44%

    But the map doesn't take more than a few seconds to starts. Which is not really the tilemaps fault, but because I generate a collision map for each of the 62500 tiles on the map. Which I would consider a CPU demanding task. So to get up to 20-30 seconds you must do a lot of things?

  • A few more features would be helpful. Especially layers.

  • This might be helpful.

    Events:

    https://www.scirra.com/manual/75/how-events-work

    Objects:

    https://www.scirra.com/manual/68/objects

    System conditions:

    https://www.scirra.com/manual/124/system-conditions

    Basic picking:

    [quote:dphqktb8]It sounds like you (not uncommon) get a bit confused about how picking works in C2.

    But the way you can look at picking of objects is like a sorting or reduction machine.

    Imagine you have 100 workers with the following attributes.

    100 Workers in total

    20 Workers are wearing a red shirt.

    40 Workers are wearing a blue shirt.

    30 Workers are wearing a yellow shirt.

    10 workers are not wearing a shirt.

    30 Workers are between 40 and 50 years old.

    50 Workers are between 20 and 30 years old,

    20 Workers are between 60 and 80 years old (No pension for these poor bastards!)

    Lets say you want all workers wearing blue shirts and that are above 60 year old to either go home or go to lunch.

    So what happens is:

    Pick all Workers : You pick all workers that match the condition that they are workers, in this case all are so its 100. (You don't really need this, its only for the explanation.)

    Workers must have blue shirts : This will reduce the number to 40 workers.

    Workers must be older than 60 : Depending on how many of those 40 workers matching this you will get a new number that further reduce or sort the amount of workers matching the former condition. Lets assume that its 15 workers.

    Now we cant reduce the amount anymore and we have found all the workers that match all our conditions. And since we want them to either go home or to lunch, and don't care how many goes where. We can do the following.

    For each Worker : This will go through each of the 15 remaining workers and tell each of them to either go home or to lunch.

    Go home or Go to Lunch

    So that's pretty much how it works whenever you pick objects, that you keep reducing or sorting them until those that remains fit whatever you want. And then if you want them to do different things you throw a "For each" at the end and then the options they have afterwards.

  • I looked at it, and it seems like it just cant keep up, for some reason. Not sure how to solve something like that. I tried to just use a every tick and set the Y value, but it was the same thing. Not sure it will work even with a pin or overlapping check, if it cant keep up without. It might be more solid, but might result in it seeing like its lagging or something. Maybe someone have made something similar that have a solution.

  • Not sure if its possible but would be nice if you could slide the line between the name and value. (See image:)

    Its a bit extreme in this example but sometimes it nice to use longer variable names. If its not possible to make it slide, then maybe do so the value are the one dominating instead of the variable name. Or make it possible to switch between them. Anyway a minor thing.

  • > (...) However the persistent layout I don't think will help you a lot, as it will make things persist as you switch layouts (...)

    >

    It is ment as an example to show him that it is possible to transport the player from one layout to another

    I completely forgot that part of the question as you had already answered it, so thought he was just going off track, sorry

  • Ok thought you meant something else, when you said patching.

    All the informations can be saved, so cant see why you shouldn't be able to reload it, if you update the game, unless you do something that would require something from the save game that is simply not there. I haven't worked a lot with the build in save functionality, but if you are careful and plan the game well, then why not

    However the persistent layout I don't think will help you a lot, as it will make things persist as you switch layouts, but if your save games are screwed then it wont work anyway. What you want is to load an old save game for an updated version of your game, so I would check that out first if I were you, if I understood you correct that is