Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Newcomers AppGameKit Corner / [SOLVED] playobjectanimation

Author
Message
smerf
19
Years of Service
User Offline
Joined: 24th Feb 2005
Location: nm usa
Posted: 11th Feb 2019 21:42 Edited at: 11th Feb 2019 21:50
using agk. im loading an object with children because it has animations. my character has only 1 animation named "run" when i use get animation name it returns global no matter how i export it or in what format.
so this is a weird issue. my second problem is only.x seems to work correctly when loading a model. all other formats seem to explode or fail to load completely. the .x that loads correctly plays a weird slow motion broken partial animation only 1 time when it is set to loop and im at a total loss or how to fix this.



is 3d character animation a supported feature of agk atm? search on forums for playobjectanimation only gives 1 result and i know im not the first person to try to put a character into a game from blender.
A child's dream never dies.





Attachments

Login to view attachments

The author of this post has marked a post as an answer.

Go to answer

fubarpk
Retired Moderator
19
Years of Service
User Offline
Joined: 11th Jan 2005
Playing: AGK is my friend
Posted: 11th Feb 2019 22:18
Quote: "is 3d character animation a supported feature of agk atm? "

It sure is and has been for a very long time

you could try .3ds models perhaps

i know for a fact all of the animated objects in the AppGameKit model pack sold separetly work without any problem

It may be that the model is not set up for animation properly, with that said agks 3D animation works with
animation to the same model over a number of frames, unlike when people use unity's 3D animation which
uses a completely different model for each animation. (no need to explain why AGKs is so much better)
Animations need to be named properly with AppGameKit which causes a problem if your importing objects with
animations from DBPRO for example.
fubar
fubarpk
Retired Moderator
19
Years of Service
User Offline
Joined: 11th Jan 2005
Playing: AGK is my friend
Posted: 11th Feb 2019 22:22
Blender is a free program and works well with animations. If you import your objects into blender it has the ability to export to 3DS
and .X but it wont import .X into Blender without a plugin

I hope i have been some help Goodluck with your coding
fubar
smerf
19
Years of Service
User Offline
Joined: 24th Feb 2005
Location: nm usa
Posted: 11th Feb 2019 22:44
my model seems to be set up correctly been using boebder for a long tine but I've never exported a char for games outside ure abd unity. blender will not export animations in 3ds format only .x and dae are animation fike types both supported in blender and agk. but tge dae file explies weird when it is rescaled. ill play around with export options and work on figuring out the name problem ty fubar
A child's dream never dies.





blink0k
Moderator
11
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 11th Feb 2019 22:51 Edited at: 11th Feb 2019 22:53
For some reason animations seem to play at a really slow speed try this;

anim = LoadObjectWithChildren("ar.x")
SetObjectAnimationSpeed( anim, 10 )
PlayObjectAnimation(anim, GetObjectAnimationName(anim, 1), 0, GetObjectAnimationDuration(anim, GetObjectAnimationName(anim, 1)), 1, 0)

Increase the speed value if it's still too slow

Note: GetObjectAnimationDuration() is important because i don't think it will match the value from your 3D proggy
Golelorn
8
Years of Service
User Offline
Joined: 20th Nov 2016
Location:
Posted: 12th Feb 2019 16:05
This post has been marked by the post author as the answer.
1) The animation speed is extremely slow. You'll need to speed it up, as Blink0k suggested. Every format seems to be different in this regard.

2) The model is orientated upside down and facing away from the camera. Adjust the rotation through AppGameKit or in your modeling software.

3) You are playing an animation loop inside your main Do loop. So its resetting every frame.
if GetObjectIsAnimating(2) = 0 then PlayObjectAnimation( 2, GetObjectAnimationName(aniO,1), 1,22, 1, 1 ) will allow your model to run its entirety.

Is your character laying flat on frame 0? Adjust frame 0 to have him standing, if so. Where is the object oriented at? It looks like its way off-center. Set the orientation point at 0,0.

Blender can't open .x, so I can't look at it.

AnimationName is not important, because I do not think AppGameKit has that functionality. Someone can correct me if I am wrong.

smerf
19
Years of Service
User Offline
Joined: 24th Feb 2005
Location: nm usa
Posted: 12th Feb 2019 16:07
thanks guys ill speed it up and fix looping issue. see if this helps keep u posted.
A child's dream never dies.





Golelorn
8
Years of Service
User Offline
Joined: 20th Nov 2016
Location:
Posted: 12th Feb 2019 16:27
Not sure what model program you're using...

If Blender, you can export FBX by selecting Scale - FBX Units Scale, and ensure you have selected objects only. The others make the model enormous. Also, check the armature tab, un-check leaf bones, and select deform bones only. When you export be sure to have the model and armature selected.

One huge thing that is often overlooked is the bones must have a scale of 1.0. If your animation is destroying the mesh, its because the scaling does not match up. Unfortunately, I have never been able to figure out how to correct this without redoing all my work.
Ortu
DBPro Master
17
Years of Service
User Offline
Joined: 21st Nov 2007
Location: Austin, TX
Posted: 13th Feb 2019 00:06
Does selecting the armature then ctrl a > apply scale not do it?
http://games.joshkirklin.com/sulium

A single player RPG featuring a branching, player driven storyline of meaningful choices and multiple endings alongside challenging active combat and intelligent AI.
Golelorn
8
Years of Service
User Offline
Joined: 20th Nov 2016
Location:
Posted: 13th Feb 2019 02:43
No, it will destroy any animations. I am sure there is a way, I just don't know it.
smerf
19
Years of Service
User Offline
Joined: 24th Feb 2005
Location: nm usa
Posted: 13th Feb 2019 06:24
Golelorn used your code and changed rotation and increased play speed. I have a character running around my map now thank you mate. still haven't solved the naming issue yet but its not terribly important atm and im still going to play around with dae exporting.
A child's dream never dies.





Login to post a reply

Server time is: 2024-11-23 09:38:34
Your offset time is: 2024-11-23 09:38:34