Sorry, I've been pretty busy lately...
@link102
If you can avoid it, don't use LOCK OBJECT ON . It's good for a quick demo, or for texturing something onto a plain like a radar or HUD indicator of some kind, but it isn't too good for complex 3d objects. The object won't have proper collision, sometimes inverts the normals, no lighting response, the list goes on...
For your machine gun rotation, whenever you set an object oriented to the camera, think of the object as backwards to the camera, sort of like a mirror. The camera looks into the world, and the objects are reflected back - so to solve your machine gun problem, all you have to do is reverse the order of it's rotations:
if check display mode(1280,1024,32) then set display mode 1280,1024,32
autocam off
sync on : sync rate 60
load object "machinegun.x",1
rem insert this line for the machine gun rotations
set object rotation zyx 1
make matrix 1,100,100,10,10
do
set cursor 0,0
print camera angle x()
etc.
Quote: "yea, about that animation I'm trying to export the animation for the ammo crate and it's just disappearing on play object.
Weird, I'll fiddle around and hope I get it fixed."
The blender direct x export outputs matrix rotation animation keys which will make your computer blow-up in DBC when you run the animation!
The easy fix for what you describe as a simple animation, is to export it, open the file up in a text editor, look for a template header name that looks something like this near the bottom of the file:
AnimationSet animset {
I specify the bottom because there is likely a definition of this at the top of the x file that you shouldn't touch.
Delete this header and everything that follows it, save the file, load the file into DBC and
set object keyframe 1,1
rotate limb 1,1,90,0,0
set object keyframe 1,10
rotate limb 1,1,0,0,0
set object keyframe 1,20
play animation 1
You can save this animation with
SAVE OBJECT ANIMATION "box_lid_anim.txt",1
Open this anim file, and open your X file of the ammo box. Copy everything from the anim file except
xof 0303txt 0032 and paste that at the bottom of your X file where you had previously deleted all of the animation keys.
Save you X file with the new anim information. Try loading it and plating it in DBC.
There's one thing I thought of as I'm writing this, if you rigged the box with a skeleton, this probably won't work because there are other things that are saved in the file besides the animation keys that can cause problems. But if you set up your box with mesh limbs as I described earlier in this thread, it should work.
Enjoy your day.