Spawning Cars
Spawning Cars
Is there a way to spawn cars on command? Can you only do it by script?
Re: Spawning Cars
I don't know how to spawn anything without using script but it would be useful. You need to find out how to execute existing gta2.exe functions from your own process/DLL.
Re: Spawning Cars
It would be useful to know this. I also asked myself this question
Re: Spawning Cars
GTA2 loads the SCR file into memory, so you can edit that part of the memory and change the script commands while it's running. I would prefer a direct way of executing existing commands but I don't know how to do that yet.
The SCR file is stored around here:
GTA2.EXE+0x2744BC, offset 35C
I tried simple one byte changes like changing the model of car that was constantly being created with a custom script and that worked, so you could try changing an entire hex SCR command to a SCR hex create_car command. You'll have to read up on the GTA2 SCR file format, look at the decompiler.dll sources or ask the SCR experts.
The SCR file is stored around here:
GTA2.EXE+0x2744BC, offset 35C
I tried simple one byte changes like changing the model of car that was constantly being created with a custom script and that worked, so you could try changing an entire hex SCR command to a SCR hex create_car command. You'll have to read up on the GTA2 SCR file format, look at the decompiler.dll sources or ask the SCR experts.