LukeWolf's Recent Forum Activity

  • 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.

  • My avatar is obviously not 128x128, but I had to make it that size with the rest as white space and I cannot upload a transparent avatar at all, also seems a bit crazy to have to make your avatar square. Will these rules become more flexible?

  • There does not appear to be a setting to get an email notification when someone responds to your thread. Sure you can follow it, but you won't get email notifications anymore? What happened to that?

  • Hey Dop,

    I could not embed the screenshot of my code on the forum for some reason, you'll have to go to the link. It must have something to do with the major forum upgrade because I initially could not do a lot of things that I wanted to show you and I only just got my avatar back. What a mess. Sorry if my initial request was confusing in any way. I could not edit it after I posted it.

    My understanding of families here are that if you add an object to a family and you add instance variables for that family, then those objects in that family will be impacted by those instance variables that the family has.

    In this case, I set an instance variable to the family, and like the screenshot showed you, it should be toggling all objects in that family to visible or not visible.

    This is fine initially but later on when helper sprites are created (for example, I wanted to toggle the visibility of my pathfinding_destintion_helper sprite for each of my people), but people are spawned later rather than at the start of the layout, and if I have the toggle off some people spawn with it's visibility off and some people spawn with it on. This seems to occur mainly if a person is created in the middle of toggling it so some sprites in the family have their visibility on when the boolean is off, and I can't seem to match the sprite's visibility with the family's visibility later for some reason. I just don't understand what I am doing wrong here.

    If I use a global variable, that means I have to toggle the visibility specific for each sprite instead, and I know I can do that, I just thought it would be easier to do this with families since later on, I will likely add other objects for debugging and my outlook of this would be a simply matter of just adding the object to the family so I don't have to go adding it to the code.

  • Hello,

    I'm trying to add a debug system to my game.

    To make this easier, I have a family for Helper Sprites

    I create a toggle for the T key. When the T key is pressed, it will toggle the visibility of the sprite.

    However, some sprites are not going to exist when the game starts so when the game creates them later, they will not always sync with the properties of the family, so if the family is suppose to be invisible, some sprites will not go invisible.

    The helper sprite's properties are initially set to invisible.

    Here's a screenshot of the code:

    https://i.imgur.com/muqMAaz.png

    I don't understand what I'm doing wrong here.

  • When you use the pathfinding behaviour clear obstacles action followed by regenerate pathfinding map around object, does it clear obstacles for every single instance or only the instances that are picked by the conditions?

  • Ashley will look into these bugs, it's just that him and his team are mainly focusing on Construct 3 beta at the moment, so expect a delay. Plus, there is a bug with collisions that he is trying to work on as well. There is a blog on that issue on the website, so we just have to be patient. In the mean time, you can either just type out the entire expression or rename your objects to remove the underscore _ in them, because not having an underscore seems to be the best workaround at the moment until this is fixed. I love using the underscores in names and whatever, so I'll continue putting up with this until it's fixed.

    Good work discovering that it's not just variables, though!

  • I reported something very similar to this here:

    Except in this case, you discovered that it does not seem to be impacted by just variables, it's any object, expression or variable being picked up by C2 after the _. You have objects starting with S_ so if you go to search anything after S without putting an _ in, it will just disappear.

    I suspected that this bug to have a more broad impact.

  • Try Construct 3

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

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

    Underscores stop C2 from guessing expressions after the underscore or if you make a spelling mistake with the variable's name after the . character (until you backspace passed the . and then it will start guessing again

    You will not need to run the layout to see this bug.

    Attach a Capx

    https://www.dropbox.com/s/rureks7adycnc0d/Underscores%20stop%20C2%20from%20guessing%20expression%20after%20the%20underscore%20or%20spelling%20mistake.capx?dl=0

    Description of Capx

    Demonstrates that C2 will stop guessing your expressions under two circumstances.

    Steps to Reproduce Bug

    • Step 1) Create an instance variable for a sprite object and (boolean or value) and call it "b_example"
    • Step 2) Create a variable called "Blah" (You can name this whatever you want, just make sure the first letter starts with the characters 'B' or 'b'
    • Step 3) Go to the event sheet.
    • Step 4) Select the sprite object to add an action.
    • Step 5) Select an action that allows you to enter an expression. For example: "Set Value"
    • Step 6) Type out your expression but make sure you are typing out the "Blah" expression. For example: "Self.Blah" You will notice that after you type the 'B' or 'b' Character, it will stop guessing what you are trying to enter and the expression results disappear.
    • Step 7) Change the name of b_example to bexample, then start this test from Step 3. When you get to Step 6, you will notice that construct will not stop guessing your expression and will continue to keep it up until you decide to select something or finish that part of the expression after the . character.
    • Step 8) Providing there are no underscores in any variables, type your expression after . with a spelling mistake and even though you backspace to fix spelling mistake, C2 will not guess your expression until after you delete and replace the . (the full stop/period character)

    Observed Result

    C2 stops guessing your expression to select from the expressions list under where you are typing.

    Expected Result

    C2 keeps results there until you have finished typing all characters of your expression (or selected from the expressions list)

    C2 returns expressions list when your expression no longer has any spelling mistakes after the . character without having to replace it.

    Affected Browsers

    • Chrome: N/A
    • FireFox: N/A
    • Internet Explorer: N/A

    Operating System and Service Pack

    Microsoft Windows 10 Pro v10.0.17134 Build 17134

    Construct 2 Version ID

    Beta release r257.3

  • dop2000 I have made those changes as well as put timers for every cooldown variable system I had, it was a bit of a learning curve but things are working very nicely, now. Thanks for your help!

    Edit: Thanks for your help, AGAIN!

LukeWolf's avatar

LukeWolf

Member since 14 Jul, 2015

None one is following LukeWolf yet!

Trophy Case

  • 9-Year Club
  • Jupiter Mission Supports Gordon's mission to Jupiter
  • Forum Contributor Made 100 posts in the forums
  • Regular Visitor Visited Construct.net 7 days in a row
  • RTFM Read the fabulous manual
  • Great Comment One of your comments gets 3 upvotes
  • Email Verified

Progress

15/44
How to earn trophies