t3hCrush3r's Forum Posts

  • 3 posts
  • Hey guys, ima newbie here and i had a small question.

    Im working on a small scale program, scattered across 4 layouts. (I may henceforth refer to them as "windows")

    There is a sidebar that allows switching between these windows.

    Now, i added the persist behaviour to stop a layout from resetting when i switched to another layout.

    To elaborate, consider i pressed a button on layout 1, and this button spawned an object.

    Not i switch to layout 2 using the sidebar i created. Then again, i switch back to layout 1. However, the object that i spawned earlier is now gone.

    To fix this, i added the "persist" behavior to the object.

    Now here arises the problem.

    What i want to do is, when a specific button is clicked, the layout be saved to some slot, lets call it "save1".

    Step1 : Easily done, right? However, there is one more thing i want to do.

    Step2 : Lets say "layout 2" has 3 objects that were spawned by some means, and these objects have the persist behavior.

    Step3 : Then i go to "layout 1" and save the game to a slot "save1".

    Step4 : Now, i change a few things in layout 2, say i add an object. Now there are 4 objects with the persist behavior in "layout 2".

    Step5 : Now i go back to layout 1 and using a button, i load the game from slot "save1".

    It loads successfully, HOWEVER, layout 2 no longer has that other object we added in step 4 is now gone. I.E: the game saved layout2 as well as layout 1 when we saved to slot "save1" in step 3. I want the game to only save the layout1 when i goto save the game in step 3 and leave the rest be.

    How can i go about this?

    Thanks in advance, and i really appreciate you going through this, i know its an extremely long post, but i wanted to ensure im being clear.

    If it is of any consequence, here is my saving system.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Can they be different for each member of a family? Because i tried and found no way to differentiate between family members.

    I have an enemy at 1000 HP and another at 15.

  • Hey all! Thanks for taking time out to help a fellow in need.

    Lets start with some background info: Im working on a platformer/RPG crossover, and as it grows, so does its complexity. Right now im trying to add multiple types of unique AI (enemies). As of now i only have 3 but i expect to have a total of 10ish. My problem today is a damage system. AS OF NOW i have 2 things that damage enemies: Thrown Weapons and Melee Weapons both wielded by the player. Now what i want to do is that on collision with a weapon, there should be a global system of subtracting health form enemies (health is stored locally by each enemy as an instance variable, and once it falls below or is equal to 0, the enemy is destroyed). For example, as of now my code is *weapon* on collision with *enemy* => Subtract X health from *enemy*. However, this code has to be repeated for each discrete enemy. Is there a way, by making an enemies family, that i can create a system in which, when the weapon collides with anything from that family, health is subtracted from the discrete enemy? Because my melee attacks consist of "streaks" so each attack has a different damage and i have to code damage separately, making ti both arduous and (i assume) inefficient.

    Basically, what im trying to make is:

    say, enemyFamily on collision with weapon, subtract *damage* from enemy(who actually hit the weapon).HP

    Im not sure if this is clear to everyone so ill rephrase it:

    If my weapon collides with enemy1 from the family "enemies" , the equivalent weapon damage should be deducted from enemy1.

    Heres an image of my current event sheet for melee weapons. Basically the enemyGeneric should be generalized to mean whatever object from the "enemies" family the weapon hit.

    [attachment=0:1rua0nya][/attachment:1rua0nya]

  • 3 posts