Official script modifying cause certain missions to crash

Anything to do with GTA1/GTA2 modding (tools, scripts and more).
Post Reply
GiftTheAuto
Jaywalker
Jaywalker
Posts: 5
Joined: 22 May 2025, 18:47

Official script modifying cause certain missions to crash

Post by GiftTheAuto »

Greetings!

I've got an old idea to make industrial map more lively by placing items on it like benches in the parks, trashcans on pavements, etc.

As far as i know, it could be done by modification of scripts. I've got an official Industrial scripts sources. Compilation by ScriptPad v2.5.1 is OK, everything works normally.

For example, I add a radio near start point by this command:

OBJ_DATA KEKW = ( 44.5 , 103.5 , 2.0 ) 0 BLASTER

As usual, it compiles OK. Desired object is in place. BUT...

When I try to take a mission phone ingame, I have a game crash.
By a precise look I've got next results:
All Krishna phones are busted.
All Zaibatsu phone are busted, except red, it works OK.
All Russian phones are busted, except green, both are normal.

All bugs are gone, if at least one non-busted job is complete.

Only one string cause this problem, any other scripts is untouched. If i delete this new command, i got no bugs again.

Using GTA2 v11.44.

Maybe, i forgot something? Please help.
User avatar
Sektor
Boss
Boss
Posts: 1448
Joined: 04 Mar 2008, 06:51
GH nick: Sektor
Location: GTAMP.com
Contact:

Re: Official script modifying cause certain missions to crash

Post by Sektor »

Some things need to be created after LEVELSTART command, some before. There could also be an issue if you create an object in the WHILE loop because it will just keep creating them.
User avatar
Sektor
Boss
Boss
Posts: 1448
Joined: 04 Mar 2008, 06:51
GH nick: Sektor
Location: GTAMP.com
Contact:

Re: Official script modifying cause certain missions to crash

Post by Sektor »

Weird things can also happen if the script name is too long
GiftTheAuto
Jaywalker
Jaywalker
Posts: 5
Joined: 22 May 2025, 18:47

Re: Official script modifying cause certain missions to crash

Post by GiftTheAuto »

I think i've figured it out.
The problem was that after compilation I copy only bil.scr into game's directory. Despite phone missions is unchanged, it's is mandatory to copy bil directory along with bil.scr into game's dir... And somehow it works without bugs anymore. That's crazy.

Thank you anyway for response!
User avatar
JernejL
Hitman
Hitman
Posts: 180
Joined: 21 Feb 2010, 22:03
GH nick: RedShirt

Re: Official script modifying cause certain missions to crash

Post by JernejL »

nice to see someone add objects, gta1 maps were full of them and they were great, lack of ambient objects in gta2 always disappointed me.
GiftTheAuto
Jaywalker
Jaywalker
Posts: 5
Joined: 22 May 2025, 18:47

Re: Official script modifying cause certain missions to crash

Post by GiftTheAuto »

I've encountered another problem.
For Industrial map size a lot of objects required summary, approximately 2000-5000.
Tried to add 1000 trashcans with random XY-coords. Game can't start, crashes upon level loading.
Reduced amount of bins to 300, the game lasts 1 min 34 sec, then crashes.
The same tendency is on 150-300 added objects (and the time is always the same!).

The game seems to be ok with amount of objects around 20. But I've tried a stress-test: a battle with 6 wanted level. The game lasts 30 sec, then crashes.

I leave one-two objects - and game won't crash anymore.

Looks like maps already on it's memory limits or something.

Meanwhile I've seen the gtamp community's maps with objects and didn't experience crashes. Much like of it's smaller size?
User avatar
JernejL
Hitman
Hitman
Posts: 180
Joined: 21 Feb 2010, 22:03
GH nick: RedShirt

Re: Official script modifying cause certain missions to crash

Post by JernejL »

perhaps there is a limit how much objects can be on screen or your random coordinates are placing objects inside buildings and cause problems?

Try placing them on road surfaces only.
User avatar
valps
Psycho
Psycho
Posts: 64
Joined: 31 Dec 2020, 15:03
GH nick: Valps
Location: Brazil
Contact:

Re: Official script modifying cause certain missions to crash

Post by valps »

GiftTheAuto wrote: 28 May 2025, 20:10 I've encountered another problem.
For Industrial map size a lot of objects required summary, approximately 2000-5000.
Tried to add 1000 trashcans with random XY-coords. Game can't start, crashes upon level loading.
Reduced amount of bins to 300, the game lasts 1 min 34 sec, then crashes.
The same tendency is on 150-300 added objects (and the time is always the same!).

The game seems to be ok with amount of objects around 20. But I've tried a stress-test: a battle with 6 wanted level. The game lasts 30 sec, then crashes.

I leave one-two objects - and game won't crash anymore.

Looks like maps already on it's memory limits or something.

Meanwhile I've seen the gtamp community's maps with objects and didn't experience crashes. Much like of it's smaller size?
If the game is crashing always at the same time, I would guess that it's a train issue. Maybe spawning objects at railroads may crash the game when the train drive over them.
GiftTheAuto
Jaywalker
Jaywalker
Posts: 5
Joined: 22 May 2025, 18:47

Re: Official script modifying cause certain missions to crash

Post by GiftTheAuto »

I've placed next objects:
- trashcans with some lids, rubbish and bench into church's space;
1_Jesus_saves.png
1_Jesus_saves.png (229.97 KiB) Viewed 82 times
- some balls and a lot of benches in the outskirts of vedic temple.
4_Vedic_temple_ourtskirts3.png
4_Vedic_temple_ourtskirts3.png (463.51 KiB) Viewed 82 times
No rail tracks affected.

Total: 84 objects.

Game crashes with 6 wanted level on any wide road with 3-tank blockade and shooting with explosions. Game lasts about 20 sec with such pressure.

I believe there is objects limit inside of game's code. It's strange that developers actually made objects as a ready-to-use content, but didn't include the possibility to use them as much as it possible.

Do you have any clues how to bypass this restriction?
User avatar
JernejL
Hitman
Hitman
Posts: 180
Joined: 21 Feb 2010, 22:03
GH nick: RedShirt

Re: Official script modifying cause certain missions to crash

Post by JernejL »

Maybe the gta2 reverse engineering project can answer some of those questions ( https://github.com/CriminalRETeam/gta2_re ), but it sounds like it is actually running out of some fixed object allocation, perhaps the crashing is related to objects created for roadblocks. does it work fine without any cops?
GiftTheAuto
Jaywalker
Jaywalker
Posts: 5
Joined: 22 May 2025, 18:47

Re: Official script modifying cause certain missions to crash

Post by GiftTheAuto »

Ok, i'll try this project.

Yes, without cops it works fine. At least it worked after 3.30 min game time passed with intensive driving.
User avatar
JernejL
Hitman
Hitman
Posts: 180
Joined: 21 Feb 2010, 22:03
GH nick: RedShirt

Re: Official script modifying cause certain missions to crash

Post by JernejL »

Pretty sure this is related to roadblocks then.

Maybe you can use gta2 powermanager or script option to disable roadblocks - try if that works.
Post Reply