|
Garage eXtender (GRGX) is a plugin for GTA San Andreas that adds more options and more garage slots into the game.
San Andreas have 50 slots for garages, but those slots are already used by default, so no mapper can create custom garages for their maps, that's sad...
This plugin solves this and also add more possibilites into garage system, like parking garages (as in GTA IV), new door movement styles, more garage opcodes...
Feel free to use this plugin within your mods to be capable of adding more garages into the game, I suggest you to add a link
in the readme file into the GTA Forums topic, the mediafire link or the gta garage link, so if I need to update this plugin sometime
you're not distributing a old version. But that's your choice, what do you think about it? ;)
There's two ways to create a GRGX. The first one is using a IPL file and the second way is by script (SCM, CLEO...),
I wanted to give both (mappers and scripters) the hability to create garages, but of course scripters will have a higher liberty to do whatever he wants to.
Let's talk about the two ways of creating a garage.
The task to create a GRGX by IPL is extremely simple, it's almost like creating a normal garage but with additional parameters.
You should put the garage creation line inside a grge section (like a normal garage) and then we're done.
The difference from the regular garage line and the grgx line is that grgx have more params, let's compare:
Regular garage line:
x1, y1, z1, x2, y2, x3, y3, z3, flags, type, name
GRGX garage line:
x1, y1, z1, x2, y2, x3, y3, z3, flags, unused, name, num_cars, grgx_type, door_style
As you can see, we just added some additional params, in that way we detect if it is a regular garage or a grgx garage being readed from the IPL!
Right, now you should ask the meaning of those params, let me explain.
Counter | Identifier | Type | Description |
---|---|---|---|
1,2,3 | Position 1 (Pos1) | float[3] | The garage rear bottom right coordinates |
4,5 | Position 2 (Depth) | float[2] | The garage front coordinates |
6,7,8 | Position 3 (Pos2) | float[3] | The garage rear upper left coordinates |
9 | Garage flags | integer | The garage flags (see below) |
10 | Unused | integer | This value is unused. it was the regular garage type. Please use -1 here! |
11 | Name | char[8] | A string which is used to manipulate the behaviour of garages through a script. The maximum number of characters for the garage name is 7!!! |
12 | Num Cars | integer | The maximum number of cars that this garage can store. Use -1 for unlimited number of vehicles. This value is ignored if the garage can't store vehicles |
13 | GRGX Type | integer | The garage type. GRGX type is different from regular garage types, (see here) |
14 | Door Style Flags | integer | Door style flags. (see below) |
Flag | Description |
---|---|
1 | Door opens up and rotates (ignored by GRGX, see door style flags) |
4 | Door goes in (ignored by GRGX, see door style flags) |
8 | Camera follows player |
Flag | Description |
---|---|
1 | Door opens up |
2 | Door rotates |
4 | Door goes in |
8 | Door opens slow |
16 | Door opens to side |
If you didn't read the Setting it up topic yet, read it first!!!
Creating garages by script is also very simple, it uses the method used by III\VC to create garages (CREATE_GARAGE).
Just put this line where you want to create the garage: (don't duplicate the garage, the garage must be created only once!)
0219: create_garage xyz1 2497.3 -1677.37 12.1 xy2 2497.3 -1670.07 xyz3 2504.08 -1677.37 16.3375 type GRGX_HIDEOUT_GARAGE name 'TEST'
Note 1: Remember to include grgx.txt!!!
Note 2: You can also use "CREATE_GARAGE" instead of "0219: create_garage"
Note 3: The garage name must have a maximum number of 7 characteres"
This garage is at grove street, remember: you need a door!
Of course the garage name must be different for each garage, 'TEST' is just a example!
If you're asking yourself what's that 3 coordinates, type and name, please take a look at the IPL params table, it will give you a good explanation, note that type is grgx_type and not a regular type!
Now, you must be asking, how to do those cool stuff, like change the way the door movement? See the next topic, Using the garage by script.
WARNING: If you're going to create garages in a CLEO Script, please look at the topic "WARNING FOR CLEO SCRIPTS"
Before anything, you should setup your sanny builder files to work within the new garage opcodes. Follow these steps:
0219: create_garage xyz1 2497.3 -1677.37 12.1 2497.3 xy2 -1670.07 2504.08 xyz3 -1677.37 16.3375 type GRGX_RESPRAY_GARAGE name 'TEST'
021C: is_car_in_mission_garage 'TEST'
02FA: grgx_command 'TEST' DESTROY_THIS_GARAGE
0329: has_respray_happened_on_garage 'TEST'
03BB: set_garage 'TEST' door_to_rotate
03DA: set_garage 'TEST' camera_follows_player
057A: set_garage 'TEST' max_cars_to 1
0219=10,create_garage xyz1 %1d% %2d% %3d% xy2 %4d% %5d% xyz3 %6d% %7d% %8d% type %9d% name %10d%
021c=1, is_car_in_mission_garage %1d%
0329=1,has_respray_happened %1d%
03bb=1,set_garage %1d% door_to_rotate
03da=1, set_garage %1d% camera_follows_player
057a=2,set_garage %1d% max_cars_to %2d%
0219=CREATE_GARAGE
021C=IS_CAR_IN_MISSION_GARAGE
02FA=GRGX_COMMAND
0329=HAS_RESPRAY_HAPPENED
03BB=SET_GARAGE_DOOR_TO_ROTATE
03DA=SET_GARAGE_CAMERA_FOLLOWS_PLAYER
057A=SET_GARAGE_MAX_CARS
0219=CREATE_GARAGE
021C=IS_CAR_IN_MISSION_GARAGE
02FA=GRGX_COMMAND
0329=HAS_RESPRAY_HAPPENED
03BB=SET_GARAGE_DOOR_TO_ROTATE
03DA=SET_GARAGE_CAMERA_FOLLOWS_PLAYER
057A=SET_GARAGE_MAX_CARS
{$INCLUDE grgx.txt}
With a script you can control during run-time a couple of garage aspects, like if the garage is activated, change the garage type and other stuffs.
We have new opcodes for garage management, opcodes removeds in SA but were in III\VC.
Here we are going to have a format like this: [OPCODE] COMMAND_NAME (params)
The following commands can be used with 02FA to change the behaviour of the garage or do something:
Identifier | Description |
---|---|
DESTROY_THIS_GARAGE | Removes the garage from the game. |
IS_GARAGE_CREATED_BY_SCRIPT | Checks if the garage has been created by a script |
DOES_THIS_GARAGE_CAN_STORE_VEHICLES | Checks if the garage can store vehicles |
IS_PLAYER_ENTIRELY_INSIDE_GARAGE | Checks if the player ie ntirely inside the garage |
IS_ANY_CAR_BLOCKING_GARAGE_DOOR | Checks if there's any car blocking the garage door |
REMOVE_CARS_BLOCKING_GARAGE_DOOR_NOT_INSIDE | Removes any car blocking the garage door |
GARAGE_PUSH_OUT_VEHICLES | Push out all vehicles trying to enter the garage |
GARAGE_PUSH_OUT_VEHICLES_BUT_NOT_TARGET | Push out all vehicles trying to enter the garage, but not the target. |
IS_NOT_ANYTHING_TOUCHING_GARAGE | Checks if nothing is touching the garage |
IS_ANY_CAR_TOUCHING_GARAGE | Checks if there's any car touching the garage |
IS_ANY_PED_TOUCHING_GARAGE | Checks if there's any ped touching the garage |
IS_ANY_CAR_TOUCHING_GARAGE_BUT_NOT_TARGET | Checks if there's any car touching the garage, but not the target |
IS_ANY_PED_TOUCHING_GARAGE_BUT_NOT_PLAYER | Checks if there's any ped touching the garage, but not the player |
IS_STATIC_PLAYER_CAR_ENTIRELY_INSIDE_GARAGE | Checks if the player car is inside the garage |
IS_GARAGE_A_HIDEOUT | Checks if the garage is a hideout (e.g. a save garage) |
CLEAR_STORED_CARS_IN_THIS_GARAGE | Clear all cars stored in this garage |
TIDY_UP_GARAGE | |
TIDY_UP_GARAGE_CLOSE | |
GARAGE_STYLE_OPENS_UP | Makes the garage door to open up |
GARAGE_STYLE_ROTATE | Makes the garage door to rotate |
GARAGE_STYLE_GOES_IN | Makes the garage door to go in |
GARAGE_STYLE_OPENS_SLOW | Makes the garage door to open slow |
GARAGE_STYLE_OPENS_TOSIDE | Makes the garage door to open to side |
DOES_GARAGE_EXISTS | Checks if the garage exist |
SET_GARAGE_DEPPENDS_ON_THIS_THREAD | Makes the garage deppends on the script that sent this command! If the script that called this doesn't exist anymore, the garage will be destroyed. Works after a load game too! The script must have a fixed name (set with 03A4) |
SET_GARAGE_DONT_SAVE | The garage won't be saved in a save-game |
82FA: grgx_command 'TEST' GARAGE_STYLE_OPENS_UP // The garage door will NOT open up (will open down), see the NOT (8 instead of 0 in the front of the opcode).
02FA: grgx_command 'TEST' GARAGE_STYLE_ROTATE // The garage door will rotate
02FA: grgx_command 'TEST' GARAGE_PUSH_OUT_VEHICLES // Will push out any vehicle trying to enter the garage (must be in a loop to work properly)
After a garage is created by a script, it is saved in a save game and all that stuff, like a create_object. So we came into a problem:
What if the user deletes your script? The garage will be lost in the save-game!!!
But we can solve this easilly by using SET_GARAGE_DEPPENDS_ON_THIS_THREAD or even SET_GARAGE_DONT_SAVE
We have another warning related with the scripter logic, when the user loads the game your script is restarted from the beggining (not if you use 0A95!), so if you came to the begging of your script again, make sure you are not going to duplicate (create again) the garage.
Use 0A95 or DOES_GARAGE_EXISTS before creating the garage.
Here is a table showing the GRGX garage types, you should use the constant name if using in a script or the id if using in a IPL.
ID | Name | Description |
---|---|---|
0 | GRGX_NULL_GARAGE | This garage does nothing |
1 | GRGX_SCRIPT_GARAGE | Script controlled garage, the script should open and close it. |
3 | GRGX_HIDEOUT_GARAGE | Normal Save Garage |
4 | GRGX_PARKING_GARAGE | Park Save Garage |
5 | GRGX_IMPOUND_GARAGE | Impound Lot, not working very well |
6 | GRGX_RESPRAY_GARAGE | Pay n' spray garage |
7 | GRGX_BOMBSHOP1_GARAGE | Bomb shop with timed detonator |
8 | GRGX_BOMBSHOP2_GARAGE | Bomb shop with engine ignition detonation |
9 | GRGX_BOMBSHOP3_GARAGE | Bomb shop with remote-control detonator |
10 | GRGX_BURGALY_GARAGE | Burgaly. Must be opened by a script and is closed automatically. |
11 | GRGX_WHEEL_ARCH_ANGEL | Only accepts vehicles with STREET_RACER flag |
12 | GRGX_LOCO_LOW_CO | Only accepts vehicles with LOW_RIDER flag |
13 | GRGX_TRANSFENDER | Accepts vehicles that aren't STREET_RACER neither LOW_RIDER |
14 | GRGX_ANYCAR_TUNNING_SHOP | Accepts every car |
15 | GRGX_OPENCLOSE_GARAGE | This garage does nothing but only opens and closes. This is the only garage on GRGX that accepts a target car, if a target car is set (using 021B) the garage will only open for the target car. |
Notes taken from: http://www.gtamodding.com/index.php?title=GRGE
The garage door only opens if the IDE flag value of the door is 2048 and the door is defined in the object.dat file.
Garage doors are very important for the camera rotation. They control how the camera moves after you have entered a garage. If your camera moves wrong, then simply rotate the pivot of your garage door, map the new one and rotate it until it fits with the rotation you want. Then test if the camera moves correctly in-game.
If you have not mapped a garage door the camera will move to the west, which corresponds to a garage door rotation of 0 degrees around the z axis.
Garage eXtender doesn't store their garages on the default San Andreas save files, there's many reason behid it but the main one is to not corrupt the save file.
The save files for grgx are stored in "GTA San Andreas User Files/grgx/%d.sav", where %d is the save slot.
This plugin was created by LINK/2012 <dma_2012@hotmail.com>
Visit also Brazillian Modding Studio
Please report if you find any bug!!
Thanks :)