010 Editor template help

Technical Discussions not Related Directly to MHS. For Example, Coding, Hex Editing, General Hacking, Etc.

Moderators: g3nuin3, SpeedWing, WhiteHat

010 Editor template help

Postby martix » Fri Jan 22, 2010 5:35 am

This is probably for L. Spiro only who suggested it to me, though if anyone else happens to be familiar with it, feel free to help.

And here are the problem: When I tried to map embedded files, I got a strange error which is absent if I use the standalone template on the standalone file.
Code: Select all
*ERROR (C:\Documents and Settings\Martixy\My Documents\SweetScape\010 Templates\InfinityEngine\CRE.bt) Line 210: Invalid array size in declaration.
And here is the abridged version:
Code: Select all
struct CRE {
    struct CRE_HEADER {
        ...
    } CRE_Header;
    KNOWN_SPELLS KnownSpells[CRE_Header.Known_Spells_Count]; //The faulty 210th line
} Cre;

I can attach templates and sample files on demand.

Also - whats the difference between
Code: Select all
typedef struct {
    ...
} <name>;
AND
struct <name> {
   ...
};
Because I keep seeing the typedef version everywhere and can detect no apparent difference bettween both. Is it just convention or what?
User avatar
martix
Acker
 
Posts: 55
Joined: Sun Feb 17, 2008 5:53 pm

Re: 010 Editor template help

Postby L. Spiro » Fri Jan 22, 2010 7:54 am

#1:
I have never actually used their scripts, but you can download plenty of samples from their site and check their help file on this issue.
If it works on some files/data and not others, then the cause is obvious: The data has an invalid size at that location (a negative number, for example).

#2:
In C the typedef form will allow you to omit the struct when using the type. Otherwise it has no purpose and is only done commonly to provide support for C.
L. Spiro Engine does not do this.


L. Spiro
Our songs remind you of songs you’ve never heard.
User avatar
L. Spiro
L. Spiro
 
Posts: 3129
Joined: Mon Jul 17, 2006 10:14 pm
Location: Tokyo, Japan

Re: 010 Editor template help

Postby martix » Fri Jan 22, 2010 1:40 pm

I can't seem to get file embedding to work anyhow... something which in theory is trivial in MHS.

The mentioned error is coming from the fact that when I include the embedded format template, it doesn't include it - it executes it. Which overrides anything done so far and you get that error over there.
I also tried to make the code that creates the mapping not execute if a flag is raised by the parent template, but that went nowhere either.

Edit: Goddamn 010 templates and their creator. They say its got C syntax, but in practice its got SQUAT in common with C. I tried every single freakin' trick and convention that exists in C and nothing even came close to working. Only after breaking every C syntax rule like putting the includes INSIDE the structs and scrapping all commonsense scope assumptions did I get it to work!
User avatar
martix
Acker
 
Posts: 55
Joined: Sun Feb 17, 2008 5:53 pm


Return to Technical Unrelated

Who is online

Users browsing this forum: No registered users and 0 guests

cron