Jump to content

Help with animated objects


swiffy

Recommended Posts

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?

Link to comment
Share on other sites

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
Link to comment
Share on other sites

Do you mean that I should save the model id for when the cannon is not rotating, and then compare it with the rotating one..?

 

height shouldn't change lol

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

Link to comment
Share on other sites

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
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

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