Quote:
Originally Posted by Dignan
I wait with cautious optimism  this is still one of my biggest complaints about the tdc
|
this is one of the biggest bugs in SH5 next to the mast height bug. How these made it through QA is beyond me
I'm also looking into the mast height bug.
@gap - looks like I found a way to call functions in other dlls easily. I found a function in ScriptManager that allows the assembly code to 'fire' a command to all the loaded scripts. The loaded scripts can easily catch this command. The 'fired' command allows you to pass parameters with it also. The scripts can also 'fire' commands to the game passing arguments also. This is excellent because I can write code in C# (hell of a lot easier) to read in your idea your group is working on. A script can load this DLL and communicate with it (again much easier writing Python than assembly!). The script updates the game (and whatever assembly code I write for your idea) by sending new command(s) (whatever I name them) to the game. The game won't understand the commands and will ignore them because it only recognizes what is hard coded in so it will pass them to my command parser assembly code who will divy it out to the correct function. That function will read in the arguments passed with the command and do whatever it needs to do with them. If the function needs to send data back to the script it 'fires' off a command passing the needed information with the command. The script intercepts this command reads the data. Cycle repeats if necessary.
I'm still figuring out how to 'fire' commands using the ScriptManager correctly. I can 'fire' commands no problem, the problem is I don't understand how the parameters for the command are created (something with ScriptManager again) and finally attached to the command (ScriptManager again). Once I figure that out two way communication between game and external DLL via script will be a snap and will open the door up for more opportunities

If I can write code for the game in C# I can a) be much faster at it and b) do MUCH more because it's easier to code in C#
Ran into another juicy thing I couldn't turn down - how to access all the menu items in game (think menu editor). I mapped it out and now have the ability to access any menu item and change it. The great thing is while decoding this most of all the pieces of the puzzle I was missing finally fell into place. I couldn't figure out how the game organizes everything. Was everything in a continual linked list? Where there multiple linked lists? Those questions baffled me. I now know that it's a tree structure with each limb of the tree a linked list. Each linked list item can point to another linked list (a limb of that limb - a child). Everything needed to render/update/etc. is contained in each linked list item via pointers. There are tables of function pointers and each table corresponds to rendering, updating, etc. The game just iterates over the tree, accessing each table, and calling functions in those tables. If a feature is not available the entry in the table will call a function that simply returns back to the caller. Actually pretty typical design with a few enhancements.