The id of the animation you send is also in the appearance block (referred to as render id)
You can grab an NPCs 'render' id from npc definitions (I don't think it's in the cache)
|
Short backstory / explanation of methodology:
I've changed Hyperion's PlayerUpdateTask to properly handle players whose appearances are set to that of an NPC. Along with that, the ::pnpc command is operational, taking an NPC ID as its argument.
The problem:
It all works well and good, save for the model deformation than results from using the human player model's animation IDs with ... well, anything that isn't the human player model.
The difference is obvious, and becomes more so when the model is actually animating to any great degree (i.e. attacking or running instead of idling).
The question:
How can I pull a certain NPC's animation IDs and substitute them for the player's?
and/or
How can I substitute alternate animation IDs for the player's own?
Thanks.
The id of the animation you send is also in the appearance block (referred to as render id)
You can grab an NPCs 'render' id from npc definitions (I don't think it's in the cache)
Thanks for your reply.
NPC definitions were the first place I looked. Here's a sample of the definition for NPC 1000 (the one in the example image):
The attack, defence, and death animations are specified here. But where would the idle and walk animations be?Code:<npcDefinition> <id>1000</id> <name>Holthion</name> <examine>One of the guardians of Iban.</examine> <combat>91</combat> <size>3</size> <attackable>true</attackable> <aggressive>false</aggressive> <retreats>false</retreats> <poisonous>false</poisonous> <respawn>10</respawn> <maxHit>1</maxHit> <hitpoints>10</hitpoints> <attackSpeed>4000</attackSpeed> <attackAnim>64</attackAnim> <defenceAnim>65</defenceAnim> <deathAnim>67</deathAnim> <attackBonus>13</attackBonus> <defenceMelee>13</defenceMelee> <defenceRange>13</defenceRange> <defenceMage>0</defenceMage> </npcDefinition>
I know they exist, and to some degree, are used. When the NPC is spawned, it idles with the correct animation, and if attacked, it will follow with its walk animation.
I just need to know how to get them.
Post your pnpc command.
The walk/stand/run are in the cache I believe, and are set by default from there.
Thanks guys. I'm relatively unacquainted with the RS client and cache ... so how would I pull them out of the cache and reference them in my code? So I can set them as the player's own.
My pnpc command calls this method:
It just uses update flags, doesn't re-set animations. Which is what I need it to do.Code:/** * Sets the NPC state of our player. * @param id The NPC ID. */ public void setPnpc(int id) { this.npcId = id; this.npcState = id > -1 ? true : false; getUpdateFlags().flag(UpdateFlag.APPEARANCE); }
Thanks to all of you!
« Previous Thread | Next Thread » |
Thread Information |
Users Browsing this ThreadThere are currently 1 users browsing this thread. (0 members and 1 guests) |