|
Post by chaosshadic456 on Jun 2, 2012 21:36:16 GMT -5
hey guys i forgot how i can add a mesh in player.bb. this problem is in ; load mesh, an example is the boost
|
|
3DSawnikku
Relic Team
Pro Coder,Rigger,Animator,GIMP-er,Etc
Posts: 647
|
Post by 3DSawnikku on Jun 3, 2012 7:39:23 GMT -5
I know how
|
|
|
Post by zankuujinmujinsho on Jun 3, 2012 11:19:32 GMT -5
Srsly, If you know then feel free to post it here instead of friggin' PM-ing them. Sharing knowledge can only help people.
|
|
|
Post by EightBitDragon on Jun 3, 2012 13:07:58 GMT -5
To keep things tidy, load your new mesh in Game_Resources_Models.bb, where the other player meshes are stored. Variables which hold models are the same as integers, so to make it global and load a model into it, do this:
Global My_New_Player_Mesh = LoadAnimMesh("Characters/Sawnik/myawesumsawnikcherectur.b3d")
This assumes you have stored your model in Characters/Sawnik folder. Change it to reflect your file's location and name.
Next, you should hide the new model, because we need to copy it to the player object when it gets created, but we don't want 2 models to be visible in the stage! Hide it with this:
HideEntity My_New_Player_Mesh
The next thing you need to do is copy it to the player object. We do this inside the Player_Create() function in Player.bb. Find the line that looks like this:
p\Objects\Mesh = CopyEntity(whatever, Game\Stage\Root)
Change the part that says "whatever" to the name of your mesh, which was My_New_Player_Mesh. You don't have to worry about un-hiding the model, because entities that are copied are unhidden automatically!
From here, you will have to adjust the animation sequences in Game_Resources_Models.bb where you loaded your model, and in Player_Animation.bb. The sequences represent the various animations, so its a good idea to leave your 3D editor open so you can tell which frames do what.
RecursiveExtractAnimSequence(mesh, start, end) is the function you use to accomplish this. The sequence number is generated automatically depending on the order in which you extracted the animations.
To give you an example, if your standing animation was frames 0-19, and your walking animation was 20-39, you would add this in Game_Resources_Models.bb:
RecursiveExtractAnimSeq(My_New_Player_Mesh, 0, 19) RecursiveExtractAnimSeq(My_New_Player_Mesh, 20, 39)
Next, in order to play the extracted animations, you would edit Player_Animation.bb with the new sequence numbers where they needed to go:
If (p\Animation\Animation<>p\Animation\PreviousAnimation) Then Select p\Animation\Animation Case 0 RecursiveAnimate(p\Objects\Mesh, 1, 1, 1, 8) Case 1 RecursiveAnimate(p\Objects\Mesh, 1, 1, 2, 8) etc ... etc ...
Basically 0 represents the first animation you extracted, and 1 represents the walking.
Here is what those numbers represent to give you an idea of what is going on:
RecursiveAnimate(entity, mode=1, speed#=1.0, sequence=0, transition#=0.0)
I hope this helps, I didn't really have time to make a more thorough tutorial on this. I'll try to write one up in Blitz Sonic Freerunner's help files later as I'm trying to document how to edit and add to the Blitz Sonic engine.
Edit: The above assumes all of your animations are in one file. You may need to add an additional field to tPlayer_Objects to hold a separate mesh, and then hide the regular player mesh, and show the new mesh when you need it using an If-Then statement.
|
|
|
Post by chaosshadic456 on Jun 4, 2012 14:20:22 GMT -5
xd thanks
|
|