vasterasjonte 0 Share Posted November 18, 2020 Check Animation id? Link to comment Share on other sites More sharing options...
jex124 0 Share Posted February 6, 2021 On 11/16/2020 at 3:39 PM, Neffarion said: Checking for animation is not reliable. If you lag then your animation can stop for a few milliseconds and your script will think it's not mining. Also, there's a chance that in between animations your character will not be animating thus also returning false to isAnimating(). You should only use isAnimating() to check if your character is mining, not to check if it isn't mining. Ideally you want to be saving the tile of the rock you interact with. So do something like: Interact with the rock, if successful save the rock tile. Then check if your character is animating. If it is then you are mining and you are good. Otherwise, get the tile in front of your character and check if it is the rock tile you saved and it isn't mined yet. Might also be a good idea to add a timeout Hey man, I am confused by your recommendation here. What is the need here to save the interacting rock tile (I assume you mean like a wrapper)?. If it is to prevent spam clicking the rock, then the isAnimating will take care of it once you start the mining animation. Also why search for the tile infront? , also this is direction sensitive, so you would need to check which direction the player is facing and do an arithematic, all of this but what is the need? Isn't it better like, click on an available rock, confim your are mining, do nothing while rock exits? Regards, J Link to comment Share on other sites More sharing options...
Neffarion 486 Share Posted February 7, 2021 9 hours ago, jex124 said: Hey man, I am confused by your recommendation here. What is the need here to save the interacting rock tile (I assume you mean like a wrapper)?. If it is to prevent spam clicking the rock, then the isAnimating will take care of it once you start the mining animation. Also why search for the tile infront? , also this is direction sensitive, so you would need to check which direction the player is facing and do an arithematic, all of this but what is the need? Isn't it better like, click on an available rock, confim your are mining, do nothing while rock exits? Regards, J You save the rock tile so you query that tile for game objects. If you save the game object and you mine the rock then when the rock loses the ore in it, it is no longer the same game object Link to comment Share on other sites More sharing options...
abouhanafy87 4 Share Posted March 2, 2021 On 2/7/2021 at 5:02 AM, Neffarion said: You save the rock tile so you query that tile for game objects. If you save the game object and you mine the rock then when the rock loses the ore in it, it is no longer the same game object like this ironObjects = new ArrayList<GameObject>(); ironObjects.add(GameObjects.getTopObjectOnTile(new Tile(3285, 3368, 0))); ironObjects.add(GameObjects.getTopObjectOnTile(new Tile(3286, 3369, 0))); Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.