Help me with create a script?

The reason for that is: It will be used by other modders too not just by me. It is more easy way like they will be just “Button clickers” when export not only created stadium but also with the entrance camera too as FDC file. So, exactly, I thinking about other modders too.P.s.: And of course, this script will be my first script ever made! :smiley:

As I used the terms (not technically correct):
header = everything before the camera data.
overwrite_target = the camera data.
footer = everything after the camera data.

More correct (but unimportant here):
Header = Meta data / file descriptor starting from the very first byte.
Footer = Meta data / file descriptor ending at the very last byte.
At least one of them tends to exist, if not both but describing different things.

That said, watch your file length after modding, as it might be encoded in either of the above.

I will upload some corrections soon in screenshots. :wink:

I came with:
https://s1.postimg.org/12toik5jcf/image.jpg
This is what I can change and when i change this values the game really change the camera locs & rots in-game too :smiley:
BUT, how to write it in the script?

That’s it, two lines? In that case check these links for how to overwrite certain bytes. If you’re modifying the same file each time the offsets can be hard coded.


Blender is python3 btw.

Thanks for the tip, BUT how to merge that code (your link) with @mano-wii wrote code?

Is there any chance?

import bpy, struct

#print(bpy.context.scene.camera.matrix_world)               #ManoWii data

xyz = bpy.data.objects['Camera'].location                      #Your highlighted loc data
wxyz = bpy.data.objects["Camera"].rotation_quaternion   #Your highlighted quat data
xzyw = list( wxyz[i] for i in [1, 3, 2, 0] )                        #swizzle quat to match FDC order

#buf = struct.pack("<f", '%sf' % len(xzyw), * xzyw)
#buf = struct.pack('d'*(len(xzyw)), *xzyw)                   # Works
buf = struct.pack("{0:d}d".format(len(xzyw)), *xzyw)

print(wxyz)
print(xzyw)
print(buf)

Currently outputs to console / terminal. As far as I got looking into this. Hope it helps your learning.