LukeWolf's Recent Forum Activity

  • I've managed to extract only the relevant part of my project to show you what I mean.

    I've tested it to see if it still happens in this project, and yes it does happen, but it may not happen all the time, so you may have to run it several times to see what I mean.

    Feel free to just reduce the Health on the FireCloak object in the debug inspector once you notice the flames on the FireCloak. You'll see what I mean.

    https://www.dropbox.com/pri/get/Testing ... u2X157e6nw

    I've left notes on the eventsheet, but please let me know if you need anything else. This problem has really lost me. <img src="{SMILIES_PATH}/icon_razz.gif" alt=":P" title="Razz">

  • Hi,

    I understand that these forums go off Gravatar.com

    Well, I have already made a gravatar, and have signed in, but it does not seem to be working, am I missing something here? I've tried looking elsewhere in my profile but it there isn't much else it directs me to do apart from getting a Gravatar.

    Edit: Sorry, I fixed the mistake in the title. I meant to say "My Avatar does not seem to work" and not "My avatar does not need to work"

    Tom

  • Hey Sol, I did try a For Each loop for the Apple tree, as a Sub-event so like I did try this:

    Event Conditions:

    FireCloak is overlapping Fire

    FireCloak is Burning

    FireCloak Health = 0

    Subevent Conditions:

    For each AppleTree

    AppleTree Object_UID = FireCloak.Object_UID

    Subevent Actions:

    AppleTree Set animation to Burnt (play from beginning)

    It still seems to do the same thing, so I removed the For Each loop because it didn't seem to make a difference.

    What I am seeing in my in-game bug mode details is that the numbers are all there in the instance variables to match the "Object_UID" instance variable on both the AppleTree and the FireCloak objects, but for some reason, it is not always working.

    All I essentially need now is for construct 2 to recognise these two objects properly so it works each time. I'm not 100% sure if I'm doing this right. At the moment, I have 4 AppleTrees, and I just tested it again, and it worked for the first two AppleTrees correctly, the third one didn't work, but when the fourth one lost all Health, it changed both the third and the fourth AppleTree to Burnt. I do not understand. Another test shows that the fire started backwards (since fires can start at random flammable objects), this time, the second and third AppleTree would not change. But changed again after it was late for a couple more minutes. It's eradic.

    The frustrating thing is I often compare instance variables with quite a few different objects in the game for different things, and a lot of those things are objects I do not know are going to happen, so the game creates them and then assigns them the appropriate numbers to be recognised. I never have a problem doing it that way, and i don't normally have an issue with doing stuff like this. For some reason, I'm just having problems with this. I could try smaller numbers and see what happens, but I definitely think I am missing something here and it's bigger than that.

    It's times like this, I feel like I need to re-study the way construct 2 picks objects and instance variables. I actually feel like I may have to specifically program every single flammable object individually, but surely there is a better way to do it, hence why I thought my FireCloak object idea was the best way.

  • Hello again,

    I'm actually having a lot of trouble trying to get this to work properly with what I suggested in Solution 2. For every Apple Tree, I have an instance variable called Object_UID and every tick I set it to self.UID, so it's UID is in an instance variable. For the FireCloak I also have an Object_UID that I manually set for each instance to match the AppleTree's UID.

    Basically, here is my event:

    Event Conditions:

    FireCloak is overlapping Fire

    FireCloak is Burning

    FireCloak Health = 0

    Subevent Conditions:

    AppleTree Object_UID = FireCloak.Object_UID

    Subevent Actions:

    AppleTree Set animation to Burnt (play from beginning)

    It works on the first AppleTree that is set on fire, but it doesn't work on the second one.

    And then it's Eradic, sometimes it works and sometimes it doesn't, but there is generally always one of the AppleTrees that does not change it's animation to "burnt" when it should. I haven't changed the code around.

    I have tried to Pick by Comparison the apple tree's UID and the FireCloak's Object_UID instance variable. Same thing happens. It does not always work.

    I assume I am doing something wrong here, but I'm out of options.

    Edit: By the way, I have checked to make sure that the Object_UID instance variable on every FireCloak instance matches the correct AppleTree's UID.

  • I understand. Thanks so much for your patience and help!

  • So in this case, doing families is not a good idea?

    Sorry, I'm just a bit confused. xD

  • Hmm, I'll give this a go, but there is just one thing I am not sure about, and I think I can do it with families because I am sure I can set individual instance variables:

    I have to be able to identify which Fire is what, because in my game, I have to be able to recognise that Fire1 and Fire2 are different. The reason being is because the player will get points for extinguishing Fires, but the player has to extinguish the entire Fire, so the entire Fire of Fire1 or the entire fire of Fire2 to get points. The game can create multiple Fires, so for each Fire that is created in the game, I have set a unique instance value called Fire_ID which is given to the Fire when it is created and when it spreads to other objects, I also assign the burning objects the same Fire_ID as the Fire that is burning it. This is to stop it conflicting with other fires. So the question is, even though all my flammable objects would be in a family, can they be set different Fire_IDs without changing the Fire_ID to all of the objects in the family?

  • I think I am definitely on the right track with this in accordance with your advice, SoldjahBoy. The only problem though is getting my head around families and how I can incorporate that in my project currently. I've read guides and watched videos, but I lack confidence in using them with what I'm doing. It might be because I feel like I have to do an overhaul. =[

  • Hey SoldjahBoy,

    Thanks for the prompt response. It was very quick.

    I have not done much family stuff in my project. I have studied families, and perhaps in some cases I should use them, and I might, but in this case, I think the best thing for me to do is to continue along the idea of the blanket system that you mentioned and that I have been trying to create, because I have pretty much everything ready. Like you said, it is better if it is done this way, particularly if they have different ways of burning, and I do, so I will copy my FireCloak over each of the objects I want to burn and then simply create an animation for that object suitable for burnt, and I will also create different points For the FireCloak and set the position of the fire accordingly depending on what is burning. I think this is appropriate, considering that I know what all the flammable objects are and where they are and how many I have. It would be a different story if I didn't know that stuff. Thanks dude, you've definitely, given me a better understanding of what I'm doing!

    Of course, if anyone else has a better idea, please reply.

    Edit: By the way, those steps you mentioned in your Edit, are principles that I intend to follow. Thanks for sharing!

  • Hey there,

    I'm going to be a bit detailed and specific with my request, so I can easily relate to everyone and my request for help.

    My goal:

    Allow any objects in my game to "Burn", "Catch fire" and "get destroyed from the fire", not just one object.

    What I have done:

    I have sucessfully programmed one object to be able to catch Fire, namely an "AppleTree", and it works great! It burns, and after a while, it will change it's animation to show that it is burnt after it's "Health" value reaches 0. I have also successfully created the concept of spreading fires to other AppleTree objects if the burning fire in question is touching another AppleTree.

    What I was working on before I got lost:

    Since the AppleTree object is the only thing that can burn in my game at the moment, I wanted to expand the possibilities here, so anything can catch on fire. The trouble is; every object has different variables and the event system recognises each object differently for different things. For example, I have not given the object "Shop" the same variables or events as the AppleTree to catch on fire, etc. So I thought what if I changed the AppleTree into "FireCloak". So it would be an invisible object, and the idea of this would be to use the FireCloak object to cover all objects that can catch fire in the game, so then, using the existing events, it can spread or catch Fire to any object. The reason why I changed AppleTree into FireCloak is because the object for AppleTree has all the programming I need for it to catch on fire (of course).

    What I am stuck with:

    The only thing I need to make sure of here (and correct me here if I'm wrong) is to recognise the visible object that is burning to change it's animation to the appropriate "burnt" animation. Now, I could do something like this, which, apart from the sub-event, I had, except I created the sub-event to consider different types of objects.

    Event Conditions:

    Is FireCloak overlapping Fire

    Is Burning

    Is Health = 0

    Sub Event:

    Is FireCloak overlapping AppleTree

    Event Actions (for sub event):

    AppleTree Set Animation to "Burnt"

    However, in my game, objects, and particularly objects like Trees can overlap each other for a graphical effect. If I used the same code here to change the animation of an AppleTree to burnt when it is overlapping another AppleTree that is not ready to change it's animation, it will pre-maturely happen, and it will likely cause other bugs I do not want. So, I am trying to figure out a way I can match each FireCloak with their respective objects.

    Possible solutions I am looking at:

    1) I thought about Containers, but this only works effectively if you're talking about the same object and it's instances, I have multiple objects with different variables, I would have to spend a lot of energy and time in changing a lot and this could also cause bugs with other objects, so I am not keen on this.

    2) I was seriously thinking I could create a variable under the FireCloak object which will be "Object_UID" and I would then somehow assign the UID of the appropriate object to the FireCloak, then when it comes to changing animations to Burnt, I can just compare the object's UID with the FireCloak's Object_UID variable, and if it matches to change the animation. The only thing I am stuck with here is how do I do this without having to copy FireCloak and then specifically change the object_UID variable to each appropriate object. I suppose this does not matter so much, Flammable objects on a level will not be changing shape, size, or position.

    Please tell me what you think, is my solution 2 the best and most effective solution?

    Thanks so much in advance!

  • Hey there,

    Whenever I load the website sometimes, especially at this time, to download a new version of construct 2, and it's not working because the website looks looks like all of it's coding except for text has gone.

    I'll have to try again later, because it doesn't always do this, but I have been noticing that this is happening more and more, and I'm not sure if it's me or not. I have tried clearing my cache at no avail.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Thanks guys for your help. Both of you assisted in prompting me to get the right idea in play for my game.

    Plinkie; I initially did try to do the fire count thing, but I was doing it on the burning objects and on the fire object instance variables, which was a reverse solution. I stopped it because it wasn't counting down properly. Unfortunately, I was not able to do it via global variables because of a couple of reasons; I did not want to limit the amount of possible fires in my game and I needed a solution for the way I had it currently. However, your advice of counting the amount of fires to set it to false when the counter hits 0 is the direction I went with, but I counted them on the HUDicon which is not subject to be destroyed automatically without the player closing it off, and it was the way to go.

    oosyrag; your idea sounded good, but I was not able to implement the pickedcount part due to the way my HUD icons were set up, so instead I tweaked it a bit and now it works fine.

    From the advice both of you gave, I was able to get it to work in my game. Thank you for your help!

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