Uglypenguin's Forum Posts

  • Great concepts! They need to navigate around complex maps and areas. Becuase of the size of the game it would be a pain to set checkpoints- though possible I'd rather avoid that approach. I was thinking something more towards the destination being generated randomly (like the idle pathfinding, they find a random destination on the layout to move to) but only places in the direction your character is facing? Perhaps random destinations within in a 90-degree angle from the player's angle? So, in theory, it would have a destination away from the player at all times.

  • So I'm trying to design AI for prey.. small creatures you can hunt down. They dont attack, they just run. I want to make a pathfinding event that will make them find a path that is away from the player or other creatures that hunt. If youre chasing them I want them to continue to stay one step ahead of you and be able to adjust their running direction or turn around if you cut them off for example. Any ideas?

  • Would inverting0' is overlapping enemy', ect. be a fix for it? Do I need to combine the code somehow and only have one else? Im not all that sure on how to clean it up

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Ive got an issue with my code I can't seem to sort out... It used to work till I had to redo the way the character walks. 2 things are supposed to change when you are attacking, the player animation and the player's boolean 'isAttacking' and they don't change. Now if try to attack in game the enemies can still be injured. If I disable the entire attack event you cant injure them. Also, I loaded up an older version of the game and copied and pasted the attack code which was working in that version to my current version, still not playing the animation but I could injure them. That tells me the code is elsewhere but... I really have no idea what it could be. It stopped working when I changed the movement type from 8 direction to Rex's 'MoveTo"

    Here is the current game- https://www.dropbox.com/s/6061rsiwkr4t7 ... .capx?dl=0

    This should be a version where the attack works- https://www.dropbox.com/s/6ujs1cjnoiia5 ... .capx?dl=0

  • It already counts weight for as many items as I pick up, Im not sure how to choose the item itself. Would I use 'x has value' as a second condition?

  • Another y column?

  • https://www.dropbox.com/s/6ujs1cjnoiia5 ... .capx?dl=0

    The inventory array is arr_inventory

  • So ive worked on creating a sort of custom movement. I had to change it from WASD to more of a fps contol for gameplay reasons, so wherever your mouse is is where the character faces, and WASD is subject to the characters angle unlike the '8 direction' pluggin. Im in need of it being smoother though, I tried using 'custom movement' for it, didnt work out. So I use a variable, its the 'step' in which the character moves. My events are set to when W is down move forward at 'step' every so and so seconds

    That left... An unnecessarily complicated method of movement, acceleration and deceleration. Does anyone know of a plugin that does what I'm looking for or just a better method of doing so?

  • Quite late! I took a break from coding for a bit. In concept it sounds great but I'm not sure how to implement it into my existing code.

  • Im trying to create a weight limit to the inventory.

    One way to do it I thought would be to add 2 global variables one is weight, the other is weight limit, weight limit can be levelled and the weight represents your current weight, which I want to manipulate by an array. I don't know how to make a condition to get value y for each spot in the array to be weight. Say I have wood in my inventory and each piece of wood is 5lbs. So y in the array is the amount of a particular item if thats 4 you will have added 20lbs to your weight. here is a concept I cant seem to figure out-

    if array contains x(ID of the object)

    addto Weight: InventoryArray(X, see condition) *(multiplied) corisponding y index?

  • Okay thanks for the help!

  • Ok how would I get that generated on the start of a layout and saved to a sprite object, so that its not regenerating every time you open the chest?

  • So in designing enemy AI, making pathfinding calls for enemies, would this make it possible to generate random paths that wouldn't be blocked?

    Enemy-on contact with player

    -Enemy-find path to player.x +random(-250,200) -(what goes here is obstacles)width

    -Enemy-find path to player.y +random(-250,200) -(what goes here is obstacles)height

  • I was able to accidentally, but successfully recreate this. Give two objects the ScrollTo behaviour, one being the player, the other being whatever sprite. Set that second sprite to the mouse cursor every tick. Then if you move your mouse the screen will move as far away as it can from the player but also keep the player on-screen. It had smooth control as well.

  • So I'm trying to find the best way to make a chest in my game. I originally tried to use an array but I don't know how to display the items in the chest doing that, nor do I know how to set each X value to a random number(loot generation). I instead made 10 variables on the chest which choose random numbers (each is an ID of an object/item). When you press E after having opened the chest, It adds ALL of them to your inventory. To make a selection of which item you want easier, I scratched that idea. I don't really want to go with the variable generation either, it seems tedious and a bad method. Let me explain what I'm trying to do.

    (Chest code for reference)

    So I came up with the idea to show a small chest inventory like the player inventory shows. So each inventory slot is an object and the frame determines the object ID and adds it to your inventory accordingly.

    What I wanna do is make it so all of these boxes for the inventory slots will do one of the following- Either move them to the chest you have opened and slightly to the left, or for each chest on the start of the layout spawn inventory boxes. But then it would be hard to set the UD and LR id's (that's how I get WASD control in the chest inventory)

    Also depending on how the above problem is fixed, I may need help creating random generation for the chests (If I end up going with random generation by chest instance variable, help with this part won't be needed). If each chest ends up spawning boxes at the start I won't need help, I have a concept that will work. If the boxes end up moving to the chest each time you open one I'm going to need a way to store the information of the chest contents and be able to retrieve them if you open the same chest, and adjust the inventory boxes accordingly.

    If you wish to mess around with it and test yourself, here is the capx. The troublesome code is on the "Object" event sheet and bookmarked. Press E to open the chest, TAB to close and resume control of the player- https://www.dropbox.com/s/6ujs1cjnoiia5 ... .capx?dl=0

    Any help is appreciated <img src="{SMILIES_PATH}/icon_e_smile.gif" alt=":)" title="Smile">