|
Post by 06hypersonic60 on Sept 10, 2011 15:06:41 GMT -5
Hey guys. You know I'm making a new blitz sonic engine. But I'm new in coding. Ok got some new things working but the one thing that piss me off that I cant make objects working exept checkpoint. I tryed to set animations to monitors and THoops but I doesn't work I just write Animate o\Entity, 3, 0.75 In Object_XXX_Create after scale and translate lines, but an error message says : Entity has no animation I also tryed setanimkey and the source code here ( in the bottom of the page after editing it) www.blitzbasic.com/Community/posts.php?topic=66060But steel not working. Can you please help me
|
|
|
Post by zankuujinmujinsho on Sept 10, 2011 16:32:02 GMT -5
Post the code.
Also make sure you're loading the mesh with "LoadAnimMesh"
This allows the program to load a mesh with animation.
|
|
|
Post by twilightzoney on Sept 10, 2011 17:29:31 GMT -5
TROLLLOLOLLLLLL I smeelllll deceptionn
|
|
|
Post by 06hypersonic60 on Sept 11, 2011 6:19:24 GMT -5
For trickHoop I just added TurnEntity o\Entity, 0, 1.2*d\Delta, 0 to the code and it worked but not for the others
This is the 1UP monitor code:
; /\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/ ; 1UP ; /\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/ ; ========================================================================================================= ; Object_Monitor_Create ; ========================================================================================================= ; Creates a New Monitor Object Function Object_1UP_Create.tObject(x#, y#, z#) o.tObject = New tObject o\ObjType = OBJTYPE_1UP o\Position = New tVector o\Position\x# = x# o\Position\y# = y# o\Position\z# = z# o\Entity = LoadAnimMesh("Objects\Life\Life.b3d") ;EntityType o\Entity, 2 ScaleEntity o\Entity, 1.1, 1.1, 1.1 TranslateEntity o\Entity, x#, y#, z#
Return o End Function
; ========================================================================================================= ; Object_Monitor_Update ; ========================================================================================================= ; Updates the Monitor object Function Object_1UP_Update(o.tObject, p.tPlayer, d.tDeltaTime) Animate o\Entity, 3, 0.75 ; Player collided with monitor If (Abs(EntityX(p\Objects\Entity) - o\Position\x) < 4.5) And (Abs(EntityY(p\Objects\Entity) - o\Position\y) < 6.5) And (Abs(EntityZ(p\Objects\Entity) - o\Position\z) < 4.5) And p\Action = ACTION_JUMP Then ; Add to ring counter Game\Gameplay\Lives = Game\Gameplay\Lives + 1 PlaySound Sound_Life If p\Motion\Speed\y# < 0 Then p\Motion\Speed\y# = -p\Motion\Speed\y# EndIf TFormVector 0, 1, 0, o\Entity, p\Objects\Entity p\Action = ACTION_COMMON p\Motion\Ground = False p\Motion\Speed\x = TFormedX()*2.5 p\Motion\Speed\y = TFormedY()*1.25 p\Motion\Speed\z = TFormedZ()*2.5 If (p\Motion\Speed\x < 1 And p\Motion\Speed\y > 0 And p\Motion\Speed\z < 1) Then p\Action = ACTION_COMMON p\Animation\Animation = 9 Else p\Action = ACTION_COMMON p\Animation\Animation = 9 EndIf If p\Motion\Speed\y# < 0 Then p\Motion\Speed\y# = -p\Motion\Speed\y# EndIf
; Play the explosion sound PlaySound Sound_Upgard ; Delete the Monitor FreeEntity o\Entity Delete o\Position Delete o Return EndIf End Function
|
|
|
Post by zankuujinmujinsho on Sept 11, 2011 7:20:59 GMT -5
For trickHoop I just added TurnEntity o\Entity, 0, 1.2*d\Delta, 0 to the code and it worked but not for the others This command doesn't "Animate" the model, it only spins it, like rings. What kind of animation are you going for here? do you want the life to spin while it's unbroken? If so, then change that 3 to a 1, since "3" for that value makes the animation only play once. Changing it to a 1 will loop it.
|
|
|
Post by 06hypersonic60 on Sept 11, 2011 9:28:22 GMT -5
If so, then change that 3 to a 1, since "3" for that value makes the animation only play once. Changing it to a 1 will loop it. I know that but I forgot about it. But doesn't work either Something's wrong in the code I guess
|
|
|
Post by zankuujinmujinsho on Sept 11, 2011 9:40:27 GMT -5
Don't try to blame the code for your incompetency.
Try setting the Animation Speed to a whole number.
AKA "Animate (o/entity, 1, 1)
|
|
|
Post by 06hypersonic60 on Sept 11, 2011 9:46:36 GMT -5
Does not work.
I will keep trying to fix it. If It works I will tell you Update: I tryed to remove "delete the monitor" and set "Animate o\Entity, 1, 1 " after play sound ( just for testing the anim) Now when I collide with the monitor the animation plays. So I think Animate o\Entity, 3, 0.75 wasn't in the right place.
|
|
|
Post by 06hypersonic60 on Sept 11, 2011 9:52:10 GMT -5
Never mind. I fixed it ;D
|
|