HeroEngine Forums

HeroEngine Support => Scripting & Programming => Topic started by: Legacy on May 03, 12, 02:53:03 AM

Title: [Resolved] Help understanding how Behave and ACC works
Post by: Legacy on May 03, 12, 02:53:03 AM
Hello,
I encountered this just yesterday but found no information on wiki so I am asking here. I am using two things for my combat animations:

first I have in character's .AAS script two base modes defined (just like in the clean engine version): Normal and Combat. If I detect that character has weapon equipped, I set this to Combat, elsewhere it's set to Normal. Then I use the account["Behave"] = "anim ..." command to play a combat animation. Both work great on my local client, but other players around me cannot see the behavior.

So how do you do this on server? The code that sets character's base mode is found in the default clean engine E_ACCController script. I am mostly curious because if I use the account["Behave"] = "hold ..." command to attach a weapon to character's hand, it works perfectly and others can see the weapon attached too, so I'd guess this is replicating somehow...

What is the difference between hold and other commands such as anim or input?
Thanks
Title: Re: Help understanding how Behave and ACC works
Post by: HE-JAY on May 03, 12, 10:53:56 AM
In general, character controller state is communicate from a controlling client to the server and then replicated to observing clients; those observing clients then interpret the state change by changing animation inputs on their client-side version of your character to play the correct animations.

The process is basically:

To understand what the "hold" command is doing, you'll have to look at the script for the character controller attached to your character; by default, this will be HeroEngine_ACCControllerClassMethods -- look at the doBehave method and find the "hold" section (you'll also see sections for other commands such as 'anim' and 'input' -- these are all defined in script and can be extended as needed).
Title: Re: Help understanding how Behave and ACC works
Post by: Legacy on May 03, 12, 12:13:33 PM
Hey Jay,
thanks for in-depth answer, I'll dive into this :)