Jump to content

one shot anim problem


cassius
 Share

Recommended Posts

The following anim which is supposed to run once only sometimes works ok and sometimes fails to happen, with the character immobile but still standing.

I have a c version and a bmax version.

 

 

Another problem is I need to to make the controller lay still on the ground after the character has "died" but it slides along in some random direction. I solved this second problem in Bmax version with FreeEntity controller but when I do the same in c the program crashes.The code is almost identical in both.

 

The first problem is the most important. Does anyone have any anim code better than mine?Thanks.

 

 

void kill_badguy() {

Animate(badguy.model,badguy.k_framebegin,1.0f,true) ;

badguy.k_framebegin = badguy.k_framebegin + 0.5f * AppSpeed() ;

if (badguy.k_framebegin >= badguy.k_frameend ) {

badguy.alive = false;

}

}

amd quad core 4 ghz / geforce 660 ti 2gb / win 10

Blender,gimp,silo2,ac3d,,audacity,Hexagon / using c++

Link to comment
Share on other sites

I got the animation working now. The only problem left is the second one How to stop "dead" character sliding along floor. FreeEntity crashes program in c but not in Bmax. I have set the flag badguy.alive to true until the character "dies" when badguy.alive becomes false.

amd quad core 4 ghz / geforce 660 ti 2gb / win 10

Blender,gimp,silo2,ac3d,,audacity,Hexagon / using c++

Link to comment
Share on other sites

1. If you want to disappear dead body it's good approach to FreeEntity(). If it crashes you are doing something wrong. Remember C has no garbage collector so you need to manage carefully all references and pointers.

 

2. If want just to stop sliding body without disappearing it depends of causes that make it sliding.

 

If it slides because of physics forces you'll need probably reduce that forces and/or increase friction.

 

If it slides because of error in your character controller moving algorithm you need to fix it.

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.

 Share

×
×
  • Create New...