Main Menu

Wiki Structure

Started by Vortrex, November 17, 2017, 02:31:20 AM

Previous topic - Next topic

Vortrex

So, I've been asked a couple of times why things are listed several times in different sections and cross-linking to each other.

I am making this post to help people understand how the structure of functions work in GTA Connected.



Every scripting function in GTA Connected comes from a class. Some classes are inherited from others, such as player from ped or vehicle from entity. I will put a list below if you have an interest in looking at it.



A quick example: the player class inherits everything from the ped class. This means that all methods and properties in the ped class, are also in the player class. For example,   works on any ped, and thus also works on any player as well.



As for the list I mentioned, here it is:
- Engine
  - Element
     - Physical
        - Ped
           - Player
           - Civilian
        - Vehicle
           - Train
Each extra indentation marks a new level of inheritance. Train inherits from Vehicle, Vehicle inherits from Physical, Physical inherits from Element, etc. Since Ped and Vehicle are on the same level, they do not inherit from each other. They both get everything from their parent class, Physical, plus anything extra exclusive to their class and it's children.



If you have any questions regarding this, feel free to leave a reply below!