LukeWolf's Forum Posts

  • Sorry I don't understand what that means.

  • Okay, thanks. I just have one more problem in regards to this issue:

    Person is underneath building. This is bad for buildings, but it's good when it comes to checking characters with characters.

    This is the good part about it, though:

    The person can go behind the building a bit on the right hand side.

    Now, I just need to consider the X value of the objects in the family. Here is the code at the moment:

    I have put the X value into an instance variable and an image point in the bottom corner of the building (this is the point I want to use to consider the Z order of objects), but I'm not sure how to get the family to consider the X value of all objects inside it. Every attempt I've made seems to not work properly.

    Is there a way to get all objects in the family to see if the X value is greater than the building before moving it behind it?

  • Thanks to both of you for your help.

    Dop, I think performance will eventually become a priority in my project as it will be quite large. Is there a way I can incorporate your solution but say if I had other characters? yoyoEleanor's example perfectly orders everything correctly regardless what object it is, which is exactly what I'm after because there could be other characters moving around that should have their X and Y taken into account as well.

    Also, it should be easy to also add the condition that X of the character is higher than the building in order to put the character behind the building with your examples, right?

  • Hello,

    I am trying to make my characters go 'behind' a building when their Y is lower than the building's Y and higher then the building's X (Because my graphics are going to be oblique, it should look like they are going behind the building if they come at it from the right a bit).

    I've put all of my building objects on the one layer and into a family called f_perception, as well as my characters. I've got this code in place to send objects in front and behind:

    Please note: the Char_box_Helper is in a container with Char_Helper

    It works for some buildings and not others, and I don't know why.

    Can I get some help with this one please?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Ahh, Kriand, I knew I was doing something wrong somewhere:

    I had this in a completely different group:

    i.imgur.com/wNufnCc.png

    The else statement was constantly forcing my criminal to keep going right.

    Thanks for helping, Kriand! I'm sorry for wasting your time. It goes to show I've had a long day in Construct. I might have a break.

  • Let me show you more of my project.

    Here are the members of the f_people family:

    i.imgur.com/T1DSRVp.png

    Both members have this instance variables. It is blank because it can contain different values for each member:

    i.imgur.com/lJiDx5i.png

    In the case of my original screenshot, my criminal should change his status according to the family instance variable, but it's not, so what am I missing?

    When I run the project, his status is "Walking Right" when he hits the "People_Boundary_Right" object, just like my civilian is doing, except my civilian is not getting stuck, he is changing his status, but my criminal is not. I don't understand.

  • Yes, it is.

  • Hey There,

    Here are my events:

    i.imgur.com/YyhqGKf.png

    I have two different "people" objects in my family. I added a second one after I wrote these events.

    The first person object responds fine, they will simply turn around when they hit the boundary, but the second person object will not.

    I don't know why. I thought if I simply put my second person into my f_People family, they would respond accordingly, but no the second person's status string variable does not change. Can anyone please help me with this?

  • I keep looking at this and I cannot fathom why the shooting enemy is not shooting anything:

    i.imgur.com/QqHFn5l.png

    Can I get a pair of fresh eyes on this one please?

  • Hey Maverick,

    Thanks for replying so quickly too. Sorry I took so long.

    Yeah I checked these, they were right 288 x 512. I actually discovered that my margins were really large for that size, they were 1000 x 1000. I made the margins 288 x 512, and this seemed to fix the issue.

    Thanks for your help, though!

  • Hi,

    I'm new to using Construct 3, and I noticed that after the first time the layout runs (which runs fine), it does this:

    i.imgur.com/ersyKNF.png

    It goes really small.

    Is it a setting or is this some sort of bug?

  • Perhaps it is a good idea, I will do it. Thanks again!

    Saying thanks to you all the time makes me feel like a bloody robot. :P

  • Thanks for answering with detail, Dop!

    Well, what I have been doing for different types of animations, say for the building, I have folders for each type of building and then the animations inside them, I have an instance variable for the type of building and this is checked from when the building is placed for construction all the way through it's main purpose. It is the type that defines it's appearance and it's purpose. When changing animations for this building, I would simply set it to the appropriate animation while checking it's type.

    Although, buildings don't change in animation as much as people do (for walking and what not), so I do not have to manage it as much, but I have a state variable for people and I control that using events, I simply determine the direction they are facing with state(number). The number being the value of the state variable matching the appropriate animation for the same number. For example state0 faces up, etc. I just don't know if I should implement different objects for other types of units, and define those with a type variable like I do with buildings or not, yet.

    Unfortunately, if I am going to use a family system, which I think I might need to do eventually, it's not that easy to change what I have now, because you can't just replace objects with families. It would take a while for me to go through all of the events to change it physically because there are a lot of events. I guess I could still use the one object with different animations method for buildings and still use families for other things like damage and enemies and stuff like that. I'm just not sure how to go about doing all that at the moment, I have to do some extra planning.

  • Thanks again, Dop;

    just a few things, and I am sorry I have more questions, but I am trying to get my head around this because if I do, I believe it will help me out with my overall design.

    1) I just want to declare that even though I have been using C2 for a while and my ideas for games are there. I have had no prior programming experience, and there are still features with C2 that I am yet to fully understand and I am still learning how the logic works, but I do believe I am growing with this every day, so if some of my questions make me seem like a complete dud, you know why. I do not proclaim myself to be experienced with any of this.

    2) To confirm about families; you can define instance variables for multiple objects without having to set it for each object, you just set it to a family. But, say if an instance of an object that is a part of a family takes 'damage' then you can tell C2 to only subtract from the health value of that one instance, it does not necessarily effect every other family member, so later if new objects were added to that family then you do not have to program the 'health system' again of the game for that object, it will just work.

    I have read about families but I'm still short of fully understanding how they work. I will have to go and look it all up again. I have not really been using them for my projects and I feel I probably should.

    3)I was hesitant writing number 2 because as I was writing it, I thought why would you want to create multiple sprite objects when I could use the one object just with different animations to look different or is that bad practice? I feel like I should be using the one object with different animations to make it look different. For example, each of my buildings is just one object with different animations, but if I am to create an enemy building I'm torn between using the one object or create a different object and put it into a family.

    4)(I wanted to ask this privately but it seems like this forum doesn't allow private messaging anymore) Specifically; I wanted to get my head around something because I am using what you suggested, I'll show you here:

    i.imgur.com/GKfdFed.png

    This is definitely so much easier, less code a lot easier to understand, and it works.

    The only thing I do not understand is how that is setting Global_b_DebugFamilyVisible between the values of 0 and 1. Setting something to "(name=0)" seems odd to me. I just don't understand how that means "if you are 0, set to 1, and if you are 1, set to 0."

  • Ahh I see what it's doing. I just needed a better method to check it's values and properties later. I thought I could do this with an every tick event for those sprites, but it was not working, I'll try the global variable.

    I didn't think they were one big project. I just thought that any later created objects after run time would inherit the values and properties of the family it belongs to, like in the case I put forward, they would just be set to invisible even if they were visible upon creation. Obviously this is not the case.

    Thank you for your help, again, Dop. I will do what you suggested. It makes sense.