- Sat 16 Feb 2019, 10:18
What is the default directory when you write to a file?
If using the storage actions it is web storage. I don't know about the new file system extension.
I want to delete it.
Just clear your browser cache or open up the developer console and you can find the data in the storage tab.
Or in case you want to do it in-game just write over the data with default values or empty values.
pathfinding making the player jump all the way back to where it first started..when I get close to an obstacle.
I have never experienced this. If you move something from A to B using pathfinding the object should avoid all obstacles and stop at point B and should not jump back to point A
Pathfinding got an event to check if object reached the destination maybe you want to use that to stop whatever is that you are doing when the object reached point B and probably you don't want to check collision with obstacle while the object travel with pathfinding. Let the pathfinding do it job which is avoid obstacles.
Using the inventory example how would you go about doing max stacks and having the next stack go to the next slot and start at 0?
The trouble is the Inventory extension count items overall in the entire inventory and in the example we are using the expression to get number of items in the entire inventory to display in the slot.
The solution is to have an object variable for each inventory slot to count the number of items in the slot and then when you add an item to an inventory, check this value first. If the value is equal to the max number, look for a new empty slot and for the text to display the number of items in the slot use the object variable of the slot instead of the inventory expression. But then you don't really need the Inventory extension any more to store items. You can just create your own Inventory system from scratch using object and structure variables.
What is the best way for doing animations based on direction when using pathfinding?
By checking the direction of the player? The pathfinding extension can rotate the object for you as moving on the path and there is an event and expression to get current direction of the object. So, all you need to do is take the direction in to account when you change the animation. If you don't want the player to actually rotate, what you can do is to have an invisible object that is rotating on the path and make the player object follow this invisible object. So you are essentially controlling the invisible object and the player object only follow the invisible. And then you can take in to account the direction of the invisible to change animation of the player accordingly.