Thanks! im as excited as you are
it seems this can be decompiled pretty easy after all.
Pyro wrote:I'm guessing the FORWARD names are not actually 'function1:', 'function2:' etc but I could be wrong. Only reason why I think this is because of the bil.mis we have with the compiler, but perhaps bil.mis was re-done to look like it is now by the programmer? Finally, since there were different people coding each city/level they might have their own way of doing things? But then looking at the rest of the decompiled script I wonder if it really is called 'function1:' etc!
As the variables, neither functions names can be known, so i have to generate my own names, i just happen to chose "function" prefix:
Code: Select all
string read_FUNCTION(FPStruct ¶ms){
return sprintf_str("%s:", setgetfuncname("function").c_str());
}
Will generate "function5:" etc.
Pyro wrote:The map zones in script are all called 'zone1', 'zone2' but in the actual ste.gmp (map) they are labelled 's01', 's02' and so on
I explained this earlier actually: there was a bug, and im generating my own names istead of taking them from strings array at end of file (where they store the real zone names). I will fix this later!
Pyro wrote:Lines 420 to 466 are all blank, I'm guessing these are some of the 77 commands that haven't been added yet?
All "(0)" commands means nullpointer: it has multiple purposes, and i noticed that also the FORWARD commands generates nullpointers. nullpointers have no data, it is the first pointer in the script and it points into garbage data of 8 bytes which doesnt make any sense so far, and we think its actually just garbage. Why it is "0" reason here:
Code: Select all
#define SCRCMD_0 0 // 0000
#define SCRCMD_1 1 // 0100
#define SCRCMD_2 2 // 0200
#define SCRCMD_3 3 // 0300
#define SCRCMD_4 4 // 0400
#define SCRCMD_PLAYER_PED 5 // 0500
#define SCRCMD_CHAR_DEC 6 // 0600
#define SCRCMD_CHAR_DECSET_2D 7 // 0700
...
Which i also compile into a strings array separately and slightly differently for first 5 items:
Code: Select all
string SCR_COMMANDS[] = {
"(0)", "(1)", "(2)", "(3)", "(4)", "PLAYER_PED", "CHAR_DEC", "CHAR_DECSET_2D",
...
};
So command 0 will return "(0)" as its the zero'th index. This array could be ANYTHING, but Vike managed to get this array from the compiler, and they match quite closely to the function names, its only as a reference to understand what kind of command there is. And the most important part is: when i add support for that yet unknown command, i will just copypaste the (wacky) name into:
Code: Select all
LinkToFunc(SCRCMD_*here*, read_*and sometimes here*);
With these predefined constants it makes it much clearer later when i do IF's such as:
Code: Select all
string read_SAVED_COUNTER(FPStruct ¶ms){
get_data(SCR_SAVED_COUNTER, data);
if(params.type == SCRCMD_COUNTER_SAVE){
...
So, i dont have to lookup for any numbers in any arrays to get an idea what that IF is actually doing, and also its less error prone since i cant write those predefined constants wrong or i get compiler error, whereas you could make error and type if(s == 551) when you meant if(s == 51) etc. (command 551 doesnt exist!). And its much harder to type wrong string since all the strings are so different, which makes you spot the error much faster if you happen to type (or copypaste) it wrong.
Pyro wrote:The 'DO_EASY_PHONE' should be 'DO_EASY_PHONE_TEMPLATE' and 'PHONE_TEMPLATE' should be 'DO_PHONE_TEMPLATE', but guessing this is also on your list of commands to do (judging by random numbers etc in the function)?
The unknown command names arent the same as the function names in .mis scripts! For example command for "SET c1 = (c2 + 10)" equals to "S_IS_S_PLUS_I" because #define's can have only "a-z_" chars. But ive done that command already so it doesnt appear in the decompiled script anymore. And yes, those phone templates arent done yet, i will do them later among other commands!
Pyro wrote:Seems that whoever wrote the initial
ste.scr has stuff all over the place!
Not as tidy as bil.mis anyway
Again, either different ways of writing code between people or bil.mis was made nicer looking afterwards to be attached with script compiler.
Im not sure what you mean, but its only matter of code formatting, and there is no way of knowing the empty space and comments from SCR files so it must be all done line after line. Just remember: every variable name WILL be generated by my decompiler,
except: zonenames, trainplatformnames(arent these zonesnames?), gangnames and missionfilenames.
Pyro wrote:Other than that, excellent stuff!
Thanks