Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Garages do not open / work #107

Open
2 of 7 tasks
JayFoxRox opened this issue May 29, 2016 · 4 comments
Open
2 of 7 tasks

Garages do not open / work #107

JayFoxRox opened this issue May 29, 2016 · 4 comments
Labels

Comments

@JayFoxRox
Copy link
Collaborator

JayFoxRox commented May 29, 2016

  • There should be a garage class.
  • Garages should also open if the player is near them

At least the following garages must be supported in order to be able to play the game:

  • Pay'n'Spray; car drives in, player looses control, spraypaint effect happens, script can check if the specific garage just resprayed something (ResprayGarage)
  • Import/Export; compares vehicle id to from a list and strikes through the entry on the door, sets a bit in a bitstring which is also stored in savegames. Script has access to said bitstring (IEGarage)
  • Hideouts, any vehicle inside the garage is stored in the savegame (SaveGarage)
  • Mission garages, controllable by script, can only open and close / no special behaviour (StandardGarage)
  • Bombshop Garage, similar to respray but installs a specific type of bomb in the car (BombshopGarage, maybe we should have a class ShopGarage for BombshopGarage and ResprayGarage which takes control away from the player etc once inside the garage?)

You can find a full list of garge types here

It's currently not known how the game knows which object is the garage door.
The garages are created from the script or a savegame. A garage is created as a specific type, and each type can have multiple garages associated with it.
The script also controls how each garage opens (swing door / slide door). It's a miracle how the game can know which garage number (which is independent from the type!) controls which door object.

There is a list which links different garages to their respective door model. However, each door model appears multiple times and the game somehow figures out which door is the correct one.

It's not known if the garage door objects might be hardcoded independent of the garages.
We should test if garage doors open, even if no garage is created from the script / savegame.

From the script the garages are identified by a number (the order they are created in the SCM, starting at index 1, index 0 is some unused (broken?) garage I believe). The index of each garage is then stored in the global variables listed on the list above.


Standard doors (such as the one to mistys house) and gates are created as instance object by script or savegame.
They are opened and closed by setting the heading / z_angle using the script or some slide opcode.

@JayFoxRox JayFoxRox changed the title Garages do not open Garages do not open / work May 29, 2016
@Djhg2000
Copy link

Also remember that you could park multiple cars in a single garage and have them saved in those positions, including the first garage (I used that trick a lot on the PS2 version).

@JayFoxRox
Copy link
Collaborator Author

I'm trying to reach @spaceeinstein at the moment as he said I misinterpreted some of the garage stuff of his.
Unfortunately one of my gtaforums accounts looks like it vanished and only my 12 year old account exists which is registed to an e-mail address I don't have access to anymore (which is why I was actually told to create a second one - I don't feel like creating a third one either).

This was referenced Jun 2, 2016
@spaceeinstein
Copy link

spaceeinstein commented Aug 2, 2016

When a garage is created through 0219, 021A, or a loading of a save game, the game looks through every object currently placed in the world. The game checks if the object's model name exists in the list of garage door model names. If there is a match, then the game checks if the object is within 20 units of the center of the garage area. If it is, then the game stores the reference of the object as a property of the garage. Now you have a door object that you can manipulate.

A garage has several states: closed, opening, opened, closing, and a few other special cases. It is independent of the door object so garages should still work without it. Using a spray shop for example, the default state is opened. In this state, if the door object exists, the z position of the door object is set to the maximum height some units above its original placement in the world. When the player stops within the garage area, the state changes to closing and, if the door object exists, the z position of the door object is decreased down to its original placement in the world. The state changes to closed and waits for a moment. Then the state changes to opening and, if the door object exists, the z position of the door object is increased up to its maximum height. Now the state has returned to opened.

The garage at index 0 is the crusher. Its creation is hardcoded into the game. The crusher is completely independent of the crane.

This was referenced Jun 3, 2018
@danhedron
Copy link
Member

This should be split into more specific issues now that there is some garage work completed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants