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.

DarkBASIC Discussion / need help with weapons animations...

Author
Message
Lucifer
19
Years of Service
User Offline
Joined: 26th Dec 2005
Location:
Posted: 29th Oct 2006 18:08 Edited at: 29th Oct 2006 18:13
i have some trouble contiuning programming my game, i started writing the combat animations thingy and i ran into some trouble. i'll only post my code here, not the media that's in my game. The problem is:
I have coded it so it plays the sword_attack animation when i press the mouse button, but when i press the mouse button, nothing happens! nothing at all! the sword animation frames are from 1 - 20 and i know it's animated because i did it myself, but dbc doesnt seem to want to play my sword animations

and btw, please dont judge me to harshly on how noobily this game is written. the code :



oh and the code xynocythe made for me didnt work on .x files so i simplified it (hugely) but it IS on my to do list to make it better so dont go yelling about that but if anyone can help me i will be very happy because i'm thinking about canceling my game if i dont figure this out!



One is the lonliest number...
CreamPie
18
Years of Service
User Offline
Joined: 20th Jul 2006
Location:
Posted: 30th Oct 2006 07:54 Edited at: 30th Oct 2006 07:59
Lucifer,

I believe it has to do with there not being a 'mouseclick lock'.



This keeps a command or commands from being multiply executed upon a single mouseclick, by enabling you to check if the mouseclick on the last loop is the same as the mouseclick on the current loop. This BUG is caused by a program looping several times during the period of physical movement of the finger pressing the key. For example, if it takes you half a second to press and release a key, with a program running at 60 FPS, the program would execute the command or commands for that keypress, approximately 30 times.

Because of this, there are some weird side effects, due to chance. However, just implement the system in the code above, or a similar system.

The following line of code should go at the bottom of your code.
Lucifer
19
Years of Service
User Offline
Joined: 26th Dec 2005
Location:
Posted: 30th Oct 2006 12:23
thanks, this code seems to solve some problems i might have had in the future but the problem is still the same , the sword_attack loads up but the animations arent playing.



One is the lonliest number...
Latch
18
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 30th Oct 2006 21:32
@lucifer

Without the animation sequence, it's hard to tell what the problem is. If your .x file containing the animation is an Ascii file, usually near the end there are a series of templates labeled AnimationSet , Animation, AnimationKey ... there are actually a couple others, but you should be able to at least see those. If that is the case, and you don't want to post your media, include a code snippet of just the animation blocks from the file.

What application did you create the animation in? And what type of animation is it? If it is skin meshed or bone animation, it will not play in DarkBASIC Classic. It would have to be articulated structure animation, which basically means you position, rotate, or scale a whole limb or a mesh each keyframe.

Enjoy your day.
Lucifer
19
Years of Service
User Offline
Joined: 26th Dec 2005
Location:
Posted: 30th Oct 2006 21:39 Edited at: 31st Oct 2006 01:34
well here are the sword models.. if you have any spare time to help me it would help , i made the animation in blender, and its just rotating the sword. no bone animations or anything like that....



One is the lonliest number...
Latch
18
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 30th Oct 2006 22:59 Edited at: 30th Oct 2006 23:06
I downloaded your models so you can remove them in the previous post if you are worried about them. I'll delete them from my harddrive also.

I looked at your files and yes, the Animations Keys are Key Type 4 which is specifically for weighted vertex transformations. It's a matrix animation key - probably works in DBP but not in DBC. You must've used the default Direct X exporter that comes with Blender.

Probably sounds like mubmo jumbo but here's an example out of your file:



That 4 under animation key means "Use a vertex transfrom matrix for animation."

The 101 means that's how many keyframes there are.

The 0 is the first key. The 16 means there are sixteen numbers that follow that make up the transform matrix. Then there are the numbers inside the matrix. This is not a graphical matrix that you define in DBC, this is a mathematical matrix that describes points in 3d space.

This is probably too much info but, looking at the values in all of the keys, the matrix numbers never change - which means even if DBC could play this type of animation, there really is no animation to play. The reason most likely is that Blender created your animation with IPO curves exclusively, but the exporter you used tried to create your animation based on skin weights and bones.


I created a DarkBasic Classic exporter specifically for Blender. Here's a link to the website.

Blender to DarkBASIC Classic

It's a little wordy, but basically, you just download the export script somewhere on your computer, and run it using the text editor from within Blender. I say to create Parent Child relationships in the documentation, but it isn't necessary unless you are linking lots of limbs together that have to function like an arm or a snake.

Enjoy your day.
Lucifer
19
Years of Service
User Offline
Joined: 26th Dec 2005
Location:
Posted: 30th Oct 2006 23:40
thanks dude! love ya ! that worked for me!!



One is the lonliest number...
MR program
18
Years of Service
User Offline
Joined: 7th Nov 2006
Location:
Posted: 12th Nov 2006 17:36


If i don´t like a program. Il´ trash it with my hammer!!!

Login to post a reply

Server time is: 2025-05-25 22:09:39
Your offset time is: 2025-05-25 22:09:39