Jump to content

Help with animated objects


Recommended Posts

Posted

Hi.

 

So I'm wondering how to check if an object is performing an animation or not. I'm working on a Dwarf-multicannon but I have no idea how to check if the cannon is rotating or needs to be fired.. For Character's you could just use character.isAnimating() but RS2Objects don't have that check.

 

f0b438ab2c70339a249aa761863706c2.png

 

Anyone have any ideas?

Posted

Hi.

 

So I'm wondering how to check if an object is performing an animation or not. I'm working on a Dwarf-multicannon but I have no idea how to check if the cannon is rotating or needs to be fired.. For Character's you could just use character.isAnimating() but RS2Objects don't have that check.

 

f0b438ab2c70339a249aa761863706c2.png

 

Anyone have any ideas?

try checking its height or its model

  • Like 1
Posted (edited)

i'm not sure what actually changes in your situation, try checking if its height changes when its rotating and if its model id is different when rotating

 

Ok I have no idea.

 

7d68ff4c6834f6c9d13582c2e9cf00b1.png

 

The "Entity Debug Info" is identical when the cannon is and isn't rotating..

Edited by swiffy
Posted (edited)

There should be a config value that changes when the cannon is firing. Try config debug

Additionally there will probably be a config storing how many cannonballs it has left

 

EDIT: I don't have the config for cannon state on hand; but remaining cannonballs should be

int cBalls = getConfigs().get(3);

From that you could make the assumption that cannon is not firing if cBalls is 0

Edited by FrostBug
  • Like 1

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...