Spawning Cars

Anything to do with GTA1/GTA2 modding (tools, scripts and more).
Post Reply
BeepBoop
Car Jacker
Car Jacker
Posts: 44
Joined: 14 Oct 2016, 01:32
GH nick: BeepBoop

Spawning Cars

Post by BeepBoop »

Is there a way to spawn cars on command? Can you only do it by script?

User avatar
Sektor
Boss
Boss
Posts: 1390
Joined: 04 Mar 2008, 06:51
GH nick: Sektor
Location: GTAMP.com
Contact:

Re: Spawning Cars

Post by Sektor »

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.

Logofero
Serial Killer
Serial Killer
Posts: 264
Joined: 09 Dec 2015, 14:18
Contact:

Re: Spawning Cars

Post by Logofero »

It would be useful to know this. I also asked myself this question

User avatar
Sektor
Boss
Boss
Posts: 1390
Joined: 04 Mar 2008, 06:51
GH nick: Sektor
Location: GTAMP.com
Contact:

Re: Spawning Cars

Post by Sektor »

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.

Post Reply