Gamestudio Links
Zorro Links
Newest Posts
Zorro 2.70
by jcl. 09/29/25 09:24
optimize global parameters SOLVED
by dBc. 09/27/25 17:07
ZorroGPT
by TipmyPip. 09/27/25 10:05
assetHistory one candle shift
by jcl. 09/21/25 11:36
Plugins update
by Grant. 09/17/25 16:28
AUM Magazine
Latest Screens
Rocker`s Revenge
Stug 3 Stormartillery
Iljuschin 2
Galactic Strike X
Who's Online Now
1 registered members (TipmyPip), 18,618 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
krishna, DrissB, James168, Ed_Love, xtns
19168 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
ent_blend explained? #276957
07/07/09 09:16
07/07/09 09:16
Joined: Jul 2009
Posts: 40
E
enrike Offline OP
Newbie
enrike  Offline OP
Newbie
E

Joined: Jul 2009
Posts: 40
hi
i am new to game studio and i am trying to understand how to use ent_blend funcion. I have one model that has one animation divided in three steps: A lifts the hand, B waves the hand (this is a loop) and finally C drops the hand.

I was getting a kind of "jump" when switching between animation parts (A to B and B to C) but I solved the translation between A and B with ent_blend, however i still get the B to C translation "jump". Looks like one frame is repeated. I think I dont fully understand the use of ent_blend, if anyone could point to a good (and simple) tutorial on this, it would be very much apreciated. thanks!

this is the code i am using to control the animation :

action Cuerpo(){

var speed = 7;

while(1){

if (key_x) {
p = 0;

while ( p <= 100 ){
p += speed * time_step;
ent_animate(my, "saludoA", p, ANM_ADD);
wait(1);
}

//blend to saludoB
p = 0;
while ( p <= 100 ){
p += 100 * time_step;
ent_animate(my, "saludoA", 100, 0);
ent_blend("saludoB", 0, p);
wait(1);
}

//inner cycle
while ( key_x ){
p = 0;
while ( p <= 100 ){ // exit on finish or on key up
p += speed * time_step;
ent_animate(my, "saludoB", p, ANM_CYCLE);
wait(1);
}
wait(1); // not really needed
}

//blend to saludoC
p = 0;
while ( p <= 100 ){
p += 50 * time_step;
ent_animate(my, "saludoB", 100, 0);
ent_blend("saludoC", 0, p);
wait(1);
}

// close
p = 0;
while ( p <= 100 ){
p += speed * time_step;
ent_animate(my, "saludoC", p, ANM_ADD);
wait(1);
}
}
wait(1);
}
}

Re: ent_blend explained? [Re: enrike] #276992
07/07/09 10:36
07/07/09 10:36
Joined: Jul 2009
Posts: 40
E
enrike Offline OP
Newbie
enrike  Offline OP
Newbie
E

Joined: Jul 2009
Posts: 40
just to add some more details about this...

looks like my problem comes from the ANM_CYCLE and ANM_ADD flags in ent_animate.

If I just play once the B part of the animation and use ANM_ADD flag it works fine. The A-B-C transitions are smoth and with no errors.

But because the B part of the animation is actually a cycle that loops while x key is pressed, I need to call ent_animate with ANM_CYCLE flag. Lets say that the complete sequence might be something like A-B-B-B-B-B-C where B might range from 1 to infinite.

Here I get the problem I described in the previous post, when exiting from the cycle B to the last animation C.

Re: ent_blend explained? [Re: enrike] #276999
07/07/09 11:12
07/07/09 11:12
Joined: Jul 2009
Posts: 40
E
enrike Offline OP
Newbie
enrike  Offline OP
Newbie
E

Joined: Jul 2009
Posts: 40
ok i solved it by doing this in the inner loop

while ( key_x ){
p = 0;
while ( p <= 100 ){ // exit on finish or on key up
p += speed * time_step;
if (key_x){
ent_animate(my, "saludoB", p, ANM_CYCLE);
} else {
ent_animate(my, "saludoB", p, ANM_ADD);
}
wait(1);
}
}


Gamestudio download | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1