Could you make a 1 line compiler? I want to be able to enter something like p1car = CREATE_CAR (118.0,133.5,1.0) 35 270 TAXI END and get the hex version, it doesn't need the header or footer since I'm going to be writing it into GTA2 RAM, not loading an SCR.

Splitting an existing SCR into each hex line would be useful too, mucher easier for me to copy and paste, I have a hard time figuring out where each command starts and ends when just looking in a hex editor.

I noticed this small script doesn't give a weapon when I use your compiler:

But im thinking...Maybe make another separate tool for the current moment. So when you type in this example above then it will show you the HEX representation of it, how it would look like in .scr file.Would this work?

But is your p1car declared already in game? When you write this line into game memory?

Dunno if you use some .cmd or .bat file to execute the compiler or you just drop the mis file onto the exe?Should this be another compiler or just add command line switch?

Also i will check the reported bug. Dunno what it could be. So simple script. But i have some ideas already what could cause this.I havent worked on this thing for a while.

Its just that coding motivation goes away for some time and then i dont have any interest in this stuff. I have to do other things.Some time passes and i get my interest back in computer coding.

Seems Logofero already figured out how to create objects/cars by modifying RAM, so I don't really need a one line compiler anymore but it could have other uses.

My method replaces the entire SCR and load at the start of the game.

Firstly: this is the need to avoid a crash (because there is a risk to change the SCR already created and you need to have a command to reboot the existing SCR in memory, but is none). Secondly, it clears the level of existing missions so that the scripter himself creates new ones in the LUA language.

Now I'm completing the search for all the offsets created by SCR. Then it will be necessary to prepare the documentation. All this requires painstaking work.

I found a bit of motivation to work on this stuff again.There were some problems with NOT command stuff. I knew what was the problem when i left the project in december 2017.Lots of time has passed since. I kinda know what was the problem, i just have to refresh the memory and watch/read the code..

Project is huge and so is the sourcecode and it grows and grows. Its complex but this was the only biggest problem i had i think.I know i tried to compile the whole BIL.MIS example that comes with miss2.

And then i noticed problems near the NOT command and then i started working on it and i stopped in december 2017 for some reason. Dunno..

Sektor wrote:

I noticed this small script doesn't give a weapon when I use your compiler:

Interesting bug. I tested in my compiler and in GTA2. Weapon flashes for a sec and disappears. Dunno atm what causes it because it was fine before and working ok. There are indeed differences in miss2 scr file and new comp. scr fileHave to debug it.

Will post here if i get any new info on this stuff.

EDIT: seems that i fixed it. There was some code commented out for some reason and variable initialization mistype.C++

Code:

int ammo= -1; // Was: int ammo= 0;

Expression expected the ammo to be initialized to -1 but it was actually 0.So the expression was never executed.C++

Found some lines of C++ code that caused to crash the compiler when it had script with "NOT" command in them in particular cases.Commented these lines out. Have to look later why they were added. Maybe they are useless anyway.

So far i have found stuff that works fine and some things that do not work with "NOT" command.

I think i found bug in miss2 or whats the problem, maybe somebody can tell me.In doc:

• DO WHILE LOOPSAnother loop variant. However, this loop guarantees to execute the commands in the block once as the end check is at the end of the loop, e.g. DO counter = counter + 1 WHILE_TRUE ( counter < 100 )

Anyways, i was messing with NOT command and thats why i needed all kinds of possible expressions..NOT command gave me alot of trouble but i figured it out.Also it was messing up compile logic etc..Now i figured out why..

Im currently fixing and working on it.And because code is generalized then it should also fix the issues for do_while_true, while_endwhile.Im currently using if..else..endif

For loops do not compile in miss2 but i think i can make for loop to work also in new compiler.Later..

Ok.BIL.mis compiles and runs in GTA2 fine.I just compiled the bil.mis and the resulting bil.scr was copied over the original file in data folder.Gta2 was happy with it. The rest of the files in bil folder are original.Messed for 15 minutes in game and no crashes.There shouldn't be. Because its compiled correctly.

Of course all the other missionscripts and stuff are not included in compilation atm.I can read and parse them but there is some more work to do before i get into them fully.

But its nice to see huge bil.mis (132KB) compiled within few seconds and Gta2 accepting it.It was not possible in earlier versions.. because of many missing complicated things..

Who is online

Users browsing this forum: No registered users and 4 guests

You cannot post new topics in this forumYou cannot reply to topics in this forumYou cannot edit your posts in this forumYou cannot delete your posts in this forumYou cannot post attachments in this forum