nimos100's Recent Forum Activity

  • Don't think I have as well, except I do think it can happen if you manual go into the folder where your project is and start to delete files there. But doesn't sound like thats what you did.

    Yeah a screenshot could have helped, but if it was in the editor it self, it most likely something that should be reported in the bug section.

  • No you have ended up with the same picking mistake as so many others

    Every time you use an object, like you have done in the area I have marked with red, you do picking. It doesn't matter if it says "pick" in front or not.

    Rule

    [quote:7tdgzrfo]Whenever you use an object in a condition it will do picking!! doesn't matter what thing you are using, width, opacity, a variable or something else.

    So the problem occurs as you already in the Trigger pick one object which is the line that are destroyed. So now you have 1 object selected.

    So no matter what conditions you add afterwards, they will only be checked against this object. So you need to reset the picking. You can do that if you use the system action "Pick All Lines". That will Pick all lines regardless of any former conditions,

    From manual

    [quote:7tdgzrfo]Pick all

    Reset the picked objects back to all of them. Subsequent conditions will pick from all instances again instead of filtering from only those meeting all the conditions so far. See How events work for more information on how instances are picked in events. Useful in subevents to start affecting different instances again.

  • [quote:1gh9mew7]Best way is to build small things.

    What game you going to make?

    Does it need a welcome screen. Build just that.

    Does it need a options screen. Build just that.

    Does it need a character to move left, right, up, down. Do just that.

    Build your game in sections.

    Agree with Dutoit, another way that can be very useful is to grab a tutorial, like the Space shooter, I think its called. And change it, for instant see if you can make it so player can switch weapon, some enemies have shields which need to be destroyed first before the enemy take damage. The reason this can be a good idea, is because you are already building on a game, where you can expect things to be done correctly. So you have some guidelines to where you have to make you changes.

    Also I good idea is to make your own space shooter from scratch more in the way you want it, and if you get stuck you can see how it was made in the tutorial, and after a while you will look at the tutorial less and less, because you start to get hang of how things work together and your game might have evolved beyond the tutorial so it cant really help you anyway.

    [quote:1gh9mew7]I'm not really a programmer but I do know some html stuff a bit of css that's all. Since C2 is based on html5, do you think it would be a wise idea to learn html5.

    I don't think doing this will help you a lot, I would actually think it would confuse you even more.

    [quote:1gh9mew7]I'm still having problems with the proper flow of events, like when will one condition be a sub event, some actions stacked together those sort of stuff.

    Its a bit difficult to explain in a proper way I think.

    But try to look at it like this:

    Trigger

    <When something happens as a result of something else> (Sounds a bit confusing )

    But this is what you can refer to as a trigger, like if a person have a pistol and pull the trigger. The Trigger in this case is that the person have pulled the trigger and the pistol is firing.

    Condition

    <Something needs to be true or false> (This is just an If, Then Else statement)

    Using the same example as above, the condition in this case could be, that the person actually have a pistol, that there are ammunition to it. Could be that the pistol is not broken and so on.

    Sub conditions

    <Something needs to be true or false> (This is just an If, Then Else statement)

    Is pretty much the same as a normal condition, except that it works on former conditions to be true. And is more of a way to specify conditions and to make things easier to understand. So lets expand the example above a bit. Imagine that you have 10 people some of them have a pistol some don't, some have ammunition but no pistol. Some use energy weapons that doesn't require ammunition. If you try to throw all of them into one condition you will suddenly end up finding it very difficult to match these conditions.

    For instant.

    We want to see if a person can shoot, the requirements for this is that the person have a pistol with ammunition or an energy pistol.

    So we make the conditions:

    Person have a pistol (So this person should be able to shoot if he have ammunition)

    Person have ammunition to pistol

    Person have an energy pistol (So he can shoot)

    However now there is a problem. Because conditions are always "AND" statement. So all of them needs to be true. So in this example, we might have a person with an energy pistol, but since he doesn't have a normal pistol he cant shoot, because all the conditions need to be true.

    So to make it work, we need to break it down, and change the conditions to use "OR" instead of "AND" (Do that by right click an event and check "OR", so now it looks like this:

    Person have a pistol (So this person should be able to shoot if he have ammunition)

    or

    Person have ammunition to pistol

    or

    Person have an energy pistol (So he can shoot)

    So now the person with the energy pistol can shoot. However now a person that doesn't even have a pistol can shoot, but also a person without ammunition can as well. So clearly this would wouldn't work either. So to solve it we add a sub condition:

    So the first thing is to simply check that the person even have something to shoot with so this will be our Main condition:

    Person have a pistol

    or

    Person have an energy pistol

    Then we need to check if the person actually need ammunition or not, and since we are not sure if the person at this state is using a pistol or an energy pistol, just that he use one of them. So to check it we add two sub condition since the person can actually have one of each pistol:

    Person have a pistol (If this is true, then we need to check if there are also ammunition, so we add another condition)

    Person have ammunition

    If both these are true, the person will pull the trigger and fire the pistol.

    Person have an energy pistol

    The same goes for the energy pistol, but here the condition is just that the person have one, and if that's the case we fire that one as well.

    So sub conditions will to some degree come automatically as things start not to work, and you simply need them to get them to work.

    Actions

    <A change to something as a result of something else>

    In our case, when the pistol is fired the person will use one piece of ammunition each time they pull the trigger.

    Hope that make it a bit clearer.

  • [quote:dohcoijd]My guess as to the problem. Is like you said, over time the way speed works causes this separation. However I think it becomes an issue because the spawn rate is determined when an object gets destroyed. As things get faster, they might hit or detect a collision with the "end line" later or further away than they should.

    Yeah this crossed my mind as well, and might be the problem.

    [quote:dohcoijd]At least I think that makes sense enough

    It might very well work, please post the solution when you have solved it, would like to see it as well.

  • You are trying to stop something that is not there. In the "Stop audio" or what its called it ask for a tag, at the moment your tag is "". So for the background music just add a tag, can be whatever you want it to. And in the "Stop audio" you write this tag instead of the audiofilename and then it works.

  • [quote:28c7c1a7]Nice work. Looks pretty slick.

    I was reading up on the thread that explains why picking works this way now, and I'm actually confused.

    In the thread, it is explained that the object doesn't exist to same-level events until the next top level event. Then how come pick by UID works on our tests?

    Agree that it gets confusing, because its logic that you have created the object, so surely it must be there, but it actually ain't as explained by Ashley in that post.

    A solution also from that post is:

    [quote:28c7c1a7]The workaround is to try to do everything in the same event - nest the other events beneath the creating event if possible, so everything is moved up in to the green area.

    Which are the reason that you can create an object and right afterwards set its variables.

    Create object

    Set Object name = "Whatever"

    That also means that you can pick UID of the object if its in a sub level of the create function.

    But if you do it like this:

    level 1: Create object

    --------------Do something

    Level 1: Pick Object with UID of the newly created object shouldn't work.

    You have to reach a top level. (Now this post is from version r102, so its pretty old, but don't think a lot if any have changed.)

    However the common way of dealing with this problem as you most likely know is to throw in a Wait of 0, 0.1 or 0.01 or whatever as it will then go through to the next tick and force it to reach a top level or what to say and then it works. Im not really sure how solid this actually is, it seems to work well with simple stuff, but if it gets a bit complex it seems to not really work well.

    For instant if you have an event:

    Repeat 10 times

    ------- Call function("Spawn enemy")

    Function Spawn enemy

    Create enemy()

    Call function ("initialize enemy")

    Function Initialize enemy

    Call function ("Create enemy weapon")

    Function Create enemy weapon

    Create Enemy_weapon

    Then suddenly things starts to go wrong as I see it.

    Because now there are actually two objects that doesn't exist yet, The Enemy and the Weapon that you want it to use. So if you throw in a Wait different places to solve it, It might work. However at the very start we are actually repeating this 10 times, to create 10 enemies which will then create 10 different weapons, so suddenly you might have 20 objects that actually doesn't exist, and then it seems to go wrong. Whether that's completely true im not 100% sure about, but it seems that a function doesn't count as a top level, which I find to be logic if its the case, but I haven't seen anything saying that it ain't which is why im not certain.

    As I mentioned in my last post, I had to repeat it 5 times, but I did something similar with 50 objects using a wait, and it looked like it was working fine, however as I went through the objects in the debugger I could see that suddenly some of the objects would have "NaN" in some of the variables. Which didn't make sense as 95-98% of them had no problems and all different possibilities for this variable was used, but for some reason some of them just failed, and my guess it that since I repeated it several times, it might have screwed up with the wait somehow. So the only thing I did, was to move the function call to the Object handler, didn't change any code and none of them had any problems after that, same goes for several other mistakes that was happening. So I moved those as well and now all of them gets initialized correctly, without having to use wait, which I think in itself is a huge benefit.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • [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.

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