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.

AppGameKit Classic Chat / Help making an old FPSC model 'hold' a gun...

Author
Message
=PRoF=
21
Years of Service
User Offline
Joined: 17th Mar 2003
Location: Milton Keynes, UK
Posted: 24th Apr 2017 00:56
Hi guys,

Over the last few days I have been trying to make a third person zombie shooter using some old FPSC models.

I've finally managed to get the character to animate properly(ish) and now the next challenge... making them hold guns to shoot the zombies with.

I remember that DBPro had an attach object to limb command (or something similar) which allowed you to attach a gun to the predefined hand. I can't see any similar command in AGK.

So far I have tried to find the co'ords and angle of the 'firespot' limb (which I'm sure is the right hand, where the gun goes) and the trying to position/rotate the gun accordingly but no luck.

I'm giving up now for the night and thought I might ask here to see if anyone could help poke me in the right direction.

As always, thanks in advance.
Preben
AGK Studio Developer
20
Years of Service
User Offline
Joined: 30th Jun 2004
Location:
Posted: 24th Apr 2017 08:49 Edited at: 24th Apr 2017 08:56
There are 2 commands you can user to do this:

FixObjectToBone
FixObjectToObject

Should be mush more easy, then doing all the calculation yourself

EDIT: some nice reading , https://www.appgamekit.com/documentation/Reference/3D/GetObjectNumBones.htm
Quote: "If the object has limb animation like in DarkBasic Classic, then the bones represent the limb hierarchy and each limb is loaded as a child object attached to a bone"

So i guess you should be able to use FixObjectToBone with no problems.

best regards Preben Eriksen,
=PRoF=
21
Years of Service
User Offline
Joined: 17th Mar 2003
Location: Milton Keynes, UK
Posted: 25th Apr 2017 01:02
Thanks Preben, I have tried both commands you suggested. I seemed to have more luck with the 'Bone' one, but it's not perfect yet.



As you can see although the weapon is attached in the right place (almost) the angle is wrong.



Using the same code with different models produced the same result, although with the pistol it's more obvious that the scale of the guns is incorrect as well.

I will have a further test tomorrow when (hopefully) I will have more time.

Thanks again.
Stab in the Dark software
Valued Member
21
Years of Service
User Offline
Joined: 12th Dec 2002
Playing: Badges, I don't need no stinkin badges
Posted: 25th Apr 2017 02:02
You may need to zero the models rotations first. Here is a post with a video showing how to fix the models.
If you intend to use the ragdoll system in AppGameKit then you will have to do it any way.

https://forum.thegamecreators.com/thread/216652
The coffee is lovely dark and deep,and I have code to write before I sleep.
=PRoF=
21
Years of Service
User Offline
Joined: 17th Mar 2003
Location: Milton Keynes, UK
Posted: 26th Apr 2017 22:12 Edited at: 26th Apr 2017 22:16
@Stab in the Dark software,

Thanks for the advice, I tried following the tutorial video which I think I did ok, but I can't test it because no matter what format I save or export from in FragMotion, AppGameKit reports that the model has no bones in.

I'm using the free version of fragmotion with a 7 day licence. I thought it said it was fully featured, but I'm starting to think that may be the issue.

I really hope its just be being a bit rubbish at this sort of thing, I tried .x originally (as that's the format the model was in before I zeroed the joints), .obj, .dbo and a few others, but they all show the same error.

None of your tutorial videos show what format you save the finished model to.

>Edit<
Ooh, and thanks for the tinypng link Hopefully that'll be handy
Stab in the Dark software
Valued Member
21
Years of Service
User Offline
Joined: 12th Dec 2002
Playing: Badges, I don't need no stinkin badges
Posted: 26th Apr 2017 23:28
The free version should work. Export .x and just choose Quaternions under rotations in the export window.
The coffee is lovely dark and deep,and I have code to write before I sleep.
=PRoF=
21
Years of Service
User Offline
Joined: 17th Mar 2003
Location: Milton Keynes, UK
Posted: 27th Apr 2017 14:56 Edited at: 27th Apr 2017 15:57
@Stab in the Dark software:
I exported the model as a .x file, using the following options..


But once again, I get the same error



Line 81 is the line 'FixObjectToBone(gunTestID,testID,38)', athough when I comment out all of the bone related commands, The exported model doesn't even appear in the AppGameKit app.

I really appreciate your help with this.

>Edit<
I have just tested loading the zeroed .x model into FragMotion and it loads in and plays fine.
Stab in the Dark software
Valued Member
21
Years of Service
User Offline
Joined: 12th Dec 2002
Playing: Badges, I don't need no stinkin badges
Posted: 27th Apr 2017 16:25
Uncheck EXPORT GROUPS.
This is not used when exporting a character that is all one mesh.
Export groups is used when your model has more then one mesh(group)
and you want to keep them separate as limbs(meshes) in AGK.

Also use LoadObjectWithChildren() for models with bones.
The coffee is lovely dark and deep,and I have code to write before I sleep.
=PRoF=
21
Years of Service
User Offline
Joined: 17th Mar 2003
Location: Milton Keynes, UK
Posted: 28th Apr 2017 21:17
@Stab in the Dark software:
Wow, that was incredibly frustrating! I tried everything you said, and it still kept coming up with the same error! In the end, I uninstalled FragMotion and downloaded the earlier version (1.3.3) from the website, and low and behold it has now miraculously worked! I dunno whether it was a borked installation or a bug in the newer version of FragMotion, but I have fixed my problem anyhoo Thanks



It's doubled the number of bones (??) and dropped 10Mb off the size of the model file, And she's apparently become a south paw; but it works (And I see an option in the export options to flip the left/right handedness of the model so that's not a massive issue)

Hopefully soon there will be a Wip post for this game. (It's either going to be called 'Night of the Endless Dead' (My Choice) or 'The Last Stand' (My son's choice), can I ask for opinions?)
Stab in the Dark software
Valued Member
21
Years of Service
User Offline
Joined: 12th Dec 2002
Playing: Badges, I don't need no stinkin badges
Posted: 29th Apr 2017 13:34 Edited at: 29th Apr 2017 13:50
I am using the 1.3.3 version with no problems. I had not yet upgraded to 1.3.4.
I will test and let the author of Fragmotion know if there is a bug. He is very good about fixing
them fast.

Quote: "It's doubled the number of bones (??) "


I have never had that happen. It should be the same number of bones as shown in Fragmotion.

Quote: " And she's apparently become a south paw; but it works (And I see an option in the export options to flip the left/right handedness of the model so that's not a massive issue)"


Yes you can flip it in the export.
By default Fragmotion displays using DirectX. You can switch it to use OpenGL so it is the same as AGK.
That way what you see in Fragmotion is what you get in AGK. Should fix the Handness problem.
Go to the Fragmotion install directory and open the screen.txt file and change it to renderOGL.dll.


P.S.When you export Binary it will reduce the size of the file which would explain the 10mb reduction.
You can also reduce the file size and load times by reducing the number of key frames in the animation.
Some models have a key frame for every frame of animation. AppGameKit can interpolate between key frames,
so it does not need one for every frame. If your model only has a 100 frames of animation it will not make much difference,
but if it has 6000 frames it will. You can remove the extra frames in Fragmotion with out messing up the animation.
I probably should make a video on how to do it.
The coffee is lovely dark and deep,and I have code to write before I sleep.

Login to post a reply

Server time is: 2024-11-24 16:41:04
Your offset time is: 2024-11-24 16:41:04