lionz's Recent Forum Activity

  • Give it a much higher 'deceleration'

  • Run it in debug mode to see what is happening with the global variable, should be able to tell you what's going on with the values. If you could make the video again with it in debug mode and global var visible and also show where you've put the image point on the player then we might be able to work something out. The waiting for 2 second action is not the best way but it could still work with that so there might be another problem.

  • You can add a variable to food items that are placed, like a boolean set to true if it is placed. Then on the arrow keys for changing animation you add a condition, placed=false. The arrows then only affect the one next to the arrow.

  • Hey, I would do this by using system 'Pick overlapping point' with water and the player imagepoint. You can put an image point on the player's head and say if water (object) is overlapping player.imagepointx, player.imagepointy then run the drowning mechanic else set breath to full. Instead of an else you could also use the same event and invert it, if water(object) is not overlapping player at imagepoint on the head. So if he is overlapping the water but has jumped out (his head is not overlapping) then he should breathe again.

  • You do not have permission to view this post

  • In my game when you unlock a rare item that can now randomly appear in game, it is added to the array of items. Just realised from the way you've set it up you may need variables for each item, so item1=0 or 1, item2=0 or 1. That way you can save the variables. You may have a long list of variables though if there are lots of items, that's why an array is useful.

    Saving, you can use system save action that saves the 'state' of the game kind of like a restore of the game at that exact point. Or you can use local storage which stores data and variables, seen here construct.net/en/make-games/manuals/construct-3/plugin-reference/local-storage

  • My initial approach to this wouldn't be to plan a route using pathfinding behaviour, although I understand the agent's general movement from place to place could be pathfinding. I would do it by using the floor I am on to locate an elevator that goes to the floor I want, and if one isn't found then to the closest floor I want. Using your image as an example, this is what my approach would be :

    Elevators are objects that have variable attached to determine what floors they go to, it could be a set of booleans, floor1=true, floor2=true etc or simply a variable for the highest floor it goes to i.e. floorMax=5 it goes to 5th floor. I will use the first example for now as the second could pose problems for going in reverse, or I guess you could add a floorMin var.

    Anyway, so I am on floor 1, I look for an elevator that is floor1=true as a priority (it goes to floor 1), and also goes to floor 5 destination (floor5=true). In your image that elevator does not exist, so it then looks for the next floors down. I need an elevator that is floor1=true and floor4=true, not found. Floor1=true and floor3=true. Ok i found it, it's the elevator on the left.

    Then I get to floor 3, I look for an elevator that is floor3=true and also floor5=true. Yes that exists it's the elevator on the right, I path to this elevator and take it to 5th floor.

  • It's true you will need save logic to remember after the game has closed but what you're talking about is simply remembering items unlocked on restarting the game after dying, right? I'm making a rogue at the moment and can help you, although I did use arrays oops..

    All you need is a global variable in condition to toggle whether the item can be found. So all items in the game that exist at the start are variable=1. Any legendary items not yet seen are variable=0. When you see it in the game you set this variable to 1 for that item. You will obviously need to adjust this to how you have set it up with the groups.

    Anything to do with closing the entire game and remembering is related to save slots which will save the global variable and remember what it was set to.

  • Yep that looks fine, are you saying that it's working now or do you need some help?

  • I can't see an image but I guess what you need is to check If wallet money < product value * quantity.

  • No problem, glad it helped!

  • ignoring the bar, you need to set a current max energy for the player. lets called this 'energyMax'.

    When you say character with 5 energy, you mean he has 5 energy to start so that is 'energyMax'.

    the current energy is 'energy', and you set this to 'energyMax' at the start of the game and I imagine you decrease 'energy' by using it.

    so you start with 5/5 energy.

    we now calculate a percentage regardless of starting energy, whether its 5 you are slotting in or 1000.

    fill = energy/energymax* 100 = 5/5*100. what you have now is a percentage of fill for the bar.

    so if your guy now dropped to 3 energy. the fill of the bar would be energy/energymax*100 = 3/5*100 = 60%

    To answer your question, using the fill bar formula, the energy that the player starts with which is what I think you are trying to slot in is energyMax.

    This also auto-resolves the bar decrease speed because it is always a percentage. if you have 5 energy it will drop 20% of the bar a time, whereas if you have 1000 energy to start with and decrease by 1 you will see almost no change because it is going to 999, 998 etc which is a small percentage of the bar.

    The next step is how you want to apply that percentage outcome (fill var) to the bar width. You can just say object.width = fill which means its width would be between 0-100 just to test it out, then multiply this later if you need it larger. You could also use the built in object progress bar to test it out and set progress=fill.

    To summarise after you've read that and understood what I mean with the values, you just need 3 variables and a formula :

    energy - the current energy,

    energymax - the max energy allowed or total given at the start,

    fill - a variable to store the percentage,

    set var fill = energy/energymax*100

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
lionz's avatar

lionz

Member since 5 Aug, 2013

Twitter
lionz has 73 followers

Trophy Case

  • 11-Year Club
  • Jupiter Mission Supports Gordon's mission to Jupiter
  • Forum Contributor Made 100 posts in the forums
  • Forum Patron Made 500 posts in the forums
  • Forum Hero Made 1,000 posts in the forums
  • Forum Wizard Made 5,000 posts in the forums
  • Regular Visitor Visited Construct.net 7 days in a row
  • Steady Visitor Visited Construct.net 30 days in a row
  • Enduring Visitor Visited Construct.net 90 days in a row
  • Unrelenting Visitor Visited Construct.net 180 days in a row
  • Continuous Visitor Visited Construct.net 365 days in a row
  • RTFM Read the fabulous manual
  • Great Comment One of your comments gets 3 upvotes
  • Email Verified

Progress

24/44
How to earn trophies