Gamestudio Links
Zorro Links
Newest Posts
Newbie Questions
by fairtrader. 12/05/23 14:22
Zorro Trader GPT
by TipmyPip. 12/04/23 11:34
Square root rule
by Smallz. 12/02/23 09:15
RTest not found error
by TipmyPip. 12/01/23 21:43
neural function for Python to [Train]
by TipmyPip. 12/01/23 14:47
Xor Memory Problem.
by TipmyPip. 11/28/23 14:23
Training with command line parameters
by TipmyPip. 11/26/23 08:42
Combine USD & BTC Pairs In Asset Loop
by TipmyPip. 11/26/23 08:30
AUM Magazine
Latest Screens
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Tactics of World War I
Who's Online Now
0 registered members (), 635 guests, and 2 spiders.
Key: Admin, Global Mod, Mod
Newest Members
fairtrader, hus, Vurtis, Harry5, KelvinC
19019 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 1 of 2 1 2
vec_for_vertex and frame animation #226613
09/10/08 15:25
09/10/08 15:25
Joined: Aug 2006
Posts: 155
R
RyuMaster Offline OP
Member
RyuMaster  Offline OP
Member
R

Joined: Aug 2006
Posts: 155
Hi! I have model which has jump frame-based animation. And I have hand attach to this model, using vec_for_vertex.
(my.x is hand model)
Quote:
vec_for_vertex(handattachpoint,player,4991);
my.x = handattachpoint.x;
my.y = handattachpoint.y;
my.z = handattachpoint.z;


It all works fine, when model moves with c_move, hands stays attached and moves as well. But..

But, when model jumps, vec_for_vertex always returns the same value, like model is staying still. And hands are being placed wrong. Also, I tried to debug those values:

handattachpoint.x;
handattachpoint.y;
handattachpoint.z;

And here comes trouble. Those variables are changing only if I rotate player. They are the same even when player moves with c_move, or jumps. I do no get, how is that so?

If

my.x = handattachpoint.x;
my.y = handattachpoint.y;
my.z = handattachpoint.z;

are not changing even when player moves, how do the hand stays attached?




Last edited by RyuMaster; 09/10/08 15:28.

What kills me not, that makes me stronger.

***Working on RPG/RTS***
Re: vec_for_vertex and frame animation [Re: RyuMaster] #226616
09/10/08 15:36
09/10/08 15:36
Joined: Sep 2003
Posts: 5,900
Bielefeld, Germany
Pappenheimer Offline
Senior Expert
Pappenheimer  Offline
Senior Expert

Joined: Sep 2003
Posts: 5,900
Bielefeld, Germany
First guess:
vec_for_vertex(handattachpoint,player,4991); is only repeated in your code, when you use c_rotate!?

Re: vec_for_vertex and frame animation [Re: Pappenheimer] #226652
09/10/08 17:22
09/10/08 17:22
Joined: Aug 2006
Posts: 155
R
RyuMaster Offline OP
Member
RyuMaster  Offline OP
Member
R

Joined: Aug 2006
Posts: 155
Nope, on every frame in hand_action(), assigned to hand entity. So it could re-align it position on every frame.

I have cheked all stuff, because it is nonsense for me.

If coordinates do not change after c_move, how come it still gets re-aligned correctly on entity move?

Well, maybe there is some stupid typo around code, still searching for it...


What kills me not, that makes me stronger.

***Working on RPG/RTS***
Re: vec_for_vertex and frame animation [Re: RyuMaster] #226654
09/10/08 17:28
09/10/08 17:28
Joined: Aug 2006
Posts: 155
R
RyuMaster Offline OP
Member
RyuMaster  Offline OP
Member
R

Joined: Aug 2006
Posts: 155
Oh, nevermind. They actually change on player move. But not when he jumps.

Is it normal, that vertex coordinates are not being updated during frame-animation? Can I force them to update somehow?


What kills me not, that makes me stronger.

***Working on RPG/RTS***
Re: vec_for_vertex and frame animation [Re: RyuMaster] #226666
09/10/08 18:15
09/10/08 18:15
Joined: Sep 2003
Posts: 5,900
Bielefeld, Germany
Pappenheimer Offline
Senior Expert
Pappenheimer  Offline
Senior Expert

Joined: Sep 2003
Posts: 5,900
Bielefeld, Germany
You should get the position of a vertex within any animation frame and between!

To say it different, I never had this problem. That's the reason why I think that it must be something in your code.

Can you post the parts of the code that show how the jumping and the vec_for_vertex are 'connected'?

Re: vec_for_vertex and frame animation [Re: Pappenheimer] #226671
09/10/08 18:35
09/10/08 18:35
Joined: Aug 2006
Posts: 155
R
RyuMaster Offline OP
Member
RyuMaster  Offline OP
Member
R

Joined: Aug 2006
Posts: 155
Thanks, that means it is my code problem. I would not bother you with it anymore, I'll better focus on finding problem, because now I know that it should work smile


What kills me not, that makes me stronger.

***Working on RPG/RTS***
Re: vec_for_vertex and frame animation [Re: RyuMaster] #226695
09/10/08 19:47
09/10/08 19:47
Joined: Aug 2006
Posts: 155
R
RyuMaster Offline OP
Member
RyuMaster  Offline OP
Member
R

Joined: Aug 2006
Posts: 155
Shame on me, but I can not get it working.

OK, I'll explaing as much as I know.

I'm using kingod hearts script sample from wiki for movement.
I have added jump there. Nothing special. Players presses "SPACE".
Then animation blends or executes this, as it it in my case:
ent_animate(my,"jump",my.animate,0);
And, jump animation plays. I do not alter player.z value here. No gravity. Model jump is fully animated via MED, so it just jump in to the air and lands down, fully vertex animated.

During his jump, I press F11 twice and this that:

Bounding box is not affected.

This is first thing which is bad. I fix it this way:

Quote:
if (my.animate > 10 && my.animate < 50)
{
vec_set(my.min_x,vector(-7.5,-7.5,2));
vec_set(my.max_x,vector(7.5,7.5,15));
}
else
{
vec_set(my.min_x,vector(-7.5,-7.5,-6));
vec_set(my.max_x,vector(7.5,7.5,15));
}


Why do not bounding box goes up along with the model feets? Probably it is calculated only once, correct? But, if I set "c_setminmax(me);" during jump, bounding box is still the same.

Now here comes vertexes. As a bounding box, they do not change their position during animation. So, if I alter player.z value, I can see it changing. Along with bounding box. But during frame vertex-based animation, nor box, nor vertexes are passing changing values. Why is that so? Have I missed something important?


What kills me not, that makes me stronger.

***Working on RPG/RTS***
Re: vec_for_vertex and frame animation [Re: RyuMaster] #226698
09/10/08 20:00
09/10/08 20:00
Joined: Sep 2003
Posts: 5,900
Bielefeld, Germany
Pappenheimer Offline
Senior Expert
Pappenheimer  Offline
Senior Expert

Joined: Sep 2003
Posts: 5,900
Bielefeld, Germany
Just for testing:

Set
vec_for_vertex(handattachpoint,player,4991);
right behind
ent_animate(my,"jump",my.animate,0);
and read the values!

What do you get then?

Re: vec_for_vertex and frame animation [Re: Pappenheimer] #226699
09/10/08 20:09
09/10/08 20:09
Joined: Aug 2006
Posts: 155
R
RyuMaster Offline OP
Member
RyuMaster  Offline OP
Member
R

Joined: Aug 2006
Posts: 155
ent_animate(player,"jump",player.animate,0);
player.animate+= 5 *time_step;
if (player.animate > 100)
{
player.animate = 0;
}

vec_for_vertex(handattachpoint,player,4991);


Same results. Entity jumps like crazy, no changings to vertex or bounding box. Very odd, indeed, ok I can see box is not changing, but vertexes DO right before my eyes.


What kills me not, that makes me stronger.

***Working on RPG/RTS***
Re: vec_for_vertex and frame animation [Re: RyuMaster] #226717
09/10/08 21:24
09/10/08 21:24
Joined: Sep 2003
Posts: 5,900
Bielefeld, Germany
Pappenheimer Offline
Senior Expert
Pappenheimer  Offline
Senior Expert

Joined: Sep 2003
Posts: 5,900
Bielefeld, Germany
what, if you change his position while playing the jump animation?
what, if you move him with c_move while playing the jump animation?

Does this make a difference?

Page 1 of 2 1 2

Gamestudio download | chip programmers | 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