Thanks but I know about that I was confused on where I should put it.
It depends on when you want to play the animation. For passive animations, I place the code in the entities
public void onEntityUpdate() {} function. Then you will always have the animation playing. (This function is called every tick)
If you want to play an animation, for example, when the entity attacks, you can use
public boolean attackEntityAsMob(Entity entity) {}
Just check out the various functions in the Entity and EntityCreature class and override them to play the animation (but dont forget to call super.method())
I'm having a small problem with the MCAnimator library on minecraft forge 1.8- build 1450. I realize that MCAnimator is not technically updated to 1.8 but everything works fine until this random crash. (Seemingly caused randomly)
This problem is only caused when a client connects to a dedicated server and not on single player after a random amount of minutes. It does not seem like a 1.8 issue even though it may be. Somehow the variable
private ArrayList<IMCAnimatedEntity> activeEntities = new ArrayList<IMCAnimatedEntity>(); in AnimTickHander.java
is being edited from multiple locations at once causing the crash. Does anyone know how to solve this?
How do I apply a running animation for when my entity is running?
I have been using entities moveEntityWithHeading(float strafe, float forward) method. This does seem a bit buggy however (the animation sometimes does not get triggered) and I think i may have to use the moveEntity method instead. Anyway, my code for moveEntityWithHeading looks like this
/**
* Moves the entity based on the specified heading. Args: strafe, forward
*/
@Override
public void moveEntityWithHeading(float strafe, float forward)
{
if (this.motionX > 0.05 || this.motionZ > 0.05) // .05 threshold for detecting enough movement to play the animation
{
if (!animHandler.isAnimationActive("Run"))
{
animHandler.activateAnimation("Run", 0);
}
}
super.moveEntityWithHeading(strafe, forward);
}
Edit: an entities motion value can be negative, therefore I had to change the above if statement to
if (this.motionX > 0.05 || this.motionZ > 0.05 || this.motionX < -0.05 || this.motionZ < -0.05)
This fixes animations randomly not playing
when ever the walking animations run it plays it for all entities even if they're not walking.
for example i spawn 2 of the same mob and one starts walking the 1 thats idle will play the walking animation aswell.
Is your animHandler declared as static for some reason? Static variables will be shared throughout all instances of a class and therefore all the mobs will have exactly the same state in the animhandler class
Every time I import Techne models to MCA it does this, The model isn't touching the ground.
I have the same issue... i found that going into the RenderEntity.class file is the best to start searching when your entity is floating in the world. I believe the public static float modelHeight = X is the line that defines how high the model sits above the ground. I just change this to something appropriate (sometimes even a negative number)... not sure if this is a clean good solution or not but it works.
Also, does anyone get spam in the console (1 per MCA entity)
[MCACommonLibrary.MCAVersionChecker:checkForLibraryVersion:12]: MCA WARNING: package.entity needs a newer version of the library (5). Things could go wrong!
I'm not sure why I would get this error since i just recently downloaded MCA 1.2.2 and have no idea what this newer library version is. Anyone got any ideas? I do happen to be using MC 1.8
I have been using entities moveEntityWithHeading(float strafe, float forward) method. This does seem a bit buggy however (the animation sometimes does not get triggered) and I think i may have to use the moveEntity method instead. Anyway, my code for moveEntityWithHeading looks like this
/**
* Moves the entity based on the specified heading. Args: strafe, forward
*/
@Override
public void moveEntityWithHeading(float strafe, float forward)
{
if (this.motionX > 0.05 || this.motionZ > 0.05) // .05 threshold for detecting enough movement to play the animation
{
if (!animHandler.isAnimationActive("Run"))
{
animHandler.activateAnimation("Run", 0);
}
}
super.moveEntityWithHeading(strafe, forward);
}
Edit: an entities motion value can be negative, therefore I had to change the above if statement to
if (this.motionX > 0.05 || this.motionZ > 0.05 || this.motionX < -0.05 || this.motionZ < -0.05)
This fixes animations randomly not playing
Please, we must keep this on topic. This is the wrong place for questions of that nature. Thanks!
Hey Tihyo. I want to be in the challenge games. Plz tell me when it is and send me the ip. Also add Winter Soldier, Doomsday,Bane,Lex Luthor,Deathstroke,Red Skull,mandrain,Venom,Kraven,Carnage,Catwoman,and Scarecrow back in. Also add the ultron boss,
import java.util.HashMap;
import fisherman77.paleocraft.common.MCACommonLibrary.IMCAnimatedEntity;
import fisherman77.paleocraft.common.MCACommonLibrary.animation.AnimationHandler;
import fisherman77.paleocraft.common.MCACommonLibrary.animation.Channel;
import fisherman77.paleocraft.common.animations.EntityCryo.CustomChannelCryoLookAt;
public class AnimationHandlerCitipati extends AnimationHandler {
/** Map with all the animations. */
public HashMap<String, Channel> animChannels = new HashMap<String, Channel>();
{
animChannels.put("Attack", new ChannelAttack("Attack", 10.0F, 5, Channel.LINEAR));
animChannels.put("Walk", new ChannelWalk("Walk", 10.0F, 13, Channel.LOOP));
animChannels.put("Idle", new ChannelIdle("Idle", 5.0F, 13, Channel.LOOP));
animChannels.put("lookAt", new CustomChannelCitiLookAt("lookAt"));
}
public AnimationHandlerCitipati(IMCAnimatedEntity entity) {
super(entity);
}
@Override
public void activateAnimation(String name, float startingFrame) {
super.activateAnimation(animChannels, name, startingFrame);
}
@Override
public void stopAnimation(String name) {
super.stopAnimation(animChannels, name);
}
@Override
public void fireAnimationEventClientSide(Channel anim, float prevFrame, float frame) {
}
@Override
public void fireAnimationEventServerSide(Channel anim, float prevFrame, float frame) {
}}
Are you getting an error compile time or run time? If it's runtime in which file is the error occouring? (Most IDE's will print a stack trace leading you to the line that caused the error)
It depends on when you want to play the animation. For passive animations, I place the code in the entities
public void onEntityUpdate() {} function. Then you will always have the animation playing. (This function is called every tick)
If you want to play an animation, for example, when the entity attacks, you can use
public boolean attackEntityAsMob(Entity entity) {}
Just check out the various functions in the Entity and EntityCreature class and override them to play the animation (but dont forget to call super.method())
I'm having a small problem with the MCAnimator library on minecraft forge 1.8- build 1450. I realize that MCAnimator is not technically updated to 1.8 but everything works fine until this random crash. (Seemingly caused randomly)
http://pastebin.com/wNNuafMn
This problem is only caused when a client connects to a dedicated server and not on single player after a random amount of minutes. It does not seem like a 1.8 issue even though it may be. Somehow the variable
private ArrayList<IMCAnimatedEntity> activeEntities = new ArrayList<IMCAnimatedEntity>(); in AnimTickHander.java
is being edited from multiple locations at once causing the crash. Does anyone know how to solve this?
How do I apply a running animation for when my entity is running?
Help my dragons! Just give 'em a click!
I have been using entities moveEntityWithHeading(float strafe, float forward) method. This does seem a bit buggy however (the animation sometimes does not get triggered) and I think i may have to use the moveEntity method instead. Anyway, my code for moveEntityWithHeading looks like this
/**
* Moves the entity based on the specified heading. Args: strafe, forward
*/
@Override
public void moveEntityWithHeading(float strafe, float forward)
{
if (this.motionX > 0.05 || this.motionZ > 0.05) // .05 threshold for detecting enough movement to play the animation
{
if (!animHandler.isAnimationActive("Run"))
{
animHandler.activateAnimation("Run", 0);
}
}
super.moveEntityWithHeading(strafe, forward);
}
Edit: an entities motion value can be negative, therefore I had to change the above if statement to
if (this.motionX > 0.05 || this.motionZ > 0.05 || this.motionX < -0.05 || this.motionZ < -0.05)
This fixes animations randomly not playing
when ever the walking animations run it plays it for all entities even if they're not walking.
for example i spawn 2 of the same mob and one starts walking the 1 thats idle will play the walking animation aswell.
Is your animHandler declared as static for some reason? Static variables will be shared throughout all instances of a class and therefore all the mobs will have exactly the same state in the animhandler class
Every time I import Techne models to MCA it does this, The model isn't touching the ground.
I have the same issue... i found that going into the RenderEntity.class file is the best to start searching when your entity is floating in the world. I believe the public static float modelHeight = X is the line that defines how high the model sits above the ground. I just change this to something appropriate (sometimes even a negative number)... not sure if this is a clean good solution or not but it works.
Also, does anyone get spam in the console (1 per MCA entity)
[MCACommonLibrary.MCAVersionChecker:checkForLibraryVersion:12]: MCA WARNING: package.entity needs a newer version of the library (5). Things could go wrong!
I'm not sure why I would get this error since i just recently downloaded MCA 1.2.2 and have no idea what this newer library version is. Anyone got any ideas? I do happen to be using MC 1.8
noob question, but how do I move the camera? It's stuck in a really bad spot for me and makes it difficult to work on my model.
WASD or Arrow keys.
Just a question, how do i tell if my model is facing front?
Please, we must keep this on topic. This is the wrong place for questions of that nature. Thanks!
Hey Tihyo. I want to be in the challenge games. Plz tell me when it is and send me the ip. Also add Winter Soldier, Doomsday,Bane,Lex Luthor,Deathstroke,Red Skull,mandrain,Venom,Kraven,Carnage,Catwoman,and Scarecrow back in. Also add the ultron boss,
That's cool!
I have a an error I can not figure out how to fix can someone please help me, it is in the entity class.
protected void entityInit() {
super.entityInit();
the super.entityInitI(); has the error.
Well what's the actual error say? (Like when you highlight the error in your IDE or run the program)
I can't see where its declared. Some things in my animhandler are declared static but changing them causes errors.
Here are my files:
AnimHandler:
.
Entity file:
Entity Model file:
Mob Animation Handler:
Is this able to be used for basic models? Or is it just meant for super advanced models? Looks cool, just want to know if it's right for me.
It can do something as simple as a regular Minecraft zombie or as complex as a snake/dinosaur, etc.
Are you getting an error compile time or run time? If it's runtime in which file is the error occouring? (Most IDE's will print a stack trace leading you to the line that caused the error)