bone animation

Posted By: sebbi91

bone animation - 06/09/09 15:48

is it possible to animate 2 different bones with different animations?

I know its possible to animate the model and change bone angles!
But is there a way to say the MOdel:
bone Arm_left ==animate "take weapon"
bone body ==animate "stand"
...

Thank you for your help ^^
Posted By: croman

Re: bone animation - 06/09/09 15:56

maybe this code from example can help you out:
http://www.conitec.net/beta/aent_animate.htm
Posted By: sebbi91

Re: bone animation - 06/09/09 17:48

thank you very much ^^
Posted By: sebbi91

Re: bone animation - 06/22/09 13:55

Arrggh ....
And how could i manage the Animation for every Bone?
I want to show 2 different Animations at the SAME time!
It means walking leg-!bones!, standing Breast-!bone!,punching hand-!bones!!

It should be possible to walk with the player and manage the Hand animations!


The code you give me is only a blend over from 1 Animation to an other!

Any Idea to give a bone an Animation!

!bone! Arm_left ==animate "take weapon"
!bone! body ==animate "stand"
!bone! head ==animate "look_angry"
!bone! legs==animate "walk"
Posted By: sebbi91

Re: bone animation - 06/22/09 15:27

I got informations about using ANM_ADD in my animations!
Now my script looks like this:

....
if(key_w==1)
{
ent_animate(me,"walk",walkvar,ANM_CYCLE);
walkvar+=3;
}

if(key_e==1)
{
ent_animate(me,"push",pushvar,ANM_ADD);
}
...



The problem is the player adds the new Animation Angles to the old one and so the Arms rotate not correctly!
They are now behind the player -.-

Any ideas?
Posted By: the_clown

Re: bone animation - 06/22/09 15:48

Perform ent_bonereset before the second ent_animate, with the requested bone as parameter.
Posted By: sebbi91

Re: bone animation - 06/23/09 16:51

thanks!
I got it working! ^^
Posted By: the_clown

Re: bone animation - 06/23/09 16:52

Good.
Posted By: sebbi91

Re: bone animation - 07/23/09 16:53

new problem!

I have an basic animation (stand) and to seperat animations(Left_hand && right_hand)

My Script works fine with one ANM_ADD animation but if I use 2 ANM_ADD Animations my Player spins his arms totally in the wrong position!
here a code snippet
Quote:


function arm_animation()
{
...
if(slot_active_p2==0&&slot1_lefthand_used_p2==1&&...)
{
if(arm_right_angle_p2.tilt>=0 && arm_left_angle_p2.tilt>=0)
{
ent_bonerotate(my,"arm_up_left",arm_right_angle_p2);
ent_bonerotate(my,"arm_up_right",arm_right_angle_p2);
arm_right_angle_p2.tilt-=30*time_step;
}
if(arm_right_angle_p2.tilt<=0&&arm_left_angle_p2.tilt<=0)
{
arm_right_angle_p2.tilt=0;
arm_left_angle_p2.tilt=0;
}
...
//add her more animations that dont working
}

action player2()
{
...
//start basic animations
if(key_cuu-key_cud)
{
ent_animate(my, NULL, 0, 0);
walkanim_p2 += 6 * time_step;
ent_animate(my, "walk", walkanim_p2, ANM_CYCLE);
}
else
{
ent_animate(my, NULL, 0, 0);
standanim_p2 += 1 * time_step;
ent_animate(my, "stand", standanim_p2, ANM_CYCLE); /
}
if(key_cul-key_cur)
{
ent_animate(my, NULL, 0, 0);
walkanim_p2 += 6 * time_step;
ent_animate(my, "walk", walkanim_p2, ANM_CYCLE);
}

arm_animation();
..
}


Any Ideas?

regards Sebastian
Posted By: sebbi91

Re: bone animation - 07/24/09 14:07

no ideas?
Posted By: Michael_Schwarz

Re: bone animation - 07/24/09 15:04

you have to animate the body parts seperatly. i.e:

walk_legs, walk_torso, walk_head
stand_legs, stand_torso, stand_head, etc, if not, you will get that weird adding of angles
Posted By: sebbi91

Re: bone animation - 07/24/09 15:21

the problem is i did what you say!
every animation is seperatly and only animate one bodypart!

the basic animation "stand" animates only the body!(arms and head don't appear)
and if i add one Animation all works fine! (left arm is seperatly animated too)

But if i animate 2 ADD animations at the same time i got this horrible angle bug!

Cant get it working since 4 days!
Posted By: Storm_Mortis

Re: bone animation - 07/24/09 16:24

hi,
also zum einen würde ich dir empfehlen nur Ober- und Unterterkörper seperat zu animieren, sonst sieht das sehr unnatürlich aus.
Du weist sicher ... aufgerichteter "stehender" brustkorb, kniehende beine und waffe aufheben ... sztock im hintern und so^^
besser also eine aufheb anim ation für den gesammten oberkörper.

zum 2. - ich weiß nicht wie dein modell und die animationen aussehen, aber du musst in jedem fall darauf achten das wenn du einen teil des körpers per addition animieren möchtest, das alles andere in der ausgangsstellung ist und bleibt.

bei addierung werden ja alle winkel und posiotionen addiert. und zwar zum jetzigen wert.

wenn du alles so gemacht hast, sei bitte nicht beleidigt, dachte nur besser es zu erwähnen falls es nicht so sein sollte wink

ansonsten probiere mal das bone "resetten" fals du das noch nicht probiertest, gugg einfach ins handbuch für einzelheiten.

hoffe dir hilft irgendwas hiervon^^
Posted By: sebbi91

Re: bone animation - 07/25/09 12:22

Keine Angst ich bin nicht beleidigt ^^

Allerdings ist es genau so wie du geschrieben hast!
Ich erklär es jetzt mal ganz genau auf deutsch(bin nicht so gut in englisch)

Also
Ich habe einen Spieler welcher standartmäßig 2 Animationen abspielt!
"Stand" und "walk"
bei der stand animation wird nur der Brustkorb animiert und bei der walkanimation nur die Beine!
Genau wie du gesagt hast, damit es natürlicher aussieht ^^

so!weiter gehts!

Mein Spieler besteht aus nur einem Modell und deswegen muss ich Arme,Kopf und Beine einzeln animieren was ich mit bone animationen und Bone rotate mache!
Früher hatte ich seperate Modelle welche ich dann einzeln ansteuern konnte!

Heute benutze ich wegen dem Realismus und besseren aussehen das Bone manipulationsprinzip!

In meinem Spiel kann der Spieler sich entscheiden welche Waffe er in welche Hand nimmt, so wie damals in Halo2 für die Xbox!
daher muss auch beim aufheben jeder Arm einzeln animiert werden was ich mit ANM_ADD mache!
Dabei wird NUR der Arm bewegt Brustkorb Kopf und Beine bleiben unverändert animiert!


wenn der Spieler nun die Waffe aus dem holster nimmt animiert er logischerweise ja nur den linken arm da er sie ja auch mit der linken Hand eingesteckt hat!

Wie bereits erwähnt funktioniert dieses Prinzip relativ gut!

Nun kommt das Problem!
Hat der Spieler allerdings 2 Waffen aufgesammelt muss er ja logischerweise den linken arm via ANM_ADD und den rechten Arm via ANM_ADD animieren, damit beide Arme sich die für sie bestimmten waffen holen!

Und da scheint mein Script einen Fehler zu haben!
Denn erst wenn ich beide Arme gleichzeitig animiere verdrehen sich beide Arme komisch!

der Befehl Bone_reset (welcher bei der einmaligen animation notwendig war) zeigte hier allerding keine besonders große wirkung!

Meine Frage an alle die jetzt mitgelesen haben:
hat jemand irgendein funktionierendes Script wo:
-eine Basisanimation abegspielt wird
-und 2 Zusatzanimtionen ZEITGLEICH hinzugefügt werden!

oder kann jemand helfen mein Script zu korrigieren!
Hier eine ausführlichere Variante aus meinem Script
Quote:


function interactionssystem_p2()
{
///////////////////////////////////////////////////////////////
// define the Interactionsrange
....
//add here a Interactionssystem(weappickup,Objekt pickup)


///ANIMATE Weapon take
////////////////////////
//CALL HERE THE WEAP TAKE [ONE-HAND-WEAPONS]
////////////////////////


//left1
if(slot_active_p2==1&&slotchange_var_p2==1&&slot1_lefthand_used_p2==1&&slot1_righthand_used_p2==0)
{
ent_bonereset_branch(my,"arm_up_left");
ent_bonereset_branch(my,"arm_up_right");//delete this entry later

//TAKE
//NOTE: PICKUP adn Take animation is the same
if(take_left_anim<100)
{
ent_animate(my,"t_leftehw_h",take_left_anim, ANM_ADD); // animiere das Modell (benutze "turn")
take_left_anim+=8*time_step;
}
if(take_left_anim>=100)
{
//BUG-Line
ent_bonereset_branch(my,"arm_up_left");
ent_bonereset_branch(my,"arm_up_right");//delete this entry later
//
take_left_anim=100;
position_slot1_leftweap_p2=1;
ent_animate(my,"h_leftehw",1, ANM_ADD); // animiere das Modell (benutze "turn")
}
if(arm_left_angle_p2.tilt!=camera2.tilt&&take_left_anim==100)//&&take_ehw_anim >=80
{
ent_bonerotate(my,"arm_up_left",arm_left_angle_p2);
arm_left_angle_p2.tilt+=30*time_step;
}
if(arm_left_angle_p2.tilt>=camera2.tilt+80&&take_left_anim==100)//&&take_ehw_anim >=80
{
arm_left_angle_p2.tilt=camera2.tilt+80;
}
}
//PUTAWAY
/////////
if(slot_active_p2==0&&slotchange_var_p2==1&&slot1_lefthand_used_p2==1&&slot1_righthand_used_p2==0&&take_left_anim>0)
{
if(arm_left_angle_p2.tilt>=0)
{
ent_bonerotate(my,"arm_up_left",arm_left_angle_p2);
arm_left_angle_p2.tilt-=30*time_step;
}
if(arm_left_angle_p2.tilt<=0)//animate th take proces with tilt°
{
arm_left_angle_p2.tilt=0;
//animate_put_ehw=0;
}

if(take_left_anim>0&&arm_left_angle_p2.tilt<=0)
{
ent_bonereset_branch(my,"arm_up_right");//delete this entry later
ent_bonereset_branch(my,"arm_up_left");
ent_animate(my,"t_leftehw_h",take_left_anim, ANM_ADD); // animiere das Modell (benutze "turn")
take_left_anim-=8*time_step;
}
if(take_left_anim<=33.33)
{
position_slot1_leftweap_p2=2;
}
if(take_left_anim<=0 && arm_left_angle_p2.tilt==0)
{
take_left_anim=0;
position_slot1_leftweap_p2=2;
}
}



///////////////////////////////////////////////////////////////
//right1
if(slot_active_p2==1&&slotchange_var_p2==1&&slot1_righthand_used_p2==1&&slot1_lefthand_used_p2==0)
{
ent_bonereset_branch(my,"arm_up_left");
ent_bonereset_branch(my,"arm_up_right");//delete this entry later


//TAKE
//NOTE: PICKUP adn Take animation is the same
if(take_right_anim<100)
{
ent_animate(my,"t_rightehw_h",take_right_anim, ANM_ADD); // animiere das Modell (benutze "turn")
take_right_anim+=8*time_step;
}
if(take_right_anim>=100)
{
//BUG-Line
ent_bonereset_branch(my,"arm_up_left");
ent_bonereset_branch(my,"arm_up_right");//delete this entry later


//
take_right_anim=100;
position_slot1_rightweap_p2=1;
ent_animate(my,"h_rightehw",1, ANM_ADD); // animiere das Modell (benutze "turn")
}
if(arm_right_angle_p2.tilt!=camera2.tilt&&take_right_anim==100)//&&take_ehw_anim >=80
{
ent_bonerotate(my,"arm_up_right",arm_right_angle_p2);
arm_right_angle_p2.tilt+=30*time_step;
}
if(arm_right_angle_p2.tilt>=camera2.tilt+80&&take_right_anim==100)//&&take_ehw_anim >=80
{
arm_right_angle_p2.tilt=camera2.tilt+80;
}
}
//PUTAWAY
/////////
if(slot_active_p2==0&&slotchange_var_p2==1&&slot1_righthand_used_p2==1&&take_right_anim>0&&slot1_lefthand_used_p2==0)
{
if(arm_right_angle_p2.tilt>=0)
{
ent_bonerotate(my,"arm_up_right",arm_right_angle_p2);
arm_right_angle_p2.tilt-=30*time_step;
}
if(arm_right_angle_p2.tilt<=0)//animate th take proces with tilt°
{
arm_right_angle_p2.tilt=0;
//animate_put_ehw=0;
}

if(take_right_anim>0&&arm_right_angle_p2.tilt<=0)
{
ent_bonereset_branch(my,"arm_up_left");
ent_bonereset_branch(my,"arm_up_right");//delete this entry later


ent_animate(my,"t_rightehw_h",take_right_anim, ANM_ADD); // animiere das Modell (benutze "turn")
take_right_anim-=8*time_step;
}
if(take_right_anim<=33.33)
{
position_slot1_rightweap_p2=2;
}
if(take_right_anim<=0 && arm_right_angle_p2.tilt==0)
{
take_right_anim=0;
position_slot1_rightweap_p2=2;
}
}

//HERE IS IT HTE PROBLEM KOMBINATION
///////////////////////////////////////////////////////////////

//left1 &right1
if(slot_active_p2==1&&slotchange_var_p2==1&&slot1_lefthand_used_p2==1&&slot1_righthand_used_p2==1)
{
ent_bonereset_branch(my,"arm_up_left");
ent_bonereset_branch(my,"arm_up_right");

//TAKE
//NOTE: PICKUP and Take animation is the same
if(take_left_anim<100)
{
ent_animate(my,"t_leftehw_h",take_left_anim, ANM_ADD);
ent_animate(my,"t_rightehw_h",take_left_anim, ANM_ADD);
take_left_anim+=8*time_step;
}
if(take_left_anim>=100)
{
//BUG-Line
ent_bonereset_branch(my,"arm_up_left");
ent_bonereset_branch(my,"arm_up_right");//delete this entry later
//
take_left_anim=100;
position_slot1_leftweap_p2=1;
position_slot1_rightweap_p2=1;
ent_animate(my,"h_leftehw",1, ANM_ADD); // animiere das Modell (benutze "turn")
ent_animate(my,"h_rightehw",1, ANM_ADD); // animiere das Modell (benutze "turn")
}
if(arm_left_angle_p2.tilt!=camera2.tilt&&take_left_anim==100)//&&take_ehw_anim >=80
{
ent_bonerotate(my,"arm_up_left",arm_left_angle_p2);
arm_left_angle_p2.tilt+=30*time_step;
}
if(arm_left_angle_p2.tilt>=camera2.tilt+80&&take_left_anim==100)//&&take_ehw_anim >=80
{
arm_left_angle_p2.tilt=camera2.tilt+80;
}

//right angles
if(arm_right_angle_p2.tilt!=camera2.tilt&&take_left_anim==100)//&&take_ehw_anim >=80
{
ent_bonerotate(my,"arm_up_right",arm_right_angle_p2);
arm_right_angle_p2.tilt+=30*time_step;
}
if(arm_right_angle_p2.tilt>=camera2.tilt+80&&take_left_anim==100)//&&take_ehw_anim >=80
{
arm_right_angle_p2.tilt=camera2.tilt+80;
}
}
//PUTAWAY
/////////
if(slot_active_p2==0&&slotchange_var_p2==1&&slot1_lefthand_used_p2==1&&slot1_righthand_used_p2==1&&take_left_anim>0)
{
if(arm_left_angle_p2.tilt>=0&&arm_right_angle_p2.tilt>=0)
{
arm_left_angle_p2.tilt-=30*time_step;
arm_right_angle_p2.tilt-=30*time_step;
ent_bonerotate(my,"arm_up_left",arm_left_angle_p2);
ent_bonerotate(my,"arm_up_right",arm_right_angle_p2);
}
if(arm_left_angle_p2.tilt<=0&&arm_right_angle_p2.tilt<=0)//animate th take proces with tilt°
{
arm_left_angle_p2.tilt=0;
arm_right_angle_p2.tilt=0;
}

if(take_left_anim>0&&arm_left_angle_p2.tilt<=0)
{
ent_bonereset_branch(my,"arm_up_left");
ent_bonereset_branch(my,"arm_up_right");//delete this entry later

ent_animate(my,"t_leftehw_h",take_left_anim, ANM_ADD); // animiere das Modell (benutze "turn")
ent_animate(my,"t_rightehw_h",take_left_anim, ANM_ADD); // animiere das Modell (benutze "turn")
take_left_anim-=8*time_step;
}

if(take_left_anim<=33.33)
{
position_slot1_leftweap_p2=2;
position_slot1_rightweap_p2=2;
}
if(take_left_anim<=0 && arm_left_angle_p2.tilt==0 && arm_right_angle_p2.tilt==0)
{
take_left_anim=0;
position_slot1_leftweap_p2=2;
position_slot1_rightweap_p2=2;
}

}


//add her the weapons postions, it means
//position_slot1_leftweap_p2=1 //weapon is in the Hand
//position_slot1_leftweap_p2=2 //weapon is in the Holster
}



//some other arguments and functions
....


action player2()
{
p2=me;
my.scale_x=0.09;
my.scale_y=0.09;
my.scale_z=0.09;

set(my,POLYGON|CAST);
my.emask|=ENABLE_SHOOT|ENABLE_BLOCK|ENABLE_IMPACT|ENABLE_ENTITY;
vec_for_bone(head_angle_p2,my,"head");//set an ANGLE for the Head rotation
vec_for_bone(breast_angle_p2,my,"breast");//set an ANGLE for the Head rotation

camera2.pan=0;
camera2.tilt=0;
camera2.roll=0;
my.push=5;
my.health =100;
my.stamina =100;
my.fat =0;
my.force =1;
my.muscles =1;
my.jumphigh = 39;
my.ground=1;

var jump_possible=0;//allow only to jump if the player stands on the ground
var jumpcounter=0;//count the high the player is jumped
var jump_block=0;//the player has to wait a moment
var power_jump=4; //if the Player walks he could jump higher

draw_textmode("arial",1,15,100); //This sets the text messagesgind of Player2
while(p2.health>0)
{
health_p2=my.health; //calculate my.skills to vars for digits and outcast functions
ground_p2=my.ground;
///////////////////////////////////////////////////////////////
// DEFINES the Movement first
///////////////////////////////////////////////////////////////
human_gravity();

if((key_enter==1&&my.ground==1&&jump_block==0)||(jump_possible==1))//selvholding
{
jump_possible=1;
}

if(jump_possible==1&&jumpcounter<=my.jumphigh)
{
jumpcounter+=power_jump;
jump_block=50;
my.distanz_z=3*time_step;

if(key_cuu)
{
power_jump=2.75;
my.distanz_x=8*(key_cuu)*time_step;
}
else{power_jump=4;}
}
else
{
jump_possible=0;
jumpcounter=0;
my.distanz_x=5*(key_cuu-key_cud)*time_step;
my.distanz_y=5*(key_cul-key_cur)*time_step;
my.distanz_z=time_step*my.force_z;
jump_block-=1;
if(jump_block<=0)
{
jump_block=0;
}
}

distanz_p2.x=my.distanz_x;
distanz_p2.y=my.distanz_y;
distanz_p2.z=my.distanz_z;
c_move(my,distanz_p2,nullvector,IGNORE_PASSABLE|IGNORE_PUSH |GLIDE);

///////////////////////////////////////////////////////////////
// DEFINES the Animations
///////////////////////////////////////////////////////////////
//important-first animate the body and the legs before //animating the head or the arms

if(key_cuu-key_cud)
{
ent_animate(my, NULL, 0, 0);
walkanim_p2 += 6 * time_step;
ent_animate(my, "walk", walkanim_p2, ANM_CYCLE);
}
else
{
ent_animate(my, NULL, 0, 0);
standanim_p2 += 1 * time_step;
ent_animate(my, "stand ", standanim_p2, ANM_CYCLE);
}
if(key_cul-key_cur)
{
ent_animate(my, NULL, 0, 0);
walkanim_p2 += 6 * time_step;
ent_animate(my, "walk", walkanim_p2, ANM_CYCLE); /
}

if(key_e==1)
{
ent_bonereset_branch(my,"arm_up_left"); ent_bonereset_branch(my,"arm_up_right");
pushanim_p2 +=6 *time_step;
ent_animate(my, "punch", pushanim_p2, ANM_ADD);
}
if(!key_e)
{
pushanim_p2=0;
}


///////////////////////////////////////////////////////////////
// DEFINES the Angles
///////////////////////////////////////////////////////////////



camera2.pan-=8*(mouse_force.x)*time_step;
camera2.tilt+=8*(mouse_force.y)*time_step;
p2.pan=camera2.pan;
head_angle_p2.roll=0;
head_angle_p2.pan=0;
head_angle_p2.tilt=camera2.tilt;
ent_bonereset(my,"Head");
ent_bonerotate(my,"Head",head_angle_p2);


if(camera2.tilt>=90)
{
camera2.tilt=90;
} //The Player shouldn't see behind him self
if(camera2.tilt<=-81)
{
camera2.tilt=-81;
}//The Player shouldn't see through him self


//IMPORTANT Add all other Definitions and Funktions (Weapons) AFTER the Movement
//because the Weapons need an aktually Position to set

//This functions are for Salvemode,Automatic,halfautomatik
if(mouse_left==1) { lefthand_firemode_p2+=1; lefthand_firemode_p2 = maxv(lefthand_firemode_p2,0); }
if(mouse_left==0) { lefthand_firemode_p2=1; }
if(mouse_right==1) { righthand_firemode_p2+=1; righthand_firemode_p2 = maxv(righthand_firemode_p2,0); }
if(mouse_right==0) { righthand_firemode_p2=1;}

interactionssystem_p2();
vec_for_vertex(camera2.x,p2,735);

wait(1);
}
}


Sorry für den Aufsatz aber ich hoffe das es etwas gebracht hat und mir jemand helfen kann wenn ich mein Problem besser schildere!

Ich persönlich glaube es liegt am Script und nicht die Animation!

Danke schon mal für die Hilfe ^^
Posted By: hopfel

Re: bone animation - 07/25/09 12:42

Setz irgentwo vor den Animations-anweisungen folgendes:

ent_animate("deinframe",NULL,ANM_CYCLE);

ANM_ADD funktioniert nur, wenn bereits eine Animation vorhanden ist.
Posted By: sebbi91

Re: bone animation - 07/25/09 12:46

ist es noch!
Schau mal unter Player2()
da ist ein grün markiertes stück script das sind die Grundanimationen von den ich rede und weiter unten wird via interactionssystem_p2(); die zusatzanimationen eingebunden (rot markiert)

Also eine Grundanimation besteht auf jeden Fall! (denk ich)

Trotzdem danke für dein Versuch^^
Posted By: hopfel

Re: bone animation - 07/25/09 13:05

Schreib trotzdem mal für jede Animation die eine Zeile am anfang von der Funktion interactionssystem_p2(). Dann kannst du zumindest sicher sein, dass auch wirklich nichts vergessen hast smile
Posted By: sebbi91

Re: bone animation - 07/25/09 13:13

sorry aber macht keinen großen Unterschied!
Posted By: hopfel

Re: bone animation - 07/25/09 15:12

Dann weist du jetzt, dass es bestimmt nicht daran liegt ^^ verdreht hat es sich bei mir bis jetzt immer nur wegen dem... Kann dir also nicht weiterhelfen frown
Posted By: Storm_Mortis

Re: bone animation - 07/25/09 15:46

alos ich hatte soetwas mal, hatte oberkörper, unterkorper und dann noch einzelne kleine anims dazuaddiert. aber ic hhabe kein plan wo ich das habe, ist eh wenn auf meinem gerade grafikkarte losem rechner -.-

aber bei mir tats super, mein char konnte halt beim laufen oder schlagen noch was sagen mit gedsichtsanimationen die per anm_add gemacht waren...

sollte ich es noch aufem notebook haben, lasse ich es dir zukommen, aber ich glaube hier ist es nicht...

und sry, zeit deinen code zu korigieren habe ich leider nicht...
Posted By: sebbi91

Re: bone animation - 07/25/09 16:03

Hier ist noch ein Bild was zeigt was ich meine:

Bild Hosted bei ImagesUp.de

Schade!
Aber das du es hingekriegt hast zeigt ja schon mal das eine Lösung in Sichtweite ist!
wenn dir irgendwie noch was einfällt sag bitte bescheid!
Posted By: Storm_Mortis

Re: bone animation - 07/25/09 16:17

auf den ersten blick sieht es nach einem problem mit dem modell aus... aber kann ja teuschen!

wenn du mir dein model per pm schickst könnte man das bestätigen oder eleminieren,
zum kurz guggen finde ich noch zeit^^
Posted By: sebbi91

Re: bone animation - 07/25/09 16:25

klar!
Ist unterwegs!
Posted By: Pappenheimer

Re: bone animation - 07/25/09 16:49

Quote:
//HERE IS IT HTE PROBLEM KOMBINATION
///////////////////////////////////////////////////////////////
//left1 &right1
if(slot_active_p2==1&&slotchange_var_p2==1&&slot1_lefthand_used_p2==1&&slot1_righthand_used_p2==1)
{
ent_bonereset_branch(my,"arm_up_left");
ent_bonereset_branch(my,"arm_up_right");

//TAKE
//NOTE: PICKUP and Take animation is the same
if(take_left_anim<100)
{
ent_animate(my,"t_leftehw_h",take_left_anim, ANM_ADD);
ent_animate(my,"t_rightehw_h",take_left_anim, ANM_ADD);


ent_animate(my,"t_leftehw_h",take_left_anim, ANM_ADD);
ent_animate(my,"t_rightehw_h",take_left_anim, ANM_ADD); ???

take_left_anim - für den rechten Arm?
Posted By: sebbi91

Re: bone animation - 07/25/09 17:03

ja beide sollen mit der selben variable animiert werden,damit sie zeitgleich animiert werden!
weiter oben hatte ich für jeden Arm eine eigene Zähler-Variable!
Macht übrigens keinen unterchied wenn ich es mit der oben benannten take_right_anim variable mache!
nur das eine weitere Variable im System hoch und runter Zählt!
Posted By: Pappenheimer

Re: bone animation - 07/25/09 17:09

Okay, hätte ich mir genauer anschauen sollen!

Ein Problem, das ich von Animationen her kenne, ist, dass Sequencen miteinander verwechselt wurden, wenn einander 2 Sequencen mit gleichem Namensanfang hintereinander in der Reihenfolge der Frames lagen, so als ob die Engine dann die Namen nicht erst komplett zu ende lesen würde. Vielleicht greift hier auch so ein Namensproblem.
Posted By: sebbi91

Re: bone animation - 07/25/09 17:15

werd mal versuchen sie testweise umzubenennen!
Jetzt wo du es sagst mit Modellbezeichnungen ist es ja genau so!
Danke für den Tipp!
Posted By: Storm_Mortis

Re: bone animation - 07/25/09 17:16

also, danke das du mir das model geschickt hast ...
leider ist es wie ich vermutete, dein modell ist in der standart pose ein "T".
Das ist nichts schlechtes nur hast du diese Pose nicht vortwährend genutzt, das ist schlecht...
deine einzelnen schiess, aufnehm und alle anderen obekörper-animationen haben die arme angezogen. siehste auch auf deinem screenshot.
die winkel werden addiert! das heisst, wenn du eine steh oder schiess animation spielst. haben die arme ca.90°. wenn du nun noch die andere dazu nimmst, dann haste schon 90°, plus nochmal 90° von der addierung. das erbibt ja 180, und der arm guckt durch den brustkorb! doof wa^^ sry, du musst einfach bei animationen die zur addierung gedacht sind, GAR NICHTS ausser dem was addiert werden soll animieren, nicht den rest ind steh pose. alles andere müsste bei dir die "T" pose beibehalten.

ich hoffe du verstehst was ich meine...
Posted By: sebbi91

Re: bone animation - 07/25/09 17:28

und was ist wenn ich die erste Animation null1 lösche, macht das dann einen unterschied oder meinst du die Positionierung des Modells außerhalb von Animationen?
Posted By: Storm_Mortis

Re: bone animation - 07/25/09 17:35

eigendlich geht die engine von dem ersten frame aus, wenn dein 2. frame mir allen stehenden und den angewinkelten armen übereinstimmt, ist es einen versuche wert!

ich würde es probieren, abern en backup machen, zuvor^^
Posted By: sebbi91

Re: bone animation - 07/25/09 18:15

bringt leider nichts, auch das umbenennen!
Posted By: Storm_Mortis

Re: bone animation - 07/25/09 18:25

ich würede dir vorschlagen einfach mal ein test model zu bauen ind da simpelste anims zu addieren, bis du mit sierheit weisst wie was funktioniert.

das ist zwar nicht so spannend aber hilft meinst echt gut^^
Posted By: sebbi91

Re: bone animation - 07/26/09 13:17

deutsch:
------------------------------------------
ahhh !!
Man ist das nervig!
da kriegt man ja ne Macke! o.O
Ich probier schon seit gestern abend ununterbrochen neue Kombinationen aus!
Hab alles erst mal Tstweise in einem neuen Script gelegt!(wie du gesagt hast)
Ist also bei weitem überschaubarer!


Wer einen versuch wagen möchte kann gerne mitmachen!
http://rapidshare.com/files/260225795/ANGLE-bug.zip

Key_a= linken arm animieren
Key_s= rechten arm animieren
Key_d= linken und rechten arm animieren (BUG)


Vieleicht kommt einer von euch dahinter ^^

english:
------------------------------------------
ahhh !!
this is so stupid!
The Script is now shorted and more simple!

Who wants to risk try , here is the Link!
http://rapidshare.com/files/260225795/ANGLE-bug.zip

Key_a= left arm animate
Key_s= right arm animate
Key_d= left and right arm animate(BUG)

Maybe someone could solve it^^

/////////////////////////////////////////////////////
/////////////////////////////////////////////////////
[EDIT]
I uploaded the wrong file!
replace the old script with this
Quote:

///////////////////////////////////////////////////////////////
// (c)by INDUSTRIAL GAME SCIENCE -[Main script] ///////////////
///////////////////////////////////////////////////////////////
#include <acknex.h>
#include <default.c>

#define PRAGMA_PATH "fonts"


var standanim;
var walkanim;
var pushanim;
ANGLE head_angle;
ANGLE body_angle;
ANGLE breast_angle;
ANGLE arm_left_angle;
ANGLE arm_right_angle;
VECTOR distanz;

var leftarm_take_anim;
var rightarm_take_anim;

action playertest()
{
my.scale_x=0.09;
my.scale_y=0.09;
my.scale_z=0.09;

set(my,POLYGON|CAST);
my.emask|=ENABLE_SHOOT|ENABLE_BLOCK|ENABLE_IMPACT|ENABLE_ENTITY;
vec_for_bone(head_angle,my,"head");//set an ANGLE for the Head rotation
vec_for_bone(breast_angle,my,"breast");//set an ANGLE for the Head rotation

while(1)
{
if(key_cuu-key_cud)
{
ent_animate(my, NULL, 0, 0); // setze alle Animationen zurück
walkanim += 6 * time_step; //erhöhe walk_speed; 1.5 setzt die Geschwindigkeit
ent_animate(my, "walk", walkanim, ANM_CYCLE); // animiere das Modell (benutze "walk")
}
else
{
ent_animate(my, NULL, 0, 0); // setze alle Animationen zurück
standanim += 1 * time_step; //erhöhe walk_speed; 1.5 setzt die Geschwindigkeit
ent_animate(my, "stand ", standanim, ANM_CYCLE); // animiere das Modell (benutze "walk"
}
if(key_cul-key_cur)
{
ent_animate(my, NULL, 0, 0); // setze alle Animationen zurück
walkanim += 6 * time_step; //erhöhe walk_speed; 1.5 setzt die Geschwindigkeit
ent_animate(my, "walk", walkanim, ANM_CYCLE); // animiere das Modell (benutze "walk")
}

if(key_a==1)//left
{
ent_bonereset_branch(my,"arm_up_left");
ent_bonereset_branch(my,"arm_up_right");
leftarm_take_anim +=6 *time_step;
ent_animate(my,"t_leftehw_h", leftarm_take_anim, ANM_ADD);
}
if(key_a==0&&key_d==0){ leftarm_take_anim=0; }

if(key_s==1)//right
{
ent_bonereset_branch(my,"arm_up_left");
ent_bonereset_branch(my,"arm_up_right");
rightarm_take_anim +=6 *time_step;
ent_animate(my,"t_rightehw_h", rightarm_take_anim, ANM_ADD);
}
if(key_s==0&&key_d==0){rightarm_take_anim=0; }


if(key_d==1)//left and right
{
leftarm_take_anim +=6 *time_step;
rightarm_take_anim +=6 *time_step;

ent_bonereset_branch(my,"arm_up_left");
ent_bonereset_branch(my,"arm_up_right");
ent_animate(my,"t_leftehw_h", leftarm_take_anim, ANM_ADD);
ent_animate(my,"t_rightehw_h", rightarm_take_anim, ANM_ADD);
}
if(key_s==0&&key_a==0&&key_d==0){leftarm_take_anim =0;rightarm_take_anim=0; }

wait(1);
}
}




void main()
{
ENTITY* temp;
ENTITY* map;

enable_polycollision = 2;

video_mode = 8; // screen size 640x480
video_depth =32; // 16 bit colour D3D mode
video_screen=1;
sound_vol = 100;
wait(1);
level_load("");
var terrain_chunk = 0;
ENTITY* sky = ent_createlayer("skycube+6.dds", SKY | CUBE | SHOW, 0);
sky.z = 30;
vec_set(sun_color,vector(100,100,100));

//Manage Level-creating
map=ent_create("outcast.hmp",NULL,NULL);
set(camera,SHOW);
temp=ent_create("test_ragdoll.mdl",vector(0,0,40),playertest);
camera.x=50;
camera.y=0;
camera.z=45;
camera.pan=180;

}


void close()
{
sys_exit ("und Tschüss");
}

void shortcuts_startup()
{
on_f10=close;
on_f9=main;
}
//IMPORTANT :ONE Empty String

PANEL* leftarm_anim =
{
digits(30,100, 4, _a4font, 1,leftarm_take_anim);
flags = SHOW ;
}
PANEL* righttarm_anim =
{
digits(60,100, 4, _a4font, 1,rightarm_take_anim);
flags = SHOW ;
}

Posted By: sebbi91

Re: bone animation - 07/26/09 13:43

@Storm_Mortis

ACh du SCHEI** !!!!
Ich glaub ich das Problem gefunden!
Ich hab genau wie du gestern gesagt hast das Model mal mit der T Position animiert und schon bekomme ich keine Angle bugs mehr!

Das ist allerdings realtiv ungünstig, weil ich die T position zum Texturieren und Bone punkte setzen brauche!

Das ist aber nicht gut!

Ich kann ja schlecht nachträglich die T position ändern oder jednn einzelnen Frame auf die Position ändern!
(außerdem sieht es nicht sonderlich gut aus wenn der Player wie Jesus mit unsichtbarem Kreuz durch das Level rennt! ^^)

Was mach ich den jetzt?
wenn de willst kann ich dir ja mal das funktionierende Modell schicken!

Posted By: Pappenheimer

Re: bone animation - 07/26/09 13:46

2 ways, that I would shoose:

1. Trying to combine other animations: legs running, head talking, arm aiming...
2. Avoiding the problem: bone animations are 'cheap', add an animation with both arms aiming

Do you want to aim at different enemies at once?, like in Tomb Raider?

EDIT: Vergiß meine Vorschläge! Storm_Mortis Analyse ist einfach durchschlagend!
Posted By: hopfel

Re: bone animation - 07/26/09 13:49

Das ist immer so eine Sache, wenn man ein Modell erstellt, die Bones drauftut und Animationen draufschmeisst und man dann merkt, dass man die Anfangsposition verändern muss... Aus meiner Erfahrung würd ich sagen: lösche alle Animationen und mach sie neu, dann ersparst du dir später viel Arbeit. Und nächstes Mal wenn du ein Modell animierst machst du den selben Fehler nicht noch einmal. smile
Posted By: sebbi91

Re: bone animation - 07/26/09 14:01

@Pappenheimer
no , but my player could choose what kind of weapon he care in what hand!
Its like Halo2!
http://www.youtube.com/watch?v=91qQ7R30nAw&feature=related
(sorry but i did only found the DS version who shows what I mean)

And carry pistol looks different like care a knife!
and if he only care one Pistol the other Hand wont be used!
And so it needs different animations!

I hope you understand what I try to say!
© 2024 lite-C Forums