Quantcast

Jump to content

» «
Photo

Is using car generators safe?

2 replies to this topic
cst1992
  • cst1992

    Spam Hater

  • Members
  • Joined: 27 Dec 2012

#1

Posted 04 September 2013 - 11:12 AM

Hi everyone,
A while ago, I had a problem with my savefile, in which I had no blips appearing on the radar because an erroneous cleo mod that I installed was filling up the blip pool, resulting in the game not being able to create more blips.
Does the same problem also exist with car generators? If I know it right, the car generator works the same way as vehicle spawner, for example, the hunter is always spawned at the abandoned airstrip if you get all golds in the Flying School. If this is true and one creates too many such generators, then won't it fill up some buffer allocated for this purpose? Or is there some way to delete a car generator once it is created?

OrionSR
  • OrionSR

    Chain Game Development Team

  • Feroci Racing
  • Joined: 23 May 2007
  • None
  • Helpfulness Award [GTA & Modding]

#2

Posted 04 September 2013 - 12:32 PM Edited by OrionSR, 15 December 2013 - 05:27 PM.

Adding car generators with CLEO is known to cause problems. You might want to consider spawning vehicles when CJ is near instead. It's more work than car generators, but doesn't alter the save.

The standard game includes 208 car generators created by main.scm. All are created during the intro missions and no more are added as the game progresses; although some are hidden and others are displayed. The car generator pool can hold 500 generators. The extra slots are used to stream in parked cars from the binary IPL files as CJ enters the area. If too many car generators are added then there won't be room for these vehicles, but there is lots of room to play with. The Chain Game saves are running 311 car generators without any noticeable problems.

Car generators added with CLEO scripts have been known to completely clog the pool and cause a noticeable lack of parked cars. The scm created car generators included in the save are mostly mission related (some of the decorative cars in Angle Pine are included in the save). It's really noticeable when the streaming car generators don't work. The standard way to prevent a car generator from being recreated in the save is to enable thread saving.

There isn't a standard opcode to remove car generators, but I have been able to work out a method to unallocate them anyway. SASE can be used to identify the index of misplaced generators. The index of the first scm car generator isn't always the same on different saves, so be careful about hardcoding a solution and expecting it to work on any save.

 

GTA:SA Save Game Editor v1.0 by Ryosuke: http://gtasamod.web....sase/index.html

The code posted below can be modified to unallocate one, some, or all of the car generators from the save. It looks like I was lazy and didn't specify the opcode for some of the operations. You might want to fix that, but the code worked well enough during tests.

// Test code that unallocates the East LS Clover so that it won't be saved.

{$CLEO .cs}
0000:
				
while true
  wait 250
  if
    0AB0:   key_pressed 0x77    // F8  
  then                                                                          
    0085: 0@ = $2766 // index of the East LS Clover
    0@ *= 0x20       // cargen record size
    0@ += 0x00c27ad0 // start of cargen structure
    0@ += 0x1D       // offset to allocation byte (save offset -2)
    0A8C: write_memory 0@ size 1 value 0 virtual_protect 0
    wait 250
    00BB: show_text_lowpriority GXT 'FESZ_LS' time 2000 flag 1  // Load Successful.
  end
end

You'll need to change this line to assign the index of your misplaced car generator to 0@
 

0085: 0@ = $2766 // index of the East LS Clover

Use the line below and replace 499 with the index that you get from the save editor.
 

0006: 0@ = 499

Pickups are another concern when placed by cleo. The pickup pool is almost completely full to start with. If you intend to add more than a handful of pickups it's a good idea to remove some of the lame pickups to free up some room.

  • cst1992 likes this

cst1992
  • cst1992

    Spam Hater

  • Members
  • Joined: 27 Dec 2012

#3

Posted 04 September 2013 - 01:01 PM

Thanks for the information.




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users